forge
Explore
Log in

Don't you dare go Hollow

wip(av1): TELL-checkpoint ladder falsifies the r7 interintra suspect; real divergence is at the VERY FIRST partition symbol of frame 1's own tile, before any mode-info read. Round 8, capped at budget.

Browse files at this commit

206379a40d70e40a0ed30acaa5f2117250e7f679Ahmet Kaan GümüşParent: 21c8320
Method (per symbol-consumption-gap class rule): added TELL checkpoints
(decode.rs, gated EC_AV1_TELL) at block_entry (decode_inter_block, right
before skip_mode), post_is_inter, post_ref_frame, post_assign_mv, mirrored
in /tmp/libaom-src/av1/decoder/decodemv.c (post_ref_frame, post_assign_mv)
-- av1/decoder/decodeframe.c already had an unconditional EC_PART/EC_PART_VAL
partition-read trace, reused as-is.

Result for the pin block (mi(0,0), decode-order frame 1, bsize=32):
  aomdec: EC_PART tell=1 (128-level, implicit split, 0 bits) -> EC_PART
  bsize=12(64x64) ctx=12 tell=1, EC_PART_VAL value=3(SPLIT) -> EC_PART
  bsize=9(32x32) ctx=8 tell=4, EC_PART_VAL value=0(NONE) -> mode info starts
  at tell=4, post_is_inter tell=5, post_ref_frame tell=7, post_assign_mv
  tell=15.
  ours: block_entry (i.e. after our own 64->32 partition read, same 2
  symbols: partition_w64 SPLIT then partition_w32 NONE, decode.rs:6984/7007)
  tell=19 already -- post_is_inter tell=19, post_ref_frame tell=21,
  post_assign_mv tell=29.

The frame is confirmed exactly 64x64 (EC_PART only ever visits
mi(0,0)/(0,8)/(8,0)/(8,8), one real 64x64 SB), so the 128-level implicit
split costing 0 bits on both sides is correct and NOT the gap (the
sb128 r1/r2 "not causal for 64x64x4" proof still holds for this file).
Both decoders read the SAME TWO real partition symbols with the SAME
decoded values (SPLIT then NONE) and reach the SAME leaf shape (side=32)
-- but ours costs ~15 more bits for those same two symbol VALUES than
aomdec does. A same-value, wildly different bit cost across the very
first two symbols read in the tile is the signature of a CDF-CONTENT
bug, not a missing/extra symbol read: either partition_w64[sb_ctx] or
partition_w32[ctx32]'s actual probability table entering this frame's
tile is badly skewed relative to aomdec's -- most likely explained by
this frame's own CDF *forwarding* from frame 0 (the preceding key
frame) carrying a wrong/stale partition CDF into frame 1, since a
freshly-initialized default CDF would decode the same value at
essentially the same cost aomdec's does.

This FALSIFIES the round 8 charter's primed suspect (the interintra
read at decode.rs:5391-5411): mv/ref/interintra/motion_mode/interp_filter
are all downstream of an interval that has already desynced by the time
`decode_inter_block` is even entered -- there is no still-unverified
syntax element to isolate there. `enable_interintra_compound`'s own gate
logic (BLOCK_8X8..=BLOCK_32X32, single-ref, SINGLE_INTER_MODE range) was
cross-checked against libaom's is_interintra_allowed/_bsize/_mode/_ref
and matches exactly -- CLOSE this suspect.

NEW PRIME SUSPECT for round 9: this frame's own partition_w64/partition_w32
CDF forwarding from the preceding key frame (Cdfs::forward or whatever
this crate's primary_ref_frame path calls) -- read cdf_state.rs's
forwarding code, diff the two partition CDF tables' actual byte values
entering frame 1's tile against libaom's own `cm->fc` right after
`av1_setup_frame_size`/`load_previous_frame_stats`/whatever gates the
CDF copy (decodeframe.c `read_uncompressed_header`'s primary_ref_frame
branch), NOT any single-block syntax read.

TELL checkpoints left in place under EC_AV1_TELL (decode.rs:
block_entry/post_is_inter/post_ref_frame/post_assign_mv) and libaom
decodemv.c (post_ref_frame/post_assign_mv) for round 9 to extend up
through the partition CDF dump itself.

Repro: EC_AV1_TELL=1 EC_AV1_PIN=<pin> EC_AV1_PIN_N=24 cargo test -p ec-av1
--release --lib scratch_isolate_pinned_mismatch -- --ignored --nocapture
crates/ec-av1/src/decode.rsmodified+25 -0
@@ -4660,6 +4660,12 @@ fn decode_inter_block(
46604660 let (cpx, cpy) = (px / 2, py / 2);
46614661 let chroma_side = side / 2;
46624662
4663+ if std::env::var_os("EC_AV1_TELL").is_some() {
4664+ eprintln!(
4665+ "TELL mi_row={} mi_col={} label=block_entry side={side} tell={}",
4666+ r * SUB_MI as usize, c * SUB_MI as usize, dec.debug_bitpos()
4667+ );
4668+ }
46634669 let skip_mode_ctx =
46644670 usize::from(neighbours.above_skip_mode[c]) + usize::from(neighbours.left_skip_mode[r]);
46654671 // lane-comppin r3: skip_mode desync isolation -- dump ctx + the pre-read
@@ -4689,6 +4695,12 @@ fn decode_inter_block(
46894695 let (above_inter, left_inter) = (neighbours.above_inter[c], neighbours.left_inter[r]);
46904696 let ii_ctx = intra_inter_ctx(has_above, has_left, above_inter, left_inter);
46914697 let is_inter = skip_mode || dec.symbol(&mut cdfs.intra_inter[ii_ctx]) == 1;
4698+ if std::env::var_os("EC_AV1_TELL").is_some() {
4699+ eprintln!(
4700+ "TELL mi_row={} mi_col={} label=post_is_inter skip_mode={skip_mode} skip={skip} is_inter={is_inter} tell={}",
4701+ r * SUB_MI as usize, c * SUB_MI as usize, dec.debug_bitpos()
4702+ );
4703+ }
46924704
46934705 let mode_for_tx;
46944706 let (luma_grid, u_grid, v_grid);
@@ -5278,6 +5290,13 @@ fn decode_inter_block(
52785290 neighbours.left_ref1[r],
52795291 );
52805292 ref_frame_for_lf = ref_frame;
5293+ if std::env::var_os("EC_AV1_TELL").is_some() {
5294+ let (mi_row, mi_col) = (r * SUB_MI as usize, c * SUB_MI as usize);
5295+ eprintln!(
5296+ "TELL mi_row={mi_row} mi_col={mi_col} label=post_ref_frame ref={ref_frame} tell={}",
5297+ dec.debug_bitpos()
5298+ );
5299+ }
52815300 // round 4-9 (lane-av1golden..lane-av1golden7): GOLDEN_FRAME's own
52825301 // stacked defects (lf_level ref/mode-delta forwarding, the
52835302 // switchable_interp ref-frame ctx gate, and a film-grain synthesis
@@ -5388,6 +5407,12 @@ fn decode_inter_block(
53885407 };
53895408 (mv, false)
53905409 };
5410+ if std::env::var_os("EC_AV1_TELL").is_some() {
5411+ eprintln!(
5412+ "TELL mi_row={mi_row} mi_col={mi_col} label=post_assign_mv tell={}",
5413+ dec.debug_bitpos()
5414+ );
5415+ }
53915416 // lane-sb128 r4: `interintra` (spec 5.11.24; libaom
53925417 // `decodemv.c` read_inter_block_mode_info ~1490-1510), placed
53935418 // right after `assign_mv` and before `read_motion_mode` below --