forge
Explore
Log in

Don't you dare go Hollow

lane-av1422warp: instrument -- EC_SYMR carries the CDF table name

Browse files at this commit

e9a6ad820388c151d358aebd2dbcbc60505802c9Ahmet Kaan GümüşParent: 0aa598b
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.rsmodified+6 -0
@@ -33539,6 +33539,7 @@ fn decode_inter_block(
33539 && enable_masked_compound33539 && enable_masked_compound
33540 && is_any_masked_compound_used_here(write_w, write_h)33540 && is_any_masked_compound_used_here(write_w, write_h)
33541 {33541 {
33542+ crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx");
33542 dec.symbol(&mut cdfs.comp_group_idx[group_ctx])33543 dec.symbol(&mut cdfs.comp_group_idx[group_ctx])
33543 } else {33544 } else {
33544 033545 0
@@ -33831,6 +33832,7 @@ fn decode_inter_block(
33831 ref_order_hints[(ref0 - LAST_FRAME) as usize],33832 ref_order_hints[(ref0 - LAST_FRAME) as usize],
33832 ref_order_hints[(ref1 - LAST_FRAME) as usize],33833 ref_order_hints[(ref1 - LAST_FRAME) as usize],
33833 );33834 );
33835+ crate::msac::SymbolDecoder::set_symr_cdf("compound_idx");
33834 let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]);33836 let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]);
33835 if crate::envflags::env_flag!("EC_TRACE_MODE") {33837 if crate::envflags::env_flag!("EC_TRACE_MODE") {
33836 eprintln!(33838 eprintln!(
@@ -34998,6 +35000,7 @@ fn decode_inter_block(
34998 // TRUE footprint -- a 16x8 strip is group 1, a 32x16 strip35000 // TRUE footprint -- a 16x8 strip is group 1, a 32x16 strip
34999 // group 2, not their square `side`'s 2/3.35001 // group 2, not their square `side`'s 2/3.
35000 let bsize_group = size_group_wh(write_w, write_h);35002 let bsize_group = size_group_wh(write_w, write_h);
35003+ crate::msac::SymbolDecoder::set_symr_cdf("interintra");
35001 let interintra = dec.symbol(&mut cdfs.interintra[bsize_group]) == 1;35004 let interintra = dec.symbol(&mut cdfs.interintra[bsize_group]) == 1;
35002 if interintra {35005 if interintra {
35003 // lane-interintra r1 (decodemv.c 1540-1555): interintra_mode,35006 // lane-interintra r1 (decodemv.c 1540-1555): interintra_mode,
@@ -40691,6 +40694,7 @@ fn decode_inter_block8(
40691 && enable_masked_compound40694 && enable_masked_compound
40692 && is_any_masked_compound_used_here(SIDE, SIDE)40695 && is_any_masked_compound_used_here(SIDE, SIDE)
40693 {40696 {
40697+ crate::msac::SymbolDecoder::set_symr_cdf("comp_group_idx");
40694 dec.symbol(&mut cdfs.comp_group_idx[group_ctx])40698 dec.symbol(&mut cdfs.comp_group_idx[group_ctx])
40695 } else {40699 } else {
40696 040700 0
@@ -40747,6 +40751,7 @@ fn decode_inter_block8(
40747 ref_order_hints[(ref0 - LAST_FRAME) as usize],40751 ref_order_hints[(ref0 - LAST_FRAME) as usize],
40748 ref_order_hints[(ref1 - LAST_FRAME) as usize],40752 ref_order_hints[(ref1 - LAST_FRAME) as usize],
40749 );40753 );
40754+ crate::msac::SymbolDecoder::set_symr_cdf("compound_idx");
40750 let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]);40755 let idx = dec.symbol(&mut cdfs.compound_idx[idx_ctx]);
40751 if idx == 1 {40756 if idx == 1 {
40752 (8, 8, 1u8)40757 (8, 8, 1u8)
@@ -41498,6 +41503,7 @@ ss_y(fctx),
41498 let mut interintra_mode: Option<u8> = None;41503 let mut interintra_mode: Option<u8> = None;
41499 let mut wedge_mask: Option<(&'static [u8], usize)> = None;41504 let mut wedge_mask: Option<(&'static [u8], usize)> = None;
41500 if enable_interintra_compound && !skip_mode {41505 if enable_interintra_compound && !skip_mode {
41506+ crate::msac::SymbolDecoder::set_symr_cdf("interintra");
41501 let interintra = dec.symbol(&mut cdfs.interintra[SIZE_GROUP_8]) == 1;41507 let interintra = dec.symbol(&mut cdfs.interintra[SIZE_GROUP_8]) == 1;
41502 if interintra {41508 if interintra {
41503 // lane-interintra r1: same read pair as the 16/32 site;41509 // lane-interintra r1: same read pair as the 16/32 site;
crates/ec-av1/src/msac.rsmodified+12 -1
@@ -335,6 +335,12 @@ thread_local! {
335 /// the inter path; without a phase its reads are unattributable.335 /// the inter path; without a phase its reads are unattributable.
336 pub(crate) static SYMR_PHASE: std::cell::Cell<&'static str> =336 pub(crate) static SYMR_PHASE: std::cell::Cell<&'static str> =
337 const { std::cell::Cell::new("") };337 const { std::cell::Cell::new("") };
338+ /// The CDF TABLE NAME for the read about to be made, mirroring the
339+ /// oracle's `ec_symr_cdf_tag`. `cdf0` alone cannot identify a table --
340+ /// two rows can share a first entry -- so this is what turns "two
341+ /// 2-symbol reads" into a named pair.
342+ pub(crate) static SYMR_CDF: std::cell::Cell<&'static str> =
343+ const { std::cell::Cell::new("") };
338 }344 }
339 345
340 impl<'a> SymbolDecoder<'a> {346 impl<'a> SymbolDecoder<'a> {
@@ -413,6 +419,10 @@ impl<'a> SymbolDecoder<'a> {
413 419
414 /// `decode_symbol` (spec 8.2.6), with the adaptation of 8.3.2.420 /// `decode_symbol` (spec 8.2.6), with the adaptation of 8.3.2.
415 ///421 ///
422+ pub(crate) fn set_symr_cdf(t: &'static str) {
423+ SYMR_CDF.with(|c| c.set(t));
424+ }
425+
416 pub(crate) fn set_symr_phase(p: &'static str) {426 pub(crate) fn set_symr_phase(p: &'static str) {
417 SYMR_PHASE.with(|c| c.set(p));427 SYMR_PHASE.with(|c| c.set(p));
418 }428 }
@@ -455,7 +465,8 @@ impl<'a> SymbolDecoder<'a> {
455 }465 }
456 if symr {466 if symr {
457 eprintln!(467 eprintln!(
458- "EC_SYMR ph={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}",468+ "EC_SYMR ph={} cdf={} mi=({},{}) pre=({},{},{}) cdf0={} n={} s={} post_rng={}",
469+ SYMR_PHASE.with(std::cell::Cell::get),
459 SYMR_PHASE.with(std::cell::Cell::get),470 SYMR_PHASE.with(std::cell::Cell::get),
460 SYMR_MI.with(std::cell::Cell::get).0,471 SYMR_MI.with(std::cell::Cell::get).0,
461 SYMR_MI.with(std::cell::Cell::get).1,472 SYMR_MI.with(std::cell::Cell::get).1,