Skip to main content

WAI Extension: Capability Constraints

Mirrored from the canonical text at commit 498e6b88 ().

Status: Draft. Makes capability dispatch (WAI SPEC.md §4) a precondition check rather than a binary claim, by ingesting the constraint-set grammar and register pattern the broadcast-IP world already ratified. No transport, no registry service, no negotiation protocol — it evaluates values WAI already carries. A sink also declares what its display presents — resolution, refresh rate, bit depth, dynamic range and physical size — and no rendition above that is sent to it (§4); the receipt of each segment records how its rendition matched. Keywords MUST, MUST NOT, SHOULD, MAY are RFC 2119/8174.

1. The problem: support is not binary

WAI dispatch treats a capability as present or absent: a sink either claims cap or does not. Real sinks are not like that. A decoder supports a codec to a level — up to a resolution, a frame rate, a bit depth, a profile. “This capability, but only to 4K60 10-bit, this profile” is the normal case and is currently unexpressible.

The consequence is that partial support fails at decode time rather than at selection time. A sink advertises the capability, receives an object it cannot actually handle, and fails after committing to the bytes. Worse, WAI’s rendition selection has nothing to evaluate, so it defers to a deployer policy the specification never states.

2. Constraint sets

A constraint set is an ORed set of constraints over named parameters, each constraint being an enumeration, a minimum, a maximum, or a combination. A sink satisfies a capability when it advertises cap and the object’s declared parameters satisfy at least one of the registered constraint sets for cap.

This grammar is deliberately not invented here. It is the shape AMWA’s Receiver and Sender Capabilities specifications (BCP-004-01 and BCP-004-02, both v1.0.0) use, with parameters drawn from a public register rather than a bespoke schema per implementation. WAI ingests the grammar and the register pattern, not the transport or the discovery model those specifications sit in.

3. Parameters and the register

Parameters are named in a register, so two implementations constrain the same property under the same name. WAI adopts the pattern; it does not adopt the existing register wholesale, for a reason worth stating plainly:

The ratified registers are broadcast-essence-shaped. They cover media type, frame rate, colour sampling, bit depth, codec profile — which serves WAI’s conventional media capabilities and nothing else. There are no entries for the neural, quantum, world or haptic families. Those register entries WAI must author itself, and until it does, those capabilities remain unconstrained under §2, which is the honest state rather than a pretended one.

3.1 The register this revision holds

WAI’s parameters are named under the prefix wai:. Each value is an integer or a string, so every evaluation is exact; a rate that would be a rational elsewhere is an integer in a stated unit here.

parametervaluewhat it is
wai:codecstringthe codec string a decoder is configured with
wai:frame_widthintegerthe coded width, in samples
wai:frame_heightintegerthe coded height, in samples
wai:frame_rate_milliintegerframes per 1000 seconds
wai:bit_depthintegerbits per sample
wai:chromastringthe chroma sampling: 4:2:0, 4:2:2, 4:4:4 or 4:0:0
wai:sample_rateintegeraudio samples per second, per channel
wai:channel_countintegeraudio channels
wai:bitrateintegerbits per second
wai:transferintegerthe video’s transfer characteristics, as a TransferCharacteristics code point of the coding-independent code points (ISO/IEC 23001-8, as draft-pantos-hls-rfc8216bis-22 §4.4.6.2 cites it): 1, 6, 13, 14 and 15 are standard dynamic range, 16 is PQ and 18 is HLG

The families §3 names (neural, quantum, world, haptic) have no entries yet, and stay unconstrained until they do. The form a page evaluates constraint sets in, and their evaluation, are browser-sink §5; its reference implementation is the browser_sink module of wai-rs.

4. Display capability

Bits a panel cannot present are spent and never seen: pixels above its resolution, pictures above its refresh rate, bits per sample above its depth, a dynamic range above its own. A sink states what its panel presents in a display declaration, and a rendition above it is not sent. The declaration is a statement the sink makes once to whatever chooses its renditions, and makes again when its panel changes; nothing is exchanged beyond it.

4.1 The declaration

membervaluewhat it is
longinteger, at least 1the panel’s longer side, in its own pixels
shortinteger, from 1 to longits shorter side
refresh_milliinteger, at least 1the most pictures it presents per 1000 seconds; for a panel whose rate varies, its highest
bit_depthinteger, 1 to 16the bits per colour component it presents
hdrbooleanwhether it presents the range of the high-dynamic-range transfers, PQ and HLG, above standard dynamic range’s
long_mm, short_mminteger, 0 or moreits physical size along its longer and shorter sides, in millimetres; 0 where the sink does not know it

The sides are stated without orientation, so a sink that turns its panel declares nothing new. A native host reads every member from its platform’s description of the display it presents on. A page reads them through the interfaces it has:

Texts read for this section: CSSOM View Module, W3C Working Draft 16 September 2025, §2.1 and §4.3 (Screen, devicePixelRatio); Media Queries Level 5, W3C Working Draft 19 February 2026, §6.5 and §8.2; draft-pantos-hls-rfc8216bis-22 §4.4.6.2 (RESOLUTION, FRAME-RATE, VIDEO-RANGE).

4.2 The match

A rendition is read through the parameters of §3.1: w = wai:frame_width, h = wai:frame_height, r = wai:frame_rate_milli, d = wai:bit_depth and x = wai:transfer, with x = 1 where the rendition declares none (an HLS variant stream without VIDEO-RANGE is standard dynamic range, rfc8216bis-22 §4.4.6.2). Its exceedances against a declaration are the bits:

bitnameset when
0resolutionmax(w, h) > long, or min(w, h) > short
1refreshr > refresh_milli
2bit_depthd > bit_depth
3dynamic_rangex is 16 or 18, and hdr is false

A rendition is within the declaration when its exceedances are 0. Of the renditions a sender offers a sink (its ladder), the admissible ones are those within the declaration; where none is, the least rendition alone is admissible. The least is the first in the order of (w × h, r, d, 1 where x is 16 or 18 and 0 otherwise), ascending, and of two equal there, the one the ladder lists first. A panel smaller than every rendition is still served, by the least of them.

The match of a rendition is its exceedances, with bit 4, none_within, set when no rendition of the ladder is within the declaration. It is what a receipt records (stream-termination §3.4).

The check is made before dispatch, as §2’s is, and like §2’s an unmet declaration is not a decode error: the rendition is not chosen.

5. What this is not

6. Framing

The grammar is thin — close to a JSON-Schema subset — and that is fine. The value is not expressiveness; it is that a ratified, register-backed way of saying “supported, to here” already exists, and WAI’s dispatch, which has only “supported”, gains a range by adopting it.