forge
Explore
Log in

Don't you dare go Hollow

lane-av1422late: s422_384x240 localised to the frame-1 altref inter chroma SKIP write, refusal-to-fix

Browse files at this commit

c48f3436a84ffe65746cc2eed244901b971b5268Ahmet Kaan GümüşParent: 63036d2
The one 4:2:2 cell that fails from decode frame 1 rather than frame 0. ffmpeg is
the pixel oracle; the cell's 17 decode frames against ffmpeg's 16 display frames
need the decode->display map measured from the full diff matrix (decode frame 1 is
the hidden altref). Flip control: one flipped oracle sample moves U by exactly +1
(1780 -> 1781) with V and every other frame unchanged.

First divergence: decode frame 1, chroma only, U/V rows 169..190 cols 23..35;
pre-filter rows 170..189 cols 23..31, 180 samples per plane. Pre-filter already
carries it (0/180/180), so this is reconstruction, not an entropy desync and not
deblock/CDEF/LR. EC_MCPUSH names the single writer: decode.rs:43948, the inter
block's chroma SKIP push_mc_rect for the 64x64 luma block at (0,128), whose chroma
plane block is the per-axis 4:2:2 (0,128,32,64). Our chroma there is byte-identical
to the reference (0 differing over 32x64) and frame 0's U is uniformly 90 across
the whole neighbourhood, so the oracle's block is not a copy and our side wrote a
flat DC -- the standing-reserved group-tail chroma SKIP signature. Refusal-to-fix,
owner named; OBMC ruled out by measurement (killing it makes the cell worse).

Family sweep reproduces the census's counts exactly and shows 384x242/384x246
byte-exact, so the defect is reachable only at 384x240. No source diff: the 4:2:2
sequence-header refusal and the probe bypass revert are both in place.
lanes/av1422late.report.mdadded+220 -0
@@ -0,0 +1,220 @@
1+# lane-av1422late — `s422_384x240`, the one 4:2:2 cell that fails from decode frame 1
2+
3+**Outcome in one line: localised to the frame-1 alt-ref's inter chroma SKIP write
4+(`decode.rs:43948`, the single-reference arm's `push_mc_rect(1, cpx, cpy, …)`), and
5+NOT fixed — the residual is the standing-reserved "group-tail chroma SKIP arm that
6+writes a flat DC the oracle never predicts", which this lane is forbidden to edit.**
7+
8+Branch `lane/av1422late`, worktree `/home/user/.cache/wt/av1422late`, base
9+`main` = `affe70dc`. **The tree carries no source diff** (`git diff --stat` empty;
10+`stream.rs:1803` reads `if seq.subsampling_x != seq.subsampling_y {`). The
11+`EC_AV1_ALLOW_422_PROBE` bypass and every temporary trace were reverted before this
12+commit; the sequence-header refusal is in place. No push.
13+
14+---
15+
16+## 0. The cell
17+
18+| | |
19+|---|---|
20+| file | `/home/user/.cache/census422b/sweep/s422_384x240.obu` |
21+| sha256 | `bf1c658e9bfdc13ec1ed51e59049d2b81201941b6ef4571f8382f356ea4b815b` |
22+| geometry | 384x240, `subsampling_x=1, subsampling_y=0` (4:2:2), 8-bit |
23+| coded frame | 384·240 + 2·(192·240) = **184 320 B** |
24+| decode frames | **17** (16 shown + 1 hidden alt-ref) |
25+
26+## 1. The comparator, and its liveness proof
27+
28+`ffmpeg -v error -i <cell> -f rawvideo -pix_fmt yuv422p -` is the pixel oracle.
29+184 320 B/frame, split by geometry, never by file size.
30+
31+### 1.1 The trap this cell sets: 17 decode frames, 16 display frames
32+
33+ffmpeg emits **display** order; our `EC_AV1_FINAL_DUMP` is **decode** order. Running
34+them index-to-index gives a garbage sheet (frame 1 "18096/11872/12038" wrong). The
35+full 17x16 ours-x-ffmpeg total-diff matrix
36+(`/home/user/.cache/late422/align.py`) has its zero band on the anti-diagonal,
37+which is the decode→display map:
38+
39+```
40+decode : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
41+display: 0 HID 7 3 1 2 5 4 6 11 9 8 10 13 12 14 15
42+```
43+
44+**decode frame 1 is the hidden alt-ref** (it has no display counterpart); the shown
45+frames are reordered around it. Cross-check: aomdec's own `EC_AV1_FINAL_DUMP`
46+(decode order) agrees with ffmpeg **0/0/0 on every shown frame it can be paired
47+with**, so the two oracles are the same pixels and only the ordering differs.
48+
49+### 1.2 Flip control — the comparator bites
50+
51+One oracle sample flipped (low byte, bit 0) in a frame that is **already wrong**,
52+chosen as the first *matching* sample so the count must move by exactly +1:
53+
54+| | Y | U | V |
55+|---|---|---|---|
56+| baseline | 0 | **1780** | **1871** |
57+| one U sample flipped at decode 8 / display 6, U(0,0) `0x5c`→`0x5d` | 0 | **1781** | 1871 |
58+
59+`/home/user/.cache/late422/aligned.py … flip`. **+1 in that plane of that frame
60+only, every other plane and frame unchanged.**
61+
62+## 2. Per-frame, per-plane counts (ffmpeg, on the alignment above)
63+
64+Wrong **samples** per plane, decode order. `HID` = the alt-ref, no ffmpeg counterpart.
65+
66+| decode | display | Y | U | V |
67+|---|---|---|---|---|
68+| 0 | 0 | 0 | 0 | 0 |
69+| 1 | HID | (202/210 vs aomdec) | | |
70+| 2 | 7 | 0 | 50 | 60 |
71+| 3 | 3 | 0 | 0 | 0 |
72+| 4 | 1 | 0 | 0 | 0 |
73+| 5 | 2 | 0 | 0 | 0 |
74+| 6 | 5 | 0 | 0 | 0 |
75+| 7 | 4 | 0 | 0 | 0 |
76+| 8 | 6 | 0 | 4 | 12 |
77+| 9 | 11 | 0 | 250 | 258 |
78+| 10 | 9 | 0 | 138 | 150 |
79+| 11 | 8 | 0 | 96 | 104 |
80+| 12 | 10 | 0 | 210 | 210 |
81+| 13 | 13 | 0 | 290 | 303 |
82+| 14 | 12 | 0 | 292 | 303 |
83+| 15 | 14 | 0 | 248 | 261 |
84+| 16 | 15 | 0 | 202 | 210 |
85+| **total** | | **0** | **1780** | **1871** |
86+
87+Plus the hidden alt-ref: **0 / 202 / 210** (aomdec decode-order). 11 of 17 decode
88+frames are wrong — the census's "11/17" reproduced exactly, first at decode 1.
89+
90+## 3. First divergence
91+
92+**Decode frame 1 (the alt-ref), chroma only.** Measured against aomdec's
93+decode-order dump (ffmpeg cannot show a hidden frame):
94+
95+* plane **U** (and V identically): rows **169..190**, cols **23..35**;
96+ pre-filter rows **170..189**, cols **23..31**, exactly 180 wrong samples per plane.
97+* values: **ours is a flat 90** (U) across the whole 9x20 box; the oracle carries a
98+ vertical profile 87, 98, 120, 131, 128, 128, … 128, 131, 120, 98, 87.
99+
100+**Classification: a RECONSTRUCTION error, not an entropy desync.** The
101+pre-filter stage dump (`EC_AV1_PREFILT_WIDE_DUMP` vs aomdec `EC_AV1_PREFILT_DUMP`,
102+per-frame, decode order) already carries the whole divergence:
103+
104+```
105+decode 0 1 2 3-7 8 9 10 11 12 13 14 15 16
106+Y/U/V 0/0 0/180 0/48 0 0/4 0/246 0/136 0/92 0/202 0/290 0/290 0/248 0/202
107+```
108+
109+180 pre-filter → 202 post-filter, so deblock/CDEF/LR only spread the edge. A
110+desynced entropy decoder cannot produce a byte-exact luma plane for the whole frame
111+and then fail on one 9x20 chroma box eleven frames later.
112+
113+## 4. The owning arm
114+
115+`EC_MCPUSH` (which names the *caller* of every MC/inter write) over the whole
116+stream: every chroma write landing on the bad box comes from one site —
117+
118+```
119+crates/ec-av1/src/decode.rs:43948:21 push_mc_rect(1, cpx, cpy, chroma_stride,
120+ write_chroma_w, write_chroma_h, su, ZERO_RESIDUAL)
121+```
122+
123+i.e. **the inter block's chroma SKIP write in `decode_inter_block`'s
124+single-reference arm** (the compound twin is `decode.rs:42191`). `EC_AV1_PIXPROBE`
125+confirms the writer at the sample:
126+
127+```
128+PIXWRITE mc_add block=(0,128)+32 px=(25,175) prev=90 val=90
129+```
130+
131+— a 64x64 luma inter block at (0, 128), chroma plane block (0, 128, 32, 64)
132+(the per-axis 4:2:2 shape, `decode.rs:40926`), writing a prediction equal to the
133+reference and adding nothing.
134+
135+**The reference cannot produce the oracle's samples.** Frame 0's U plane is
136+**uniformly 90 for columns 0..31 over rows 126..199** (V uniformly 240) — there is
137+no 128 anywhere near, at any offset. So the oracle's block is *not* a copy of the
138+reference there, while ours is, byte for byte, over the whole 32x64 chroma plane
139+block (0 differing samples against frame 0, 180 against the oracle). Our side
140+produced a **flat DC** exactly where the oracle predicts content: the standing
141+signature of the reserved arm.
142+
143+The left edge of the wrong box moves with the object (cols 19,21,23,26,28,30 over
144+frames 9..16) while the right edge stays at 31..35 and the rows stay 169..190 —
145+i.e. it is the *chroma footprint of the alt-ref's moving object*, corrupted from
146+its first appearance and inherited by every later frame that references the alt-ref
147+(frames 3..7 are exact because they do not).
148+
149+## 5. Why this lane does not fix it
150+
151+The arm is inside the class the project ledger reserves:
152+
153+> the 4:2:0 group-tail chroma SKIP arm — *writes a flat DC the oracle never
154+> predicts* — is known-broken and reserved for its owning lane; never touch it from
155+> other chroma work; if another fix or witness depends on it, **stop and report
156+> instead of editing it**.
157+
158+This cell's signature is that arm's signature (flat DC in chroma where the oracle
159+predicts, luma exact, inter block, SKIP). Editing it here would be the recurrent
160+regression the rule names. **Refusal-to-fix; the owner is the group-tail chroma SKIP
161+arm's lane.** What is *not* claimed: that the 4:2:0 arm and this 4:2:2 site are the
162+same line of code — only that the failure mode is the reserved one and the fix must
163+be made there, in the arm, not here.
164+
165+Ruled out on the way, with measurements, not inference:
166+* entropy desync — pre-filter already differs, luma exact (above);
167+* deblock / CDEF / loop-restoration — pre-filter carries 180 of the 202;
168+* OBMC — `EC_KILL_OBMC=1` makes the cell strictly worse (frame 13 goes
169+ 0/290/303 → 225/573/577), so OBMC is load-bearing and not the writer;
170+* compound / warp / scaled-reference — the block reaches neither closure
171+ (`LATE422P` single-ref parse trace and `LATE422Q` compound parse trace both
172+ absent for it); `EC_MC_CALL` shows its chroma MC at `xfrac=0 yfrac=0`,
173+ `hk=Regular vk=Regular`;
174+* the `EC_AV1_DEBUG_SKIP_*` rungs are not usable for stage attribution on their own
175+ (they disable the filter on our side only, so every plane goes red); the
176+ pre/post/post-CDEF **stage dumps** are, and were used instead.
177+
178+## 6. Family sweep — measured on the same instrument, same tree
179+
180+`/home/user/.cache/late422/sweep.py` (ours vs aomdec `EC_AV1_FINAL_DUMP`,
181+decode order, per plane per frame, depth-correct).
182+
183+| cell | geometry | depth | frames | Y/U/V | verdict |
184+|---|---|---|---|---|---|
185+| `s422_384x240` (this cell) | 384x240 | 8 | 17 | **0/1982/2081** | DIVERGES, first at decode 1 |
186+| `s422_384x242` | 384x242 | 8 | 17 | 0/0/0 | exact |
187+| `s422_384x246` | 384x246 | 8 | 17 | 0/0/0 | exact |
188+| `s422_320x240` | 320x240 | 8 | 17 | 0/0/0 | exact |
189+| `s422_320x246` | 320x246 | 8 | 17 | 0/8339/5903 | DIVERGES (frame 0) |
190+| `s422_322x246` | 322x246 | 8 | 17 | 0/3603/2324 | DIVERGES (frame 0) |
191+| `s422_322x240` | 322x240 | 8 | 17 | 0/22969/22534 | DIVERGES (frame 0) |
192+| `s422_352x242_10b` | 352x242 | 10 | 17 | 0/4858/3949 | DIVERGES (frame 0) |
193+| `s444_352x242_10b` | 352x242 4:4:4 | 10 | 17 | **0/0/0** | exact — **closed since the census** |
194+
195+* Every diverging count the census published is **reproduced exactly** on this tree
196+ (5 of the 5 swept, including this cell's own 0/1982/2081), so the instrument is
197+ the census's and the numbers are comparable.
198+* The two "closed at frame 0" geometry siblings of this cell — `s422_384x242` and
199+ `s422_384x246` — are **byte-exact over all 17 frames**. That is the requested
200+ "not frame-0-only" control in the only direction available without a fix: the
201+ 384-wide family is not uniformly broken, the defect is reachable only at
202+ 384x240.
203+* `s444_352x242_10b` (4:4:4) closed between the census's tree and `affe70dc`; the
204+ census's 0/1166/1413 no longer reproduces. Recorded so the next reader does not
205+ re-chase it.
206+* 4:2:0 controls were **not** swept in this run (the driver's y4m header parse does
207+ not cover the `C420*` spellings aomdec writes) — stated, not assumed.
208+
209+## 7. Not measured
210+
211+* No fix, so no after-fix numbers exist; the "gate" this lane adds is the
212+ localisation itself plus the measurements above. **No new test was added** — a
213+ gate on an unfixed arm would only pin the defect.
214+* The oracle's *own* inter chroma prediction is not observable: aomdec's `EC_PRED`
215+ / `EC_PREDOUT8` rungs fire on the intra path only, so the claim "the oracle's
216+ block is not a copy of the reference" rests on frame 0's chroma being uniformly
217+ flat over the whole search neighbourhood, not on a rung.
218+* Frames 3..7 are exact but the alt-ref is not; the exact propagation path from
219+ decode 1 to each later bad frame is inferred from the shared geometry, not traced
220+ reference by reference.