Completes the switch (abfbbc6a).
- tests/int_splat_ops.rs needs legacy_int now that the direct decode is test-only
(required-features), and gains the scan: every committed splat set (the one that
int-payload-conformance and the staged splat case name) has a layer of tag 0, 1 or
2, header shifts under 128, no bias of magnitude 2^63 - 1 or more, and lowers and
loads under acc64; every committed payload (the vector, the refusal fixtures, the
staged base's) decodes or is refused through the lowering exactly as directly.
- integer-payloads: 2 names the decode its stream rules define (E1, t4097, lenient,
canonical); 6 cites whm1/1 and the RGB8 step; 7's set rules add the lowering and
load, its order puts them after g_s's shape and before the stream, and Exactness
says a lowered network makes its checks as check ranges; 12 lists WIA1 and WIS1
among the byte-equality goldens (so does int-payload-conformance's README).
- integer-operators: the status note names wai.splat.int_codec; 15.3 item 3 states
the codes and order of its breaks and the two more the lowering makes.
- SPEC 8's planned breaks and the CHANGELOG entry (the decode, the breaks, the
interpreter's memory) record them.
Measured (int_payload_cost): with the set loaded, the splat decode holds 325878 bytes
against 344656 declared; with the previous interpreter it held 622992 (1.8 times the
declared bytes, not the 1.6 the previous commit's message estimated).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
5.2 KiB
int-payload-conformance — the integer payloads
Vectors for the payload formats SPEC §5 pins to the WAI-native integer codecs
(extensions/integer-payloads.md): WIV1 for
wai.video.int_motion (keyframe 0) and wai.video.int_hyper (keyframe 1), WIH1
for wai.neural.int_hyper, WIA1 for wai.audio.int_codec and WIS1 for
wai.splat.int_codec.
Provenance. Generated here: wai_int_payload_vectors gen converts the vectors under ../wai-rs/tests/vectors/ and changes them for the refusal fixtures; tests/vectors/README.md states each vector's provenance. One payload indexed here is not generated content: video_real (int_video) codes a third-party image (see there).
Code-equivalence. A conforming sink decodes every payload to the output digests its vector states, and refuses every fixture with the code it states, from the extension's closed list (§8).
vectors.json— the index. For each payload: its capability, its path, its SHA-256, the JSON it is converted from, the parameter set it decodes against (each member's name in the set, and the committed file that holds it), and thesha256.jsonsidecar that states its decoded output's SHA-256. For each refusal fixture: its capability, its path, its code, and whether parsing alone refuses it (parse) or the decode does (decode). Paths are relative towai/.- The payloads sit beside their JSON sources under
../wai-rs/tests/vectors/:int_video/*.wiv1,int_hyper/tiny_bitstream.wih1,int_audio/audio_bitstream.wia1andint_splat/splat.wis1. Their sidecars are the ones the JSON forms' decodes are checked against: a payload and its JSON source decode to the same bytes. refusals/*.bin— each a committed payload changed in one place (a byte, a field, a truncation, a word appended to a stream), so that it is refused with one code, or, forwiv1_end_stateandwiv1_one_frame_end_state, a small clip written to end its stream in a state other than2^31. The fixtures named*_order_*break two rules at once and pin which one a sink reports (the extension's §2 and §7), and so do thewiv1_geometry_flip_*fixtures:wiv1_geometrywith one byte of its keyframe's last stream words changed, refused for the keyframe's size before that stream is read. The fixtures forbad_magicare the JSON sources themselves: a tool's JSON output is a converter input, never a payload.sets/— a parameter-set member a fixture decodes against in place of a committed one:entropy_median_max.jsonis the tiny conditional codec's tables with one median ati64::MAX.
Files are compared as bytes; .gitattributes turns off line-ending conversion.
Generation. Every file here, and every payload under tests/vectors/, is
written by one generator from the committed JSON alone, so it can be rebuilt and
compared:
cd wai/wai-rs
cargo run --no-default-features --features video_int,audio_int,splat_int \
--bin wai_int_payload_vectors -- gen ../int-payload-conformance
Verifiers.
-
wai_int_payload_vectors verify ../int-payload-conformance(wai-rs) regenerates every file and requires it to equal the committed one byte for byte, decodes every payload throughint_payload::decode_intto its sidecar's SHA-256, and requires every fixture to be refused with its code at its layer, and byint_payload::declared_costwith the same code unless the decode's refusal comes from a stream or a network run.tests/int_payload.rsruns the fixtures again in both build profiles, refuses every strict prefix of every payload, and runs a sweep of single-byte changes in which nothing may panic;tests/int_payload_preflight.rschecks that a header past the caps or past what the parameter set can fit is refused before anything sized from it is allocated, and that a payload whose streams cannot carry what its header declares is refused at its first exhausted symbol, having allocated only what it decoded. -
int_payload_verify.py, Python standard library only and sharing no code with wai-rs, written from the extension: it parses every payload with the extension's rules and check order, converts every JSON source independently and requires the committed bytes, decodes theWIV1payloads with keyframe 0 in full (the rANS decoder with its bypass escape, its stop at the first exhausted symbol and its canonical end, whole-pel and half-pel motion compensation) to their sidecars' SHA-256, and checks every fixture: aparsefixture's code, and that adecodefixture parses (aWIV1keyframe-0 one is decoded and must be refused with its code).python3 int-payload-conformance/int_payload_verify.py int-payload-conformance
Not decoded independently. The Python verifier does not decode WIH1, WIV1
with keyframe 1 (its keyframe is a WIH1), WIA1 or WIS1: their decodes run
integer networks it does not implement. Their outputs are checked by wai-rs against
the sidecars above, and also by the cross-architecture goldens in
../byte-exact-conformance/. For their decode
fixtures the Python verifier checks that they parse; their codes are checked by
wai-rs.