Commits
2026-09-28
av1ibc128chunk: restore the truncated lossless-arm unblock recipe in the report (review nit)Ahmet Kaan Gümüş · 405e2ecBrowse files
ec-av1: lane-av1-ibc128chunk r2 -- the mu_chroma replay walks chunk THEN unit, report red counts correctedAhmet Kaan Gümüş · fda214d
ec-av1: lane-av1-ibc128chunk r2 -- the mu_chroma replay walks chunk THEN unit, report red counts corrected
Review r1 found a real coverage regression this lane introduced, and a
wrong attribution in the report.
P2, the defect. r1 gave the mu_chroma replay per-axis EXTENTS but kept the
old STEP: rows/cols count mu CHUNKS (ch / chunk_chroma_h) while the loop
body advanced the mi origin and read the grid PER UNIT (cr *
(unit_luma_h / MI), grid (cr * chunk_chroma_h)). Those agree only when a
chunk holds exactly one unit. At 4:2:0 (chunk_chroma == cu == 32) it is
line-identical to the parent, so nothing measured it; at 4:2:2
(chunk_chroma_h = 64 = 2 * cu) the body reached only the FIRST of the two
stacked units per chunk, so rows mi_r+8 .. mi_r+16 kept the composed-grid
smearing the replay exists to undo. The parent reached those rows (wrong
span, full coverage), so this was a regression r1 added, not a pre-existing
gap.
The reshape is the twin's chunk-then-unit loop (decode_inter_block's
mu_chroma_units, lane-av1-444 c8): (ur, uc) = (chunk_chroma_h / cu,
chunk_chroma_w / cu), inner `for kr in 0..ur { for kc in 0..uc {`, mi
origin (cr * 64 + kr * unit_luma_h) / MI per axis -- cr * 64 is the mu
chunk's LUMA-px step, 64 on both axes at every subsampling, which is why
the twin can write it unshifted -- and grid origin (cr * chunk_chroma_h +
kr * cu). At 4:2:0 ur/uc are 1 so kr/kc are 0 and the whole thing
collapses to r1's walk, line for line.
The LOSSLESS arm is pre-existing and deliberately untouched. On a lossless
frame cu is 4 and the composed grid is a raster of TX_4x4 units, so the
chunk-counted rows/cols do not enumerate it at all: that arm re-stamps
only the 4x4 at each chunk's top-left with a 2x2-mi span, where the twin
raster-walks the whole plane block (lane-av1-llinter). It is a 4:2:0
defect, not a subsampling square-cut, so it is out of this lane's class,
and fixing it would change 4:2:0 LOSSLESS output on a reconstruction with
no witness to verify it. Measured unreachability: a temporary env-gated
counter in the arm records 0 hits across the whole lossless and intrabc
gate battery (13 + 19 tests). Unblock named in the report.
P3, the report. The red counts were attributed to the wrong fixture: the
primary witness 422_intrabc_sb128_strip.obu is 46891 (f0) / 44842 (f3) on
the parent, 45135 / 44540 is the _notxsearch arm's. Both re-measured per
fixture and the table now reports each arm separately. The first
difference is byte 98368 = f0 Y row 256 col 64 on both -- the top-left of
the first 128x64 intrabc block at mi(64,0) -- and green is 0/0/0/0/0.
Re-measured after the reshape: both witnesses byte-identical to r1's
output (6 blocks, 48 chroma units, 5/5 frames exact vs aomdec), so the
reshape is a pure coverage repair. Gate battery 7/0 -- the four named
gates, both new gates and the bigblock pin gate -- plus intrabc 19/0 and
422+444+lossless 20/0; cargo check --all-targets 0 warnings. The source
scan gains the chunk-then-unit pins and its non-vacuity is measured twice:
forcing (ur, uc) = (1, 1) fails it (found 0), and re-introducing the
square cut at the read-walk site fails it (left: 1, right: 0). The
EC_AV1_ALLOW_422_PROBE bypass is NOT in the commit.ec-av1: lane-av1-ibc128chunk -- the 128-root intrabc strip's mu-chunk chroma walk de-square-cut, with a red/green 4:2:2 witnessAhmet Kaan Gümüş · a50f363
ec-av1: lane-av1-ibc128chunk -- the 128-root intrabc strip's mu-chunk chroma walk de-square-cut, with a red/green 4:2:2 witness decode_intrabc_128rect cut each mu chunk's chroma plane block with `chunk_chroma = cside * 64 / side` -- a `chroma_side`-SQUARE chunk, i.e. the 4:2:0 unit count on BOTH axes. This is the same defect lane-av1-422bigblock fixed and witnessed in decode_inter_block and decode_block_128rect; this copy was deferred there as unwitnessed. It is now witnessed: a real `aomenc --i422 --profile=2 --sb-size=128 --enable-intrabc=1` stream reaches the shape. A 64x64 mu chunk's chroma plane block is (64 >> ss_x) x (64 >> ss_y) -- 32x32 at 4:2:0, 32x64 at 4:2:2 (TWO STACKED TX_32X32 per plane, which av1_get_max_uv_txsize still caps at 32 per axis), 64x64 at 4:4:4. At 4:2:2 the square cut read one chroma unit per plane per chunk instead of two, left the chunk's lower 32 chroma rows with no residual at all, and stamped each unit's entropy context over a 16x16-mi luma square instead of 16x8; the block's own plane block was still the 4:2:0-hardcoded `bw/2 x bh/2` (and `px/2, py/2`) even though the same function's two mv_to_q4 calls already scaled the DV per axis by ss_y. The halved unit count desynced the tile. Fix: per-axis at BOTH sites (the mu-chunk read walk and the mu_chroma per-unit context replay) in the same expression shape the two witnessed twins carry -- chunk_chroma_w/h = 64 >> ss, unit_luma_w/h = cu_tx << ss, around_mi_rect/record_mi_chroma on the per-axis spans, per-axis unit origins and composed-grid offsets, and cw/ch = bw/bh >> ss for the block's chroma plane block. Red before (parent a7d22aec, on the EC_AV1_ALLOW_422_PROBE patch-run-restore build): 8 chroma units stamped over 2 reached blocks, frames 0 and 3 diverge from aomdec (45135 / 44540 of 245760 samples), first difference at Y row 256 col 64 -- the top-left of the first 128x64 intrabc block. Green after: 48 chroma units, all 6 blocks decoded, and all FIVE frames byte-identical to aomdec --rawvideo. The recovered 4 blocks are the signal as much as the pixel count. Both witnesses pinned (422_intrabc_sb128_strip.obu sha f92000db, 422_intrabc_sb128_strip_notxsearch.obu sha 80dd0d4e) and gated by the_pinned_422_intrabc_sb128_strip_witnesses_refuse_by_name (byte pins plus the unconditional refusal-by-name contract; decode_stream still refuses 4:2:2 in committed code, so the decode-level assertions are probe-measured and reproducible from the lane report's recipe) and a comment-stripped source-scan arm the_intrabc_128rect_chroma_chunk_walk_stays_per_axis, whose non-vacuity is measured: re-introducing the square cut fails it. Two new counters (INTRABC_128RECT_CHROMA_CHUNK_HITS, INTRABC_128RECT_CHUNK_SHAPE) pin the walk for the probe arms. 4:2:0 is byte-identical (64 >> 1 = 32, 32 << 1 = 64, bw >> 1 = bw/2) and proven by the tree's own sb128 intrabc-rect gate -- same recipe as the witness, at yuv420p/yuv420p10le, 30 blocks through the changed walk, all three arms decode-order pixel-exact. DISCLOSED 4:4:4 behavior change: at ss (0,0) the walk now codes four TX_32X32 per chunk per plane and the block's chroma plane block is luma-sized; the parent's was provably wrong there (chroma_side is the 4:2:0 half-side, so the old 32x32 chunk covered a quarter of a 64x64 4:4:4 chunk and the origin was off by half a superblock). No committed 4:4:4 fixture engages this function at all (ibc128=0 on all six), so the change is landed on the twins' geometry argument and flagged as needing its own 4:4:4 witness. Battery green: an_sb128_rect_strip_with_intrabc_decodes_pixel_exact, an_sb128_screen_stream_with_intrabc_decodes_pixel_exact, a_444_sb128_root_rect_stream_with_restoration_decodes_pixel_exact, a_lossless_sb128_rect_intra_block_decodes_sample_exact, the two other intrabc gates, the bigblock pin gate; intrabc filter 19/0, 422+444 filters 12/0; cargo check --all-targets 0 warnings. The EC_AV1_ALLOW_422_PROBE bypass is NOT in the commit.