From 6ff7f844795c6ca6dd9c342fe5bdfbfa41c214c8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 00:31:38 +0000 Subject: [PATCH] craft-raw: the RW2 format 8 robustness seed carries a valid stream Its random payload decoded only while out-of-depth samples were clamped; mutations now start from a file that decodes. --- crates/raw/tests/it/vendor_robust.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/raw/tests/it/vendor_robust.rs b/crates/raw/tests/it/vendor_robust.rs index d0be373f60..4df4912d35 100644 --- a/crates/raw/tests/it/vendor_robust.rs +++ b/crates/raw/tests/it/vendor_robust.rs @@ -136,7 +136,14 @@ fn rw2_of(format: u16, bits: u16, n: usize) -> Vec { }; let off = build(0).len(); let mut b = build(off as u32); - b.extend((0..n).map(|i| (i * 89 % 253) as u8)); + if format == 8 { + // a valid stream: the category-0 code `111110` over and over, each byte's bits from bit 0 up (every sample 0, + // inside any bit depth) + let bit = |k: usize| u8::from(k % 6 != 5); + b.extend((0..n).map(|i| (0..8).fold(0u8, |a, j| a | bit(i * 8 + j) << j))); + } else { + b.extend((0..n).map(|i| (i * 89 % 253) as u8)); + } b }