test: add run_full_fuzz.sh deep fuzz-campaign helper - #74
Conversation
Adds fuzz/run_full_fuzz.sh: runs every cargo-fuzz target in libFuzzer fork mode for a per-target budget, persisting the (resumable) corpus and collecting crash artifacts, with a clean/dirty exit status. Safe-by-default for any machine, not just a big workstation: - FORKS defaults to cores-2 (machine stays responsive; FORKS=$(nproc) for all), and the run prints estimated total time + peak RAM (~FORKS x RSS_LIMIT_MB) up front. - When run interactively it waits 5s so a heavy run can be aborted and re-launched with smaller knobs; skipped under nohup/redirection. - Tunables: SECS_PER_TARGET, FORKS, RSS_LIMIT_MB, TARGETS. Quick run: SECS_PER_TARGET=120 FORKS=2 ./fuzz/run_full_fuzz.sh (~14 min, 2 cores). Also gitignores fuzz/*.log (campaign logs) and adds a CONTRIBUTING "Fuzzing" section pointing devs at the CI smoke (fuzz.yml), ad-hoc cargo-fuzz, and this helper. Validated with `bash -n` and a config-arithmetic simulation across machine profiles; not run live (leaving the CPU free). Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Review Summary by QodoAdd deep fuzz campaign helper script and fuzzing documentation
WalkthroughsDescription• Add run_full_fuzz.sh script for deep fuzzing campaigns across all targets • Script runs libFuzzer in fork mode with configurable per-target budgets • Safe-by-default tuning: FORKS defaults to cores−2, estimates time/RAM upfront • Interactive abort window and environment knobs for laptop-friendly runs • Document fuzzing workflow in CONTRIBUTING.md with script usage examples Diagramflowchart LR
A["Developer"] -->|runs| B["run_full_fuzz.sh"]
B -->|builds| C["cargo fuzz targets"]
C -->|runs fork mode| D["libFuzzer per-target"]
D -->|collects| E["Corpus & Artifacts"]
E -->|reports| F["Campaign Summary"]
G["CONTRIBUTING.md"] -->|documents| B
File Changes1. fuzz/run_full_fuzz.sh
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive fuzzing script, fuzz/run_full_fuzz.sh, to run deep fuzzing campaigns across all cargo-fuzz targets, along with updated documentation in CONTRIBUTING.md and gitignore rules. The feedback focuses on improving the script's portability and usability, specifically by adding fallbacks for macOS/BSD systems that lack nproc and the GNU-specific date -Is flag, and by ensuring that interrupting the script (e.g., via Ctrl-C) correctly aborts the entire sequential loop rather than skipping to the next target.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8baafd2bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a developer-facing helper for running an exhaustive, resumable local cargo-fuzz campaign across all ordvec fuzz targets, and documents the recommended fuzzing workflow (CI smoke vs. local deep runs).
Changes:
- Add
fuzz/run_full_fuzz.shto run all seven fuzz targets sequentially with libFuzzer fork mode, persistent corpus/artifacts, and an end-of-run artifact summary. - Update
fuzz/.gitignoreto ignore campaign log files. - Extend
CONTRIBUTING.mdwith a Fuzzing section pointing to CI smoke runs and the new local helper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
fuzz/run_full_fuzz.sh |
New deep fuzz-campaign runner script with configurable budgets/forks/RSS caps and crash artifact reporting. |
fuzz/.gitignore |
Ignore *.log produced by the full campaign helper. |
CONTRIBUTING.md |
Document fuzzing workflow and how to run the full local campaign. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses PR #74 review (gemini/qodo/copilot/codex): - Portable CPU count: nproc -> getconf -> BSD/macOS sysctl -> 1, so a missing nproc on macOS no longer leaves NCPU empty under set -u. - Portable timestamps: GNU 'date -Is' -> 'date -u +%Y-%m-%dT%H:%M:%SZ' (a now() helper), which BSD/macOS date supports. - Ctrl-C trap (SIGINT): stops the whole campaign instead of killing one target's fuzzer and marching to the next. - Propagate exit codes: each target's rc is captured; a non-zero run sets any_fail and the final status is non-zero (was only logged before, Codex P1). - Iterate the parsed array (for t in "${_targets[@]}") instead of unquoted word-splitting over $TARGETS. Validated: bash -n, now(), nproc fallback, and the propagate-on-failure logic. Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
run_full_fuzz.sh— deep fuzz-campaign helper for devsAdds
fuzz/run_full_fuzz.sh: a helper to run a deep local cargo-fuzz campaign across all seven targets. Complements the bounded CI smoke (fuzz.yml) with an exhaustive, resumable run for pre-release / ad-hoc deep fuzzing.What it does: runs each target in libFuzzer fork mode for a per-target wall-clock budget, persists the corpus (cumulative / resumable across runs), collects any crash/oom/timeout/leak artifacts, and exits non-zero if any are found.
Safe-by-default (not just for a big workstation)
The original was tuned for a high-core box; this makes it friendly to laptops/smaller machines:
FORKSdefaults tocores − 2so the machine stays responsive (setFORKS=$(nproc)to use every core).~FORKS × RSS_LIMIT_MB) up front, so you see the commitment (the full default run is ~21h and tens of GB).nohup/redirection so detached campaigns start immediately.SECS_PER_TARGET,FORKS,RSS_LIMIT_MB,TARGETS. Laptop-friendly quick run:SECS_PER_TARGET=120 FORKS=2 ./fuzz/run_full_fuzz.sh # ~14 min, 2 coresAlso
fuzz/.gitignore: ignore*.log(the campaign writesfuzz/full_fuzz_run.log).CONTRIBUTING.md: a Fuzzing section pointing devs at the CI smoke, ad-hoccargo +nightly fuzz run, and this helper.Validation
bash -n(syntax) + a config-arithmetic simulation across machine profiles (beast / laptop-quick / 2-core / 1-core) — confirms safeFORKS, sane time/RAM estimates, no arithmetic errors. Not run live in CI/locally on purpose (the corecargo +nightly fuzz build/fuzz run … -fork=… -max_total_time=…invocation is the same one already proven by a multi-hour campaign).