forge
Explore
Log in

Don't you dare go Hollow

ec-av1: ss-aware chroma reach in the lossless 16x4/4x16 pair walk

Browse files at this commit

eb6524280803575e493126b53531e78ad0bb16e8Ahmet Kaan GümüşParent: e772a72
The sweep's H4 ("4:4:4 lossless + --tile-rows=1, frame 3 onward the plane
goes flat") is not a tile defect. Two measured corrections:

  - `--tile-rows=1` at 256x128 is a no-op: aomenc's default superblock is
    128px, so 256x128 is 2x1 superblocks with no second superblock row to
    split, and the "tiled" stream is byte-identical to the untiled one.
    Tile rows at 4:4:4 lossless are exact at 1, 2 and 4 rows, both axes,
    on four geometries.
  - the "flat plane from frame 3" signature is a decode-order vs
    display-order mismatch in the measurement itself: aomdec dumps 7
    frames in decode order, ffmpeg emits 6 in display order, and
    aomdec-vs-ffmpeg alone reproduces the identical damage with no edith
    decoder in the loop.

The defect behind it is real and tile-INDEPENDENT (it reproduces on the
zero-tile stream). The lossless 16x4/4x16 chroma-pair walk passed
`tu_reach` a hardcoded 4:2:0 luma footprint (`ox * 2, oy * 2, 8`); at
4:4:4 a 4x4 chroma unit is 4x4 luma, so the footprint is doubled and
`Reach::of_tu`'s `col_off + tx_w < bw` test answers against a block twice
its real width -- every unit past the midpoint wrongly reports
`above_right = false` and a directional chroma strip predicts from a
neighbour libaom never reads. Patched to the ss-aware form already used
by the block-walk sibling at decode.rs:35342; the 4:2:0 answer is
unchanged because `<< 1` is `* 2`.

Measured site: testsrc2 256x128 yuv444p, `--profile=1 --lossless=1
--cpu-used=2 --lag-in-frames=0 --kf-max-dist=100 --limit=6`, first wrong
sample U(110,26) (ours 8, ref 7), 63 samples wrong per frame (U 29 + V
34, deltas -10..+13) on the key frame and all five inter frames. Entropy
is bit-identical: 351109 EC_SYMR reads compared on both sides with the
CDF convention reconciled, zero divergence -- reconstruction, not a fork.

Gate `a_lossless_444_rect16x4_chroma_reach_is_ss_aware` pins the fixture
(77918 bytes, sha256 382e67c0cc0988d14c500a62f5c3457a3f3b5f76d05acce2f655b1089bb8e7e3),
asserts the header really is ss (0,0)/8-bit/256x128, requires
rect4_16_lossless_chroma_hits to fire (80 on this fixture, 0 for a 4:2:0
stream of the same content), and compares every frame against aomdec in
decode order and ffmpeg in display order. Reverting the two calls turns
it red at byte 39534 -- U(110,26), the measured site.

Identity: 10/10 a_lossless, 9/9 444, 3/3 tile gates, and the sweep's 3
new gates all green.

Not fixed here, handed to the H1 lane: 512x128 --lossless=1 --cpu-used=2
(130708 wrong by frame 5) also forks entropy (459866 oracle reads vs
369136 ours) and is unchanged by this fix.
crates/ec-av1/fixtures/ll444_rect16x4_chroma_reach.obuadded+0 -0

Binary file changed

crates/ec-av1/src/decode.rsmodified+23 -6
@@ -17384,12 +17384,26 @@ fn decode_rect4_16_strip(
17384 for rr in 0..ch / 4 {17384 for rr in 0..ch / 4 {
17385 for cc in 0..cw / 4 {17385 for cc in 0..cw / 4 {
17386 let (ox, oy) = (cc * 4, rr * 4);17386 let (ox, oy) = (cc * 4, rr * 4);
17387+ // The unit's origin and extent in LUMA pixels: `<< ss`
17388+ // at 4:2:0 (8x8 luma for a 4x4 chroma unit), identity
17389+ // at 4:4:4 -- the same form as the block-walk sibling
17390+ // at decode.rs:35342. The hardcoded `ox * 2 / 8` is
17391+ // only right at ss (1,1): at 4:4:4 it claims a 4x4
17392+ // chroma unit is 8x8 luma, so `of_tu`'s
17393+ // `col_off + tx_w < bw` test answers against a
17394+ // footprint twice the real one and every unit past
17395+ // the block's midpoint wrongly reports
17396+ // `above_right = false` -- a directional chroma
17397+ // strip then predicts from a neighbour libaom
17398+ // never reads (measured: key frame 0, 4:4:4 lossless
17399+ // 16x4 strip at (104,26), U 29 + V 34 samples wrong,
17400+ // entropy bit-identical over 351109 EC_SYMR reads).
17387 let cu_reach = tu_reach(17401 let cu_reach = tu_reach(
17388 pw,17402 pw,
17389 ph,17403 ph,
17390- ox * 2,17404+ ox << ss_x(fctx),
17391- oy * 2,17405+ oy << ss_y(fctx),
17392- 8,17406+ 4 << ss_x(fctx),
17393 pair_reach,17407 pair_reach,
17394 ppx,17408 ppx,
17395 ppy,17409 ppy,
@@ -17468,12 +17482,15 @@ fn decode_rect4_16_strip(
17468 // one entry over the unit's two cells17482 // one entry over the unit's two cells
17469 // (`read_intra_chroma_lossless`).17483 // (`read_intra_chroma_lossless`).
17470 let cu_around = neighbours.around_mi(cu_mi, MI);17484 let cu_around = neighbours.around_mi(cu_mi, MI);
17485+ // Same ss-aware luma footprint as the skip arm
17486+ // above -- `ox * 2 / 8` is the 4:2:0-only form and
17487+ // mis-answers `of_tu` at 4:4:4 (see there).
17471 let cu_reach = tu_reach(17488 let cu_reach = tu_reach(
17472 pw,17489 pw,
17473 ph,17490 ph,
17474- ox * 2,17491+ ox << ss_x(fctx),
17475- oy * 2,17492+ oy << ss_y(fctx),
17476- 8,17493+ 4 << ss_x(fctx),
17477 pair_reach,17494 pair_reach,
17478 ppx,17495 ppx,
17479 ppy,17496 ppy,
crates/ec-av1/src/stream.rsmodified+180 -0
@@ -9563,6 +9563,186 @@ pub(crate) mod tests {
9563 "{NAME}: measured byte 108"9563 "{NAME}: measured byte 108"
9564 );9564 );
9565 }9565 }
9566+
9567+ /// lane-av1tilerows: the 4:4:4 LOSSLESS rect-pair chroma REACH fix --
9568+ /// the defect lane `av1formatsweep` filed as **H4** ("4:4:4 lossless +
9569+ /// `--tile-rows=1`, frame 3 onward the whole plane goes flat") and this
9570+ /// lane's red-before actually measured.
9571+ ///
9572+ /// **The H4 label was wrong; the defect it points at is real.** Two
9573+ /// corrections to the sweep's framing, both measured:
9574+ ///
9575+ /// 1. `--tile-rows=1` at 256x128 is a **no-op**. aomenc's default
9576+ /// superblock is 128px, so 256x128 is 2x1 superblocks -- there is no
9577+ /// second superblock ROW to split, and aomenc silently emits a
9578+ /// stream BYTE-IDENTICAL to `--tile-columns=0 --tile-rows=0`
9579+ /// (verified: both 64828 bytes, `cmp` equal). The sweep's "tiled"
9580+ /// fixture contained no tile rows at all. Tile rows at 4:4:4
9581+ /// lossless are exact here: measured pixel-exact at 1, 2 and 4 tile
9582+ /// rows, both axes (2x2), at 256x128 / 256x256 / 128x256 / 512x128,
9583+ /// on a recipe that is exact without tiles.
9584+ /// 2. The "frames 0-2 byte-exact, frame 3 onward flat, Y(0,0) 128 vs
9585+ /// 81" signature is a **harness frame-order mismatch, not a decode
9586+ /// defect**: with altref on, aomdec's `EC_AV1_FINAL_DUMP` writes 7
9587+ /// frames in DECODE order while `ffmpeg -f rawvideo` writes 6 in
9588+ /// DISPLAY order. Indexing one against the other makes frame 1 differ
9589+ /// by 29109 samples (30%) -- and aomdec-vs-ffmpeg ALONE reproduces
9590+ /// the identical 29109/24412/20046/19906 counts with no edith
9591+ /// decoder in the loop. Our decode-order output is byte-exact against
9592+ /// the oracle on all 7.
9593+ ///
9594+ /// The defect IS real, is in the class the sweep named (a hardcoded
9595+ /// 4:2:0-shaped walk at 4:4:4), and is tile-INDEPENDENT: it reproduces
9596+ /// on the zero-tile stream. `decode.rs`'s lossless 16x4/4x16 chroma-pair
9597+ /// walk passed `tu_reach` a hardcoded 4:2:0 luma footprint
9598+ /// (`ox * 2, oy * 2, 8`) for every chroma transform unit. At 4:4:4 a
9599+ /// 4x4 chroma unit is 4x4 LUMA, so the footprint is doubled:
9600+ /// `Reach::of_tu`'s `col_off + tx_w < bw` test then answers against a
9601+ /// block twice its real width and every unit past the midpoint wrongly
9602+ /// reports `above_right = false`, so a directional chroma strip predicts
9603+ /// from a neighbour libaom never reads.
9604+ ///
9605+ /// **Measured site (red-before, `git stash` of the fix, same tree):**
9606+ /// `testsrc2 256x128 yuv444p`, aomenc `--profile=1 --lossless=1
9607+ /// --passes=1 --end-usage=q --threads=1 --row-mt=0 --limit=6
9608+ /// --cpu-used=2 --lag-in-frames=0 --kf-max-dist=100` (pinned below).
9609+ /// Frame 0 (the KEY frame) and all five inter frames: **63 samples wrong
9610+ /// per frame, U 29 + V 34, first at U(110,26) / V(108,26), deltas -10..+13**,
9611+ /// region x108..125 y26..29 -- a 16x4 chroma strip at 4:4:4, whose rows
9612+ /// are NOT block-aligned (y26), which is the signature of a REACH
9613+ /// answer and not of a coefficient or transform error.
9614+ ///
9615+ /// **Entropy is bit-identical**: `EC_SYMR` on both sides, 351109 reads
9616+ /// compared on `(value, range, symbol, post_rng)` with the CDF-row
9617+ /// convention reconciled (`32768 - ours_cdf0 == oracle_cdf0`): **zero
9618+ /// divergence**. So this is reconstruction arithmetic, not an entropy
9619+ /// fork -- which is what separates it from the H1 rect-partition fork
9620+ /// (that one forks `EC_SYMR` at `decodetxb.c:158` `txb_skip`).
9621+ ///
9622+ /// A second, far worse instance of the SAME defect is the 512x128
9623+ /// `--cpu-used=2` stream (18779 wrong in the key frame, growing to
9624+ /// 130708 by frame 5) -- but that stream ALSO forks entropy
9625+ /// (459866 oracle reads vs 369136 ours), so it is not claimed here;
9626+ /// it belongs to the H1 rect-partition lane. The pinned fixture below is
9627+ /// the entropy-clean, fully-repaired instance.
9628+ ///
9629+ /// Non-vacuity: the fixture bytes are pinned (length + FNV-1a, like the
9630+ /// other `ll444_*` pins), the header must really be `ss (0,0)` at 8-bit
9631+ /// with `lossless == 1` (asserted from the parsed sequence header, not
9632+ /// assumed), the tiled sweep gates' counter
9633+ /// `decode::rect4_16_lossless_chroma_hits()` must FIRE (measured 80
9634+ /// units on this fixture -- a 4:2:0 stream of the same content leaves it
9635+ /// at 0, because a 4:2:0 lossless 16x4 pair is an 8x4 chroma block and
9636+ /// takes the pair-merge, not this walk), and every frame must be
9637+ /// byte-exact through BOTH the oracle `aomdec --rawvideo` (decode order,
9638+ /// the 7-frame compare that the hidden-frame gates use) and ffmpeg
9639+ /// (display order, 4:4:4 full-resolution chroma).
9640+ #[test]
9641+ fn a_lossless_444_rect16x4_chroma_reach_is_ss_aware() {
9642+ const NAME: &str = "a_lossless_444_rect16x4_chroma_reach_is_ss_aware";
9643+ const FIXTURE_LEN: usize = 77918;
9644+ const FIXTURE_FNV: u64 = 0xe2a2_90ac_f249_4bf7;
9645+ const W: usize = 256;
9646+ const H: usize = 128;
9647+ const FRAMES: usize = 6;
9648+ let obu = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
9649+ .join("fixtures/ll444_rect16x4_chroma_reach.obu");
9650+ let stream = std::fs::read(&obu).unwrap_or_else(|e| {
9651+ panic!(
9652+ "{NAME}: pinned fixture {} is missing ({e}) -- the gate cannot run, \
9653+ which is a failure, not a skip",
9654+ obu.display()
9655+ )
9656+ });
9657+ assert_eq!(stream.len(), FIXTURE_LEN, "{NAME}: fixture length moved");
9658+ assert_eq!(fnv1a64(&stream), FIXTURE_FNV, "{NAME}: fixture bytes moved");
9659+
9660+ // The header must really be the shape the fix is about: 4:4:4
9661+ // (ss 0/0) at 8-bit. A fixture that silently became 4:2:0 would
9662+ // take the pair-merge and make every arm below vacuous.
9663+ {
9664+ let mut p = Av1Parser::new();
9665+ let mut pos = 0usize;
9666+ let mut seq = None;
9667+ while pos < stream.len() {
9668+ let Ok(obu) = p.parse_obu(&stream[pos..]) else {
9669+ break;
9670+ };
9671+ pos += obu.total_size;
9672+ if matches!(obu.kind, ObuKind::SequenceHeader(_)) {
9673+ seq = p.sequence_header();
9674+ break;
9675+ }
9676+ }
9677+ let seq = seq.unwrap_or_else(|| panic!("{NAME}: no sequence header parsed"));
9678+ assert_eq!(
9679+ (seq.color_config.subsampling_x, seq.color_config.subsampling_y),
9680+ (0, 0),
9681+ "{NAME}: fixture is not 4:4:4 (ss {}x{})",
9682+ seq.color_config.subsampling_x,
9683+ seq.color_config.subsampling_y
9684+ );
9685+ assert_eq!(
9686+ seq.color_config.bit_depth, 8,
9687+ "{NAME}: fixture bit depth moved"
9688+ );
9689+ assert_eq!(seq.max_frame_width, W as u32, "{NAME}: fixture width moved");
9690+ assert_eq!(seq.max_frame_height, H as u32, "{NAME}: fixture height moved");
9691+ }
9692+
9693+ let _guard = lock_gate_counters();
9694+ crate::decode::reset_rect4_16_pair_hits();
9695+ let frames = decode_stream(&stream).unwrap_or_else(|e| {
9696+ panic!("{NAME}: the pinned stream no longer decodes cleanly: {e}")
9697+ });
9698+ let hits = crate::decode::rect4_16_lossless_chroma_hits();
9699+ assert!(
9700+ hits > 0,
9701+ "{NAME}: gate is vacuous -- no lossless 16x4/4x16 chroma-pair unit was \
9702+ walked (rect4_16_lossless_chroma_hits = {hits}), so the repaired \
9703+ `tu_reach` call site never ran"
9704+ );
9705+ assert_eq!(frames.len(), FRAMES, "{NAME}: shown frame count");
9706+ for f in &frames {
9707+ assert_eq!((f.width, f.height), (W, H), "{NAME}: dimensions");
9708+ }
9709+
9710+ // The oracle, DECODE order, every frame including hidden alt-ref
9711+ // frames. This is the arm that proves the repair against aomdec's
9712+ // own reconstruction, not just ffmpeg's.
9713+ if aomdec_path().is_file() {
9714+ let (decoded, hidden) = decode_all_frames_vs_oracle(&stream, NAME);
9715+ assert!(
9716+ decoded >= FRAMES,
9717+ "{NAME}: oracle decoded {decoded} frames, expected at least {FRAMES}"
9718+ );
9719+ let _ = hidden;
9720+ } else {
9721+ eprintln!(
9722+ "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
9723+ aomdec_path().display()
9724+ );
9725+ }
9726+
9727+ // ffmpeg's decoder: DISPLAY order, full-resolution chroma.
9728+ if have_ffmpeg() {
9729+ let refs = ffmpeg_decode_sequence_444(&stream, W, H, FRAMES);
9730+ for (i, (got, want)) in frames.iter().zip(refs.iter()).enumerate() {
9731+ for (p, (g, r)) in [(&got.y, &want.y), (&got.u, &want.u), (&got.v, &want.v)]
9732+ .iter()
9733+ .enumerate()
9734+ {
9735+ let bad = g.iter().zip(r.iter()).filter(|(a, b)| a != b).count();
9736+ assert_eq!(
9737+ bad, 0,
9738+ "{NAME}: ffmpeg frame {i} plane {p}: {bad} samples differ"
9739+ );
9740+ }
9741+ }
9742+ } else {
9743+ eprintln!("SKIP {NAME} ffmpeg arm: no ffmpeg");
9744+ }
9745+ }
9566 /// lane-av1-intrabc r4: the reviewer's unblock witness for the rect-strip9746 /// lane-av1-intrabc r4: the reviewer's unblock witness for the rect-strip
9567 /// reconstruction -- a CODED `use_intrabc` block (so its residual reader9747 /// reconstruction -- a CODED `use_intrabc` block (so its residual reader
9568 /// runs, not just the prediction copy) on a 2:1 strip in BOTH9748 /// runs, not just the prediction copy) on a 2:1 strip in BOTH
lanes/av1tilerows.report.mdadded+198 -0
@@ -0,0 +1,198 @@
1+# lane-av1tilerows — H4: 4:4:4 lossless + tile rows
2+
3+**Verdict.** The H4 *label* is wrong; the defect it points at is real, and it is
4+**not** a tile defect. Fixed: a hardcoded 4:2:0-shaped chroma reach at 4:4:4 in
5+the lossless 16x4/4x16 chroma-pair walk (`decode.rs`). Red-before **63 samples
6+wrong per frame**; entropy **bit-identical** over 351,109 `EC_SYMR` reads.
7+
8+**Tree.** `lane-av1tilerows` off `4155c7c7`, worktree `~/.cache/wt/av1tilerows`.
9+Not pushed (Main merges).
10+
11+## 1. Two corrections to the sweep's H4 framing
12+
13+Both measured, both reproducible.
14+
15+### 1.1 `--tile-rows=1` at 256x128 is a no-op
16+
17+aomenc's default superblock is 128px, so **256x128 is 2x1 superblocks** — there
18+is no second superblock *row* to split. aomenc silently emits a stream
19+**byte-identical** to `--tile-columns=0 --tile-rows=0`:
20+
21+```
22+g_256x128_notile.obu vs g_256x128_rows1.obu identical=True (64828/64828 bytes)
23+```
24+
25+The sweep's "tiled" H4 fixture contained **no tile rows at all**. (Same trap at
26+512x128: `g_512x128_notile` == `g_512x128_rows1`, 90553 bytes both.)
27+
28+Tile rows at 4:4:4 lossless are **exact**. Measured pixel-exact, 6-8 frames
29+each, against ffmpeg display order, on a recipe that is itself exact untiled:
30+
31+| recipe | tile grid | wrong/frame |
32+|---|---|---|
33+| `clean_notile` | 1x1 | 0 |
34+| `clean_sb64_r1` | 1x2 | 0 |
35+| `clean_sb64_r2` | 1x2 | 0 |
36+| `clean_sb64_r1c1` | 2x2 | 0 |
37+| `clean_512_r1` | 1x2 | 0 |
38+| `clean_256x256_r2` | 1x4 | 0 |
39+| `clean_128x256_r1` | 1x2 | 0 |
40+
41+(`clean` = `--enable-rect-partitions=0 --enable-palette=0 --cpu-used=2
42+--lag-in-frames=0 --lossless=1`, so the tile path is measured in isolation.)
43+
44+### 1.2 The "flat plane from frame 3" is a harness frame-order mismatch
45+
46+The reported signature — *frames 0-2 byte-exact, frame 3 onward the whole plane
47+comes out flat, Y(0,0) ours 128 vs ref 81* — is **not a decode defect**. With
48+altref on (the recipe's default), aomdec's `EC_AV1_FINAL_DUMP` writes **7**
49+frames in **decode** order while `ffmpeg -f rawvideo` writes **6** in **display**
50+order. Indexing one against the other:
51+
52+```
53+aomdec_decode[i] vs ffmpeg_display[i]: f0 EXACT, f1 29109 (30%), f2 EXACT,
54+ f3 24412 (25%), f4 20046, f5 19906
55+```
56+
57+**aomdec vs ffmpeg alone reproduces the identical counts with no edith decoder
58+in the loop.** Our decode-order output is byte-exact against the oracle on all 7
59+frames of that exact stream. Any H4-shaped verdict obtained by pairing a
60+decode-order dump against a display-order reference is a harness artefact.
61+
62+## 2. The real defect (found at the same recipe, tile-independent)
63+
64+The stream at the sweep's recipe **does** diverge, and it does so **with zero
65+tiles** — so it was never a tile-row bug:
66+
67+```
68+notile 256x128 wrong=[63, 63, 63, 63, 63, 63]
69+rows1 256x128 wrong=[63, 63, 63, 63, 63, 63] (same counts)
70+```
71+
72+**First wrong sample: U(110,26)** (ours 8, ref 7). V first at (108,26). 63
73+samples/frame, U 29 + V 34, deltas **-10..+13**, region x108..125 y26..29.
74+Frame 0 (the **key** frame) is already wrong, and all five inter frames inherit
75+it identically.
76+
77+**Entropy: bit-identical.** `EC_SYMR` both sides, 351,109 reads compared on
78+`(value, range, symbol, post_rng)` with the CDF convention reconciled
79+(`32768 - ours_cdf0 == oracle_cdf0`): **zero divergence**. So this is
80+reconstruction arithmetic, not an entropy fork — which is exactly what
81+separates it from H1.
82+
83+**Bisect** (all at 256x128, `--lossless=1`):
84+
85+| toggle | wrong/frame |
86+|---|---|
87+| baseline (default partitions) | 63 |
88+| `--enable-rect-partitions=0` | **0** |
89+| `--enable-palette=0` | **0** |
90+| `--min-partition-size=32` | **0** |
91+| `--min-partition-size=8` | **0** |
92+| `--max-partition-size=64` | 63 |
93+| `--enable-ab-partitions=0` | 63 |
94+| `--enable-tx-size-search=0` | 63 |
95+| `--enable-cfl-intra=0` | 63 |
96+
97+So the site is a **rect-partitioned 16x4/4x16 luma block** whose **lossless**
98+4:4:4 chroma pair walk mis-answers `Reach::of_tu`.
99+
100+## 3. Class and fix
101+
102+**Class: hardcoded 4:2:0-shaped walk at 4:4:4** (`reach-is-4:2:0-shaped`), the
103+same class the wave fixed in the 422 monochrome-table and chroma-block-size bugs.
104+
105+`decode.rs`, the lossless 16x4/4x16 chroma-pair walk (both the skip and the
106+coded arm) passed `tu_reach` a hardcoded **4:2:0 luma footprint**:
107+
108+```rust
109+tu_reach(pw, ph, ox * 2, oy * 2, 8, pair_reach, ...)
110+```
111+
112+A 4x4 chroma unit is 8x8 **luma** at 4:2:0 — so `ox * 2 / 8` is right there and
113+**only** there. At 4:4:4 the same unit is 4x4 luma, so the footprint is doubled:
114+`Reach::of_tu`'s `col_off + tx_w < bw` test then answers against a block twice
115+its real width, and every unit past the midpoint wrongly reports
116+`above_right = false`. A directional chroma strip then predicts from a
117+neighbour libaom never reads.
118+
119+The wrong rows are **not block-aligned** (y26 is not a multiple of 4) — the
120+signature of a REACH answer, not of a coefficient or transform error.
121+
122+Fix: the ss-aware form, identical to the block-walk sibling at
123+`decode.rs:35342` (`<< ss` at 4:2:0, identity at 4:4:4):
124+
125+```rust
126+tu_reach(pw, ph, ox << ss_x(fctx), oy << ss_y(fctx), 4 << ss_x(fctx), ...)
127+```
128+
129+Both copies patched (the class sweep found exactly two). The 4:2:0 answer is
130+unchanged by construction — `<< 1` is `* 2` and `4 << 1` is `8` — which is why
131+every 4:2:0 gate stayed green.
132+
133+## 4. Gate
134+
135+`a_lossless_444_rect16x4_chroma_reach_is_ss_aware` (`stream.rs`), fixture
136+`fixtures/ll444_rect16x4_chroma_reach.obu`:
137+
138+- **77918 bytes**, sha256 `382e67c0cc0988d14c500a62f5c3457a3f3b5f76d05acce2f655b1089bb8e7e3`,
139+ FNV-1a `0xe2a290acf2494bf7`. Recipe: `testsrc2 256x128 yuv444p`, aomenc
140+ `--profile=1 --lossless=1 --passes=1 --end-usage=q --threads=1 --row-mt=0
141+ --limit=6 --cpu-used=2 --lag-in-frames=0 --kf-max-dist=100`.
142+- **Non-vacuity**: header asserted `ss (0,0)` / 8-bit / 256x128 from the
143+ *parsed* sequence header; `rect4_16_lossless_chroma_hits()` must fire
144+ (measured **80** on this fixture; a 4:2:0 stream of the same content takes the
145+ pair-merge and leaves it at 0); every frame byte-exact through the oracle
146+ `aomdec --rawvideo` in **decode** order (all 7) and ffmpeg in **display**
147+ order with full-resolution chroma.
148+- **Mutation proof (non-vacuous, run)**: reverting the two calls to `ox * 2 /
149+ oy * 2 / 8` turns the gate **RED** —
150+ `decode-order frame 0 ... differs from the oracle at byte 39534 (ours 8 vs 7),
151+ 63 bytes differ` — byte 39534 is exactly U(110,26), the measured site.
152+
153+## 5. Identity (all green locally, this tree)
154+
155+| group | result |
156+|---|---|
157+| new gate `a_lossless_444_rect16x4_chroma_reach_is_ss_aware` | ok (mutation red) |
158+| all `a_lossless` (10, incl. 4:2:0 `a_lossless_16x4_chroma_pair_repairs_the_measured_site`, `a_lossless_sb128_rect_intra`, `a_lossless_libaom_key_frame`, `a_lossless_libaom_inter_frame`) | 10 passed / 0 failed |
159+| all `444` (9, incl. the 4 committed `ll444_*` pins and `a_444_sb128_root_rect_stream_with_restoration`) | 9 passed / 0 failed |
160+| tile gates (3: two_tile_rows, …_through_decode_stream, four_tile_rows) | 3 passed / 0 failed |
161+| sweep's 3 new gates, run in `~/.cache/wt/av1fmt` with this `decode.rs` applied, then restored | 3 passed / 0 failed |
162+
163+## 6. Handed back to the H1 lane (NOT fixed here)
164+
165+**512x128, `--cpu-used=2`, `--lossless=1`**: 18779 wrong in the key frame,
166+growing to **130708** by frame 5. Same *shape* of damage, but it **also forks
167+entropy** — 459,866 oracle `EC_SYMR` reads vs 369,136 ours — so it is not this
168+defect and not claimable here. The 512x128 damage is **unchanged by this fix**
169+(measured before and after: `[18779, 84910, 93811, 104654, 82976, 130708]` both
170+times) — it forks entropy before any reach is consulted, so
171+**the residual is an entropy fork in the H1 rect-partition class**. Recommended
172+for whoever takes H1: re-run the `EC_SYMR` ladder on
173+`testsrc2 512x128 yuv444p --lossless=1 --cpu-used=2 --lag-in-frames=0
174+--kf-max-dist=100 --limit=6` and pair the first fork against
175+`decodetxb.c:158` (`txb_skip`) exactly as the sweep's H1 section did.
176+
177+Two other pre-existing items found but **not** fixed (out of scope, not
178+introduced here, and neither is a tile-row defect):
179+
180+1. **256x256 4:4:4 lossless, zero tiles, `--sb-size=64`**: panics at
181+ `decode.rs:2787` — `debug_assert_eq!((self.w, self.h), (4, 4))` in
182+ `TxParams::run`, i.e. a non-4x4 unit reached the lossless WHT path. Release
183+ builds miss the assert, so this is a latent wrong-shape reconstruction.
184+2. **256x256 4:4:4 lossless with default (128px) superblocks**: exact. Only the
185+ 64px-SB variant panics.
186+
187+## 7. Hygiene
188+
189+- No temporary instrumentation added: the diagnosis used existing env-gated
190+ rungs only (`EC_SYMR`, `EC_TRACE` on the oracle). Nothing to remove —
191+ `git diff` touches `decode.rs` (the two reach calls + comments), `stream.rs`
192+ (the gate) and the pinned fixture.
193+- No formatters run.
194+- Local runs used `EC_NOMEMGUARD=1`: the repo's `scripts/memguard-runner.sh`
195+ transient-scope wrapper collided with stale `run-p*.scope` units on this box
196+ ("Unit run-p…scope was already loaded"), which aborts `cargo test` before any
197+ test runs. That is an environment artefact, not a test failure — every gate
198+ above was run with the wrapper bypassed.