From e9a6ad820388c151d358aebd2dbcbc60505802c9 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 13:14:30 +0300 Subject: [PATCH] lane-av1422warp: instrument -- EC_SYMR carries the CDF table name No behaviour change: set_symr_cdf only feeds the env-gated print. Identity re-proved after the edit: 4:2:0 control a420.obu byte-identical to aomdec --rawvideo, 4:4:4 444_sb128rect_lr_witness.obu byte-identical to the pre-lane build, both pinned 422 witnesses pixel-exact. `cdf0` alone cannot identify a table -- two rows can share a first entry -- which is what stopped round 27 from naming the two missing reads. EC_SYMR now prints `cdf=`, set at the read sites for the tables in this window: interintra, comp_group_idx, compound_idx (both sides; the oracle's tags are snapshotted separately). With the oracle side tagged, read 107517 at mi(30,62) carries `cdf=interintra` and the two reads this decoder omits sit either side of it. That is NOT yet an attribution: the matching gate on our side (`enable_interintra_compound && !skip_mode`) is TRUE on every one of its 451 firings, so this decoder is not skipping the interintra read there, and the cdf tag on our side has not been verified against a known read. Recorded in the report as an open question rather than closed. --- crates/ec-av1/src/decode.rs | 6 ++++++ crates/ec-av1/src/msac.rs | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 0dc7f071..b1d5987f 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -33539,6 +33539,7 @@ fn decode_inter_block( && enable_masked_compound && is_any_masked_compound_used_here(write_w, write_h) { + crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx"); dec.symbol(&mut cdfs.comp_group_idx[group_ctx]) } else { 0 @@ -33831,6 +33832,7 @@ fn decode_inter_block( ref_order_hints[(ref0 - LAST_FRAME) as usize], ref_order_hints[(ref1 - LAST_FRAME) as usize], ); + crate::msac::SymbolDecoder::set_symr_cdf("compound_idx"); let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]); if crate::envflags::env_flag!("EC_TRACE_MODE") { eprintln!( @@ -34998,6 +35000,7 @@ fn decode_inter_block( // TRUE footprint -- a 16x8 strip is group 1, a 32x16 strip // group 2, not their square `side`'s 2/3. let bsize_group = size_group_wh(write_w, write_h); + crate::msac::SymbolDecoder::set_symr_cdf("interintra"); let interintra = dec.symbol(&mut cdfs.interintra[bsize_group]) == 1; if interintra { // lane-interintra r1 (decodemv.c 1540-1555): interintra_mode, @@ -40691,6 +40694,7 @@ fn decode_inter_block8( && enable_masked_compound && is_any_masked_compound_used_here(SIDE, SIDE) { + crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx"); dec.symbol(&mut cdfs.comp_group_idx[group_ctx]) } else { 0 @@ -40747,6 +40751,7 @@ fn decode_inter_block8( ref_order_hints[(ref0 - LAST_FRAME) as usize], ref_order_hints[(ref1 - LAST_FRAME) as usize], ); + crate::msac::SymbolDecoder::set_symr_cdf("compound_idx"); let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]); if idx == 1 { (8, 8, 1u8) @@ -41498,6 +41503,7 @@ ss_y(fctx), let mut interintra_mode: Option = None; let mut wedge_mask: Option<(&'static [u8], usize)> = None; if enable_interintra_compound && !skip_mode { + crate::msac::SymbolDecoder::set_symr_cdf("interintra"); let interintra = dec.symbol(&mut cdfs.interintra[SIZE_GROUP_8]) == 1; if interintra { // lane-interintra r1: same read pair as the 16/32 site; diff --git a/crates/ec-av1/src/msac.rs b/crates/ec-av1/src/msac.rs index 4f4b208e..c24fcaea 100644 --- a/crates/ec-av1/src/msac.rs +++ b/crates/ec-av1/src/msac.rs @@ -335,6 +335,12 @@ thread_local! { /// the inter path; without a phase its reads are unattributable. pub(crate) static SYMR_PHASE: std::cell::Cell<&'static str> = const { std::cell::Cell::new("") }; + /// The CDF TABLE NAME for the read about to be made, mirroring the + /// oracle's `ec_symr_cdf_tag`. `cdf0` alone cannot identify a table -- + /// two rows can share a first entry -- so this is what turns "two + /// 2-symbol reads" into a named pair. + pub(crate) static SYMR_CDF: std::cell::Cell<&'static str> = + const { std::cell::Cell::new("") }; } impl<'a> SymbolDecoder<'a> { @@ -413,6 +419,10 @@ impl<'a> SymbolDecoder<'a> { /// `decode_symbol` (spec 8.2.6), with the adaptation of 8.3.2. /// + pub(crate) fn set_symr_cdf(t: &'static str) { + SYMR_CDF.with(|c| c.set(t)); + } + pub(crate) fn set_symr_phase(p: &'static str) { SYMR_PHASE.with(|c| c.set(p)); } @@ -455,7 +465,8 @@ impl<'a> SymbolDecoder<'a> { } if symr { eprintln!( - "EC_SYMR ph={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}", + "EC_SYMR ph={} cdf={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}", + SYMR_PHASE.with(std::cell::Cell::get), SYMR_PHASE.with(std::cell::Cell::get), SYMR_MI.with(std::cell::Cell::get).0, SYMR_MI.with(std::cell::Cell::get).1,