forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 6828b152fbb3de7dbfdfdce189e9b72de86552f7Filtered to crates/ec-image/tests/fuzz.rsClear filter

2026-08-14

test(image): differential corpus, fuzz sweep and a real-library passAhmet Kaan Gümüş · 82499c0
test(image): differential corpus, fuzz sweep and a real-library pass

Three bars, one per format, each the strictest the format allows:

- PNG and lossless WebP are pixel-exact against the incumbent `image`
  crate over every colour type, bit depth and interlace method, with the
  16-bit variants compared at 16 bits so neither side's narrowing rounds
  the comparison away.
- JPEG is measured, not asserted away: max sample delta 5 of 255 (1 on
  grayscale, 3 on 4:4:4), correlation above 0.9999 and 49-66 dB against
  the incumbent's own decode, all printed per file. T.81 leaves IDCT
  rounding to the implementation and both readings are legal.
- WebP lossy is measured against the *source picture*: 32.1-36.5 dB,
  within 0.05 dB of the incumbent everywhere, and the alpha plane, being
  lossless, must match exactly.

Ten thousand mutations per format — bit flips, truncations, injections and
noise behind each signature, with PNG chunk CRCs repaired so the mutations
reach the decoder instead of stopping at the checksum — must produce an
Ok or an Err, never a panic. A header claiming four gigapixels is refused
before anything is allocated from it.

The real-library sweep decodes the PNGs and JPEGs actually on this machine
and prints a per-file table: 13 files, PNGs pixel-exact, JPEGs within four
counts, 33 Mpx in 568 ms and a 12.6 Mpx phone JPEG in 247 ms in release.