test: wallet: BnB marks exhaustive search complete #36775

pull Conradgabe wants to merge 1 commits into bitcoin:master from Conradgabe:test-bnb-algo-completed changing 1 files +1 −0
  1. Conradgabe commented at 12:48 PM on November 5, 2026: contributor

    SelectCoinsBnB marks its result as completed when it exhausts the search space before reaching TOTAL_TRIES. Only the incomplete case is checked in the unit tests (bnb_exhaustion_with_solution_test), and the bnb_finds_min_waste fuzz target only reads the flag to decide whether to assert optimality, so reporting false goes unnoticed.

    This PR checks GetAlgoCompleted() in TestBnBSuccess for cases that finish below the attempt limit (100,000).

    Kills the following mutant (https://mutanthub.space/mutants/1096):

    --- a/src/wallet/coinselection.cpp
    +++ b/src/wallet/coinselection.cpp
    @@ -233,7 +233,7 @@ util::Result<SelectionResult> SelectCoinsBnB(std::vector<OutputGroup>& utxo_pool
                 if (curr_selection.empty()) {
                     // Exhausted search space before running into attempt limit
                     is_done = true;
    -                result.SetAlgoCompleted(true);
    +                result.SetAlgoCompleted(false);
                     break;
                 }
                 // Set `next_utxo` to one after last selected, then deselect last selected UTXO
    
  2. test: BnB marks exhaustive search complete
    SelectCoinsBnB marks its result as completed when it
    exhausts the search space before reaching TOTAL_TRIES.
    Only the incomplete case is checked in the unit tests
    (bnb_exhaustion_with_solution_test), and the
    bnb_finds_min_waste fuzz target only reads the flag to
    decide whether to assert optimality, so reporting false
    here goes unnoticed.
    
    Check GetAlgoCompleted() in TestBnBSuccess for cases that
    finish below the attempt limit.
    ac2c946d3b
  3. DrahtBot added the label Tests on Nov 5, 2026
  4. DrahtBot commented at 12:49 PM on November 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK yancyribbens, davidgumberg, murchandamus

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. Conradgabe renamed this:
    test: BnB marks exhaustive search complete
    test: wallet: BnB marks exhaustive search complete
    on Nov 5, 2026
  6. yancyribbens commented at 3:07 PM on November 5, 2026: contributor

    ACK ac2c946d3b211e90abb48357b0cb2afadbc64a38

  7. yancyribbens commented at 3:10 PM on November 5, 2026: contributor

    Some people find such small PRs not worth responding to but I think small PRs are fine, especially if people are just learning their way around.

  8. murchandamus commented at 8:31 PM on November 5, 2026: member

    ACK ac2c946d3b211e90abb48357b0cb2afadbc64a38

  9. sedited merged this on Nov 5, 2026
  10. sedited closed this on Nov 5, 2026

  11. davidgumberg commented at 1:25 AM on November 6, 2026: contributor

    Not strictly related to this PR, but is the reason for CI failure here likely to have been github service related? (https://github.com/bitcoin/bitcoin/actions/runs/42030338160/job/127515412961)

  12. Conradgabe deleted the branch on Nov 6, 2026
  13. Conradgabe commented at 6:57 AM on November 6, 2026: contributor

    Not strictly related to this PR, but is the reason for CI failure here likely to have been github service related?

    I don't think it is a service issue, a service problem would usually show timeouts or 5xx errors. The error says couldn't find remote ref and I found similar CI fail at #36658 (https://github.com/bitcoin/bitcoin/actions/runs/40365464333/job/121792086648)

  14. frankomosh commented at 10:20 AM on November 6, 2026: contributor

    Post merge ACK


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-07 14:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me