open-standards/wai/tools
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 51ab07aff1 wai-rs: the whole decoder end to end — codestream → RGB vs the reference PNG
Composes every validated stage into one decode of test256.bin and compares the
result to the reference test256_dec.png:

  codestream ─┬ luma:   z→i_s→σ/mask→SORP→y_q→resi→ψ→MCM→ŷ→LSBS→decode_y
              └ chroma: z→i_s→σ/mask→SORS→y_q→resi→ψ→(no MCM)→ŷ→LSBS→decode_uv
    YUV → EFElinear → eICCI → EFEnonlinear → LEF → BT.709 → RGB

Result: max|Δ| = 1, 4.45% of samples differ. Every differing sample is off by
exactly one, and the fraction sits at the PTQ floor already measured per plane —
luma ~1.4%, chroma ~3.4%, so ~4.4% across the combined RGB is expected. This is
not bit-equality with the reference PNG and is not meant to be: ψ, the MCM stages
and synthesis are 16-bit PTQ. The contract the integer path keeps is determinism —
byte-identical output on every machine — bought with ~1 LSB of accuracy.

Composing the stages is what earned this test its place. Each stage passed in
isolation, yet the composition surfaced four wiring faults no per-stage test could
see, three of them the exact class this test exists to catch:

  * hyper_scale / hyper_decoder take z at the 4×4 hyper resolution, not the 16×16
    latent plane — a hardcoded 16 indexed off the end of the weights;
  * reconstruct_yhat / LSBS take the 16×16 plane dims, which the function halves
    internally — passing 2× double-counted;
  * eICCI runs in [0,1]; the chain handed it [0,255], the folded BN and ReLUs
    misbehaved, and it scored worse than a no-op (already fixed in the eICCI
    commit, re-confirmed composed here);
  * EFElinear applies `filters_best2`, NOT `filters_best` — the naming is inverted,
    and the wrong group has a ~−16 luma cross-gain that blew U/V to −3882.

wai_jpegai_build_e2e_inputs.py extracts every runtime input — the model weights
for both planes, the normative tables, the LSBS and LEF op-point tables, and the
reference RGB — straight from the shipped assets, so the test is reproducible from
the assets alone rather than from hand-made scratch files. Verified: regenerating
the inputs with it and re-running gives the identical 4.45%.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-26 05:48:42 -04:00
..
build_reference_decoders.sh
wai_bmshj2018_encode.py
wai_bmshj2018_export_onnx.py
wai_bmshj2018_extract_cdfs.py
wai_carriage_demo.sh
wai_dac_encode.py
wai_dac_export_onnx.py
wai_elic_encode.py
wai_elic_export.py
wai_encodec_decode.py
wai_encodec_encode.py
wai_encodec_export_onnx.py
wai_generate_model.py
wai_int_audio_export.py wai: learned integer-exact audio codec (wai.audio.int_codec) + conformance 2026-06-27 17:01:31 -04:00
wai_int_hyper_tiny_vector.py wai.video.int_hyper: neural-keyframe video — learned int_hyper I-frame + integer P-frames 2026-06-27 07:34:20 -04:00
wai_int_splat_export.py wai-web: decodeIntSplat binding + per-attr ranges for the in-browser 3D demo 2026-06-28 09:49:40 -04:00
wai_int_synth_export.py
wai_int_synth_qat.py
wai_int_synth_real.py
wai_int_synth_train.py
wai_int_video_demo_encode.py wai-web: in-browser byte-exact video player (decodeIntVideo) 2026-06-27 08:37:53 -04:00
wai_int_video_encode.py
wai_int_video_keyframe_encode.py wai.video.int_hyper: neural-keyframe video — learned int_hyper I-frame + integer P-frames 2026-06-27 07:34:20 -04:00
wai_int_video_real_encode.py wai: half-pel motion compensation for int_motion video + real-footage conformance 2026-06-27 11:10:48 -04:00
wai_int_video_sota_keyframe_encode.py wai-web: in-browser NEURAL-KEYFRAME video — learned int_hyper I-frame + integer P-frames 2026-06-27 10:07:16 -04:00
wai_int_world2_export.py wai: two-agent co-control world.model — both agents drive one byte-exact frame 2026-06-28 03:14:57 -04:00
wai_int_world_export.py wai: world-model trainer — GPU (MPS) device + STEPS CLI arg + longer demo walk 2026-07-01 17:35:31 -04:00
wai_jpegai_build_e2e_inputs.py wai-rs: the whole decoder end to end — codestream → RGB vs the reference PNG 2026-07-26 05:48:42 -04:00
wai_jpegai_export_weights.py tools: an icci export mode for the eICCI model weights 2026-07-26 05:48:42 -04:00
wai_jpegai_extract_model_consts.py
wai_jpegai_goldens.py
wai_mbt2018_mean_encode.py
wai_mbt2018_mean_export.py
wai_mimi_encode.py
wai_mimi_export_onnx.py
wai_mlicpp_encode.py
wai_mlicpp_export.py
wai_snac_export.py
wai_sota_int_synth_export.py
wai_validate_synthetic.py
wai_video_bmshj2018_encode.py
wai_wavtokenizer_encode.py
wai_wavtokenizer_export_onnx.py