#35608 contrib: Skip llvm-cov rendering for deterministic fuzz inputs

full analysis

https://github.com/bitcoin/bitcoin/pull/35608 · HowHsu · +71/-36 in 1 files, 1 commits · labels: Scripts and tools

Goal

  • Accelerate fuzz coverage determinism checks by skipping redundant report rendering
  • Save developer time during long fuzz testing runs

Optimizes `deterministic-fuzz-coverage` by checking whether raw profile data (`.profdata`) matches byte-for-byte between runs before invoking `llvm-cov show`. Because identical profdata implies identical coverage reports, the expensive report rendering step is skipped for deterministic inputs and only executed if a difference is detected.

Problem: Running `llvm-cov show` for every single fuzz input across two runs is the primary bottleneck of `deterministic-fuzz-coverage`, spending significant developer time rendering identical coverage reports that are immediately discarded.

Category: Tools and scripts (#8 of 22)

P3 · speedup

  • P3 because it provides a substantial speedup for an offline developer helper script
  • Cuts execution times from hours down to minutes on larger fuzz targets

Provides a substantial speedup for a developer helper script, cutting execution times from hours down to minutes on larger corpora like `process_message`.

Membership: Modifies `contrib/devtools/deterministic-fuzz-coverage/src/main.rs`, an offline developer tool under contrib.

Factors: security/stability 0, bug 0, performance 2, user value 1, leverage 0

Reviewability: Ready

  • Ready for review, with CI passing and all reviewer feedback addressed

The code is clean, CI passes, and the author addressed all feedback from the latest reviews.

Author status: Active; incorporated review suggestions via force-push on 2026-09-03.

Resolved concerns:

  • maflcko suggested simplifying `check_diff` to avoid repetitive code and path handling, which the author adopted.
  • jeanpablojp noted that builds missing coverage mapping flags now pass determinism rather than failing fast, which maflcko clarified was acceptable for a dev-only tool.

Agreement: Strong

  • Strong support with confirmed performance gains and accepted cleanups
  • Verified massive speedup across fuzz corpora testing (jeanpablojp)
  • Approved with code simplification suggestions adopted by the author (maflcko)

Strong: tested speedup confirmed and suggested cleanup adopted (jeanpablojp, maflcko)

Both reviewers supported the approach, with one confirming massive speedups in testing and another providing code simplifications that the author merged.

  • jeanpablojp tested ACKed: 'addition_overflow went from 5m49s to 31s and process_message from 1h50m to 25m48s, same PASS on both'
  • maflcko approved review with a nit/patch to deduplicate code: 'lgtm, left a nit to slim this down a bit'
  • HowHsu applied maflcko's refactoring and force-pushed.

Review verdicts (DrahtBot): 0 (+1)

Files

107 lines under test/bench/ci.

  • contrib/devtools/deterministic-fuzz-coverage/src/main.rs +71/-36

Card

This PR optimizes the `deterministic-fuzz-coverage` tool by comparing merged `.profdata` files directly and skipping `llvm-cov show` report rendering when profiles match. This directly addresses excessive runtimes for fuzz determinism audits, reducing test runs on targets like `process_message` from nearly two hours to under 30 minutes. The PR has been tested and approved by multiple contributors with review refactorings adopted.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T16:19, confidence high, input hash d10bb7af6efc3b14