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. 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.

  3. DrahtBot added the label Tests on Dec 10, 2024
  4. in src/test/fuzz/package_eval.cpp:203 in fafaad5edc outdated
    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

  5. maflcko marked this as a draft on Dec 10, 2024
  6. fuzz: Speed up *_package_eval fuzz targets a bit fa96ca1f4c
  7. fuzz: [refactor] Avoid confusing c-style cast fac8f07cc6
  8. maflcko force-pushed on Jan 14, 2025
  9. maflcko commented at 8:14 am on January 20, 2025: member
    Closing for now, because changing the order of the elements in the set may invalidate the existing fuzz inputs, making this harder to review/test.
  10. maflcko closed this on Jan 20, 2025

  11. maflcko deleted the branch on Jan 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-01-21 06:12 UTC

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