forge
Explore
Log in

Don't you dare go Hollow

lane-av1rect8x16: prove decode_block_rect's (4,8) chroma arm is unreachable

Browse files at this commit

406d67329d20556fe961f05e115c176f19084dd0Ahmet Kaan GümüşParent: ec131f6
The refusal "a rectangular chroma transform whose size has no coefficient
table" (decode.rs:14804) had no PROVEN row -- it was the audit round's
single unproven refusal. The sibling sweep that surfaced the gap
(every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table)
audits decode_rect_split's tables, not this function's, and so only ever
asserted the superblock-level 64x32/32x64 footprints. The 8x16 luma strip's
4x8 chroma was left unasked.

Answered: UNREACHABLE, and structurally so. All 8 call sites of
decode_block_rect are 32-level match part32 arms of read_sb128_root and pass
bw/bh as the integer literals 32, 16 or 16, 32, so the function's chroma
footprint set over every subsampling an AV1 color_config can carry is
{(16,8), (8,16), (16,16), (8,32), (32,16), (16,32)} -- all six have a row. A
16-level 2:1 luma strip is read by decode_leaf_rect, which carries the (4,8) /
(8,4) rows itself (decode.rs:15409-15420).

Measured, not assumed: 840 real aomenc 4:2:0 key-frame encodes, 826 of whose
parsed leaf lists provably code a 16-level 2:1 luma strip (via
horz_vert_intra_hits(), which fires only at the three decode_leaf_rect strip
sites), all 840 decoded to completion with the refusal firing 0 times.

every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table reads
the caller shape set out of decode.rs's own argument lists, pins the table's
six rows, walks the domain, and asserts the (4,8)/(8,4) residual as code.
Red under three mutations (an 8x16 caller, a new (4,8) row, a non-literal
strip size). Inventory: 32 -> 33 proven.

decode.rs, decode_rect_split and read_block_tx_size untouched; no existing
test weakened.
crates/ec-av1/src/refusal_inventory.rsmodified+243 -0
@@ -553,6 +553,25 @@ const PROVEN: &[(&str, &str)] = &[
553553 "a 64-axis strip whose chroma unit has no coefficient table",
554554 "every_chroma_unit_a_64_axis_strip_can_present_has_a_coefficient_table",
555555 ),
556+ // lane-av1rect8x16, enumeration: `decode_block_rect`'s `_` arm. All nine
557+ // call sites pass `bw`/`bh` as integer LITERALS and every one of them is
558+ // a 32-level `PARTITION_HORZ`/`VERT`/`HORZ_A`/`_B`/`VERT_A`/`_B` arm of
559+ // `read_sb128_root`'s `match part32`, so the caller shape set is exactly
560+ // {32x16, 16x32} and their chroma halves under the three subsamplings an
561+ // AV1 `color_config` can carry are {(16,8), (8,16), (16,16), (8,32),
562+ // (32,16), (16,32)} -- every one of which has a row. The shape the
563+ // sibling sweep left open, a 4:2:0 8x16 luma strip's (4,8) chroma, is
564+ // NOT reachable here: a 16-level 2:1 luma strip is read by
565+ // `decode_leaf_rect`, which carries the (4,8)/(8,4) rows itself
566+ // (decode.rs:15409-15420). Measured, not assumed: 840 real aomenc 4:2:0
567+ // key-frame encodes, 826 of whose parsed leaf lists carry a coded
568+ // 16-level 2:1 luma strip (`horz_vert_intra_hits()`, which fires only
569+ // at the three `decode_leaf_rect` strip sites), decoded to completion
570+ // with this string firing 0 times.
571+ (
572+ "a rectangular chroma transform whose size has no coefficient table",
573+ "every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table",
574+ ),
556575 // lane-t900 r33, enumeration: each of the four symbols this guard tests is
557576 // read under a size gate that no 128-pixel side passes (the call site's
558577 // literal `cfl=false`, `filter_intra_size_class_rect`'s table, and
@@ -1514,6 +1533,230 @@ mod tests {
15141533 );
15151534 }
15161535
1536+ /// lane-av1rect8x16, ENUMERATION for "a rectangular chroma transform
1537+ /// whose size has no coefficient table" --
1538+ /// [`crate::decode::decode_block_rect`]'s `_` arm.
1539+ ///
1540+ /// This refusal had NO `PROVEN` row: the sibling sweep that found the
1541+ /// gap (`every_rect_strip_shape_the_split_path_codes_has_a_luma_and_
1542+ /// chroma_table`, which audits `decode_rect_split`'s tables, not this
1543+ /// function's) asserted only the superblock-level 64x32/32x64
1544+ /// footprints, so the 8x16 luma strip's 4x8 chroma was left unasked.
1545+ ///
1546+ /// The answer is that the shape is UNREACHABLE, and structurally so:
1547+ /// every one of the function's call sites passes its `bw`/`bh` as
1548+ /// integer LITERALS, and all of them are 32-level `PARTITION_HORZ` /
1549+ /// `VERT` / `HORZ_A` / `HORZ_B` / `VERT_A` / `VERT_B` arms of
1550+ /// `read_sb128_root`'s `match part32` -- i.e. 32x16 or 16x32, never
1551+ /// 8x16. A 16-level 2:1 luma strip (16x8 / 8x16) is read by
1552+ /// [`crate::decode::decode_leaf_rect`], which carries the matching
1553+ /// `(4, 8)` / `(8, 4)` chroma rows (decode.rs:15409-15420,
1554+ /// `TxbSet::ChromaRect8x4` + `SCAN_4X8` / `SCAN_8X4`).
1555+ ///
1556+ /// So the proof is the CALLER SHAPE SET, read out of the call sites'
1557+ /// own argument lists, walked through `bw >> ss_x` / `bh >> ss_y` for
1558+ /// every subsampling an AV1 `color_config` can carry, against the
1559+ /// `match (chroma_w, chroma_h)` table read out of the function's own
1560+ /// text (class `table-and-reader-move-together`: a table edit
1561+ /// invalidates this test rather than sneaking past it).
1562+ ///
1563+ /// The subsampling domain is `{(0,0), (1,0), (1,1)}` and excludes
1564+ /// `(0,1)`: `ec-av1-syntax`'s `color_config` only ever READS
1565+ /// `subsampling_y` when `subsampling_x == 1` (sequence.rs:481), so
1566+ /// `(0,1)` is uncodable. `(1,0)` is 4:2:2, refused at the sequence
1567+ /// header by `a_non_420_subsampled_sequence_header_is_refused_by_name`
1568+ /// -- it is walked anyway, so the proof does not depend on that guard
1569+ /// staying in place.
1570+ #[test]
1571+ fn every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table() {
1572+ let src = include_str!("decode.rs");
1573+
1574+ // (1) The caller shape set, read out of the call sites' own
1575+ // argument lists. `decode_block_rect(dec, cdfs, neighbours, at, bw,
1576+ // bh, ...)`, so args 4 and 5 (0-based, after the opening paren) are
1577+ // `bw` and `bh`; the first three are the fixed `&mut` borrows.
1578+ const LEAD: [&str; 3] = ["&mut dec", "&mut cdfs", "&mut neighbours"];
1579+ let mut shapes: BTreeSet<(usize, usize)> = BTreeSet::new();
1580+ let mut sites = 0usize;
1581+ let at_def = src
1582+ .find("fn decode_block_rect(")
1583+ .expect("decode_block_rect is gone");
1584+ for (i, _) in src.match_indices("decode_block_rect(") {
1585+ // The definition's own parameter list carries the same text,
1586+ // preceded by "fn " -- that is a declaration, not a call.
1587+ if src[..i].ends_with("fn ") {
1588+ continue;
1589+ }
1590+ // Split the argument list at top level (paren/bracket/angle
1591+ // balanced), so the `(at32.0 + 1, at32.1)` origin argument --
1592+ // which contains its own comma -- does not shift the indices.
1593+ let open = i + "decode_block_rect(".len();
1594+ let bytes = src.as_bytes();
1595+ let mut args: Vec<String> = Vec::new();
1596+ let mut depth = 0i32;
1597+ let mut start = open;
1598+ for j in open..bytes.len() {
1599+ match bytes[j] {
1600+ b'(' | b'[' => depth += 1,
1601+ b')' | b']' => {
1602+ if depth == 0 {
1603+ args.push(src[start..j].to_string());
1604+ break;
1605+ }
1606+ depth -= 1;
1607+ }
1608+ b',' if depth == 0 => {
1609+ args.push(src[start..j].to_string());
1610+ start = j + 1;
1611+ }
1612+ _ => {}
1613+ }
1614+ }
1615+ assert!(
1616+ args.len() >= 6,
1617+ "a decode_block_rect call has only {} arguments -- the arg indices this \
1618+ enumeration reads are off",
1619+ args.len()
1620+ );
1621+ for k in 0..3 {
1622+ assert_eq!(
1623+ args[k].trim(),
1624+ LEAD[k],
1625+ "decode_block_rect's first three arguments changed -- re-derive the bw/bh \
1626+ argument indices below"
1627+ );
1628+ }
1629+ let lit = |a: &str| -> usize {
1630+ a.trim().parse::<usize>().unwrap_or_else(|_| {
1631+ panic!(
1632+ "decode_block_rect is called with a non-literal strip size {:?} -- \
1633+ this enumeration can no longer read the caller shape set",
1634+ a.trim()
1635+ )
1636+ })
1637+ };
1638+ shapes.insert((lit(&args[4]), lit(&args[5])));
1639+ sites += 1;
1640+ }
1641+ assert_eq!(
1642+ sites, 8,
1643+ "the number of decode_block_rect call sites changed"
1644+ );
1645+ let expected_shapes: BTreeSet<(usize, usize)> =
1646+ [(32usize, 16usize), (16, 32)].into_iter().collect();
1647+ assert_eq!(
1648+ shapes, expected_shapes,
1649+ "the set of strip sizes decode_block_rect is called with changed -- re-derive \
1650+ the chroma domain below. An 8x16/16x8 caller makes this refusal LIVE (a \
1651+ 4:2:0 8x16 luma strip's chroma is 4x8, which libaom codes as TX_4X8: \
1652+ av1_ss_size_lookup[BLOCK_8X16][1][1] = BLOCK_4X8 in \
1653+ av1/common/common_data.c:24, then max_txsize_rect_lookup[BLOCK_4X8] = TX_4X8 \
1654+ in av1/common/common_data.h:130, via av1_get_max_uv_txsize, blockd.h:1372)"
1655+ );
1656+
1657+ // (2) The table, read out of the function's own text: every
1658+ // `(w, h) =>` / `(w, h) |` arm head between the match and the guard.
1659+ let body_at = at_def;
1660+ let rest = &src[body_at..];
1661+ let body = &rest[..rest.find("\nfn ").expect("unterminated fn")];
1662+ let from = body
1663+ .find("let (chroma_set, chroma_scan): (TxbSet, &[u16]) = match (chroma_w, chroma_h)")
1664+ .expect("decode_block_rect's chroma match is gone");
1665+ let to = body[from..]
1666+ .find("a rectangular chroma transform whose size has no coefficient table")
1667+ .expect("the refusal string is gone from decode_block_rect")
1668+ + from;
1669+ let table = &body[from..to];
1670+ let mut arms: BTreeSet<(usize, usize)> = BTreeSet::new();
1671+ let bytes = table.as_bytes();
1672+ for (i, _) in table.match_indices('(') {
1673+ let mut j = i + 1;
1674+ let mut w = 0usize;
1675+ while j < bytes.len() && bytes[j].is_ascii_digit() {
1676+ w = w * 10 + usize::from(bytes[j] - b'0');
1677+ j += 1;
1678+ }
1679+ if j == i + 1 || !table[j..].starts_with(", ") {
1680+ continue;
1681+ }
1682+ j += 2;
1683+ let mut h = 0usize;
1684+ let start_h = j;
1685+ while j < bytes.len() && bytes[j].is_ascii_digit() {
1686+ h = h * 10 + usize::from(bytes[j] - b'0');
1687+ j += 1;
1688+ }
1689+ if j == start_h || !table[j..].starts_with(')') {
1690+ continue;
1691+ }
1692+ // Only an arm HEAD counts, never a `(32, 8)` inside prose.
1693+ let after = table[j + 1..].trim_start();
1694+ if after.starts_with("=>") || after.starts_with('|') {
1695+ arms.insert((w, h));
1696+ }
1697+ }
1698+ assert_eq!(
1699+ arms,
1700+ [
1701+ (8usize, 16usize),
1702+ (8, 32),
1703+ (16, 8),
1704+ (16, 16),
1705+ (16, 32),
1706+ (32, 16)
1707+ ]
1708+ .into_iter()
1709+ .collect::<BTreeSet<(usize, usize)>>(),
1710+ "decode_block_rect's chroma table changed -- re-derive the walk below"
1711+ );
1712+
1713+ // (3) The enumeration itself: every caller shape under every
1714+ // subsampling an AV1 color_config can carry.
1715+ let mut checked = 0u32;
1716+ for &(bw, bh) in &shapes {
1717+ for (ss_x, ss_y) in [(0usize, 0usize), (1, 0), (1, 1)] {
1718+ let (cw, ch) = (bw >> ss_x, bh >> ss_y);
1719+ assert!(
1720+ arms.contains(&(cw, ch)),
1721+ "a {bw}x{bh} strip at subsampling ({ss_x},{ss_y}) has a {cw}x{ch} chroma \
1722+ transform with no coefficient table -- the chroma refusal is LIVE"
1723+ );
1724+ checked += 1;
1725+ }
1726+ }
1727+ assert_eq!(
1728+ checked, 6,
1729+ "the chroma domain is not two shapes x three formats"
1730+ );
1731+
1732+ // (4) The residual, stated as an assertion so it cannot rot: the two
1733+ // 4:2:0 rows an 8x16/16x8 luma strip would need are NOT in this
1734+ // table, and (4,8)/(8,4) is not a shape any caller can produce. If a
1735+ // future caller hands this function an 8x16, step (1) goes red
1736+ // first, and the new row has to be added here with it.
1737+ for residual in [(4usize, 8usize), (8, 4)] {
1738+ assert!(
1739+ !arms.contains(&residual),
1740+ "decode_block_rect grew a {0}x{1} chroma row -- update the residual note",
1741+ residual.0,
1742+ residual.1
1743+ );
1744+ }
1745+ let produces: BTreeSet<(usize, usize)> = shapes
1746+ .iter()
1747+ .flat_map(|&(bw, bh)| {
1748+ [(0usize, 0usize), (1, 0), (1, 1)]
1749+ .into_iter()
1750+ .map(move |(sx, sy)| (bw >> sx, bh >> sy))
1751+ })
1752+ .collect();
1753+ assert!(
1754+ !produces.contains(&(4, 8)) && !produces.contains(&(8, 4)),
1755+ "the caller set can now produce a 4x8/8x4 chroma shape but the table has no \
1756+ such row -- the chroma refusal is LIVE"
1757+ );
1758+ }
1759+
15171760 /// lane-av1-refusalaudit, ENUMERATION for "a 64-axis strip whose chroma
15181761 /// unit has no coefficient table" -- [`decode_block_rect64`]'s `_` arm,
15191762 /// reached only for depth-0, non-skip, non-lossless superblock-level
lanes/av1rect8x16.report.mdadded+186 -0
@@ -0,0 +1,186 @@
1+# lane-av1rect8x16 — is `decode_block_rect`'s missing `(4, 8)` chroma arm a live refusal or a documented upstream gate?
2+
3+**Base:** `afa13bcff4a988534555a4ca34b84937d0b6036d` (branch `lane-av1rect8x16`, worktree `~/.cache/wt/av1rect8x16`).
4+**Verdict:** **(a) UNREACHABLE — documented upstream gate.** The claim is true about the `match` and false about the decoder: a 4:2:0 8x16 luma strip is never handed to `decode_block_rect` at all, so no conformant stream can reach the refusal. A conformant 4:2:0 stream that codes 8x16/16x8 luma strips decodes to completion; measured 826 of them.
5+
6+---
7+
8+## 0. The question, restated
9+
10+`decode_block_rect` (`decode.rs:14475`) ends its non-skip chroma read with
11+
12+```rust
13+let (chroma_set, chroma_scan): (TxbSet, &[u16]) = match (chroma_w, chroma_h) { // decode.rs:14788
14+ (32, 16) => (TxbSet::ChromaRect32x16, &SCAN_32X16),
15+ (16, 32) => (TxbSet::ChromaRect32x16, &SCAN_16X32),
16+ (16, 8) => (TxbSet::ChromaRect16x8, &SCAN_16X8),
17+ (8, 16) => (TxbSet::ChromaRect16x8, &SCAN_8X16),
18+ (16, 16) => (TxbSet::Chroma16, default_scan(16)),
19+ (8, 32) => (TxbSet::Chroma16, &SCAN_8X32),
20+ _ => {
21+ return Err(unsupported( // decode.rs:14804
22+ "a rectangular chroma transform whose size has no coefficient table",
23+ ));
24+ }
25+};
26+```
27+
28+`(chroma_w, chroma_h) == (bw >> ss_x(fctx), bh >> ss_y(fctx))` (`decode.rs:14680`). A 4:2:0 8x16 luma strip halves both axes to a 4x8 chroma block, `(4, 8)` has no arm, so the string would fire **if that shape reached the function**. The sibling test `every_rect_strip_shape_the_split_path_codes_has_a_luma_and_chroma_table` audits `decode_rect_split`'s tables, not this one, so it never asks.
29+
30+**State on arrival:** the string was in `REFUSALS` (`refusal_inventory.rs:50`) with **no `PROVEN` row** — the one unproven row this audit round was cataloguing.
31+
32+---
33+
34+## 1. CALLER SET, mechanically
35+
36+`decode_block_rect(` has **9 textual matches in the crate: 1 declaration + 8 call sites.** All 8 call sites are in one function, `read_sb128_root` (`decode.rs:32852`), and none is inside a `macro_rules!` body.
37+
38+The dispatch chain that reaches them:
39+
40+```
41+SB match PARTITION_SPLIT decode.rs:33651
42+ -> 4 x 32x32 quadrant (r32, c32) = (sb_r*2 + q/2, sb_c*2 + q%2) decode.rs:33652-33656
43+ -> part32 = dec.symbol(&mut cdfs.partition_w32[ctx32]) (BLOCK_32X32, bsize=9) decode.rs:33663-33674
44+ -> match part32 { decode.rs:33743
45+ PARTITION_HORZ | HORZ_A | HORZ_B | VERT | VERT_A | VERT_B ==> decode_block_rect
46+ PARTITION_SPLIT => 4 x 16x16 (sr, sc) decode.rs:33774-33778
47+ part16 = dec.symbol(&mut cdfs.partition_w16[ctx16]) (BLOCK_16X16, bsize=6) decode.rs:33801
48+ match part16 { ... } decode.rs:33844 / 33989 / 34037
49+```
50+
51+| # | call site | enclosing arm | upstream guard (verbatim) | `bw`/`bh` passed | can it be handed an 8x16 / 16x8 strip? |
52+|---|---|---|---|---|---|
53+| 1 | `decode.rs:34485` | `PARTITION_HORZ =>` | `match part32 {` at `decode.rs:33743`, `part32` read at `decode.rs:33674` from `cdfs.partition_w32[ctx32]` | `at32, 32, 16` | **No** — 32-level HORZ, two 32x16 strips |
54+| 2 | `decode.rs:34509` | same arm, frame-edge half | `if has_rows32 {` at `decode.rs:34508`; `has_rows32` from `has_half(r32 * BLOCK_MI, BLOCK_MI, mi_rows)` at `decode.rs:33661` | `(at32.0 + 1, at32.1), 32, 16` | **No** |
55+| 3 | `decode.rs:34531` | `PARTITION_VERT =>` | same `match part32` | `at32, 16, 32` | **No** |
56+| 4 | `decode.rs:34555` | same arm, frame-edge half | `if has_cols32 {` at `decode.rs:34554`; `has_cols32` from `has_half(c32 * BLOCK_MI, BLOCK_MI, mi_cols)` at `decode.rs:33660` | `(at32.0, at32.1 + 1), 16, 32` | **No** |
57+| 5 | `decode.rs:34634` | `PARTITION_HORZ_A =>` | `match part32` (`PARTITION_HORZ_A` is value 8, read from the same `partition_w32` symbol) | `(at32.0 + 1, at32.1), 32, 16` | **No** — the 32x16 is the third child of a 32x32 |
58+| 6 | `decode.rs:34658` | `PARTITION_HORZ_B =>` | `match part32` | `at32, 32, 16` | **No** |
59+| 7 | `decode.rs:34790` | `PARTITION_VERT_A =>` | `match part32` | `(at32.0, at32.1 + 1), 16, 32` | **No** |
60+| 8 | `decode.rs:34815` | `PARTITION_VERT_B =>` | `match part32` | `at32, 16, 32` | **No** |
61+
62+**The caller shape set is exactly `{(32, 16), (16, 32)}`, and every `bw`/`bh` is an integer literal — there is no variable, no computed size, no dispatch that could yield 8x16.** This is now asserted in code, not merely observed: `every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table` parses the argument lists out of `decode.rs` itself (§5).
63+
64+### Where an 8x16 / 16x8 luma strip ACTUALLY goes
65+
66+Every 16-level 2:1 luma strip is read by **`decode_leaf_rect`** (`decode.rs:15064`), which is a different function with the matching chroma rows:
67+
68+| 16-level route | call site | strip | reader |
69+|---|---|---|---|
70+| `part16 == PARTITION_HORZ` | `decode.rs:33995` / `34014` | `16, 8` x2 | `decode_leaf_rect` |
71+| `part16 == PARTITION_VERT` | `decode.rs:34044` / `34063` | `8, 16` x2 | `decode_leaf_rect` |
72+| `part16 ∈ HORZ_A..=VERT_B` via `ab_strip!` | `decode.rs:33942`, `33946`, `33963`, `33967` | `16, 8` / `8, 16` | `decode_leaf_rect` |
73+| frame-edge 8-mod-16 strip | `decode.rs:34336` | `(16, 8)` or `(8, 16)` per `if has_cols16 { (16, 8) } else { (8, 16) }` (`decode.rs:34334`) | `decode_leaf_rect` |
74+
75+`decode_leaf_rect` handles the 4:2:0 chroma half of exactly those strips — `(4, 8)` and `(8, 4)` — with `SCAN_4X8` / `SCAN_8X4` and `TxbSet::ChromaRect8x4` (`decode.rs:15409-15420`):
76+
77+```rust
78+} else if bw == 16 {
79+ (&SCAN_16X8, &SCAN_8X4)
80+} else {
81+ (&SCAN_8X16, &SCAN_4X8)
82+};
83+```
84+
85+So the `(4, 8)` arm is missing from a function that cannot be handed a 4x8, and present in the function that can.
86+
87+### Chroma-domain walk over the caller set
88+
89+For each caller shape, under each subsampling an AV1 `color_config` can carry:
90+
91+| caller | (ss_x, ss_y) | chroma `(bw>>ss_x, bh>>ss_y)` | arm? |
92+|---|---|---|---|
93+| 32x16 | (0,0) 4:4:4 | (32, 16) | yes |
94+| 32x16 | (1,0) 4:2:2 | (16, 16) | yes |
95+| 32x16 | (1,1) 4:2:0 | (16, 8) | yes |
96+| 16x32 | (0,0) 4:4:4 | (16, 32) | yes |
97+| 16x32 | (1,0) 4:2:2 | (8, 32) | yes |
98+| 16x32 | (1,1) 4:2:0 | (8, 16) | yes |
99+
100+`(0, 1)` is **structurally uncodable**: `ec-av1-syntax`'s `color_config` only reads `subsampling_y` when `subsampling_x == 1` (`crates/ec-av1-syntax/src/sequence.rs:480-485`), so that pair never exists. `(1, 0)` is 4:2:2, refused at the sequence header by `a_non_420_subsampled_sequence_header_is_refused_by_name` — walked anyway, so the proof does not lean on that guard. **The table is complete over the caller set. The refusal is dead code.**
101+
102+---
103+
104+## 2. EMPIRICAL — the decisive test
105+
106+Non-vacuity precondition: `HORZ_VERT_INTRA_HITS` fires at exactly three sites, `decode.rs:33990`, `34038`, `34330` — all three are `decode_leaf_rect` 16-level 2:1 strip routes. **A nonzero `horz_vert_intra_hits()` delta is therefore proof that the stream's parsed leaf list really contains a coded 16x8/8x16 luma strip**, not a proxy for it.
107+
108+Sweep: 7 sources (mandelbrot 64x64 / 128x128 / 130x122, testsrc2 64x64 / 128x128, rgbtestsrc, smptebars) x cq {16,22,28,34,42,52} x (`--cpu-used`, `--max-partition-size`) ∈ {(0,16),(0,32),(1,16),(3,32),(4,64)} x `--enable-ab-partitions` {0,1} x `--reduced-tx-type-set` {0,1}, always `--codec=av1 --passes=1 --end-usage=q --threads=1 --row-mt=0 --sb-size=64 --kf-max-dist=0 --enable-rect-partitions=1 --enable-1to4-partitions=0 --enable-cdef=0 --enable-restoration=0 --min-partition-size=8 --obu`, single yuv420p key frame from `ffmpeg -f lavfi`.
109+
110+```
111+SUMMARY attempts=840 decoded=840 streams_with_16lvl_strips=826 refusals_with_16lvl_strips=0
112+```
113+
114+| recipe family | parsed 16-level 2:1 luma strips | decode | `"a rectangular chroma transform…"` |
115+|---|---|---|---|
116+| 840 encodes (full grid above) | 826 of 840 streams carry ≥1 (3–20 each; cq 52 cpu=0 max=16 reached 20) | **840/840 `Ok`**, 1 frame each | **0 occurrences** |
117+| the 14 that carry none | 0 | 840 group total, all `Ok` | 0 |
118+
119+Three witness streams, each independently carrying coded 8x16/16x8 luma strips and each decoding `Ok`:
120+
121+| file | recipe | 16-lvl strips | sha256 | size |
122+|---|---|---|---|---|
123+| `w_cq34_cpu0_max16.obu` | mandelbrot 130x122, `--cq-level=34 --cpu-used=0 --min-partition-size=8 --max-partition-size=16 --enable-ab-partitions=1` | 17 | `6189103938308fac94fb027448f64d0cf3fc791968cf8aae4cb27a8d904f7ae8` | 1588 |
124+| `w_cq28_cpu1_max16.obu` | same, `--cq-level=28 --cpu-used=1` | 13 | `e32a7f0de4d6d339716d0410f304ba985e210111a37c80c5eabf36b2301839d9` | 1991 |
125+| `w_cq42_cpu0_max16.obu` | same, `--cq-level=42 --cpu-used=0` | 15 | `8fee40fdfa04b0a4904e9947343c494fbb9d6958827eefb169c9e1d1e87eb629` | 1063 |
126+
127+(Written to `~/.cache/av1rect8x16/`. **Not committed as a fixture**: outcome (a) needs no pin, and a fixture whose only job is to keep an unreachable guard unreachable is what the enumeration test is for.)
128+
129+**A refusal on a stream whose parsed leaves carry an 8x16 rect block would be the defect. That never happened — 0 refusals over 826 non-vacuous streams.**
130+
131+---
132+
133+## 3. VERDICT
134+
135+> **(a) UNREACHABLE.** The upstream gate is structural, not a size heuristic: all 8 call sites of `decode_block_rect` are 32-level `match part32` arms of `read_sb128_root` and pass `bw`/`bh` as the integer literals `32, 16` or `16, 32`, so the function's chroma footprint set is `{(16,8), (8,16), (16,16), (8,32), (32,16), (16,32)}` — all six of which have a row. A 4:2:0 8x16 luma strip's 4x8 chroma is read by `decode_leaf_rect`, not here, and that function carries the `(4, 8)` / `(8, 4)` rows itself. Measured over 840 real aomenc 4:2:0 key-frame encodes — 826 of which provably code a 16-level 2:1 luma strip — the refusal fires **0** times and every stream decodes to completion.
136+
137+**This is NOT a decoder capability defect. No conformant stream is refused by name.**
138+
139+### What the arm would have been (recorded, not added)
140+
141+For the record, had an 8x16 caller appeared, libaom *does* have the shape — so the row would be legitimate, not a fabrication:
142+
143+- `av1_ss_size_lookup[BLOCK_8X16][subsampling_x=1][subsampling_y=1] = BLOCK_4X8` — `~/.cache/aom-oracle/src/av1/common/common_data.c:24` (row 5 of the table; and `[BLOCK_16X8][1][1] = BLOCK_8X4` at `common_data.c:25`)
144+- `max_txsize_rect_lookup[BLOCK_4X8] = TX_4X8` — `~/.cache/aom-oracle/src/av1/common/common_data.h:130`
145+- chained by `av1_get_max_uv_txsize(bsize, subsampling_x, subsampling_y)` — `~/.cache/aom-oracle/src/av1/common/blockd.h:1372-1379`, which is `av1_get_tx_size`'s chroma branch (`blockd.h:1381-1388`)
146+
147+So the 4:2:0 chroma of an 8x16 luma block is a genuine single `TX_4X8` in libaom. `decode_leaf_rect` already decodes it (`SCAN_4X8` + `TxbSet::ChromaRect8x4`, `decode.rs:15412`/`:15419`). The `(4, 8)` row in `decode_block_rect` would be a duplicate of that path for a shape no caller produces.
148+
149+---
150+
151+## 4. Deliverable: the claim is now PROVEN, not assumed
152+
153+`refusal_inventory.rs` gained a `PROVEN` row for the string (it previously had **none** — it was the audit round's single unproven row) and the test that proves it:
154+
155+- **`every_chroma_unit_decode_block_rect_can_present_has_a_coefficient_table`** (`refusal_inventory.rs:1571`)
156+ 1. reads the caller shape set out of `decode.rs`'s own call-site argument lists (paren-balanced argument splitter, so the `(at32.0 + 1, at32.1)` origin argument does not shift the indices), asserts the site count and the shape set;
157+ 2. reads the `match (chroma_w, chroma_h)` arm heads out of the function's own text and pins the exact six-row set (class `table-and-reader-move-together`: a table edit invalidates the test);
158+ 3. walks every caller shape under `{(0,0), (1,0), (1,1)}` and asserts a row exists for each;
159+ 4. asserts the residual as code, not a comment: `(4, 8)` / `(8, 4)` are *not* rows, and no caller shape can produce them.
160+
161+The inventory summary moved from **32 proven to 33 proven**; all 16 `refusal_inventory` tests pass.
162+
163+### Non-vacuity: three red-proofs, then revert
164+
165+| mutation | result |
166+|---|---|
167+| `decode.rs:34490` `32,` → `8,` (an 8x16 caller appears) | **RED** — `the set of strip sizes decode_block_rect is called with changed … An 8x16/16x8 caller makes this refusal LIVE` |
168+| a `(4, 8) => (TxbSet::ChromaRect8x4, &SCAN_4X8),` row added to the table | **RED** — `decode_block_rect's chroma table changed -- re-derive the walk below` |
169+| `decode.rs:34490` `32,` → `at32.0 * 2,` (a call site stops being a literal) | **RED** — `decode_block_rect is called with a non-literal strip size "at32.0 * 2"` |
170+
171+`decode.rs` restored byte-identical after each (`git status` shows `refusal_inventory.rs` as the only modified file).
172+
173+---
174+
175+## 5. Scope and hygiene
176+
177+- No existing test weakened, renamed, or re-pinned. Net diff: `crates/ec-av1/src/refusal_inventory.rs`, **+240 / -0**.
178+- `decode_rect_split` and `read_block_tx_size` untouched (other lanes own them). `decode.rs` untouched.
179+- `decode_block_rect` itself untouched — the refusal stays as a named shape guard for the next caller, the repo's convention for a proven-unreachable guard (same as `a_sb_level_horz_vert_strip_admits_no_filter_intra_symbol`).
180+- The scratch sweep lived in two `#[ignore]`d tests, ran, and were deleted; the tree diff is the 240-line addition above.
181+- Main untouched: `git -C /home/user/Documents/Code/Rust/edith_codecs status --porcelain` shows no tracked-file modification from this lane. Never pushed.
182+
183+
184+## 6. Checked and CLEARED (recorded so it is not re-opened)
185+
186+`decode_leaf_rect` reads a 4:2:0 8x16 strip's 4x8 chroma with `TxbSet::ChromaRect8x4` + `SCAN_4X8`, while libaom's `get_txsize_entropy_ctx(TX_4X8)` reduces to the **8x8 square** set — a name that looks like a possible disagreement. It is not one: `Cdfs::txb` resolves `TxbSet::ChromaRect8x4` (`cdf_state.rs:2116`) to the *same* 8x8 chroma CDFs as `TxbSet::Chroma8` (`cdf_state.rs:1852`) — `txb_skip_chroma_8`, `eob_extra_chroma_8`, `base_chroma_8`, `base_eob_chroma_8`, `br_chroma_8`, `dc_sign_chroma`, `tx_type: None`, `side: 8` — differing only in the end-of-block group (`eob_pt_32_chroma` / `eob_pt_32_chroma_class1`, the rect-appropriate EOB_PT_32, versus `eob_pt_64_chroma`). The entropy set is the square-up one, as libaom has it; the variant name is a convenience for the distinct EOB table.