forge
Explore
Log in

Don't you dare go Hollow

lane-av1422warp: the bands MATCH at mi(64,24) -- and round 15's mystery is a NULL deref

Browse files at this commit

02e6f270fa9a156262fffb9e1e45602d50dfdc8fAhmet Kaan GümüşParent: 50341ea
Report only; tree byte-identical to 02919127, aomdec restored (744
name=mode lines, zero stray strings), 4:2:0 control byte-exact.

Build discipline first: touch before ninja, and the known-firing rung
verified at 744 name=mode lines before trusting any new field.

ROUND 15's MYSTERY SOLVED. The MODECTX rung there did not fail to fire
-- it fired, printed for the first block, and the process then DIED:
above_mi is NULL for a block on the frame's first row (left_mi on the
first column), and the unguarded above_mi->mode dereference killed the
decode so nothing after that line was emitted. A MODEMARK printed
BEFORE the field access made it unambiguous (1 marker, 0 mode lines).
Guarded, the extended print works and the rung returns to 744. Round
15's conclusion was an artefact of a NULL dereference and is now closed.

THE BAND-MATCH VERDICT: THEY MATCH. Oracle at mi(64,24):
    EC_ISTEP mi_row=64 mi_col=24 name=mode val=6 rng=44416
             above_mode=0 left_mode=6
against ours above_mode=0 left_mode=6 above_ctx=0 left_ctx=4 ->
mode=1. Compared across all 744 mode reads (ours from all three
kf_y_mode sites: square, rect, sub-8) the contexts are identical up to
and including mi(64,24) (oracle mode-read index 723 of 744). The 37 raw
differences are all libaom's NULL neighbour (-1) against our DC_PRED,
which get_y_mode_cdf maps to the same context; after that mapping 17
remain and EVERY one is at index >= 724, strictly after the divergence.

So not a neighbour-lookup defect: the lane-rectx r5 mi-exact override
hypothesis is RULED OUT for this block -- the square path's coarse bands
carry exactly what libaom's above_mbmi/left_mbmi carry here.

The defect is therefore the kf_y_mode[0][4] TABLE STATE, not the row.
AV1's aom_read_symbol adapts backwards as well as forwards, so a read
from a NEIGHBOURING row can move [0][4] without moving a bit position
and the ladder cannot see it.

Unblock: print kf_y_mode[0][4] immediately before the mi(64,24) mode
read on both sides. If the entry already differs the drift is upstream
and walkable across the 723 preceding reads; if it agrees and only the
decoded value differs, the defect is in the symbol decode itself.
lanes/av1422warp.report.mdmodified+62 -2
@@ -392,6 +392,63 @@ tx_size lookup (the oracle's `get_tx_size_context` for that block is
392 printable and ours computes the same `above + left` form as everywhere392 printable and ours computes the same `above + left` form as everywhere
393 else).393 else).
394 394
395+### Round 17 — MEASURED: the bands MATCH, and round 15's mystery is solved
396+
397+Build discipline first: `touch` before `ninja`, and the known-firing rung
398+verified at **744 `name=mode` lines** before any new field was trusted.
399+All instrumentation reverted; `aomdec` restored (744 lines, zero stray
400+strings), 4:2:0 control byte-exact.
401+
402+**Round 15's mystery, solved.** The `MODECTX` rung there did not
403+"fail to fire" — it fired, printed for the first block, and then the
404+**process died**. `above_mi` is NULL for a block on the frame's first
405+row (and `left_mi` on its first column), and the unguarded
406+`above_mi->mode` dereference killed the decode, so nothing after that
407+one line was ever emitted. A `MODEMARK` printed BEFORE the field access
408+made it unambiguous: 1 marker, 0 mode lines. Guarded
409+(`above_mi ? above_mi->mode : -1`), the extended print works and the
410+rung returns to 744. **Round 15's conclusion was an artefact of a NULL
411+dereference, and is now closed rather than left as a mystery.**
412+
413+**The band-match verdict: THEY MATCH.** With the guard, the oracle at
414+mi(64,24) reports
415+
416+```
417+EC_ISTEP mi_row=64 mi_col=24 name=mode val=6 rng=44416 above_mode=0 left_mode=6
418+```
419+
420+against ours `above_mode=0 left_mode=6 above_ctx=0 left_ctx=4 -> mode=1`.
421+Compared across the WHOLE frame — all 744 mode reads, ours from all
422+three `kf_y_mode` sites (square, rect, sub-8) — the contexts are
423+identical up to and including mi(64,24) (oracle mode-read index 723 of
424+744). The 37 raw differences are all libaom's NULL neighbour (`-1`)
425+against our `DC_PRED`, which `get_y_mode_cdf` maps to the same context;
426+after that mapping 17 remain, and **every one of them is at index >= 724,
427+i.e. strictly after the divergence**. The first differing context is the
428+first one downstream of it.
429+
430+**So: not a neighbour-lookup defect.** The lane-rectx r5 mi-exact
431+override hypothesis is **ruled out** for this block — the square path's
432+coarse bands carry exactly what libaom's `above_mbmi` / `left_mbmi`
433+carry here. (Whether the square path *should* use the mi-exact map
434+generally is a separate question this block does not answer.)
435+
436+**Where that leaves the defect.** Same context, same bit position,
437+different symbol value (1 against 6) — so the divergence is the
438+`kf_y_mode[0][4]` **table state**, not the row. AV1's
439+`aom_read_symbol` adapts backwards as well as forwards, so a read from a
440+NEIGHBOURING row can move `[0][4]` without moving any bit position, and
441+the ladder cannot see that. Main's step 4 is therefore the live
442+question and the one worth the next round.
443+
444+**Unblock.** Print `kf_y_mode[0][4]` (and the whole `kf_y_mode` table, or
445+just that entry) immediately BEFORE the mi(64,24) mode read on both
446+sides. If the entry already differs, the drift is upstream and the
447+first read that moved it is findable by walking the table backwards
448+across the 723 preceding mode reads. If the entry agrees and only the
449+decoded value differs, the defect is in the symbol decode itself, not
450+in the table — a much narrower target.
451+
395 ### Round 16 — the unblock was NOT completed, and a build hazard was found452 ### Round 16 — the unblock was NOT completed, and a build hazard was found
396 453
397 No code change; `aomdec` restored to its committed shape454 No code change; `aomdec` restored to its committed shape
@@ -456,8 +513,11 @@ MODECTXM mi=(64,24) above_mode=0 left_mode=6 above_ctx=0 left_ctx=4
456 ```513 ```
457 514
458 **The oracle side could not be measured, and this lane will not guess515 **The oracle side could not be measured, and this lane will not guess
459-past that — see round 16, which found the likely reason and leaves the516+past that — SOLVED in round 17: the rung fired and the unguarded
460-conclusion UNVERIFIED.** A `MODECTX` rung placed immediately above517+`above_mi->mode` dereference killed the decode at the frame's first
518+row, so nothing after the first line was ever emitted. Guarded, the
519+extended print works. Round 15's "does not fire" was a NULL
520+dereference, not a property of the decoder. A `MODECTX` rung placed immediately above
461 `mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi,521 `mbmi->mode = read_intra_mode(r, get_y_mode_cdf(ec_ctx, above_mi,
462 left_mi))` in `decodemv.c:936`, rebuilt, with its format string522 left_mi))` in `decodemv.c:936`, rebuilt, with its format string
463 confirmed present in the binary and the env var set, emits nothing —523 confirmed present in the binary and the env var set, emits nothing —