-
Notifications
You must be signed in to change notification settings - Fork 239
Improve BDD sifting (2x speed, more reduction) #2890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mtdowling
wants to merge
4
commits into
main
Choose a base branch
from
improve-sifting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,969
−279
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
This pull request does not contain a staged changelog entry. To create one, use the Make sure that the description is appropriate for a changelog entry and that the proper feature type is used. See |
cde5bc1 to
ce749f7
Compare
b9eaaba to
4e3040d
Compare
ce749f7 to
c9bc8aa
Compare
4e3040d to
b62ba47
Compare
- Add AdaptiveEffort to dynamically adjust optimization parameters based on observed improvement rates (increase effort when making progress, decrease when plateauing) - Add block moves optimization that moves groups of dependent conditions together to escape local minima - Add cost-based tie-breaking using BddCostEstimator when multiple positions have the same node count
b62ba47 to
8a23dbf
Compare
kstich
approved these changes
Dec 19, 2025
...s-engine/src/main/java/software/amazon/smithy/rulesengine/logic/bdd/SiftingOptimization.java
Outdated
Show resolved
Hide resolved
...s-engine/src/main/java/software/amazon/smithy/rulesengine/logic/bdd/SiftingOptimization.java
Outdated
Show resolved
Hide resolved
JordonPhillips
approved these changes
Dec 19, 2025
This commit adds a new function to the rules engine, ite, that performs
an if-then-else check on a boolean expression without branching. By not
needing to branch in the decision tree, we avoid SSA transforms on
divergent branches which would create syntactically different but
semantically identical expressions that the BDD cannot deduplicate.
This commit also adds an S3-specific decision tree transform that
canonicalizes S3Express rules for better BDD compilation:
1. AZ extraction: Rewrites position-dependent substring operations to
use a single split(Bucket, "--")[1] expression across all branches
2. URL canonicalization: Uses ITE to compute FIPS/DualStack URL segments,
collapsing 4 URL variants into a single template with {_s3e_fips} and
{_s3e_ds} placeholders
3. Auth scheme canonicalization: Uses ITE to select sigv4 vs
sigv4-s3express based on DisableS3ExpressSessionAuth
The transform makes the rules tree ~30% larger but enables dramatic BDD
compression by making URL templates identical across FIPS/DualStack/auth
variants. Endpoints that previously appeared distinct now collapse into
single BDD results, reducing nodes and results by ~43%.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Testing
Links
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.