### `wai.live.compose`: a room's composition as an integer function

- **The extension** ([live-compose](extensions/live-compose.md)) registers the record
  `wai.live.compose`. A `WCD1` composition descriptor, signed by the room authority or by a
  principal whose grant has the compose power, fixes a canvas (each edge even, 16 to 1920
  pixels, at most 1920 × 1080 pixels, 1 to 60 frames a second), an sRGB background, the
  highest layer composed, a layout, the grant attributes it reads, and its limits on tiles
  and voices.
- **The participant set** at a room-clock instant is the room's lifecycle replay up to it:
  every present publisher but the compositor, its video source (own video, own screen, or
  its live place in a slot) and audio source, each with the dimensions of the composed
  layer, the attributes of its grant in effect, and its join order. A gap in a room key's
  chain is `lifecycle_incomplete`; a gap elsewhere changes nothing. The set has a digest.
- **The layout** (§5) is integer arithmetic throughout, with every rounding stated: a grid
  chosen by the largest tile of the reference aspect among every column count, its rows
  centred; tile aspects auto, 16:9, 1:1 and 3:4; a featured participant above the others;
  fill, cover and contain, by default cover for grid tiles and contain for the featured
  one; stopped video shown or omitted; order by attribute, then join order, then key; and
  picture in picture, the PiP participant's window over the grid in any corner, of a set or
  derived size, static or dynamic (alone, it is laid out as though it had no PiP
  attribute). The layout is computed again at every lifecycle event and grant exchange.
- **The mix** (§6): per-voice gain and pan as integers in units of 1/4096, over signed
  16-bit PCM, summed exactly in 64 bits and saturated once, so it is byte-exact over the
  decoded PCM; a decode and a lossy re-encode are not, and the receipt binds objects.
- **Where it runs** (§7): on each sink by default, with no server encode; a server
  compositor must be the descriptor's compositor, hold the compose power and sign a `WCR1`
  receipt for each object of a composed track, naming the descriptor, the set's digest at
  `t`, the output object and the input objects of exactly the tracks the layout reads.
- **Live rooms.** §1, §3.3 and §4.4 point at the extension for the compose power and the
  attributes `featured`, `order` and `pip` (and `gain` and `pan`, which it adds).
- **Reference and corpus.** `wai-rs` feature `live_compose` (`src/live_compose.rs`; the
  layout and the mixer in `src/live_compose/layout.rs` use nothing beyond `core`, `Vec` and
  `String`); `live-conformance/compose/`, written from fixed seeds by
  `wai_live_compose_vectors`, and checked by `tests/live_compose.rs` and by
  `live-conformance/live_compose_verify.py`, a second implementation that shares no code
  with `wai-rs`, steps through the room's lifecycle replay itself and requires every
  mutated copy of the corpus to fail. The registry lists the record and its magics (`WCD1`,
  `WCR1`).

