### Testing

- **13 lib tests**: per-codec round-trip + envelope round-trip
- **21 FFI robustness tests**: null pointers, length mismatches,
  dimension overflow, malformed magic, truncated payloads, bad JSON,
  invalid Opus sample rates, zero fps, garbage decoder input
- **10 fuzz smoke targets**: 1024 adversarial random byte sequences per
  decoder asserting no panic. Stable Rust, no `cargo-fuzz` toolchain
  needed. Found and fixed a real envelope-truncation panic.
- **`wai_bench` corpus walker**: quick mode (4 images + 4 audio + 3
  text + 2 video) for spot-checks; `--full` walks the entire corpus
  (169 images + 5 audio + 13 text + 12 video sequences = 588 codec
  runs in ~9.4 min). Per-codec aggregate stats: runs, ok / fail counts,
  WAI vs reference byte sizes, PSNR delta vs ffmpeg, encode time.
- **`--report file.json`** writes a structured bench report;
  `wai_bench_diff baseline.json head.json` flags regressions on bytes
  (±5% default tolerance), encode time (±25%), or new failures. Non-zero
  exit on regression — ready for CI gating.
- **Hosted CI** [name removed 2026-09-30] (`.github/workflows/ci.yml`): ubuntu + macOS
  matrix, apt/brew codec deps, `cargo test --release`, cdylib/staticlib
  artifact verification, quick bench, JSON report uploaded as artifact.

