mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
contrib: Skip llvm-cov rendering for deterministic fuzz inputs #35608
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!35608
Loading…
Reference in a new issue
No description provided.
Delete branch "det-fuzz-cov-profdata-fastpath"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
deterministic-fuzz-coveragerendered a fullllvm-cov showreport for everyfuzz input on both runs and diffed the two reports, even though almost all
inputs are deterministic.
llvm-cov showis by far the most expensive step, sothe vast majority of that work produced two identical reports that were
immediately discarded.
Compare the merged
.profdatafirst: identical counters are a sufficientcondition for deterministic coverage, so when the two profdata files match the
llvm-cov showrendering is skipped entirely. Only when they differ does itfall 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 showoutput (the report is adeterministic function of the profdata and the binary). Any profdata difference
falls back to the exact same
llvm-covdiff as before.Benchmark
standalone coverage build (
-DBUILD_FOR_FUZZING=ON+-fprofile-instr-generate -fcoverage-mapping, no sanitizer), par=4,qa-assets corpora:
On
process_messageevery input is deterministic, so all 2386 take theprofdata fast path and zero
llvm-cov showreports are rendered, down from2*2386 + 2 = 4774.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
No conflicts as of last run.
tACK 87ecdf2cf0bd3aa222b744a59ceaa62c2240b725
Ran both versions on qa-assets with the coverage build left over from my #35809 review with par=4.
addition_overflowwent from 5m49s to 31s andprocess_messagefrom 1h50m to 25m48s, same PASS on both, and the new flow rendered zero reports. Identical.profdatawould mean an identical report anyway; if they differ it falls back to the usual render and diff.lgtm, left a nit to slim this down a bit
Nit: There's now a lot of
'a'and'b'. Maybecheck_diffcan just accept the&Pathand then do everything itself. This would de-dupl a bunch of code. Something like this (untested):Possibly could also inline
profdata_eqand only keep a small comment as it is only called once, to save some more lines?Small nit: A build with
-fprofile-instr-generatebut no-fcoverage-mappingnow printsCoverage test passedwhere master dies withllvm-cov show failed. Determinism is still checked either way, only the broken build slips by. Under your version, worth onerun_profileandrender_covbefore the loop?This is a dev-only script. If there is a "broken build" (because the dev ignored the docs), I think it is fine to not hold their hands with extra logic here. If needed, the error message can be adjusted, but other than that, I'd say the logic shouldn't be modified.
Updated, thanks. Kept the
profdata_eq, since I feel it is very good for beginners (like me) to understand the code logic.🐙 This pull request conflicts with the target branch and needs rebase.
nit: Needs rebase anyway, and while touching this, could make it a proper named arg in a new commit:
@HowHsu are you still working on this?
Updated
🔵 Suggestion · The fast path also skips
llvm-covcompatibility validationWhen all profile comparisons match, success no longer establishes that
llvm-cov showcan render the coverage, although no configuration where merging succeeds but rendering fails was reproduced.Location:
contrib/devtools/deterministic-fuzz-coverage/src/main.rs:257(head).Review coverage was incomplete.
Reviewed:
02275f6a7070· Review report · Previous reportspermalink
Sorry for delay, it's updated.