# platform-decode-conformance — the query a sink asks a web platform Vectors for [`extensions/platform-decode.md`](../extensions/platform-decode.md): the query a sink reads from an entry's payload for a web platform's Media Capabilities and WebCodecs (§2.1 video, §2.2 audio), and the chunks it gives the decoder (§2.3). The order the platform's answers feed is SPEC §4's energy order inside browser-sink's routing, and its vectors are the `choices` of [`../live-conformance/browser/`](../live-conformance/browser/). **Provenance.** `queries.json` names payloads written by real encoders and muxers, none of them made for these vectors but those in `payloads/`: - two floor objects of the packaging corpus (`../pack-conformance/packs/`), whose codec strings are the ones the packager wrote into the packs' HLS masters, and one HEVC SPS the platform's encoder wrote through WebCodecs, configured with `prefer-hardware`, a hint the user agent may ignore (§5 of the extension records the run); - the elementary streams of `../identify-conformance/ext/` (VP9 in IVF, H.264 and H.265 Annex B, Ogg Opus, FLAC, ADTS), written by `tools/make_external.sh` there; - AVC and HEVC streams the platform's and a software encoder wrote (`../encode-conformance/streams/`); - `payloads/`, written by `payloads/make.sh` with open encoders from synthetic test patterns and sine waves: VP8, VP9 4:4:4 (profile 1) and 10-bit BT.2020 full range (profile 2), AVC High with B-frames and a cropped height, stereo AAC-LC at 44.1 kHz, stereo 24-bit FLAC, stereo Ogg Opus, and one Opus packet with no container (the first audio packet of that stream). `payloads/prober.tsv` is what an independent media prober read of each: its codec, profile, size, pixel format, colour, rate and channels. Then planted faults: a payload with one edit (`mutate`, a byte offset and the bits flipped there) and the outcome it gives, refused or another query. Every expectation of the cases this revision added was computed by the second implementation (below) from the payload, and the reference gives each one; neither reads the other's code. ## Layout - `queries.json` — `cases`: a `capability`; a `payload_file` (a `WAI1` envelope, relative to `wai/`), a `payload_raw` (a file whose bytes are the payload) or an `sps_hex`; `rate`, the presentation rate a sink gives a payload that states none; `mutate`, the edit of a planted fault; then `refused: true`, or `expect` (members of the query's JSON form, `platform_decode::query_json`) and `chunks` (`platform_decode::chunks_json`: how many chunks, how many key, the bytes they hold, the samples a channel they decode to, the description's length). - `payloads/` — the payloads above, `make.sh` and `prober.tsv`. - `grain-free-av1/` — §6 of the extension: a grain-free `wai.video.av1` base, its reference decode and probe, two `wai.video.int_refine` layers written against that decode, a stream with film grain, and the cases a sink replays; its `README.md` states them and their verifiers. ## Equivalence An implementation conforms when it gives every query's members and every chunk summary, and refuses every case marked refused. The reference is `wai::platform_decode` (`wai-rs/src/platform_decode.rs`), whose tests read this file. The second implementation is `../live-conformance/browser_sink_verify.py`, written from the extension's text, which with this directory as its second argument recomputes every case from the payload and requires every mutated copy of the vectors to fail: ``` python3 -I live-conformance/browser_sink_verify.py live-conformance/browser platform-decode-conformance ``` `wai-web/demo/verify_platform_decode.mjs` reads every payload here that is not a planted fault in browser engines, through the wasm32 build, and decodes it through the platform's WebCodecs where the platform accepts its configuration.