forge
Explore
Log in

Don't you dare go Hollow

lane-av1422warp: the defect-3 dc-sign VERDICT -- our value is wrong, the rect

Browse files at this commit

3d97c32405002df3b49d9a72142107cc0d41701aAhmet Kaan GümüşParent: 50a0927
path votes over luma unit counts

Report only. No code change; the tree is byte-identical to 2959d233, the
EC_AV1_ALLOW_422_PROBE bypass is reverted, and the oracle's instrumented
aomdec is rebuilt to its committed shape (grep -c DCSIGN = 0).

VERDICT, the thing the last round left open: our dc_sign_ctx value is
GENUINELY wrong, not a drifted CDF adaptation state.

First, a wrong turn recorded so nobody repeats it: our dc_sign_ctx TABLE is
correct. libaom's dc_sign_contexts is 65 entries read at dc_sign + 32;
extracted programmatically it is dc_sign < 0 -> 1, == 0 -> 0, > 0 -> 2,
which is exactly what dc_sign_ctx's signum buckets compute. A hand count
of that table literal reads as a different mapping and would have sent the
next lane after a non-bug. Verified programmatically, not by eye.

The VOTE differs. Ours resolves ctx 0, libaom resolves ctx 1, i.e.
libaom's dc_sign is negative and ours is 0. Our own EC_DCDUMP at the block
in question names the input:

    EC_DCDUMP mi=(48,28) plane=2 wh=(16,8) vote=0
      above=[None/6, None/6, Some(false)/7, Some(false)/7]   FOUR cells
      left =[Some(true)/7, Some(true)/7]                     TWO cells

wh=(16,8) is the block's LUMA footprint, so the rect path summed the vote
over 4 above + 2 left cells. The unit being decoded is the 8x8 V CHROMA
transform, whose own txb_w_unit/txb_h_unit are 2 and 2 -- libaom reads two
above cells. Dropping two above cells can drop a negative contribution and
produce exactly the 0 we resolve.

THE CAUSE: the 4:2:2 chroma correction exists but is not wired into this
path. around_mi_422_chroma -- whose own comment says libaom reads its above
votes over txb_w_unit CHROMA 4-px cells and that sampling every second above
cell IS libaom's sum -- is reached 1653 times on this stream, but NOT for
this block: mi(48,28) prints EC_DCDUMP, not EC_DCDUMP422. The rect path
(around_mi_rect) has no 4:2:2 variant, so a 4:2:2 RECT block votes over the
luma unit counts. Same neighbour-read family as the smooth_uv fix, same
file, same reason: a per-axis shape correction applied to some paths and
not to the rect one.

This lane ran out of budget before landing the fix; handed off with the
evidence. Refined unblock: route the rect path's dc-sign vote through
around_mi_422_chroma the way the square/leaf paths already are.

On Main's caution about the scan-table finding: CHECKED, and the caution
does not explain it. Unit 1418 is mi(48,28) plane 2 and it PAIRED on both
sides as 8x8 with an identical prediction sum (9024); the tiling divergence
(TX_4X4 vs TX_8X8) is at unit 1419, the NEXT unit. So unit 1418 is 8x8
on both sides and "a different scan table by design because the tx size
differs" does not apply to it. The finding stands, second priority.
lanes/av1422warp.report.mdmodified+56 -0
@@ -294,6 +294,62 @@ VALUES match by scan index on both sides, so this does not by itself move a bit,
294 but it places coefficients in the wrong cells and would corrupt the transform294 but it places coefficients in the wrong cells and would corrupt the transform
295 independently of the entropy question.295 independently of the entropy question.
296 296
297+### The dc-sign verdict: the VALUE is wrong, and the input is the rect path
298+
299+Rung on both sides: ours is the existing `EC_DCDUMP` (which prints the vote and
300+every sampled neighbour cell), the oracle's is a new `DCSIGN` print in
301+`get_txb_ctx_general` reading `txb_ctx->dc_sign_ctx`, its `dc_sign` sum, and the
302+individual `a[]`/`l[]` sign fields over `txb_w_unit`/`txb_h_unit`. Both reverted
303+(oracle `aomdec` rebuilt, `grep -c DCSIGN` = 0).
304+
305+**First, a wrong turn worth recording: our `dc_sign_ctx` table is CORRECT.**
306+libaom's `dc_sign_contexts` is 65 entries read at `dc_sign + 32`; extracted
307+programmatically it is `dc_sign < 0 -> 1`, `== 0 -> 0`, `> 0 -> 2`, which is
308+exactly what [`dc_sign_ctx`]'s `signum` buckets compute. A hand count of that
309+table literal suggests a different mapping and would have sent the next lane
310+after a non-bug; the table is fine.
311+
312+**The vote differs.** libaom's own print at the neighbouring units is shaped
313+`dc_sign=-4 ctx=1 above=[-1,-1,-1,-1] left=[0,0,0,0,0,0,0,0]` — and the symbol
314+ladder showed the oracle resolving ctx **1** where we resolve **0**, i.e.
315+libaom's `dc_sign` is negative and ours is 0.
316+
317+**The input, from our own `EC_DCDUMP` at the block in question:**
318+
319+```
320+EC_DCDUMP mi=(48,28) plane=2 wh=(16,8) vote=0
321+ above=[None/6, None/6, Some(false)/7, Some(false)/7] <- FOUR cells
322+ left =[Some(true)/7, Some(true)/7] <- TWO cells
323+```
324+
325+`wh=(16,8)` is the block's LUMA footprint, so the rect path summed the vote over
326+**4 above + 2 left** cells. The unit actually being decoded is the 8x8 V CHROMA
327+transform, whose own `txb_w_unit`/`txb_h_unit` are **2 and 2** — libaom reads two
328+above cells, not four. Dropping two above cells can drop a negative contribution
329+and turn a negative vote into exactly the 0 we produce.
330+
331+**So: the 4:2:2 chroma correction exists but is not wired into this path.**
332+[`around_mi_422_chroma`] — the function whose own comment says "libaom
333+`get_txb_ctx_general` reads its above votes over `txb_w_unit` CHROMA 4-px cells,
334+and at ss_x 1 one chroma cell spans TWO luma mi columns... Sampling every second
335+above cell counts each chroma column once, which IS libaom's sum" — is reached
336+1653 times on this stream, but NOT for this block: mi(48,28) prints
337+`EC_DCDUMP`, not `EC_DCDUMP422`. The **rect** path (`around_mi_rect`) has no 4:2:2
338+variant, so a 4:2:2 RECT block votes over the luma unit counts.
339+
340+That is the same neighbour-read family as the `smooth_uv` fix, in the same file,
341+for the same reason: a per-axis shape correction that was applied to some paths
342+and not to the rect one. **This lane ran out of budget before landing the fix**;
343+it is handed off here with the evidence above.
344+
345+**On the scan-table finding (Main's caution): checked, and the caution does not
346+explain it.** Unit 1418 is mi(48,28) plane 2 and it PAIRED on both sides as 8x8
347+with an identical prediction sum (9024) — the tiling divergence (TX_4X4 vs
348+TX_8X8) is at unit 1419, the NEXT unit. So unit 1418 is 8x8 on both sides and a
349+"different scan table by design because the tx size differs" explanation does not
350+apply to it. The finding stands, though it may still be downstream of something
351+else; it is second priority to the vote.
352+
297 ### Unblock353 ### Unblock
298 354
299 The per-TU window bisect below has been run and NAMES the read: the **DC sign355 The per-TU window bisect below has been run and NAMES the read: the **DC sign