test(preset): cargo-fuzz targets + no-panic regression tests for parsers#32
Merged
Conversation
…arsers Add a cargo-fuzz harness (crates/resonance-preset/fuzz) with one target per untrusted-input parser: fuzz_fac -> fac::parse_fac fuzz_apo -> apo::parse_apo (transitively the GraphicEQ fitter) fuzz_graphic -> graphic::fit_graphic_eq (raw f64 pairs) + graphic_eq_summary Each target only asserts the parser returns without panicking. Seed corpus is built from the parser test fixtures (valid presets, band-header form, channel directives, glued GraphicEQ pairs, a binary f64-pair set). The fuzz crate is its own workspace root (empty [workspace]) so 'cargo build --all' / 'cargo test --all' from the repo root never build it. Backlog item 11.
Each parser was fuzzed for 3 min (~20.8M execs fuzz_fac, ~78.6k fuzz_apo, ~4.5k fuzz_graphic) with zero crashes — the parsers already carry prior hardening (MAX_COUNT/MAX_BANDS bounds, parse_finite NaN/Inf rejection, MAX_FIT_POINTS DoS cap, bounds-checked indexing). Lock the no-panic property in as fast unit tests feeding the adversarial input classes libFuzzer explored (empty, NUL bytes, truncated, negative counts, non-finite/zero/negative/huge freqs, degenerate cancelling pairs, over-cap point sets, glued/empty pairs).
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
cargo-fuzzharness for the untrusted.fac/ APO / GraphicEQ parsers (backlog item 11) plus no-panic regression tests.crates/resonance-preset/fuzz/(its own workspace root — excluded fromcargo build/test --all).#[test]s (one per parser) lock the property in as fast unit tests.resonance-presetnow 31 tests.No production-code changes; test infrastructure only.
make checkgreen.