forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to lanes/realdesync.report.mdClear filter

2026-09-16

vp9kf: real content decodes byte-exact -- per-SB-row left contexts, MI-row chroma extentsAhmet Kaan Gümüş · bd4fadc
vp9kf: real content decodes byte-exact -- per-SB-row left contexts, MI-row chroma extents

Two boundary bugs, both found by driving real content through the decoder
(a real 320x240 clip and a real 1920x1080 clip, all-intra VP9 transcodes):

1. decode.rs: the left entropy and partition contexts were zeroed only on the
   tile's FIRST superblock row (`if sb_row == row_lo`). libvpx zeroes them at
   the start of EVERY SB row - vp9_decodeframe.c:2256-2258 (plain decode_tiles;
   row-mt twin :2114-2115, per-tile-row twins :1825-1826 / :1898-1899). Our
   luma left index wraps at mi_row 16, so the first block of SB row 2 read a
   stale slot: ctx 1 instead of 0. First divergent bool of a real 320x240 frame
   was #74792, block mi_row 16 mi_col 0, coef_probs[TX_4X4][Y][band 0][ctx]:
   oracle prob 195 (ctx 0) vs ours 84 (ctx 1) - everything before it agreed
   bit-for-bit.
2. loopfilter.rs: the chroma ss11 row-group extents were gated on the visible
   chroma height; libvpx iterates MI rows (`r += 4`, vp9_loopfilter.c:1400;
   horizontal `r += 2`, :1431), so a group whose first MI row is inside the
   frame is filtered even when its 8 chroma rows overhang the visible height.
   1080p lost chroma rows 536-539 (last SB row, mi_rows 135); the level read
   also goes through a bounds-safe `level_at` now.

Evidence (all reproduced independently by a reviewer in hermetic scratch
copies): real 320x240 0/3 -> 3/3 byte-exact; 1080p single-tile 0/3 -> 3/3;
1080p with 4 tile columns refused -> 3/3 (both this and the BE tile-prefix fix
meet here); keyframe_exact 4/4 and the whole crate green; 5 lib warnings
unchanged. Reverting either hunk alone regresses the matching sweep.

Also: lanes/realdesync.report.md (the diagnosis: first divergent decision,
ranked causes, the tile-row class caveat) and a report section recording that
the tile-ROW path (log2_tile_rows > 0) is NOT correct yet - three pre-existing
defects isolated there, listed in lanes/vp9kf.report.md.