Summary
deterministic-fuzz-coverage rendered a full llvm-cov show report for every
fuzz input on both runs and diffed the two reports, even though almost all
inputs are deterministic. llvm-cov show is by far the most expensive step, so
the vast majority of that work produced two identical reports that were
immediately discarded.
Compare the merged .profdata first: identical counters are a sufficient
condition for deterministic coverage, so when the two profdata files match the
llvm-cov show rendering is skipped entirely. Only when they differ does it
fall back to rendering and diffing the reports to confirm and locate the
difference.
The pass/fail result is unchanged: identical profdata implies identical
counters, which implies identical llvm-cov show output (the report is a
deterministic function of the profdata and the binary). Any profdata difference
falls back to the exact same llvm-cov diff as before.
Benchmark
standalone coverage build (-DBUILD_FOR_FUZZING=ON +
-fprofile-instr-generate -fcoverage-mapping, no sanitizer), par=4,
qa-assets corpora:
| target | inputs | before | after | speedup |
|---|---|---|---|---|
| addition_overflow | 112 | 32s | 10s | 3.2x |
| process_message | 2386 | 719s | 247s | 2.9x |
On process_message every input is deterministic, so all 2386 take the
profdata fast path and zero llvm-cov show reports are rendered, down from
2*2386 + 2 = 4774.