fuzz: reduce iterations in slow targets #33429

pull marcofleon wants to merge 1 commits into bitcoin:master from marcofleon:reduce-iterations changing 3 files +4 −4
  1. marcofleon commented at 4:56 pm on September 18, 2025: contributor

    The mini_miner, txdownloadman, txdownloadman_impl, and tx_pool_standard fuzz targets are all slow-running targets. Fix this by reducing the iteration count in the LIMITED_WHILE loops.

    This should help decrease the run time of the fuzz CI jobs. See #33425.

    Addresses #32870 as well.

  2. DrahtBot added the label Tests on Sep 18, 2025
  3. DrahtBot commented at 4:56 pm on September 18, 2025: 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/33429.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge, brunoerg, Crypt-iQ
    Concept ACK enirox001

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33425 (ci: run native_fuzz_with_msan by fanquake)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. marcofleon commented at 5:01 pm on September 18, 2025: contributor

    There should be no loss of coverage when running on the inputs in qa-assets.

    For tx_pool_standard I saw a speed up from 1068 to 720 seconds with this change. I think the loop in initialize_tx_pool is still slowing it down? I would need to look into it some more, but I left that as is for now.

  5. fuzz: Reduce iterations in slow targets 6a33970fef
  6. marcofleon force-pushed on Sep 19, 2025
  7. marcofleon commented at 2:32 pm on September 19, 2025: contributor

    I ran the MSan fuzz CI script on my machine with these changes and for single run through the qa-assets inputs:

    • mini_miner 105 sec
    • txdownloadman 115 sec
    • txdownloadman_impl 165 sec
    • tx_pool_standard 727 sec

    Some previous times can be seen in #33425.

  8. marcofleon marked this as ready for review on Sep 19, 2025
  9. dergoegge approved
  10. dergoegge commented at 2:46 pm on September 19, 2025: member
    utACK 6a33970fef1b7b4d634f28277607b882958c95ac
  11. marcofleon commented at 5:32 pm on September 19, 2025: contributor

    coverage:

  12. enirox001 commented at 6:00 pm on September 19, 2025: contributor

    Concept ACK 6a33970

    While working on #32870, I considered reducing iterations to speed up fuzzing, but wasn’t sure it was feasible since that wasn’t the issue’s intended goal. However, I noticed that reducing iterations did speed up the MiniMiner fuzz test.

    This seems like a good approach to solving the issue, pending the reimplementation of MiniMiner.

  13. brunoerg approved
  14. brunoerg commented at 6:34 pm on September 19, 2025: contributor

    ACK 6a33970fef1b7b4d634f28277607b882958c95ac

    I verified the perfomance gain. e.g. mini_miner target is now 10x faster on my machine.

    mini miner (master):

    0[#256](/bitcoin-bitcoin/256/)	pulse  cov: 4182 ft: 24483 corp: 253/57Kb exec/s: 128 rss: 278Mb
    1[#512](/bitcoin-bitcoin/512/)	pulse  cov: 4234 ft: 27611 corp: 501/1139Kb exec/s: 8 rss: 761Mb
    2[#602](/bitcoin-bitcoin/602/)	INITED cov: 4235 ft: 28000 corp: 576/4293Kb exec/s: 5 rss: 797Mb
    3[#602](/bitcoin-bitcoin/602/)	DONE   cov: 4235 ft: 28000 corp: 576/4293Kb lim: 489495 exec/s: 5 rss: 797Mb
    4Done 602 runs in 113 second(s)
    

    mini miner (this PR):

    0[#256](/bitcoin-bitcoin/256/)	pulse  cov: 4100 ft: 22796 corp: 251/57Kb exec/s: 128 rss: 252Mb
    1[#512](/bitcoin-bitcoin/512/)	pulse  cov: 4121 ft: 24106 corp: 414/715Kb exec/s: 56 rss: 631Mb
    2[#602](/bitcoin-bitcoin/602/)	INITED cov: 4121 ft: 24200 corp: 454/2430Kb exec/s: 46 rss: 768Mb
    3[#602](/bitcoin-bitcoin/602/)	DONE   cov: 4121 ft: 24200 corp: 454/2430Kb lim: 296374 exec/s: 46 rss: 768Mb
    4Done 602 runs in 13 second(s)
    
  15. DrahtBot requested review from enirox001 on Sep 19, 2025
  16. Crypt-iQ commented at 7:12 pm on September 19, 2025: contributor
    crACK 6a33970fef1b7b4d634f28277607b882958c95ac
  17. furszy commented at 7:21 pm on September 19, 2025: member
    A few extra optimizations (plus a bug fix) to the mini miner target: https://github.com/furszy/bitcoin-core/tree/2025_fuzz_improve_mini_miner. They don’t seem to add much gain per @brunoerg’s feedback, but might help on the long run. Feel free to take them if you like them.
  18. fanquake commented at 1:52 pm on September 20, 2025: member
    @furszy Could you PR that branch separately?
  19. fanquake merged this on Sep 20, 2025
  20. fanquake closed this on Sep 20, 2025


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: 2025-09-26 15:13 UTC

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