wai: the integer codecs' binary payloads, pinned in place #139
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/land-16-binary-payloads"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The integer codecs' payloads are pinned in place as binary formats, each the normative payload of an existing capability string:
wai.video.int_motion,wai.video.int_hyperWIV1wai.neural.int_hyperWIH1wai.audio.int_codecWIA1wai.splat.int_codecWIS1These strings' rows named a decoder and fixed no byte layout. SPEC §8 gains Completing a registration: a revision may pin a byte layout for such a string, the envelopes that carried another form become non-conforming (they still parse, and SPEC §5 lists them), and "fixed forever" starts at the pin. The JSON tool outputs stay as debug formats; an envelope carrying one under these strings is refused, and every emit path —
wai wrap, the Rust and C packers and the browser writers — runs the same wire parser a sink does.int_payload::decode_intdecodes every integer capability without a machine-learning runtime and refuses a malformed payload with one of a closed list of reasons, in one stated order, alike on every target. A decode does only the work its stream backs: it stops at the first symbol the stream cannot supply, and its memory bound is stated (extension §7). A stream must end canonically.extensions/integer-payloads.mddefines the four formats; SPEC §4, §5 and §8, prior-carriage and jwp-receipts §7.9 follow.int-payload-conformance/).neural::DecodedgainsIntand is#[non_exhaustive];ParamSourceandIntParamschange shape. The CHANGELOG lists the breaking changes.The browser demonstrations that still read the JSON forms move to the binary payloads in a follow-up to the site.
Checked locally on macOS arm64: the link gate including the Kani harnesses, the release fast-kernel step, the neural gates, the C ABI and CLI steps, the receipt tests, the wai-web native and wasm32 checks, the Python verifier (also under
-O),wai registry export --check, the section-reference guard and the public-text checks. Two adversarial reviews' findings are fixed, each with a test that was shown to fail first. The forge CI runs on this pull request.🤖 Generated with Claude Code
wai-web's decodeIntHyper and decodeIntHyperBin read the conditional codec's JSON through panicking readers and the unchecked decode, so {} or a hyper-latent of 2^61 elements panicked the page. - IntModel::try_from_json and CondBitstream::try_from_value read what from_json and from_value read (an absent number as 0, as before) and refuse a member of the wrong type, a size that does not fit, or an unknown layer type. - The browser's JSON decode goes through them, CondEntropy::try_from_value and decode_conditional_checked. - int_video::VideoJson refuses a frame whose motion vectors are not a list instead of reading it as empty; the Python converter refuses it too. Tests: wai-web neural_int::tests::the_debug_json_decode_refuses_instead_of_panicking (the reviewer's {} and 2^61 cases, too many z channels, and the committed JSON models decoding alike) and int_payload::tests::a_frame_entry_that_is_not_a_list_is_refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>The emit paths skip the integer framing check for an envelope whose manifest declares an encryption, since its payload is ciphertext; but the reference dispatchers did not apply SPEC §6.4 step 2, so a payload sent in the clear under a false claim of encryption was decoded as plaintext, and a WAI2 security member that is not a security object (true, "aes", [], {"encryption": 5}) was written. - Wai::dispatch_verified and WaiMulti::pick open no scheme, so an envelope whose manifest declares an encryption other than "none" is inert at them before any capability is considered: unsupported_encryption (container::Inert::Encrypted, and container::Skip::Encrypted for every WAI2 entry). The neural sink reports neural::DecodeError::Encrypted, its C ABI WAI_ERR_CONTAINER; wai-web's dispatchCapability returns undefined. - WaiMulti::to_emit_bytes, and so the C packer and wai-web's packMulti, refuse a security member that is not a security object (EmitError::Security, container::manifest_v2_security); read, such a member is treated as encrypted. SPEC §6.4 step 2 names the reference's report, and §7.1 states the WAI2 security member and the reason it gives every entry. Tests: container's an_encrypted_envelope_is_inert_at_the_reference_dispatchers (WAI1 and WAI2, "none", null, an absent and an empty member, the four malformed members refused at emit and inert when read); neural_native_decode's an_encrypted_envelope_is_inert_at_the_reference_sink (a valid WIH1 and its JSON form in the clear under the claim, a WAI2 encrypted or with security true); wai-web's writers test. Co-Authored-By: Claude Opus 5.5 <[email protected]>