From 5a6ca9d707aceb2c14aa11dab83f5336bb7cf825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 28 Sep 2026 11:13:52 +0300 Subject: [PATCH] lane-av1422warp: run the bit-position bisect on defect 3; narrows it to 6 bits Report only. No code change -- the tree is byte-identical to 109e8e6f. The EC_AV1_ALLOW_422_PROBE bypass is reverted, and the oracle's instrumented aomdec has been rebuilt to its committed shape (my EC_COEFF_STEP bitpos prints are gone; `strings aomdec | grep -c bitpos` = 0). I added an exact bit position to the coefficient rungs on BOTH sides -- ours via the existing SymbolDecoder::debug_bitpos() (msac.rs:520), the oracle via aom_reader_tell(r) in decodetxb.c -- rebuilt aomdec with ninja, and paired the all_zero-level traces on bit position instead of the colliding 16-bit rng. The result is a clean constant, and it is the strongest statement this lane can make about the desync: the offset is a CONSTANT -14 for every coefficient unit from 0 through 1418 (a fixed convention difference between the two tell()s), and at unit 1419 it becomes -20. Relative to that baseline we are exactly 6 BITS AHEAD. Whatever the defect is, between unit 1418's txb_skip read and unit 1419's we consume 6 more bits than libaom -- a small, bounded magnitude, not a whole skipped block or a mis-sized symbol read. It does not name the symbol, and the report says so rather than guessing. I extended the same bitpos field to the per-coefficient tag=base / tag=br prints to bisect inside the window; a bit-anchored greedy alignment of the two step streams does not work, because the two readers traverse a transform unit's coefficients in DIFFERENT ORDERS (the oracle runs read_coeffs_reverse_2d with c descending; ours emits a different unit's c=53,52,51) and the streams have no index correspondence -- 32500 oracle steps against 16464 of ours. Matching on bit position alone is ambiguous and the alignment breaks within the first few hundred steps, far short of the window. The report records this so the next lane does not trust a step-index pairing here. Refined unblock, replacing the previous one: restrict the per-coefficient pairing to ONE transform unit at a time (pair on the unit's own coordinates, per ec-av1-oracle-trace-pairing's "restrict pairing to one frame/block" rule) rather than to the whole step stream. The 6-bit magnitude says the target is very close -- that unit's tail, or the mode reads between two units. --- lanes/av1422warp.report.md | 63 +++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 7 deletions(-) diff --git a/lanes/av1422warp.report.md b/lanes/av1422warp.report.md index 9b205859..85376a13 100644 --- a/lanes/av1422warp.report.md +++ b/lanes/av1422warp.report.md @@ -196,15 +196,64 @@ a missing read, and the `EC_ISTEP` line ORDER is not comparable between the two builds (the oracle's trace jumps back from mi(50,26) to mi(48,28)), so the step-by-step pairing cannot be used to bracket the extra read either. +### The bit-position bisect (run; narrows it, does not close it) + +I added an exact bit position to the coefficient rungs on BOTH sides — ours via +the existing `SymbolDecoder::debug_bitpos()` (`msac.rs:520`), the oracle via +`aom_reader_tell(r)` in `decodetxb.c`'s `EC_COEFF_STEP` prints — rebuilt +`aomdec` with ninja, and paired the all_zero-level traces on bit position rather +than on the colliding 16-bit `rng`. Both rungs have since been reverted (the +oracle's `aomdec` is rebuilt to its committed shape; `strings aomdec | grep -c +bitpos` = 0). + +The result is a clean constant, and it is the strongest statement this lane can +make about the desync: + +``` +unit oracle bit ours bit delta +1414 56335 56349 -14 +1415 56347 56361 -14 +1416 56374 56388 -14 +1417 56424 56438 -14 +1418 56469 56483 -14 <- last unit that pairs +1419 56507 56527 -20 <- first divergent unit +``` + +The offset is a **constant -14** for every unit from 0 to 1418 — a fixed +convention difference between `debug_bitpos` and `aom_reader_tell`, nothing more. +At unit 1419 it becomes **-20**: relative to that baseline we are **exactly 6 bits +ahead**. So whatever the defect is, between unit 1418's `txb_skip` read and unit +1419's, we consume 6 more bits than libaom. That is a magnitude, and it is +bounded and small — not a whole skipped block or a whole mis-sized symbol read. + +**Why this does not name the symbol.** I extended the same `bitpos` field to the +per-coefficient `tag=base` / `tag=br` prints to bisect inside the window, and +tried a bit-anchored greedy alignment of the two step streams. It does not work, +and the reason is worth recording: the two readers traverse a transform unit's +coefficients in DIFFERENT ORDERS (the oracle goes `read_coeffs_reverse_2d`, `c` +descending from `end_si`; ours emits `c=53, c=52, c=51` on what is plainly a +different unit), so their step streams have no index correspondence — 32500 +oracle steps against 16464 of ours. Matching on bit position alone is ambiguous +and the alignment breaks within the first few hundred steps, long before the +window of interest. **A next lane must not trust a step-index pairing here.** + +The workable refinement, which this lane did not have the budget to run: restrict +the comparison to ONE transform unit at a time (pair on the unit's own +coordinates, per the `ec-av1-oracle-trace-pairing` skill's "restrict pairing to +one frame/block" rule) rather than to the whole step stream. The 6-bit magnitude +says the target is very close — the same unit's tail, or the mode reads between +two units. + ### Unblock -Bisect the bit position directly, not through the 16-bit `rng` the rungs print -(it collides and the two traces interleave differently). Concretely: add an -`EC_BITPOS` rung to the oracle's `aom_read_symbol`/header read and to ours, -then diff the two symbol sequences between mi(50,26)'s last chroma unit and -mi(50,28)'s `skip`. The 4:2:2-only constructs in that window are the candidates: -the chroma-reference bookkeeping for the shared mi(50,27) column, and whatever -the 4:2:2 block tail reads after the shared chroma. Fixtures and dumps are in +The bit-position bisect below has been run and narrows this to a **6-bit** +excess consumed between unit 1418's and unit 1419's `txb_skip` reads. Continue +by restricting the per-coefficient step pairing to a SINGLE transform unit at a +time — the whole-stream pairing does not work, because the two readers traverse +a unit's coefficients in different orders. The 4:2:2-only constructs in that +window remain the candidates: the chroma-reference bookkeeping for the shared +mi(50,27) column, and whatever the 4:2:2 block tail reads after the shared +chroma. Fixtures and dumps are in `~/.cache/av1422warp/` (`a1_f0.obu`, `f0.opred`, `f0.mpred`, `f0.ocoeff`, `f0.mcoeff`, `f0.ostep`, `f0.step`, `f0.otx`); the probe bypass (`EC_AV1_ALLOW_422_PROBE`) is reverted and in no commit.