Fix tuple BnB metric ordering propagation#39
Merged
evanlinjin merged 2 commits intobitcoindevkit:masterfrom Feb 14, 2026
Merged
Fix tuple BnB metric ordering propagation#39evanlinjin merged 2 commits intobitcoindevkit:masterfrom
evanlinjin merged 2 commits intobitcoindevkit:masterfrom
Conversation
evanlinjin
requested changes
Feb 14, 2026
Member
There was a problem hiding this comment.
Thanks for the fix! Before ACK/Merge, I propose the following changes:
1. Simplify tests
No need to actually run .bnb_solutions. We just need to make sure ((metric_a, 1.0), (metric_b, 1.0)).requires_ordering_by_descending_value_pwu() returns the correct value.
scoreandboundimplementations ofOrderSensitiveandNoOrderMetriccan just returnSome(Ord32(0.0)).- Have the following test cases:
- Both metrics require ordering
- One metric requires ordering
- No metric requires ordering
2. Don't have a separate clippy/lint commit
Just merge the commits.
Contributor
Author
|
Thanks for the suggestions. I've made the tests easier by only covering the three ordering situations and getting rid of the lint commit. Please let me know if anything else needs to be changed |
evanlinjin
reviewed
Feb 14, 2026
Member
evanlinjin
left a comment
There was a problem hiding this comment.
Don't forget to do cargo fmt and cargo clippy otherwise CI will fail.
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
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.
Tuple BnB metrics currently propagates
requires_ordering_by_descending_value_pwu()usingall().If one metric requires descending order and another does not, order is skipped, thus violating the requirement of the order-dependent metrics.
What this PR does:
Adds a test (
bnb_tuple_metric_respects_ordering_requirement) demonstrating the issue.The fix involves changing the ordering propagation to use any() instead of all().
The test is added in a separate commit to clearly demonstrate the failing behavior before the fix.