test(fuzz): add four coverage-gap targets, seeds, and round-trip asserts #283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/283/head"
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?
Closes the fuzz-coverage gaps identified in a review of the existing 23 targets: every top-level container parser was fuzzed, but several deeper decoders were not.
New targets
graphics_decode— parses the archive then drainsiter_image_with_palette+iter_sfx, driving every record through the on-demand nibble-RLE / bit-plane / overlay image codecs and the SFX codec.graphics_archivestops at the container index and never touches the pixel decoders.sms_smf— the SMF parsers behind resource-fork songs (sms_audio::smf::events,dm2_music::scan_channels). Themac_rsrctargets fuzz only the fork wrapper, not the SMF inside it.cdda— the raw CD-DA LE/BE energy sniffer + sample walker (dm2_music::cdda::{detect_byte_order,to_wav,byte_order_stats}).mod_render— the ProTracker module parser behindmod_audio::LoopRender::new(viaxmrs);mod_p41only covered the depacker.Round-trip asserts
dungeon_le/beandsave_decode_le/bego beyond parse-and-drop to assert writer/parser symmetry: re-parsing their ownto_bytesoutput must re-encode identically. Idempotence, not equality with the fuzzer input (parse accepts non-canonical inputs the writer normalizes). Validated on real fixtures plus 20s of mutation fuzzing each with no counterexample.ftl_containerdeliberately keeps no such assert:Ftl::to_bytesrepacks payloads contiguously by contract, so a gap-bearing input parses but does not round-trip — confirmed via mutation before reverting the assert (documented inline + in ROADMAP + seeds README).Seeds
Hand-authored, not game-derived:
minimal.mid(MThd + one MTrk) andminimal.mod(M.K. header + one empty pattern) clear the MThd / M.K. magic gates without committing copyrighted, gitignored shipped assets.graphics_decodereuses thegraphics_archivecorpus;cddais ungated. Both seeds verified to parse and to raise coverage over blind fuzzing.Verification
All 27 targets build clean on nightly. Each new target smoke-run (no crashes, growing coverage). Fuzzing remains out of CI (nightly-only, non-terminating), unchanged.