wai-web: expose the byte-exact JPEG-AI mANS decode to wasm (decodeJpegAiMans) #51

Merged
dcharlot merged 1 commit from wai-jpegai-wasm-demo into main 2026-08-01 19:26:06 -04:00

2026-08-01

Transaction Science
wai-web: expose the byte-exact JPEG-AI mANS decode to wasm (decodeJpegAiMans)
The ISO/IEC 6048 JPEG-AI entropy decoder (`wai::jpegai_mans`) as a browser entry:
given the reference stream, the integer PMF rows, the per-distribution bounds, and
the per-position σ indices + coded-position masks, it rebuilds the decode tables and
returns the decoded residual symbols. The same pure-i64 Rust a native sink runs,
compiled to wasm32 — no float, no ML runtime — so the symbols are byte-identical to
the native decode, and their hash is portable across host and browser.

Verified: the wasm decode reproduces the native cross-arch golden exactly (172 coded
positions, 0 mismatches) and hashes to the same digest. Drives the /jpegai
reproduction-vector demo.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-01 10:55:22 -04:00