diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index a852ed77..b4e23478 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -32512,14 +32512,22 @@ fn decode_inter_sub8_split4( neighbours.fill_lf_grid_rect(lmi, 1, 1, B4 as u8, B4 as u8, ref_frame.max(LAST_FRAME), fctx); last_skip = skip; } - // lane-sub8intra: when the chroma-reference sub-block was INTRA it coded + // lane-av1-444: when the chroma-reference sub-block was INTRA it coded // and reconstructed the group's one chroma unit itself. - // lane-av1-444: at ss 0/0 the group unit does not exist -- every piece - // coded its own U/V inside the loop above. The mode-level bookkeeping - // below still runs for both subsamplings: an inter 4x4 piece's - // `mbmi->uv_mode` is the DC_PRED default and no piece can be a palette - // block, exactly as the 4:2:0 path already published. - neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); + // lane-av1-444 (f19): at ss 0/0 the group unit does not exist -- every + // piece coded its own U/V inside the loop above, and every piece also + // wrote its own `uv_mode` neighbour state: an inter piece through + // `record_inter_rect_mi`'s is_inter DC stamp (libaom leaves `uv_mode` + // unset on an inter mbmi, `is_smooth` reads 0), an INTRA piece through + // [`decode_intra_sub8_leaf`]'s chroma_444 arm (libaom's per-sub-block + // `mbmi->uv_mode` is real there -- frame 19 of the fixture reads + // uv 12/11/9/12 on the four pieces of the (42,54) group, and the next + // block's `get_intra_edge_filter_type` must see that SMOOTH_H left + // neighbour, not the DC_PRED this stamp used to paint over it). So the + // group-level stamp runs only where the 4:2:0 group unit is real. + if !chroma_444 { + neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); + } // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map // needs EVERY writer): a sub-8x8 group published no palette state, so // once an 8x8 leaf of the same row can BE a palette block, the group @@ -33785,11 +33793,16 @@ fn decode_inter_sub8_rect2( last_skip = skip; } // lane-av1-444: at ss 0/0 the group unit does not exist -- each piece - // coded its own U/V inside the loop above. The mode-level bookkeeping - // below still runs for both subsamplings: an inter piece's - // `mbmi->uv_mode` is the DC_PRED default and no piece can be a palette - // block, exactly as the 4:2:0 path already published. - neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); + // coded its own U/V inside the loop above, and each piece wrote its own + // uv neighbour state (inter pieces through `record_inter_rect_mi`'s + // is_inter DC stamp, intra pieces through their own per-piece record). + // The group-level DC stamp below stays 4:2:0-only: at ss 0/0 it painted + // over an intra piece's real `uv_mode` and the next block's + // `get_intra_edge_filter_type` lost the smooth neighbour (same class as + // [`decode_inter_sub8_split4`]'s tail, frame 19 of the fixture). + if !chroma_444 { + neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); + } // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map // needs EVERY writer): a sub-8x8 group published no palette state, so // once an 8x8 leaf of the same row can BE a palette block, the group diff --git a/lanes/av1444.report.md b/lanes/av1444.report.md index d7036bc0..66f559d3 100644 --- a/lanes/av1444.report.md +++ b/lanes/av1444.report.md @@ -176,7 +176,67 @@ Full suite NOT run this round (budget wall). 4. Full suite `--test-threads=1` (NOT run this round), 0-warning parity (build IS warning-clean), update this report. -## Continuation 6 (2026-09-23, Tuna — budget-wall WIP) +## Continuation 7 (2026-09-23, Vefa — budget-wall WIP) + +Round-6's wall is RESOLVED; the fixture moved from "shown 18 seed" to a new, +exactly-localized wall at decode idx 52 (shown 49). + +1. **Root cause (leaf B was a victim, class stale-neighbour-mode):** leaf + (42,58)'s chroma DC base 145-vs-146 traced to its LEFT edge, not to the DC + gather. Our `dc()` already carries libaom's `(sum + count/2) / count` bias; + the sums differed because leaf A (42,56) output was wrong: its left + neighbour (42,55) coded `uv=SMOOTH_H` (11) on a 4x4 intra-in-inter piece, + but the inter sub8 group tails (`decode_inter_sub8_split4` / + `decode_inter_sub8_rect2`) stamped `DC_PRED` over the whole 2x2-mi group's + uv-mode neighbour cells AFTER the pieces had recorded their own modes + (trace: pieces 12/11/9/12 at (42,54..55) wiped to 0). libaom keeps every + sub-block's own `mbmi->uv_mode`. Consequence chain: aom + `get_intra_edge_filter_type`=1 for leaf A vs our 0 → libaom's type-1 + upsample cap (`blk_wh <= 8`) leaves the edge alone while our type-0 cap + (`blk_wh <= 16`) UPSAMPLES it for V_PRED p_angle=87 (dx=3): base row0 + [174,172,**179**,189,185,**183**,195,**182**] vs aom + [174,172,**178**,189,185,**182**,195,**183**] — every later sample + reproduced numerically. Leaf B's left column then differed at rows + 168/170, and the (correct) biased DC rounded 145 vs 146. +2. **Fix:** gate both group-tail uv stamps on `!chroma_444`. At ss 0/0 every + piece already writes its own state (inter pieces through + `record_inter_rect_mi`'s is_inter DC stamp, intra pieces through + `decode_intra_sub8_leaf`'s chroma_444 arm); the group stamp is 4:2:0-only. +3. **Verified:** w24 cut — ALL 26 decode-order frames prefilt byte-exact + (was f19=122 U/V diffs, f20, f22). Full fixture — decode 0..51 (shown + 0..48) byte-exact vs ffmpeg yuv444p; round-6's f1 single V sample is gone. +4. **New wall (localized, next round):** decode idx 52 first diverges at + Y(128,192) (ours 210, aom 209); prefilt 21735 diffs; the symbol ladder + desyncs INSIDE frame 52. Facts: aom f52 walk at mi(52,16) is + BLOCK_16X16 PARTITION_NONE (`EC_PART bsize=6 value=0`); luma ONE + TX_16X16 (matches ours); then chroma U TX_16X16 reads all_zero with + `txb_skip_ctx=8` = base 1 + offset 7 (`get_txb_ctx_general`: chroma + offset 10 iff plane_bsize bigger than the transform, else 7; + plane_bsize==BLOCK_16X16==tx → 7). OUR same-position read: all_zero + **ctx=0** — `decode_block`'s cn==1 chroma arm passes offset `None` + (only cn>1 passes `Some(3)`), and our above/left entropy flags read + 0 where aom's combine gives 1. Pinned with the rebuilt oracle's new + `EC_DBGCTX` print (cellsA/cellsL per unit): aom's U TX_16X16 cellsA + = 0,0,0,0 but cellsL = **21,21,21,21** — the left cells at mi rows + 52..55 were written by the 64x64 mi(48,0) block's U TX_32X32 (48,8) + unit with cul 21, while OUR left cells for the same rows/plane read 0. + So the desync is ONE symbol (the U all_zero) and the suspect is our + per-unit chroma context WRITE for the 64x64 inter path + (`record_mi_chroma` span/cul derivation) or its cell mapping — our + (48,8) U grid has its coefficients in the unit's TOP half (grid rows + 8..15), so a correct bottom-cell write would be 0 and the 21 must + come from aom's cul derivation over the whole 32x32 unit (cul is a + running count, not per-cell) — verify `read_coeffs`' cul accounting + against libaom's `read_coeffs_txb` loop. +5. **Infra note:** the oracle's `EC_AV1_POSTCDEF_DUMP` index is off by one + (aom pc.fK = decode K+1); under that alignment CDEF is byte-exact frames + 44..51, and post-deblock is byte-exact through idx 51 — the wall is NOT + loop-filter related. +6. NOT done this round (budget): regression arms (420/444 square, forced-64, + mono, 10-bit, qmatrix, cdf) and the full suite. Committed at the wall; + tree clean; no push. + + Round-5's frame-18 target was mis-aimed: the visible 2-pixel U diff is INHERITED. Per-frame prefilt diff (EC_AV1_PREFILT_DUMP, crop-aware):