forge
Explore
Log in

Don't you dare go Hollow

lane-av1422warp: run the bit-position bisect on defect 3; narrows it to 6 bits

Browse files at this commit

5a6ca9d707aceb2c14aa11dab83f5336bb7cf825Ahmet Kaan GümüşParent: 287d154
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.mdmodified+56 -7
@@ -196,15 +196,64 @@ a missing read, and the `EC_ISTEP` line ORDER is not comparable between the two
196196 builds (the oracle's trace jumps back from mi(50,26) to mi(48,28)), so the
197197 step-by-step pairing cannot be used to bracket the extra read either.
198198
199+### The bit-position bisect (run; narrows it, does not close it)
200+
201+I added an exact bit position to the coefficient rungs on BOTH sides — ours via
202+the existing `SymbolDecoder::debug_bitpos()` (`msac.rs:520`), the oracle via
203+`aom_reader_tell(r)` in `decodetxb.c`'s `EC_COEFF_STEP` prints — rebuilt
204+`aomdec` with ninja, and paired the all_zero-level traces on bit position rather
205+than on the colliding 16-bit `rng`. Both rungs have since been reverted (the
206+oracle's `aomdec` is rebuilt to its committed shape; `strings aomdec | grep -c
207+bitpos` = 0).
208+
209+The result is a clean constant, and it is the strongest statement this lane can
210+make about the desync:
211+
212+```
213+unit oracle bit ours bit delta
214+1414 56335 56349 -14
215+1415 56347 56361 -14
216+1416 56374 56388 -14
217+1417 56424 56438 -14
218+1418 56469 56483 -14 <- last unit that pairs
219+1419 56507 56527 -20 <- first divergent unit
220+```
221+
222+The offset is a **constant -14** for every unit from 0 to 1418 — a fixed
223+convention difference between `debug_bitpos` and `aom_reader_tell`, nothing more.
224+At unit 1419 it becomes **-20**: relative to that baseline we are **exactly 6 bits
225+ahead**. So whatever the defect is, between unit 1418's `txb_skip` read and unit
226+1419's, we consume 6 more bits than libaom. That is a magnitude, and it is
227+bounded and small — not a whole skipped block or a whole mis-sized symbol read.
228+
229+**Why this does not name the symbol.** I extended the same `bitpos` field to the
230+per-coefficient `tag=base` / `tag=br` prints to bisect inside the window, and
231+tried a bit-anchored greedy alignment of the two step streams. It does not work,
232+and the reason is worth recording: the two readers traverse a transform unit's
233+coefficients in DIFFERENT ORDERS (the oracle goes `read_coeffs_reverse_2d`, `c`
234+descending from `end_si`; ours emits `c=53, c=52, c=51` on what is plainly a
235+different unit), so their step streams have no index correspondence — 32500
236+oracle steps against 16464 of ours. Matching on bit position alone is ambiguous
237+and the alignment breaks within the first few hundred steps, long before the
238+window of interest. **A next lane must not trust a step-index pairing here.**
239+
240+The workable refinement, which this lane did not have the budget to run: restrict
241+the comparison to ONE transform unit at a time (pair on the unit's own
242+coordinates, per the `ec-av1-oracle-trace-pairing` skill's "restrict pairing to
243+one frame/block" rule) rather than to the whole step stream. The 6-bit magnitude
244+says the target is very close — the same unit's tail, or the mode reads between
245+two units.
246+
199247 ### Unblock
200248
201-Bisect the bit position directly, not through the 16-bit `rng` the rungs print
202-(it collides and the two traces interleave differently). Concretely: add an
203-`EC_BITPOS` rung to the oracle's `aom_read_symbol`/header read and to ours,
204-then diff the two symbol sequences between mi(50,26)'s last chroma unit and
205-mi(50,28)'s `skip`. The 4:2:2-only constructs in that window are the candidates:
206-the chroma-reference bookkeeping for the shared mi(50,27) column, and whatever
207-the 4:2:2 block tail reads after the shared chroma. Fixtures and dumps are in
249+The bit-position bisect below has been run and narrows this to a **6-bit**
250+excess consumed between unit 1418's and unit 1419's `txb_skip` reads. Continue
251+by restricting the per-coefficient step pairing to a SINGLE transform unit at a
252+time — the whole-stream pairing does not work, because the two readers traverse
253+a unit's coefficients in different orders. The 4:2:2-only constructs in that
254+window remain the candidates: the chroma-reference bookkeeping for the shared
255+mi(50,27) column, and whatever the 4:2:2 block tail reads after the shared
256+chroma. Fixtures and dumps are in
208257 `~/.cache/av1422warp/` (`a1_f0.obu`, `f0.opred`, `f0.mpred`, `f0.ocoeff`,
209258 `f0.mcoeff`, `f0.ostep`, `f0.step`, `f0.otx`); the probe bypass
210259 (`EC_AV1_ALLOW_422_PROBE`) is reverted and in no commit.