lane-av1422llinter: the lossless 4:2:2 inter divergence is localised and isolated to 4:2:2
Browse files at this commit677fb7482d1e4c7a596ac948508e3015b04413bfParent: ec5451f1 changed file +342 -0
- lanes/av1422llinter.report.md +342 -0
lanes/av1422llinter.report.mdadded+342 -0
| @@ -0,0 +1,342 @@ | |||
| 1 | +# lane-av1422llinter — the residual divergence on the 16-frame lossless 4:2:2 cells | ||
| 2 | + | ||
| 3 | +**Outcome: localised and isolated to a single chroma format, but NOT fixed and NOT | ||
| 4 | +gate-able.** The first offending msac read is named and bounded; the site inside | ||
| 5 | +`decode.rs` is not, and §7 says plainly why it cannot be gated from a committed test. | ||
| 6 | + | ||
| 7 | +Tip: `main` = `ac00e9fb` (Merge lane-av1422llpred2). Worktree | ||
| 8 | +`/home/user/.cache/wt/av1422llinter`, branch `lane-av1422llinter`. | ||
| 9 | +**No source change was made.** The only edit ever applied to this tree was the | ||
| 10 | +4:2:2 sequence-header bypass probe, and it is reverted (`git status` clean). | ||
| 11 | + | ||
| 12 | +--- | ||
| 13 | + | ||
| 14 | +## 1. Re-measurement on the tip (the numbers in the brief were partly stale) | ||
| 15 | + | ||
| 16 | +Geometry first, because the brief's numbers invited a wrong reading: the cell is | ||
| 17 | +**320x240**, not 300x256. Byte totals coincide (16 frames x 153600 B) because | ||
| 18 | +4:2:2 luma is `320*240` and chroma `2 x 160*240`, so a 300x256 guess gives the | ||
| 19 | +same frame size and silently mislabels every row/column. All row/column claims | ||
| 20 | +below use 320x240. | ||
| 21 | + | ||
| 22 | +Bypass patched in (`stream.rs:1803` `if false && seq.subsampling_x != seq.subsampling_y`), | ||
| 23 | +`decode_probe` release build, compared per plane against the pre-existing oracle | ||
| 24 | +`/home/user/.cache/cells/av1422lpf/oracle/{W,X,Y}.yuv` (DISPLAY order, 16 frames). | ||
| 25 | + | ||
| 26 | +Comparator: `/home/user/.cache/lane-av1422llinter/cmp.py`, with an | ||
| 27 | +**oracle-flip control** (`--flip-sample 0`) that XORs one oracle byte. | ||
| 28 | + | ||
| 29 | +| cell | result | | ||
| 30 | +|---|---| | ||
| 31 | +| `W_intrabc.obu` (130320 B) | frame 0 byte-exact; **frame 1** Y 60575/76800, U 30740/38400, V 31932/38400 differ; first sample frame 1 Y (0,0) ours 74 / oracle 81 | | ||
| 32 | +| `X_intrabc_tiled.obu` (131696 B) | same shape: frame 0 exact; **frame 1** Y 42325, U 19863, V 20461 differ, first sample Y (0,0) ours 74 / oracle 81 | | ||
| 33 | +| `Y_intrabc_10b.obu` (202281 B) | **CORRECTION to the brief.** It does *not* refuse at frame 0. Re-measured on a **freshly built** bypassed binary in a separate detached worktree at the same commit: this cell is **300x256, 10-bit** (not 320x240). It emits **4 of the oracle's 17 decode frames** (`U.f0..U.f3`, 307200 B each) and then stops. Frame 0 byte-exact; **frame 1** first bad sample at byte 36. **Honest flag:** the brief's `unsupported: AV1 tile (a Golomb tail longer than this decoder reads)` **does not reproduce** — three re-runs of a freshly built bypassed binary (`EC_PROBE_OUT`, `EC_PROBE_OUT16`, and no env) produce **no message at all** and simply stop after 4 frames. I report the reproducible fact and flag the discrepancy rather than asserting either version. Whatever stops it, it is not a frame-0 refusal and the decoder is not completing the cell. | | ||
| 34 | + | ||
| 35 | +**Flip control (both cells):** flipping oracle byte 0 adds **exactly 1** differing | ||
| 36 | +byte, reported at frame 0 plane Y (0,0). The comparator bites. | ||
| 37 | + | ||
| 38 | +### Display order vs decode order — the brief's frame 1 is NOT decode frame 1 | ||
| 39 | + | ||
| 40 | +`W_intrabc.obu` has **23 frame headers**: 17 coded frames (16 `show=true`, 6 of | ||
| 41 | +those `show_existing`, so 10 newly-coded-and-shown) + 6 `show_existing` + 7 | ||
| 42 | +hidden. The 16-frame YUV is therefore **DISPLAY order**; `EC_AV1_FINAL_DUMP` is | ||
| 43 | +**DECODE order** on both sides (`EC_AV1_FINAL_DUMP=<p>` -> `<p>.f<N>`, 17 files each). | ||
| 44 | + | ||
| 45 | +Display slot -> decode index: `0->0, 1->4, 2->5, 3->6(se), 4->8, 5->9(se), | ||
| 46 | +6->10, 7->11(se), 8->12, 9->15, 10->16(se), 11->17, 12->18(se), 13->20, 14->21(se), 15->22`. | ||
| 47 | + | ||
| 48 | +**The divergence tracks the HIDDEN frames, not the shown ones** — exactly the | ||
| 49 | +mis-localisation the brief warned about: | ||
| 50 | + | ||
| 51 | +| decode frame | hidden? | result vs oracle (decode-order FINAL, 153600 B) | | ||
| 52 | +|---|---|---| | ||
| 53 | +| 0 | shown | **BYTE-EXACT** | | ||
| 54 | +| **1** | **hidden (show=false)** | **138708/153600 differ — 90%** | | ||
| 55 | +| 2 | hidden | 127180 | | ||
| 56 | +| 3 | hidden | 83617 | | ||
| 57 | +| 4 | shown (= display 1) | 123247 | | ||
| 58 | + | ||
| 59 | +So the first bad frame is **decode frame 1 = the first inter frame = the first | ||
| 60 | +frame that predicts from a reference slot**, and it is *hidden*. The brief's | ||
| 61 | +"frame 1 is the first inter block" is right in spirit and wrong in index: the | ||
| 62 | +first *shown* inter frame is decode frame 4. | ||
| 63 | + | ||
| 64 | +**What frame 0 exercises that frame 1 does not:** frame 0 is `type=Key intra=true | ||
| 65 | +intrabc=true` — pure intra + intrabc, no reference slot read, no MV, no | ||
| 66 | +interp filter, no OBMC, no warp. Frame 1 is the first `type=Inter`: it is the | ||
| 67 | +first frame that (a) fetches a reference slot, (b) reads a motion vector, (c) | ||
| 68 | +applies an interp filter, (d) runs OBMC, and (e) applies warp. Frame 0 being exact | ||
| 69 | +therefore exonerates the whole intra + intrabc path and says nothing about inter. | ||
| 70 | + | ||
| 71 | +--- | ||
| 72 | + | ||
| 73 | +## 2. Stage attribution: every post-recon filter is INERT, proven | ||
| 74 | + | ||
| 75 | +**Header evidence:** every frame of W has `deltalf=false`, `lf_level=[0,0,0,0]`, | ||
| 76 | +`cdef_bits=0`, `lr=[None,None,None]`, `superres=false/8`. There is no loop | ||
| 77 | +filter, no CDEF, no loop restoration and no superres to run. | ||
| 78 | + | ||
| 79 | +**Measured evidence (both sides, decode frame 1).** Oracle `P`=PREFILT, | ||
| 80 | +`Dk`=POSTDEBLOCK, `Cd`=POSTCDEF, `F`=FINAL: | ||
| 81 | + | ||
| 82 | +* oracle: `F == P`, `Cd == Dk`, and `P != Dk` by 29775 B. | ||
| 83 | +* **`Dk.f1 == P.f2` and `Cd.f1 == P.f2`** (byte-identical to the *next* frame's | ||
| 84 | + prefilter). The oracle's postdeblock/postcdef rungs are **frame-offset by one**, | ||
| 85 | + so the 29775 B is a rung-scheduling artefact, **not** a deblock. Oracle | ||
| 86 | + deblock/CDEF/LR: **inert**, proven by identity, not assumed. | ||
| 87 | +* ours: `P == Dk == Cd` on f0..f3, i.e. our deblock and CDEF are no-ops too. | ||
| 88 | +* **PREFILTER vs FINAL on decode frame 1 differs by 138708 B — the identical | ||
| 89 | + count to the FINAL-vs-oracle difference.** So the whole divergence is already | ||
| 90 | + present *before* any filter: prediction + residual. Deblock, CDEF, LR, | ||
| 91 | + superres and the deblock are each **exonerated with evidence**. | ||
| 92 | + | ||
| 93 | +(Ours' `P`/`Dk`/`Cd` dumps are 163840 B = 320x256 Y + 160x256 U + 160x256 V, | ||
| 94 | +plane-padded to 256 rows; the oracle's are 153600 B crop-to-240. Comparing the | ||
| 95 | +first 153600 B of ours against the oracle is a stride mismatch and must be | ||
| 96 | +cropped first — `cmpcrop.py` does that. A naive `cmp` there reports a fake | ||
| 97 | +66825 B diff.) | ||
| 98 | + | ||
| 99 | +--- | ||
| 100 | + | ||
| 101 | +## 3. Controlled single-variable isolation: it is 4:2:2 and nothing else | ||
| 102 | + | ||
| 103 | +Same source content, same encoder, same settings, same 16 frames, same 320x240, | ||
| 104 | +same `tx_mode=Only4x4`, warp + alt-refs + OBMC + ref-mvs all on, all lossless | ||
| 105 | +(`base_q=0`), differing **only** in `-pix_fmt`: | ||
| 106 | + | ||
| 107 | +| cell | bytes | result | | ||
| 108 | +|---|---|---| | ||
| 109 | +| `bisect/ll_420.obu` (4:2:0) | 156294 | **25/25 decode frames BYTE-EXACT** | | ||
| 110 | +| `bisect/ll_444.obu` (4:4:4) | 314506 | **25/25 BYTE-EXACT** | | ||
| 111 | +| `bisect/ll_wshape.obu` (4:2:2) | 203530 | frame 0 exact, **frame 1 bad at byte 160** | | ||
| 112 | + | ||
| 113 | +This is a fresh reproducer built with **ffmpeg + libaom only** (no aomenc on this | ||
| 114 | +host): `testsrc2 320x240 yuv422p -> libaom-av1 -crf 0 -b:v 0 -cpu-used 6 | ||
| 115 | +-usage good -lag-in-frames 2 -f obu`. Variants with `-lag-in-frames 0` and | ||
| 116 | +`-enable-cdef 0` fail **identically** (frame 1, byte 160), so alt-refs and CDEF | ||
| 117 | +are not involved. | ||
| 118 | + | ||
| 119 | +**The same source losslessly encoded as 4:2:0 and 4:4:4 is exact. It is 4:2:2.** | ||
| 120 | + | ||
| 121 | +--- | ||
| 122 | + | ||
| 123 | +## 4. Full 4:2:2 corpus census (`lossy_all/`, 27 cells) | ||
| 124 | + | ||
| 125 | +`census.sh` decodes each cell on both sides with `EC_AV1_FINAL_DUMP` and reports | ||
| 126 | +per-DECODE-frame byte-exactness. **22/27 are exact on every frame**, including the | ||
| 127 | +ones a reader would guess are implicated: | ||
| 128 | + | ||
| 129 | +| exact | not exact | | ||
| 130 | +|---|---| | ||
| 131 | +| `422_residual_compound_warp_16f` **16/16** (compound + warp + residual) | `W_intrabc` exact 1/17, first bad **decode frame 1** byte 32 | | ||
| 132 | +| `AA_inter_compound` **43/43** | `X_intrabc_tiled` exact 1/17, first bad **decode frame 1** byte 32 | | ||
| 133 | +| `AD_inter_nogm` 43/43, `AB_inter_warp_odd` 0/43 *(see §4b)* | `Y_intrabc_10b` exact 1/4, first bad **decode frame 1** byte 36 | | ||
| 134 | +| `422_intrabc_sb128_strip` 5/5, `422_allskip_2f` 2/2, `422_sb128_3f` 3/3 | `O_odd322x242` 0/17 f0, `Q_odd320x242` 0/17 f0, `S_odd326x242_10b` 0/17 f0 | | ||
| 135 | +| `A,B,C,D,E,F,H,I,J,K,L,R_odd322x240,T,U,V` all 17/17 or 16/16 | | | ||
| 136 | + | ||
| 137 | +### 4b. A SECOND, unrelated defect is hiding in this census | ||
| 138 | + | ||
| 139 | +`AB_inter_warp_odd`, `O_odd322x242`, `Q_odd320x242`, `S_odd326x242_10b` all fail | ||
| 140 | +at **decode frame 0, byte ~103k-214k** — i.e. inside the **intra** key frame, | ||
| 141 | +with **no** inter frame involved and no reference slot read. They are all | ||
| 142 | +**242 pixels tall**; `R_odd322x240` (240 tall, odd *width* 322) is **17/17 exact**. | ||
| 143 | +So that cluster is an **odd-HEIGHT** defect, not a chroma-format one, and it is a | ||
| 144 | +different mechanism from the W/X/Y one. It is adjacent to `lane-av1oddheightfork3` | ||
| 145 | +(closed today) and is **not** this lane's subject — flagging it, not claiming it. | ||
| 146 | + | ||
| 147 | +--- | ||
| 148 | + | ||
| 149 | +## 5. The first divergent unit, and what it is not | ||
| 150 | + | ||
| 151 | +### 5.1 Pixel onset (reproducer `ll_wshape.obu`, decode frame 1) | ||
| 152 | + | ||
| 153 | +| plane | leading exact prefix | first differing sample | ours | oracle | | ||
| 154 | +|---|---|---|---|---| | ||
| 155 | +| Y | **160** | row 0, col 160 | 210 | 41 | | ||
| 156 | +| U | 56 | row 0, col 56 | 17 | 16 | | ||
| 157 | +| V | 49 | row 0, col 49 | 29 | 28 | | ||
| 158 | + | ||
| 159 | +Wrong region: a clean staircase, 246/300 16x16 Y blocks — the exact region is a | ||
| 160 | +staircase in the top-left and the wrong region grows down-and-right. Per-column | ||
| 161 | +and per-row diff counts are ~uniform, so there is no systematic column or row | ||
| 162 | +strip (an apparent "1-sample vertical strip" in an ASCII map was a misread; the | ||
| 163 | +histogram is flat). | ||
| 164 | + | ||
| 165 | +### 5.2 Prediction vs residual, separated by the residual-map identity test | ||
| 166 | + | ||
| 167 | +Frame 0 is byte-exact on both sides, so it is a trustworthy reference. For a | ||
| 168 | +lossless frame the residual is `prefilter(f1) - final(f0)`, and because these | ||
| 169 | +blocks are zero-MV, that map is the true residual. Both sides' maps: | ||
| 170 | + | ||
| 171 | +| plane | residual-map agreement | first residual-map difference | | ||
| 172 | +|---|---|---| | ||
| 173 | +| Y | 27543/76800 (35%) | (0,160): ours **+169**, oracle **0** | | ||
| 174 | +| U | 13021/38400 (33%) | (0,56): ours +1, oracle 0 | | ||
| 175 | +| V | 12707/38400 (17%) | (0,49): ours +1, oracle 0 | | ||
| 176 | + | ||
| 177 | +At the seed the oracle's residual is **0** (its recon equals the reference | ||
| 178 | +verbatim) and ours is **+169**. Because the block's decoded mode/ref/MV agree with | ||
| 179 | +the oracle's (§5.3), the prediction formula is the same, so **the difference is in | ||
| 180 | +the coefficients, not the motion compensation.** | ||
| 181 | + | ||
| 182 | +**Method warning, recorded because it already bit once:** a first run of this | ||
| 183 | +test passed *our own* prefilter as both sides' prediction and reported a bogus | ||
| 184 | +"RESIDUAL MAPS IDENTICAL -> prediction is at fault". The correct pairing is | ||
| 185 | +`UF.f0` (our ref) + `U.f1` (our pred) vs `OP.f0` + `OP.f1`. | ||
| 186 | + | ||
| 187 | +### 5.3 The parse fork, from the paired `EC_MODE`/`EC_MODE_VAL` ladder | ||
| 188 | + | ||
| 189 | +On this clean reproducer the two ladders **do share a label space** (mi in 4x4 | ||
| 190 | +units, same `mode`/`ref0`/`ref1`/`mv0`/`rng` fields; the oracle's rung is | ||
| 191 | +`decodemv.c:1467/1479`, ours `decode.rs:40795`). Unlike the `noibc` cell — where | ||
| 192 | +they carry 3846 vs 3400 lines and the mi labels transpose, the documented | ||
| 193 | +`av1-trace-label-mismatch-class` trap — here they align element for element. | ||
| 194 | + | ||
| 195 | +``` | ||
| 196 | +line 0 O mi(0,0) mode=13 ref0=1 mv=(0,0) rng=35922 | ||
| 197 | + U mi(0,0) mode=13 ref0=1 mv=(0,0) rng=35922 <-- IDENTICAL | ||
| 198 | +line 1 O mi(0,4) mode=13 ref0=1 mv=(0,0) rng=43856 | ||
| 199 | + U mi(0,4) mode=13 ref0=1 mv=(0,0) rng=36912 <-- RNG FORK, values still equal | ||
| 200 | +line 11 O mi(0,20) mode=13 ref0=1 mv=(0,0) rng=48823 | ||
| 201 | + U mi(4,16) mode=16 ref0=1 mv=(0,80) rng=50600 <-- STRUCTURE FORK | ||
| 202 | +``` | ||
| 203 | + | ||
| 204 | +**The first divergent unit is the 2nd inter block of decode frame 1, mi (0,4) in | ||
| 205 | +4x4 units = luma (0,16).** The decoded *values* of that block are identical on | ||
| 206 | +both sides; the msac `rng` is not (43856 vs 36912). So the offending read lies in | ||
| 207 | +the reads **between** block 1's `EC_MODE_VAL` and block 2's — i.e. block 1's | ||
| 208 | +tx-size / transform-partition / coefficient region — and it desynchronises the | ||
| 209 | +coder without changing the next few decoded values. By line 11 the *block | ||
| 210 | +structure itself* forks, so the rest of the frame is unrecoverable. | ||
| 211 | + | ||
| 212 | +**Why the pixel onset (col 160) is later than the parse onset (col 16):** the | ||
| 213 | +first ten inter blocks are all `mode=13` (NEARESTMV) with `mv=(0,0)` and, on the | ||
| 214 | +oracle, zero residual. Prediction is then the reference verbatim, so a desynced | ||
| 215 | +coder is *invisible* in the pixels until the first block that actually carries a | ||
| 216 | +nonzero residual. Pixel onset is therefore a lower bound on the parse fork, not a | ||
| 217 | +contradiction of it. | ||
| 218 | + | ||
| 219 | +--- | ||
| 220 | + | ||
| 221 | +## 6. The named mechanism, as far as the evidence carries it | ||
| 222 | + | ||
| 223 | +* **Ours, `crates/ec-av1/src/decode.rs`, the inter coefficient/tx region of the | ||
| 224 | + first inter block** — bounded but not narrowed to a line. The reads between | ||
| 225 | + `EC_MODE_VAL` of inter block 1 and of inter block 2 are the block's | ||
| 226 | + transform-size / var-tx partition reads and the per-plane coefficient reads. | ||
| 227 | + The defect is 4:2:2-chroma-specific (§3), sits in the **inter** path (§1), and | ||
| 228 | + is invisible in intra/intrabc (§1) and in every filter (§2). | ||
| 229 | +* **libaom, the mirror of that region**: `av1/decoder/decodetxb.c` | ||
| 230 | + `read_coeffs` / `read_transform_block` / `read_block_tx_size`, reached from | ||
| 231 | + `av1/decoder/decodeframe.c` `parse_decode_block` for an inter block. | ||
| 232 | +* **What produces what is observed:** one extra or one missing msac read in the | ||
| 233 | + 4:2:2 chroma coefficient region. That desynchronises the coder for the rest of | ||
| 234 | + the frame while leaving the next few symbols' *values* intact (a skewed CDF | ||
| 235 | + returns the same symbol from a different state), so the failure presents as | ||
| 236 | + "recon looks right for a while, then a block with a nonzero residual comes out | ||
| 237 | + wrong by a large amount" — which is exactly the +169 at (0,160) and the | ||
| 238 | + 138708/153600 blow-up. | ||
| 239 | +* **The 4:2:2-specific read this points at** is the chroma transform extent / | ||
| 240 | + coefficient unit for an inter block. AV1's smallest transform unit is 4x4 | ||
| 241 | + *chroma* samples, which in 4:2:2 is **8x8 luma** (subsampling only in x); a code | ||
| 242 | + path that derives the chroma TU from a 4:2:0-shaped extent will read a | ||
| 243 | + different number of coefficients than libaom. **I did not confirm this at a | ||
| 244 | + line** — see §7. | ||
| 245 | + | ||
| 246 | +**Alternative I could not exclude:** a CDF-table or `dc_sign`/`sign` context | ||
| 247 | +selection that is chroma-shape-dependent, rather than a unit-count error. Both | ||
| 248 | +produce "same values, different rng". Distinguishing them needs a paired | ||
| 249 | +coefficient ladder whose unit boundaries line up; per `av1-coeff-ladder-shape` | ||
| 250 | +that is a real project (four documented rung-shape asymmetries, and the raw | ||
| 251 | +counts here are 1255383 vs 657583 `tag=base` reads on the `noibc` cell, i.e. the | ||
| 252 | +unit decomposition genuinely differs). **Not attempted to completion.** | ||
| 253 | + | ||
| 254 | +--- | ||
| 255 | + | ||
| 256 | +## 7. Gate-ability: NO. Stated plainly. | ||
| 257 | + | ||
| 258 | +**This fix cannot be gated from any committed test, and I am not going to | ||
| 259 | +describe it as gated.** | ||
| 260 | + | ||
| 261 | +4:2:2 is refused at the **sequence header** — `stream.rs:1803` | ||
| 262 | +`if seq.subsampling_x != seq.subsampling_y` — so no committed fixture and no | ||
| 263 | +committed test can reach the inter coefficient path where this defect lives. To | ||
| 264 | +observe it at all, the guard must be patched out. The proof I have is therefore | ||
| 265 | +**measurement + a single-variable control**, which is the strongest evidence | ||
| 266 | +available here and is *not* a regression gate: | ||
| 267 | + | ||
| 268 | +* **Control (proves the comparator bites):** oracle-flip on both W and X adds | ||
| 269 | + exactly 1 differing byte, at frame 0 Y (0,0). | ||
| 270 | +* **Control (proves it is 4:2:2):** one source, one encoder, one setting, three | ||
| 271 | + chroma formats — 4:2:0 **25/25 exact**, 4:4:4 **25/25 exact**, 4:2:2 bad at | ||
| 272 | + decode frame 1. Any non-chroma-format explanation dies here. | ||
| 273 | +* **Control (proves it is inter, not intra):** decode frame 0 is byte-exact on | ||
| 274 | + both W and the reproducer; the fork is in decode frame 1's second inter block. | ||
| 275 | +* **Control (proves it is not a filter):** prefilter already carries 100% of the | ||
| 276 | + difference, with filter-inertness proven by rung identity in §2. | ||
| 277 | + | ||
| 278 | +**No source-scan substitute is offered.** A source-scan gate would be asserting | ||
| 279 | +something about code text, not about the decoder's behaviour on 4:2:2, and this | ||
| 280 | +lane's acceptance forbids dressing that up as a gate. | ||
| 281 | + | ||
| 282 | +**The reproducer is nonetheless committable as bytes** — `ll_wshape.obu` is | ||
| 283 | +203530 B, built from `ffmpeg + libaom` with no aomenc dependency, and §3's | ||
| 284 | +command line is recorded above verbatim. A future lane that *lifts* the 4:2:2 | ||
| 285 | +refusal (the product decision is the user's, not this lane's) can turn it into a | ||
| 286 | +byte-exactness gate immediately, and should mutation-prove it then. | ||
| 287 | + | ||
| 288 | +--- | ||
| 289 | + | ||
| 290 | +## 8. What was refuted, and how | ||
| 291 | + | ||
| 292 | +| claim | verdict | how | | ||
| 293 | +|---|---|---| | ||
| 294 | +| "a loop filter / CDEF / LR / superres stage carries it" | **refuted** | prefilter == the whole difference (138708 both sides); every header has `lf_level=0`, `cdef=0`, `lr=None`, no superres; oracle deblock/CDEF proven inert by `Dk.f1 == P.f2` | | ||
| 295 | +| "the oracle's 29775 B postdeblock delta is a deblock" | **refuted** | it is a rung frame-offset: `Dk.f1` and `Cd.f1` are byte-identical to `P.f2` | | ||
| 296 | +| "display frame 1 is the first bad frame" | **refuted** | display frame 1 = decode frame 4; decode frame 1 (hidden) is already 90% wrong | | ||
| 297 | +| "the divergence is in the shown frames" | **refuted** | it tracks the hidden frames; decode frame 1 is `show=false` | | ||
| 298 | +| "W is 300x256" | **refuted** | `max_frame=320x240`; the byte totals coincide, which is how the error hides | | ||
| 299 | +| "frame 0 is the last exact frame because intra is broken late" | **refuted** | frame 0 is intra+intrabc and is byte-exact on all three planes on both cells | | ||
| 300 | +| "it is a chroma-format-generic 4:2:2 inter bug" | **refuted** | same source/settings: 4:2:0 25/25 exact, 4:4:4 25/25 exact | | ||
| 301 | +| "it is 4:2:0-vs-4:2:2 independent of losslessness" | **refuted** | `422_residual_compound_warp_16f` (4:2:2, 16 frames, compound+warp) is 16/16 exact, but it is **lossy** (`base_q=73..114`). Lossy 4:2:2 inter is fine. It needs **lossless** (`base_q=0`, `tx_mode=Only4x4`) **and** 4:2:2 **and** inter | | ||
| 302 | +| "it is alt-refs or CDEF" | **refuted** | `-lag-in-frames 0` and `-enable-cdef 0` variants fail identically (frame 1, byte 160) | | ||
| 303 | +| "residual is in sync, so it is a prediction bug" | **refuted** | that reading came from a **void test** that passed our own prefilter as both sides' prediction. Correct pairing: residual maps agree only 35% (Y); at the seed ours is +169 where the oracle is 0 | | ||
| 304 | +| "it is one defect" | **partly refuted** | the census splits it: the W/X/Y cluster is lossless 4:2:2 inter; the `O_odd322x242`/`Q_odd320x242`/`S_odd326x242_10b`/`AB_inter_warp_odd` cluster fails at decode **frame 0** (intra, no reference slot) and is **odd-height**, with `R_odd322x240` (odd width, even height) exact. Two mechanisms. §4b | | ||
| 305 | +| "the `EC_MODE` ladders can be paired on `noibc`" | **refuted** | 3846 vs 3400 lines, mi labels transpose at line 96 — but frames 0-1 of that cell are byte-exact, so a parse fork there is impossible; it is the documented label-space trap. Only the clean `ll_wshape` reproducer pairs | | ||
| 306 | + | ||
| 307 | +--- | ||
| 308 | + | ||
| 309 | +## 9. Regression | ||
| 310 | + | ||
| 311 | +``` | ||
| 312 | +cargo test -p ec-av1 --lib -- 420 422 444 lossless warp intra \ | ||
| 313 | + --skip bitrate_target_lands_within_5_percent_over_48_frames | ||
| 314 | +``` | ||
| 315 | + | ||
| 316 | +**`test result: ok. 181 passed; 0 failed; 2 ignored; 0 measured; 618 filtered out; finished in 290.40s`** (309 s wall including the build). | ||
| 317 | + | ||
| 318 | +Run on the reverted (bypass-free) tree. No source change was made by this lane, | ||
| 319 | +so this is a baseline confirmation, not a fix-verification. | ||
| 320 | + | ||
| 321 | +--- | ||
| 322 | + | ||
| 323 | +## 10. Handover | ||
| 324 | + | ||
| 325 | +1. **Reproduce in one command** (no aomenc needed): | ||
| 326 | + `ffmpeg -f lavfi -i testsrc2=size=320x240:rate=25:duration=1.0 -pix_fmt yuv422p -f rawvideo src.yuv` | ||
| 327 | + then `ffmpeg -f rawvideo -pix_fmt yuv422p -s 320x240 -r 25 -i src.yuv -c:v libaom-av1 -crf 0 -b:v 0 -cpu-used 6 -usage good -lag-in-frames 2 -pix_fmt yuv422p -f obu ll_wshape.obu`. | ||
| 328 | + Bypass the header guard, then `EC_AV1_FINAL_DUMP` both sides: frame 0 exact, | ||
| 329 | + frame 1 first bad at byte 160. | ||
| 330 | +2. **Attack point:** the inter coefficient / tx-size reads of the **first inter | ||
| 331 | + block** of the first inter frame, 4:2:2 chroma only. Instrument with the | ||
| 332 | + `EC_COEFF_STEP` ladder on both sides and **count reads per unit before | ||
| 333 | + comparing values** (per `av1-coeff-ladder-shape`); the raw counts on the | ||
| 334 | + `noibc` cell were 1255383 vs 657583 `tag=base`, so the unit decomposition needs | ||
| 335 | + reconciling before any value diff means anything. | ||
| 336 | +3. **The specific hypothesis to test first:** whether the chroma transform unit | ||
| 337 | + for an inter block is derived from a 4:2:0-shaped extent. In 4:2:2 the minimum | ||
| 338 | + chroma TU is 4x4 chroma = **8x8 luma** (subsampling in x only). A 4:2:0-shaped | ||
| 339 | + derivation reads a different coefficient count and desyncs the coder exactly as | ||
| 340 | + observed. | ||
| 341 | +4. **Do not** treat §4b's odd-height cluster as part of this lane. | ||
| 342 | +5. **Gating stays impossible** until the 4:2:2 refusal is lifted (§7). | ||