From aabeeaf8825577a1ee548bd484a92039e8db4e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Sep 2026 15:31:48 +0300 Subject: [PATCH] fix(av1): a var-tx inter block published its parent's side into the partition-context bands The `vartx_leaves` branch of `decode_inter_block` called `record_split_luma_rect_mi(at, side, side, ..)` on the premise that "a var-tx block is always square". A superblock-level PARTITION_VERT inter strip is 32x64 with `side == 64`, so every such strip stamped 64 into `above_side_mi`/`left_side_mi` instead of its own 32x64. The next superblock's 64-level partition context then read `above_side_mi*2 <= 64` as false and picked CDF row 0 where libaom picked row 1. Class `tx-grid-published-block-side` (7th instance). On the pinned 192x68 cq61 tile_cols=1 8-bit stream the 64x64 partition of mi(16,32) now enters and exits at the oracle's ranges (ctx 0 -> 1, rng 51641 -> 38495, aomdec EC_PART ctx=13 = bsl*4+1); the edge-straddling gate goes 3622 -> 3376 differing pixels. Residue is a frame-1 reconstruction defect (mode and coefficient ladders of frame 1 are now element-exact vs the instrumented oracle) -- see lanes/mergefix-r3.report.md. --- crates/ec-av1/src/decode.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index fcb971d7..b14a1537 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -20850,9 +20850,13 @@ fn decode_inter_block( if vartx_leaves.is_some() { // Plane 0 is already correct per transform unit // ([`Neighbours::record_mi_luma`] above); this writes everything else - // [`Neighbours::record_rect`] would (a var-tx block is always square, - // so `write_w == write_h == side`). - neighbours.record_split_luma_rect_mi(at, side, side, mode_for_tx, uv_predict_mode, [&u_grid, &v_grid]); + // [`Neighbours::record_rect`] would. + // lane-mergefix r3 (class `tx-grid-published-block-side`): a var-tx + // block is NOT always square -- a superblock-level PARTITION_VERT + // inter strip is 32x64 with `side == 64`, and publishing `side, side` + // stamped the PARENT's 64 into `above_side_mi`/`left_side_mi`, so the + // next superblock's partition ctx read 0 where libaom read 1. + neighbours.record_split_luma_rect_mi(at, write_w, write_h, mode_for_tx, uv_predict_mode, [&u_grid, &v_grid]); } else { neighbours.record_rect_mi( at,