av1intrapred: stop-report — first divergence is the chroma txb_skip CDF content at mi (36,66) p2 (txb 2162); prediction and filter chain exact
Browse files at this commitcfa56e2ea2f59476b745ab25b3f66c8e27a62120Parent: 50f12471 changed file +70 -0
- lanes/av1intrapred.report.md +70 -0
lanes/av1intrapred.report.mdadded+70 -0
| @@ -0,0 +1,70 @@ | ||
| 1 | +# lane-av1-intrapred — stop-report: first divergence is a chroma txb_skip CDF-content divergence at mi (36,66) plane 2, not intra prediction | |
| 2 | + | |
| 3 | +Base 7f863c5f (lane-av1-ibcvtx), worktree edith_codecs-av1intra, branch lane-av1-intrapred. | |
| 4 | +Tree left CLEAN (all temporary probes reverted; decode.rs/tile.rs byte-identical to base). No push. | |
| 5 | + | |
| 6 | +## Reproduction (step 1 — done) | |
| 7 | + | |
| 8 | +* R5 (testsrc2 320x180 tiled 2x2 → 640x360, sb64, maxp64, cq20, square-only, screen, intrabc, 1 frame) | |
| 9 | + reuses `~/.cache/av1ibcvtx-tmp/R5.obu`. Our decode (decode_probe) vs aomdec/ffmpeg: | |
| 10 | + first diff byte 82217 = luma (x=296, y=128), 189 vs 170; 84510 luma + 21005 U + 22347 V diffs total. | |
| 11 | +* `EC_AV1_PREFILT_DUMP` (ours, cropped, vs oracle): identical diff positions ⇒ the filter chain | |
| 12 | + (deblock/cdef/lr) is NOT the defect. | |
| 13 | +* Fresh witness: W2 = same recipe at `--cq-level=8`: ours vs aomdec diverge at byte 353 = pixel | |
| 14 | + (353, 0) — top row, near frame start. Much earlier, much tighter witness for this class. | |
| 15 | +* R9 (smptebars same recipe): byte-exact pre-fix, consistent with coarse-q smooth content | |
| 16 | + (DC-only residuals hiding the defect). | |
| 17 | + | |
| 18 | +## Localization (step 2 — done, decisive) | |
| 19 | + | |
| 20 | +Per-symbol trace diff (ours `EC_TRACE_COEFF` ↔ instrumented aomdec, aligned on the per-txb | |
| 21 | +`all_zero` reads; one per txb on both sides, 1:1 through the whole aligned prefix): | |
| 22 | + | |
| 23 | +* Symbols, order, rngs and txb shapes match **1:1 through txb index 2161** (including every | |
| 24 | + partition read, mode read and coefficient read — the "isolated sample" fingerprint of the | |
| 25 | + ibcvtx report is downstream noise). | |
| 26 | +* **txb 2162 = mi (36,66), plane 2 (V chroma), TX_4X4, the txb_skip (all_zero) symbol**: | |
| 27 | + both sides decode the same value (`all_zero=0`, "has coefficients") but consume different | |
| 28 | + bits — aom 44076→55196, ours 44076→42907. Same entry state, same symbol, different | |
| 29 | + probability ⇒ **the CDF row content differs at that moment**. | |
| 30 | +* Measured content: aom `txb_skip_cdf[txs=4x4][8][0] = 8480`; ours `TxbSet::Chroma4` row 1 | |
| 31 | + `cdf[0] = 24154`. No aom chroma-4x4 row (18102 / 8614 / 9170 / 16384) matches ours. | |
| 32 | +* The context VALUE mapping is verified correct at every chroma txb through 2162 | |
| 33 | + (aom ctx = ours row + 7 everywhere; aom above0=15/left=0 ↔ ours (1,0) at this unit), | |
| 34 | + so the bug is not the around-flag arithmetic — it is the **adaptation history (or default) | |
| 35 | + of our Chroma4 txb_skip rows** diverging from aom's shared `txb_skip_cdf[4x4][7..10]` rows. | |
| 36 | +* Everything after 2162 — the whole "cascade" (rows 128+, the +19 at (296,128) whose block | |
| 37 | + even reads a different var-tx tree, the chroma 4x4 cell diffs at rows 4..9, and the ibcvtx | |
| 38 | + lane's "mi (32,32) 64x64 all_zero" fingerprint, whose block is actually a 32x32 PAETH at | |
| 39 | + mi (32,72) that aom codes as one all-zero txb) — is **post-desync noise**, not defects. | |
| 40 | + | |
| 41 | +## Why this is a stop for this lane | |
| 42 | + | |
| 43 | +The defect is inside the intra block's **entropy layer** (chroma txb_skip CDF contents for | |
| 44 | +`TxbSet::Chroma4`), not in intra prediction arithmetic, mode reads, or the filter chain. | |
| 45 | +Prediction at every pre-desync site is pixel-exact (DC 170 / DC 103 cells verified against | |
| 46 | +aom recon with identical inputs). Fixing it is a cdf.rs/decode.rs chroma-CDF-set task | |
| 47 | +(defaults + update path for `TxbSet::Chroma4` rows vs aom's `default_txb_skip_cdf[0][7..10]`), | |
| 48 | +which I could not complete within this run's budget. | |
| 49 | + | |
| 50 | +## Unblock (exact, machine-checked) | |
| 51 | + | |
| 52 | +1. Diff the DEFAULT of our `TxbSet::Chroma4` txb_skip rows against aom's | |
| 53 | + `default_txb_skip_cdf[0][7..10]` (aom cdf.c) — aom's first chroma-4x4 ctx=8 read shows | |
| 54 | + cdf0=15696 post-adapt. | |
| 55 | +2. Diff the adaptation sequence: instrument `read_coeffs`' `all_zero` read (chroma only) to | |
| 56 | + log row index + content per read (the `tmp_chroma` plumbing I used and reverted is the | |
| 57 | + template), and compare against the oracle's `tag=all_zero ... cdf0=` lines | |
| 58 | + (the oracle build at `~/.cache/aom-oracle/build` now prints `cdf0=` and `EC_ROWS8` per | |
| 59 | + chroma-4x4 read — reusable). | |
| 60 | +3. R5 must become byte-exact vs aomdec AND ffmpeg; W2 (cq8) is the sharper gate | |
| 61 | + (diverges at byte 353 pre-fix); R9 must stay exact. | |
| 62 | + | |
| 63 | +## Notes | |
| 64 | + | |
| 65 | +* A parity-flip experiment on the default-scan zigzag was performed and fully reverted; it | |
| 66 | + proved our scan tables are entropy-correct as-is (the flip desyncs at the first | |
| 67 | + multi-coeff txb). Scan tables are NOT the defect. | |
| 68 | +* The oracle build `~/.cache/aom-oracle` gained extra env-gated probes during this hunt | |
| 69 | + (EC_R5CELL, EC_ROWS8, `cdf0=` in the all_zero line, EC_DBGCTX retargeted to mi 36,66). | |
| 70 | + They are env-gated and outside the repo; retarget/keep as needed. |