Skip to content

clazel-webp: WebP container and lossless decoding (item 6.8) - #199

Draft
atiernan wants to merge 5 commits into
phase6/6.3-shapefrom
phase6/6.8-webp-lossless
Draft

atiernan wants to merge 5 commits into
phase6/6.3-shapefrom
phase6/6.8-webp-lossless

Conversation

@atiernan

Copy link
Copy Markdown
Member

Item 6.8 of Phase 6: clazel-webp, a WebP decoder on clazel-image-shape's Decoder interface (tier 0, target tier 1; the tier is not raised).

Built

  • RFC 9649: RIFF, VP8X, ANIM and ANMF with every frame composited (disposal, blending, Webp::frame()); ICCP/ALPH/EXIF/XMP /unknown chunks skipped; VP8 recognised and refused as Error::Unsupported (lossy is 6.9).
  • VP8L: predictor (14 modes), colour, subtract green, colour indexing with pixel bundling; colour cache; meta prefix codes; simple and normal code length codes; LZ77 backward references with the distance map. Twelve listed choices in lib.rs.
  • Vendored Wuffs' WebP files (commit b36a81d) with a converter in xtask. libwebp's own vectors have no licence, so Wuffs' lossless files stand in; image-webp 0.2.4 is the reference (new test dependencies: image-webp, byteorder-lite, quick-error, rows added to DEPENDENCIES.md).

Tested (native)

  • 22 unit tests and 15 integration tests pass.
  • All 11 Wuffs lossless files are exact against image-webp. The animation is exact on its first frame and within 1 per channel on blended frames, because image-webp rounds blending differently from libwebp's formula (a listed difference). 2 lossy files are refused.
  • Every file at chunk sizes 1 to 4096 equals the whole-file decode. 1,440 byte mutants never panic.
  • 531 images made by a test-side VP8L encoder decode exactly and agree with image-webp; animation against a test-side compositor; 12 malformed inputs.
  • cargo build, cargo clippy --workspace --all-targets -D warnings, cargo fmt --check and cargo xtask check are clean.

Not done

  • 16 Kani harnesses are written but have not been run. Neither Kani, Miri nor cargo xtask verify was run locally. CI's approved proof jobs have to run them, and bounds may need adjusting. The whole step is not a harness, as for GIF; it is covered in parts (README).
  • Miri strides are sized (about 0.002 s native with the Miri branch forced) but not run.
  • Lossy VP8 and ALPH (6.9), loop count and timing (6.19), more than 1,024 prefix code groups.
  • The tier stays 0 until a full verification is green.

🤖 Generated with Claude Code

atiernan and others added 5 commits November 20, 2026 00:01
…m 6.8)

14 files of commit b36a81d (11 lossless, the animation, 2 small lossy ones for the refusal test); libwebp's own vectors have no licence.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
RFC 9649: RIFF, VP8X, ANIM and ANMF with composited frames; VP8L with every transform, the colour cache, meta prefix codes and backward references; VP8 refused as unsupported. Sixteen Kani harnesses written, not yet run. Adds image-webp, byteorder-lite and quick-error as test dependencies.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ts (item 6.8)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e Miri and changed-crate CI)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan deployed to full-verification November 20, 2026 01:09 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
full-verification — 1a917869 Deployed Nov 20, 2026 by atiernan via Approve the proofs #597
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant