fuzz: Speed up *_package_eval fuzz targets a bit #31457

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2412-fuzz-pkg-eval-faster changing 1 files +11 −11
  1. maflcko commented at 12:42 pm on December 10, 2024: member
    Each target is at least 10% faster for me when running over the current set of qa-assets, which seems nice.
  2. fuzz: Speed up *_package_eval fuzz targets a bit fa33818978
  3. fuzz: [refactor] Avoid confusing c-style cast fafaad5edc
  4. DrahtBot commented at 12:43 pm on December 10, 2024: 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/31457.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. DrahtBot added the label Tests on Dec 10, 2024
  6. in src/test/fuzz/package_eval.cpp:198 in fafaad5edc
    194@@ -195,8 +195,8 @@ FUZZ_TARGET(ephemeral_package_eval, .init = initialize_tx_pool)
    195     MockTime(fuzzed_data_provider, chainstate);
    196 
    197     // All RBF-spendable outpoints outside of the unsubmitted package
    198-    std::set<COutPoint> mempool_outpoints;
    199-    std::map<COutPoint, CAmount> outpoints_value;
    200+    std::unordered_set<COutPoint, SaltedOutpointHasher> mempool_outpoints;
    


    dergoegge commented at 3:24 pm on December 10, 2024:
    Using a SaltedOutpointHasher probably requires to call SeedRandomStateForTest(SeedRand::ZEROS) each iteration. Otherwise non-determinism might happen due to e.g. different order when iterating over the sets.

    maflcko commented at 3:47 pm on December 10, 2024:

    Good catch. This means:

    • Other tests may also need a re-seed on every iteration, if they interact with data, sorted by a salted hasher
    • The speed-up may actually come from invalidating the fuzz inputs, making a change like this harder to test

    maflcko commented at 10:57 am on December 12, 2024:

    Other tests may also need a re-seed on every iteration, if they interact with data, sorted by a salted hasher

    Fixed in #31481, possibly

  7. maflcko marked this as a draft on Dec 10, 2024

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: 2024-12-21 12:12 UTC

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