Skip to content

[bdd] Optimize BddQueryEngine performance and reduce BDD node creation - #4802

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_965159664
Aug 22, 2026
Merged

[bdd] Optimize BddQueryEngine performance and reduce BDD node creation#4802
copybara-service[bot] merged 1 commit into
mainfrom
test_965159664

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 18, 2026

Copy link
Copy Markdown

[bdd] Optimize BddQueryEngine performance and reduce BDD node creation

This change introduces several optimizations to BddQueryEngine and BinaryDecisionDiagram to avoid creating unnecessary BDD nodes and bypass expensive operations:

  • Adds a MutuallyExclusive helper to check if two BDD nodes are mutually exclusive without constructing new BDD nodes.
  • Enable early-exit for KnownValue, IsAllZeros, IsAllOnes, and IsFullyKnown by querying BDD nodes directly, rather than constructing a ternary.
  • Optimizes KnownEquals and KnownNotEquals to use direct BDD index comparison when no assumption is present.
  • Refactors AtMostOneTrue and AtLeastOneTrue to minimize BDD operations and handle untracked bits more efficiently.
  • Skips redundant bounds checks (e.g., zero lower bounds or maximal intervals) during interval specialization.

Also takes advantage of the new MutuallyExclusive helper in the visibility analysis.

@copybara-service copybara-service Bot changed the title [bdd] Optimize BddQueryEngine performance and reduce BDD node creation. [bdd] Optimize BddQueryEngine performance and reduce BDD node creation Aug 21, 2026
@copybara-service
copybara-service Bot force-pushed the test_965159664 branch 3 times, most recently from de01876 to 485df96 Compare August 22, 2026 02:41
This change introduces several optimizations to `BddQueryEngine` and `BinaryDecisionDiagram` to avoid creating unnecessary BDD nodes and bypass expensive operations:
- Adds a `MutuallyExclusive` helper to check if two BDD nodes are mutually exclusive without constructing new BDD nodes.
- Enable early-exit for `KnownValue`, `IsAllZeros`, `IsAllOnes`, and `IsFullyKnown` by querying BDD nodes directly, rather than constructing a ternary.
- Optimizes `KnownEquals` and `KnownNotEquals` to use direct BDD index comparison when no assumption is present.
- Refactors `AtMostOneTrue` and `AtLeastOneTrue` to minimize BDD operations and handle untracked bits more efficiently.
- Skips redundant bounds checks (e.g., zero lower bounds or maximal intervals) during interval specialization.

Also takes advantage of the new MutuallyExclusive helper in the visibility analysis.

PiperOrigin-RevId: 968839585
@copybara-service
copybara-service Bot merged commit dc311d6 into main Aug 22, 2026
0 of 7 checks passed
@copybara-service
copybara-service Bot deleted the test_965159664 branch August 22, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant