From 5ff10e120dbb2e1255b5457176ca155f0b89a9b2 Mon Sep 17 00:00:00 2001 From: David Mann Date: Sun, 1 Nov 2026 14:30:55 +0100 Subject: [PATCH] Integration: keep the NaN-safe .atn fuzz invariant (#7561) The previous fix-up put main's atn fuzz target back. It compares the parsed actions with assert_eq!, so any valid file holding a NaN double fails the fuzzer falsely (NaN != NaN); the PR's own contract test nan_payloads_signed_zero_and_infinities_survive_without_false_fuzz_failures covers exactly that. The target now calls the shared check again, at its new path under tests/it/common. Co-authored-by: denstu473 <63150090+denstu473@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- crates/psd/fuzz/fuzz_targets/atn.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/psd/fuzz/fuzz_targets/atn.rs b/crates/psd/fuzz/fuzz_targets/atn.rs index 3bb1777c8a3..e02e25b0731 100644 --- a/crates/psd/fuzz/fuzz_targets/atn.rs +++ b/crates/psd/fuzz/fuzz_targets/atn.rs @@ -1,14 +1,12 @@ //! Fuzz the `.atn` actions parser: any input must return `Ok` or `Err`, never panic, and -//! anything that parses must survive a write and parse back equal. +//! anything that parses must survive writing, reparsing and stable canonical writing. #![no_main] use libfuzzer_sys::fuzz_target; -use photocraft_psd::atn; + +#[path = "../../tests/it/common/atn_roundtrip.rs"] +mod atn_roundtrip; fuzz_target!(|data: &[u8]| { - if let Ok(f) = atn::parse(data) { - let bytes = atn::write(&f).expect("a parsed set is writable"); - let again = atn::parse(&bytes).expect("a written set parses"); - assert_eq!(again.actions, f.actions); - } + atn_roundtrip::check(data); });