Skip to content

refactor: bench: make_hard_case to find a solution - #35997

Open
yancyribbens wants to merge 1 commit into
bitcoin:masterfrom
yancyribbens:0817-refactor-bnb-exhaustion-benchmark
Open

yancyribbens wants to merge 1 commit into
bitcoin:masterfrom
yancyribbens:0817-refactor-bnb-exhaustion-benchmark

Conversation

@yancyribbens

Copy link
Copy Markdown
Contributor

Add additional assertions showing the number of attempts ware exhausted and that a solution was found.

@DrahtBot

DrahtBot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35997.

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK Dontbyshai

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

No conflicts as of last run.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • to be found before the exhausting the 100,000 attempt limit. -> to be found before exhausting the 100,000 attempt limit. [“the exhausting the” is ungrammatical and obscures the meaning]

2026-08-24 16:01:36

@yancyribbens

Copy link
Copy Markdown
Contributor Author

cc @murchandamus

@DrahtBot

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task Alpine (musl): https://github.com/bitcoin/bitcoin/actions/runs/32048916305/job/95443267332
LLM reason (✨ experimental): CI failed due to a build error: coin_selection.cpp has invalid leading whitespace, triggering -Werror=leading-whitespace during compilation.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@Dontbyshai

Copy link
Copy Markdown

ACK

Hi everyone, I reviewed the changes in this PR and tested the benchmark locally. I checked the BnB search logic as well as the assumptions used in make_hard_case(). I built bench_bitcoin with the changes from this PR and ran the BnBExhaustion benchmark. The benchmark completed successfully with exit code 0, and all the new assertions passed. The results confirm that the benchmark reaches the limit of 100,000 evaluations. ✌🏻

Add assertions showing the number of attempts were exhausted and that
a solution was found.
@yancyribbens
yancyribbens force-pushed the 0817-refactor-bnb-exhaustion-benchmark branch from bd9d9a2 to 6019067 Compare August 24, 2026 16:01
@yancyribbens

Copy link
Copy Markdown
Contributor Author

Updated the target and UTXO amounts to be more realistic. Previously the target of 800,000 sats gave the false impression that such large numbers are needed to exhaust the search limit. Also adjusted the cost_of_change param to sit at the threshold of exhausting the limit so that it's more meaningful for the benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants