Skip to main content

WAI Extension: Live Composition

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

Status: Draft. Registers the record wai.live.compose: the deterministic composition of a live room’s participants. A signed composition descriptor fixes a canvas, a background, a layout (a grid, with a featured tile, or a grid under a picture-in-picture window, or an ad frame: a program squeezed into a corner with an ad in the L around it, or a program and an ad in two boxes side by side), the grant attributes it reads and its limits. The participant set at a room-clock instant is derived from the room’s lifecycle replay (live-rooms §9): who publishes, each one’s video and audio source and its dimensions, the attributes of its grant in effect, and its join order. The layout is then a pure integer function of the descriptor and the set, and the mix a pure integer function of decoded PCM, so every sink composes the same rectangles locally, with no server encode, and a server compositor that publishes a composed track signs a composition receipt that anyone can check against the same function. No new transport: a composed track is a track of the room, and the receipt names the objects it was made from. The reference implementation is the live_compose module of wai-rs (feature live_compose); the corpus is live-conformance/compose/, and its second implementation is live-conformance/live_compose_verify.py. In an ad frame, a session’s sink may show the session’s own ad: a per-session ad track, decided for that session by a stitched-presentation pod-input record and bound to the frame by an ad-track binding, WAT1, which the record’s signer signs (§5.10). A binding that does not match its session’s composition is refused. Its reference is the compose_ad_track module of wai-rs (feature compose_ad_track); its corpus is live-conformance/compose-ad-track/, and its second implementation live-conformance/compose_ad_track_verify.py. Keywords MUST, MUST NOT, SHOULD, MAY are RFC 2119/8174.

Texts read for this revision: draft-ietf-moq-transport-22 (MOQT), an Internet-Draft not past Working Group Last Call, for the Full Track Name (§2.4.1) and the Location (§8.2); RFC 6716 §6; RFC 8032; FIPS 180-4; and IEC 61966-2-1 (sRGB). A section number of that draft in this text is that revision’s.

1. Scope

In scope: the composition descriptor, its digest and signature, its limits and who may sign it (§3); the participant set at an instant, the attributes the descriptor reads, the order, and the set’s digest (§4); the layout function (§5), and a session’s own ad in an ad frame with its binding (§5.10); the audio mix (§6); where composition runs (§7); the composition receipt and its verification (§8, §9).

Out of scope: a transport; how a renderer scales and filters a source into its rectangle, and how it converts the background’s colour into its output’s (the layout fixes rectangles, not pixels); decoding, resampling and encoding; and the browser compositor that renders a layout in a page, which a later slice builds from this function.

Relationship to the core spec: wai.live.compose is a record (SPEC §5): a signed record a WAI tool emits and verifies. It names no payload format and is not dispatchable.

2. Terms

3. The composition descriptor

3.1 Layout

fieldsizemeaning
magic4WCD1 (ASCII)
version11 in this revision
room32the room id (live-rooms §3.2)
signer32the Ed25519 key that signs the descriptor (§3.5)
effective8u64: the room-clock instant from which the descriptor applies
compositor32the principal that may publish the composed tracks (§7); 32 zero bytes for none
width, height2 eachu16: the canvas, in pixels (§3.4)
fps1the canvas’s frame rate, in frames per second (§3.4)
background3the canvas’s colour: red, green and blue, 8 bits each, in sRGB (IEC 61966-2-1)
layer1the highest layer of a source composed (§4.2)
layout11 grid, 2 picture in picture, 3 squeeze, 4 double box (§5; 3 and 4 are the ad frames of §5.9)
gap2u16: the pixels between two grid tiles
aspect1the grid tiles’ aspect: 0 auto, 1 video (16:9), 2 square (1:1), 3 portrait (3:4) (§5.3)
fill10 default, 1 fill, 2 cover, 3 contain (§5.6)
featured_attrshortthe attribute key that marks the featured participant; empty for none (§4.3)
order_attrshortthe attribute key that orders participants; empty for none
omit_stopped11: a participant whose video is stopped has no tile; 0: it has one (§5.2)
pip_attrshortthe attribute key that marks the PiP participant, or in an ad frame the ad participant (§5.9); empty for none
corner1the PiP window’s corner, or a squeeze’s program window’s: 1 top left, 2 top right, 3 bottom left, 4 bottom right; a double box’s program side: 1 left, 2 right
pip_width, pip_height2 eachu16: the PiP window’s size, 0 derives it (§5.5); a squeeze’s program window’s size (§5.9)
offset2u16: the window’s distance, in pixels, from both edges of its corner
behaviour1what the PiP participant does when it is the only one composed: 1 static, 2 dynamic (§5.5)
channels1the mix’s channels: 1 mono, 2 stereo (§6)
sample_rate4u32: the rate, in Hz, every voice is decoded to before it is mixed
gain_attrshortthe attribute key of a participant’s gain; empty for none (§6)
pan_attrshortthe attribute key of a participant’s pan; empty for none
max_tiles1the most tiles (§5.2)
max_voices1the most voices of the mix (§6)
sig64§3.2

A grid’s pip_attr is empty and its corner, pip_width, pip_height, offset and behaviour are 0 (§3.3).

3.2 Digest and signature

The digest of a descriptor is SHA-256 over its record from magic through max_voices: every byte but sig. The signature is Ed25519 (RFC 8032) by signer over the 17 bytes wai:live-compose (ASCII) and 0x01, followed by the bytes the digest covers. It is verified strictly, as SPEC §7 Signatures requires: a key that fails step 1 or 2 is bad_key, and a signature that fails a later step is bad_signature.

3.3 Reading and field rules

A reader reads exactly the bytes it is given as one descriptor, in the order of §3.1, and refuses at the first of these that holds:

  1. Fewer than 4 bytes: truncated. A magic other than WCD1: malformed. No byte after the magic: truncated. A version other than 1: unknown_version.
  2. The bytes end before a field the layout requires: truncated.
  3. Bytes after sig: malformed.

It then holds the canvas to §3.4, and refuses one beyond its limits as canvas_out_of_range. It then refuses, as compose_invalid, a descriptor that breaks any of these rules:

Then the signature (§3.2): bad_key or bad_signature.

3.4 The canvas

width and height are each even, and each 16 to 1920; width × height is at most 2 073 600, the pixels of 1920 × 1080; and fps is 1 to 60. The edges are even so that a picture subsampled 4:2:0 has whole chroma samples. A portrait 1080 × 1920 and a square 1440 × 1440 canvas are within these limits.

3.5 Who may sign

Against a room, a descriptor that reads (§3.3) is refused as wrong_room when its room is not the room id; and as compose_not_permitted unless its signer is the room authority, or a principal present at effective whose grant in effect then (§4.1) has the compose power.

The power is checked at effective, when the descriptor takes effect: a descriptor does not lapse when its signer leaves or later loses the power. A composition has one descriptor; a room that changes its layout signs another, and each composed track and each receipt names the one it follows (§8).

4. The participant set

4.1 The room at an instant

A composition reads a room that verifies (live-rooms §9): one refused is refused here with the room’s reason, at room. A room whose outcome is a gap is composed only when no gap is in a room key’s chain: the lifecycle is then whole, and a gap in another principal’s chain (a chat not delivered) changes no room state. A gap in a room key’s chain is lifecycle_incomplete, at room: the state at no instant after it is known.

The room at t is the room state (live-rooms §9.3) replayed from the lifecycle events whose t is at most t, in the merged order: equally, the room each chain gives when it is cut before its first record whose t is above t. Events at t itself are applied, so a principal that joins at t is in the set at t.

The join order of a principal present at t is the number of the join that made it present (its last), where the room’s accepted join events up to t are numbered from 0 in the merged order, a duplicate (live-events §6.2 step 1) counted once.

4.2 Participants and their sources

The participants at t are the principals present at t, other than the descriptor’s compositor, that publish at t: each has an own track of any media kind published, or is the live publisher of a slot (live-rooms §7.1). A standby is not composed for its place in a slot, since its media is not delivered.

Each participant has:

A source’s profile is the profile its track was published under (the publish or takeover that made it, live-rooms §7.2), and its layers the number of layers published. Its composed layer L is the lower of layers − 1 and the descriptor’s layer, and its width and height are those of layer L of the profile (live-rooms §8.1); an audio source’s are 0. A descriptor whose layer is below a publisher’s top layer composes from a layer the compositor’s grant can subscribe to, and every sink lays the room out in that layer’s pixels.

4.3 Attributes

For each participant, each attribute key the descriptor names (not empty) is looked up among the attributes of its grant in effect, and read:

keyvaluewhen absent
featured_attr, pip_attrtrue or falsefalse
order_attra decimal integer from −2 147 483 648 to 2 147 483 647no order
gain_attra decimal integer from 0 to 16 3844096
pan_attra decimal integer from −4096 to 40960

A decimal integer is 0, or an optional - followed by 1 to 10 of the digits 0–9 of which the first is not 0: no +, no space, no -0. Every attribute the descriptor names is read for every participant, whether or not it has the source the attribute is about; one whose value is not of its row is attr_malformed, and the composition at t is refused, at set. The keys featured, order and pip that live-rooms §4.4 names are these attributes under the keys a descriptor gives them; gain and pan are the mix’s.

4.4 Order

The participants are ordered: those with an order first, by order ascending, then those with none; between two of one order (or none), by join order ascending; and between two of one join order, by key, as unsigned bytes. This order is S.

4.5 The set’s digest

The digest of the participant set at t is SHA-256 over the 21 bytes wai:live-compose-set (ASCII) and 0x01, the room id, t (u64), the number of participants (u32), and then, for each participant in ascending order of key:

fieldsizemeaning
principal32its key
grant32the digest of its grant in effect
join4u32: its join order
video, audio1 or 9 + s eachits source: one byte 0 for none; otherwise media (u8, the media kind of live-rooms §6.1), slot (short: empty for an own track), profile (u8, the profile’s index in the room descriptor), layers (u8), the composed layer L (u8), width and height (u16 each)

The grant’s digest fixes its attributes, so the set’s digest fixes everything §5 and §6 read of the room at t.

5. The layout

5.1 Integers

Every quantity of this section is an integer, and none is negative. ⌊a / b⌋, for b above 0, rounds down. fit(bw, bh, a, b), the largest rectangle of aspect a:b within bw × bh, is (bw, max(1, ⌊bw × b / a⌋)) when bw × b ≤ bh × a, and (max(1, ⌊bh × a / b⌋), bh) otherwise. A rectangle of w × h centred in (x, y, W, H) is (x + ⌊(W − w) / 2⌋, y + ⌊(H − h) / 2⌋, w, h). No product here exceeds 2^63.

5.2 Which participants have tiles

An ad frame’s tiles are §5.9’s. Otherwise, from S (§4.4):

  1. V is S, less every participant whose video is stopped when omit_stopped is 1.
  2. For a picture in picture, the PiP participant P is the first of V whose pip_attr attribute is true; with none there is no PiP window. For a grid there is none.
  3. G is V without P, in order. The featured participant F is the first of G whose featured_attr attribute is true; it is moved to the front of G.
  4. G is cut to its first max_tiles members, less one when there is a P. F, being first, is kept; when G is then empty there is no F.

5.3 The grid

A grid of n ≥ 1 tiles over a region (X, Y, W, H) is chosen by its reference aspect a:b: 16:9 for auto and video, 1:1 for square, 3:4 for portrait.

With no tile the canvas is its background.

With F and n ≥ 2 members of G, the featured tile is (0, 0, width, mh), with mh = ⌊(height − gap) × 3 / 4⌋, and the other n − 1 members are a grid (§5.3) over the band below it, (0, mh + gap, width, height − mh − gap). The featured tile is its whole region: aspect is the grid tiles’. With F alone the featured tile is the whole canvas. With no F, the members of G are a grid over the whole canvas.

5.5 Picture in picture

With P and a G that is not empty, G is laid out over the canvas as §5.3 and §5.4 lay it out, and P’s window is drawn over it. With P and an empty G:

The window is pip_width × pip_height when both are above 0. Otherwise, with a:b the width and height of P’s video source, or the canvas’s when P’s video is stopped, it is fit(bw, bh, a, b), where bw is pip_width when that is above 0, width − offset when only pip_height is, and the lower of ⌊width / 4⌋ and width − offset when neither is; and bh is pip_height when that is above 0 and height − offset otherwise. With o the offset and pw × ph the window, it is at (o, o) in the top left corner, (width − o − pw, o) in the top right, (o, height − o − ph) in the bottom left, and (width − o − pw, height − o − ph) in the bottom right.

5.6 Fill

A tile (tx, ty, tw, th) shows a source of sw × sh by its fill mode. The source is wider when sw × th ≥ sh × tw.

Each mode gives a source rectangle and a destination rectangle: the part of the source drawn, and where on the canvas it is drawn. A tile of stopped video has neither, and shows the background, as does the part of a tile outside its destination. How the source rectangle is scaled into the destination is the renderer’s; a sink that holds a source at a layer below its composed one scales it to the composed layer’s width and height first.

5.7 What the layout gives

The layout of a descriptor and a participant set gives:

A renderer paints the background over the canvas, then the tiles in order. No two tiles of z 0 overlap.

5.8 Re-layout

The participant set changes only at the t of a lifecycle event: a join, leave, publish, unpublish, grant_exchange, takeover or failover (an exchange always changes it, since the set names each participant’s grant). At every such instant at or after effective the layout is computed again, and it changes when the sources, the attributes or the order do; between two such instants it does not change. The layout at t is the function of this section over the descriptor and the set at t, and of nothing a sink sees otherwise, so a sink that joins late lays the room out as one that was there throughout, and a grant exchange that changes an attribute re-lays the room out at the exchange’s tick, with no participant leaving. On the sink of a session that holds an ad-track binding, an ad frame’s layout also changes where the binding comes into effect and where it ends (§5.10.4).

5.9 Ad frames

An ad frame composes a program and an ad into one picture: a squeeze (layout 3) shrinks the program into a window in one corner and shows the ad in the L around it; a double box (layout 4) shows the program and the ad in two boxes side by side. The frame is an integer function of the canvas and the fields below, so the part of the picture the ad shows in is fixed by what the descriptor’s signer signed, and a record of another extension that states the same fields fixes the same part (stitched-presentation §6). The ad is the room’s, one participant every sink shows, or each session’s own, on a per-session ad track (§5.10).

The frame of a canvas of width × height, with W its width and H its height:

The ad region’s rectangles are in order of their top edge, and none of them overlaps the program’s tile. Its share of the picture is ⌊10 000 × A / (W × H)⌋ basis points, with A the sum of its rectangles’ areas.

The participants. From V (§5.2 step 1), the ad participant is the first whose pip_attr attribute is true, and the program participant is the first of the others once the featured participant (§5.2 step 3) is moved to their front. Then:

No other participant has a tile; the voices are §6’s, as for every layout.

5.10 Per-session ad tracks

An ad frame’s ad region may show each session an ad decided for it alone: an ad of a pod-input record of the session (stitched-presentation §4.6). The program is the room’s, laid out as §5.9 lays it, and every sink draws the same rectangles; the ad is the session’s ad track, which the record’s signer publishes for that session and binds to the frame with an ad-track binding.

5.10.1 The session’s ad track

A session is the 16 bytes stitched-presentation §5.2 derives from a player’s session key. The ad track of session s is named as live-rooms §6.1 names a track, with the owner ad_ followed by s as 32 lowercase hexadecimal digits: its Track Namespace is the room id, that owner and video, and its Track Name is 0. The owner is neither a key (64 digits) nor a slot (_ first), so it names no participant, and each of its bytes is one of a–z, 0–9 and _. Its track is the digest live-events §3.1 gives an anchor’s track: SHA-256 over the namespace’s rendering (live-rooms §6.2), one zero byte, and the name.

5.10.2 The binding

fieldsizemeaning
magic4WAT1 (ASCII)
version11 in this revision
room32the room id
descriptor32the digest of the descriptor whose ad frame shows the track (§3.2)
record32the digest of the session’s pod-input record (stitched-presentation §4.4)
session16the session
slot1the ad’s slot in the record (stitched-presentation §4.2)
start8u64: the room-clock instant from which the ad region shows the track
width, height2 eachu16: the track’s picture, in pixels, each 1 to 1920
signer32the record’s signer, which signs the binding
sig64Ed25519 by signer

The digest of a binding is SHA-256 over its bytes before sig; its signature is Ed25519 by signer over the 26 bytes wai:live-compose-ad-track (ASCII) and 0x01, followed by the bytes the digest covers, verified strictly (SPEC §7 Signatures). A reader reads exactly the bytes it is given, as §3.3 steps 1 to 3 read a descriptor with WAT1 for WCD1 (truncated, malformed, unknown_version); refuses as ad_track_invalid a binding whose width or height is 0 or above 1920; and then verifies the signature (bad_key, bad_signature).

A binding holds for its ad’s duration_ms (stitched-presentation §4.2): it is in effect at a room-clock instant t when start ≤ t < start + 1000 × duration_ms.

5.10.3 Verifying a binding

A binding verifier is given a descriptor, a pod-input record and a binding. In this order, the first that fails names the refusal and where:

  1. The descriptor reads (§3.3): its refusal, at descriptor. Who may sign it (§3.5) is checked against the room, where the room is composed.
  2. The record reads and its signature verifies (stitched-presentation §4.4, §7.2 steps 1 and 2): pod_input_malformed, bad_key or bad_signature, at record.
  3. The binding reads (§5.10.2), at binding; from here on every refusal is at binding.
  4. Its signer is the record’s signer: otherwise ad_track_not_permitted.
  5. Its room is the descriptor’s: otherwise wrong_room.
  6. Its descriptor is the descriptor’s digest: otherwise descriptor_mismatch.
  7. It matches its session’s composition: otherwise ad_track_mismatch, naming the first of these that differs:
    • layout: the descriptor’s layout is an ad frame, 3 or 4;
    • record: its record is the record’s digest;
    • session: the record is a record of a session, not a shared one, and its session is the binding’s;
    • frame: the record’s frame (stitched-presentation §4.3) is the descriptor’s: its kind the layout, its width and height the canvas’s, its corner the corner, its window_w and window_h the pip_width and pip_height for a squeeze and 0 for a double box, its gap the gap for a double box and 0 for a squeeze, and its aspect the aspect for a double box and 0 for a squeeze;
    • slot: the record has an ad of its slot.
  8. Its start is at or after the descriptor’s effective: otherwise not_yet_effective.

A binding that passes is accepted: the session’s ad track shows the ad of slot of the session’s own record in the ad region the descriptor fixes, from start for that ad’s duration. A verifier states its digest, the session, the slot, the track, the span from start to start + 1000 × duration_ms, and the ad region and its share (§5.9), which are the record’s frame’s (stitched-presentation §6).

5.10.4 The layout of a session

On the sink of a session that holds an accepted binding in effect at t, the layout of an ad frame at t is §5.9’s, with the session’s ad track for the ad:

A tile of the track names the track (§5.10.1) where every other tile names a participant. With no binding in effect, the layout is §5.9’s. A session’s layout is composed on its sink (§7): a composed track that a server compositor publishes (§8) is the room’s, never a session’s.

5.10.5 Reasons

reasonraised at
ad_track_invalid§5.10.2
ad_track_not_permitted§5.10.3 step 4
ad_track_mismatch§5.10.3 step 7

A binding verifier also raises truncated, malformed, unknown_version, bad_key and bad_signature for a binding that does not read, wrong_room, descriptor_mismatch and not_yet_effective (§10) at binding, a descriptor’s refusals at descriptor and a record’s at record.

6. The audio mix

The voices are the members of S (before any is omitted for its video) that have an audio source, in S’s order, the first max_voices of them. Each has its gain g, from 0 to 16 384 in units of 1/4096 (4096 is unity), and its pan p, from −4096 (left) to 4096 (right) (§4.3).

The mixer mixes one block of N frames. Each voice’s input is its decoded audio for the block: N frames of signed 16-bit samples, of 1 or 2 channels (interleaved, left first), at the descriptor’s sample_rate. Each output sample is a sum over the voices in signed 64-bit integers, one term per voice:

The output sample is ⌊(s + 2^23) / 2^24⌋ of the sum s, the arithmetic shift right by 24 bits of s + 2^23, which rounds half up; then saturated once to −32 768 … 32 767. A term is at most 2^41 in magnitude and a mix has at most 64 voices, so the sum is exact, the order of its terms changes nothing, and saturation applies to the whole once. The pan is a balance: at the centre both channels are at the voice’s gain, and panning attenuates one channel only. A single voice at unity gain and the centre is passed through unchanged. A mixer that holds no decoded block of a voice for the output mixes it as silence.

A mixer is refused as mix_input_malformed when an output has other than 1 or 2 channels, or an input has other than 1 or 2 channels, has other than N frames, or a gain or pan out of range.

The mix is byte-exact over the decoded PCM: two mixers given the same blocks give the same samples. It is not byte-exact over what precedes and follows it. A decoder of a lossy codec need not reproduce another decoder’s PCM bit for bit (RFC 6716 §6 holds a decoder to a quality measure, not to equality), and a lossy encode of the mix is not byte-reproducible: two encoders, or one encoder under two settings, give different bytes. The receipt (§8) therefore binds the input objects and the output object, not samples.

7. Where composition runs

On each sink, by default. A sink composes the room locally from the tracks it subscribes to, by §5 and §6, with no server decode or encode. It needs no power: the descriptor states how the room is laid out, and laying it out is reading it. A session’s own ad in an ad frame is composed on its sink alone, from the session’s ad track (§5.10.4).

On a server, under the compose power. A principal that publishes a composed track (its own video track for a layout, its own audio track for a mix, live-rooms §6.1) MUST be the descriptor’s compositor, MUST hold the compose power in its grant in effect, and MUST sign a receipt (§8) for each object of a composed track it publishes. It is not a participant of its own composition (§4.2), so a composed track is never composed again. A subscriber subscribes to a composed track as to any other; the descriptor and the receipts let it check that the track is the room’s composition.

8. The composition receipt

8.1 Layout

fieldsizemeaning
magic4WCR1 (ASCII)
version11 in this revision
room32the room id
compositor32the compositor’s key, which signs the receipt
descriptor32the digest of the descriptor it follows (§3.2)
t8u64: the room-clock instant of the output object
state32the digest of the participant set at t (§4.5)
media11 audio (a mix), 2 video (a layout)
output80the output object
inputs1 + 112 × na u8 count n, then each input: principal (32), the participant it is read from, and an object (80)
sig64Ed25519 by compositor

An object is 80 bytes: track (32), the digest live-events §3.1 gives an anchor’s track, over the track’s namespace as live-rooms §6.2 renders it, one zero byte, and its name; group and object (u64 each), its MOQT Location (MOQT §8.2); and digest (32), the SHA-256 of the object’s payload. An input whose digest is 32 zero bytes states that the compositor held no object of that track for the output: it drew the tile with no video, or mixed the voice as silence.

The digest of a receipt is SHA-256 over its bytes before sig; its signature is Ed25519 by compositor over the 25 bytes wai:live-compose-receipt (ASCII) and 0x01, followed by the bytes the digest covers, verified strictly (SPEC §7 Signatures). A reader reads exactly the bytes it is given, as §3.3 steps 1 to 3 read a descriptor with WCR1 for WCD1 (truncated, malformed, unknown_version); refuses as receipt_invalid a receipt whose media is not 1 or 2, or that names two inputs of one participant and one track; and then verifies the signature (bad_key, bad_signature).

8.2 The inputs

The inputs of an output at t are, in this order:

The tracks of a source are named as live-rooms §6.1 names them: the namespace is the room, the owner (the participant’s key, or _ and the slot’s name for a slot) and the media kind; the names follow the profile’s layering (live-rooms §6.3) at the composed layer L: track 0 for single and svc (an svc track carries every layer), track L for simulcast, and tracks 0 to L for staged, since a refinement is applied to the layers below it (staged-delivery). The receipt names, for each, the object it read.

8.3 Verifying a receipt

A receipt verifier is given a room (as live-rooms §9.1), a descriptor and a receipt. In this order, the first that fails names the refusal and where:

  1. The room (§4.1): its refusal, at room.
  2. The descriptor (§3.3, §3.5): at descriptor.
  3. The receipt reads (§8.1), at receipt; and its room is the room id, otherwise wrong_room.
  4. Its descriptor is the descriptor’s digest: otherwise descriptor_mismatch.
  5. Its t is at or after the descriptor’s effective: otherwise not_yet_effective.
  6. The descriptor names a compositor, the receipt’s compositor is it, and that principal is present at t with a grant in effect that has the compose power: otherwise compositor_not_permitted.
  7. Its output’s track is a track of the compositor’s own track of the receipt’s media kind, published at t, at a layer from 0 to its layers − 1: otherwise output_not_published.
  8. The set and the layout at t (§4, §5): their refusal, at set.
  9. Its state is the set’s digest: otherwise state_mismatch.
  10. Its inputs, each its principal and its object’s track, are §8.2’s, in order: otherwise inputs_mismatch.

A receipt that passes is accepted: its output object was composed under this descriptor, from this set, out of objects of exactly the tracks the layout reads. Anyone holding the room’s events and the descriptor recomputes the layout and checks that the inputs were the right ones; a party holding the objects checks their digests. The receipt does not fix the output’s pixels or samples (§6).

9. Verification

A composition verifier is given a room, a descriptor and a list of instants. It runs these steps and stops at the first refusal, which it reports with the reason and where:

  1. The room (§4.1): at room, with the room’s own place (live-rooms §9.1) when the room is refused.
  2. The descriptor (§3.3, §3.5): at descriptor.
  3. Each instant, in the list’s order: the instant is at or after effective (otherwise not_yet_effective), and the participants’ attributes read (§4.3, otherwise attr_malformed): at set, with the instant.

Its outcome is refuse, with the reason and the place; or the composition: the descriptor’s digest and, for each instant, the participants with their sources and tracks, the set’s digest, the order, the tiles and the voices. A receipt verifier (§8.3) reports its refusals at the same places, and at receipt.

10. Reasons

The codes this extension adds, each with where it is raised:

reasonraised at
canvas_out_of_range§3.3, §3.4
compose_invalid§3.3
compose_not_permitted§3.5
not_yet_effective§8.3 step 5, §9 step 3
lifecycle_incomplete§4.1
attr_malformed§4.3
mix_input_malformed§6
receipt_invalid§8.1
descriptor_mismatch§8.3 step 4
compositor_not_permitted§7, §8.3 step 6
output_not_published§8.3 step 7
state_mismatch§8.3 step 9
inputs_mismatch§8.3 step 10

The ad-track binding’s codes are §5.10.5’s.

A verifier of this extension also raises truncated, malformed and unknown_version for a descriptor or a receipt that does not read; bad_key and bad_signature for their signatures; wrong_room for one of another room (§3.5, §8.3); and every code a room verifier raises (live-rooms §11 and the live-events codes it lists), at room.

11. Conformance

live-conformance/compose/ holds the corpus, in one file, vectors.json, written from fixed seeds by wai_live_compose_vectors gen. It has:

A conforming verifier gives every case the outcome, the reason, the place and the data the corpus states. wai_live_compose_vectors verify and the test tests/live_compose.rs check that the file regenerates byte for byte, that wai-rs gives every case its outcome, that every reason of §10 refuses a case, and that §10 lists exactly the reference’s codes. live-conformance/live_compose_verify.py is the second implementation, written from this text: it shares no code with wai-rs, verifies signatures with WAI’s strict rule written from RFC 8032 (claim-conformance/_ed25519.py), verifies each room with the live-rooms corpus’s own second implementation (live_rooms_verify.py) and replays its lifecycle to each instant itself, and gives every case the same outcome, rectangle for rectangle and sample for sample; it also mutates copies of the corpus and requires every copy to fail.

live-conformance/compose-ad-track/ holds the corpus of §5.10, in one file, vectors.json, written from fixed seeds by wai_compose_ad_track_vectors gen. It has:

wai_compose_ad_track_vectors verify and the test tests/compose_ad_track.rs check that the file regenerates byte for byte, that wai-rs gives every case its outcome, and that §5.10.5 lists exactly the codes the reference adds. live-conformance/compose_ad_track_verify.py is the second implementation, written from this text: it shares no code with wai-rs; it reads descriptors and lays rooms out with the live-compose corpus’s second implementation, reads records with the stitched-presentation corpus’s, and verifies Ed25519 with WAI’s strict rule; and it mutates copies of the corpus and drops each of its own checks in turn, and requires each to be caught.

12. Security and privacy considerations