perf(ci): deal the fuzz smoke across a matrix instead of walking it on one runner#401
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…n one runner go test -fuzz takes one target per invocation, so the budget is paid per target and one runner pays the sum of them. A push to main takes the full sweep by design, which measured 10m34s. The targets are independent, and dev/fuzz already deals them out round-robin under FUZZ_SHARD, which the nightly has been using. Use it here too: same fuzz-seconds, roughly a quarter of the wall clock. The crasher artifact is now named per shard. The upload rejects a name another job in the same run already used, so under a matrix a fixed name would mean the second shard to find a crasher silently loses its reproducing input, which is the one thing this job exists to keep.
45876e0 to
119b631
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
Fuzz smokejob now runs as a four-way matrix, passingFUZZ_SHARD=<k>/4todev/fuzz, and names its crasher artifact per shard.Why
go test -fuzzaccepts exactly one target per invocation, so the fuzz budget is paid per target and a single runner walking the list pays the sum of every target's budget. A push tomaintakes the full sweep by design: around ninety targets at five seconds each, plus each one's compile and baseline-coverage cost. That measured 10m34s on the last merge, and every merge pays it.The targets are independent, and
dev/fuzzalready knows how to slice them:FUZZ_SHARD=<k>/<n>deals them out round-robin, deliberately not in contiguous blocks, because a package's targets sit next to each other in the list and tend to cost alike, so blocks would pile the slow ones into one shard. The nightly has been running this way already. This brings the same treatment to CI: the same fuzz-seconds, roughly a quarter of the wall clock.A pull request is barely affected either way, since
dev/fuzzalready scopes a PR's run to the targets its diff can break, and a shard with nothing in its slice exits immediately.fail-fast: false, because a crasher in one slice says nothing about the others, and finding two bugs in one run beats finding the first one twice.The artifact rename is not cosmetic. The upload rejects a name another job in the same run already used, so under a matrix the fixed name would mean the second shard to find a crasher silently loses its reproducing input, which is the one thing this job exists to preserve.
How to verify
The budget per target (
FUZZTIME=5s) and the set of targets covered are unchanged: four shards still cover every target between them. A crasher in any shard still fails the job, andCI successstill gates onfuzz, which under a matrix aggregates every shard's result.Locally,
FUZZ_SHARD=1/4 ./dev/fuzzprints the slice it selected and the total it was drawn from.Notes
The budget itself is untouched. Making the sweep cheaper by fuzzing less would defeat the point of having it.