diff --git a/crates/ec-av1/fixtures/intra128_in_inter_witness.obu b/crates/ec-av1/fixtures/intra128_in_inter_witness.obu new file mode 100644 index 0000000000000000000000000000000000000000..1996e3d2376eb0713a097d9ed1ef22511c1ef67a GIT binary patch literal 13066 zcmV+lGxf|80168L000a}|Nj5{;2<*H8xR16fC?x82mk^IBGi6;@rb#3P3*F%alwsN zCcQNQx@TrN(} zZxYhCV1+_~G9EWc!(1BY2?raTjv9`0v=od_6mm;vmJ*O#&5RPk`c7b=gDMLKoFd7Zq~r?$|3IWLy%;Ib;o3 zxrq<#ulH>AW#dFl045h_@>I@wy9%M*%pvD2kH^=bQzRWRRLvHoQaS}>gQvW~{JA9q z2p9m2w%5y)kZZ{s@t#?ea2OA|FMFOLIXm7uRhQ~{sCrWMl;KB2gO>BVKy<0^No`Ju z-bokoy|o>BC)OV^_%RMZOLGwt`sy2go&|GC)C~g+3pYAyVKIP$A^FlRLGV9|4cw+> zpzLKM*cx~1Nfvl#)1dObRy(~u;%KM@*4+ao#6NKidgocoh#&CSIZA-)xMjX~Q;cK= z5sg&CttEz*fzl?I>P|i8R4xYo4f8^L<0|Q{Rj)hV*DFD5We71p;23tI#3pYhVHZLq z(`2c5YY<64&~-KSc%w$`UT!P=KIyilo;2tsD1{*n)3){~YLn;GvL4f3cj8$U$I85N zm!cro!nMkF&c{8x1}*T+JNoNU8r2UMX1x@5>A3p~umeO->oZfBU$$|L=b44SQGk+T zyN-)B?9wBzbl{8Uj&l&^2wqiv*t)Uw5q;W~c8^7h6xL9>2kf&No%=^nn?^TBJM$)f zCwH*{a;=Oc273}?DETQ7z(vHxlWZx)iNg`K@1it>$S+}Ylez?LP6vmnzj6g|z%8oQ zSmB*0cl~onDlDtTUnc7ex5B3@p@w%anM1G7<`US~Ea5=baX1OJk64^f<;WsRjR^m{ zZT@DK3tTS@!PF<_v##99IJ-5X%ya3knFluU&h|a+HjSa>RYUzL`+-C zC`E4f(QqqtaK81_s>E4v-d4ObqXP(*1!4YgRC;-}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=&9D)X8>(w$JXlddov1r?S zZ|1OchEHn{7#A)-K``z>cSvN}g`xjDzOxg%B4vhLBt@s$4zjhi8E7S||B-8sUR)!BYZ9u1F zvOSni$pP|d*($@uQ-N?`ARO!iah>X4SYeLIX*D^&4gdGF*cn3eD7uNDn6yfBazsJ8 z#xX0zR6%7kEErhU^lhU0Lbu~G`@)3q9bNCD>uHlzAM$|1%Vc{iLMIW_@|Zn!k?b`W z6Pktxv)^#k1{2k!he)5@U)72e*DQh+w>H0V`D_f$d40r)d0?uP1I8+(C?rU78dklM zvrtLd#8q{{s{MT@Aw&IIr7u!_VDs$q59&hXt94Lu>utUZR}uZD?0Vf_%6p-{!%Sdd zE*81=Dhs%x&8zzUj3uh^bc^fQ%VZ#H*&QE#PGvO8)-E`|-G1=gnQ9Q}YI$6<5T&#x z#rr}eyr+gytsL|3wxFJJ)nL!{a^s`sK(bFx`f4r#*+{M;x{N`j$g>+s);- z+c9#Ny~BYhvae&WuS)s5{sQ-VX+wsJQVg*t1@hnsXEaF9NJ00qIC!{Z zp1A*ZBqMzRSWQ|C5C64qn^AVABFp*H$l0+uW5Ww;6lkg=cAMp!J*PF{!qu5r_nH3} z=M!rxyu2Z?o+T;h87J!MUMH3!H$VaJWoto-X6TQk&dK!0!I<;Das`-jTT|a)2-Q1UEq}thHzszkh}153sUopNWH4dfFDR zqa?o;di#Gu$F-%`!G8%uby)+oYs`S-{!^D0H=sP>-R0?>Wj#$V87d+fl_ZX-8y!*0 zwgW*a33w}ep!8e9#Iqs{U2_KyymSaJNv1ZreeEo1XYVxNo(}9{r$*MuyetF~PNzM) zTH&Ip9gd^Cf7W~>pB}KK1ipzyKu_>!d&XdSvx9drQ8R`OpT!<#_e@p6dU$NHvo = + (0..w_mi).map(|k| self.above[mi_c + k][0].level.to_string()).collect(); + let lf: Vec = + (0..h_mi).map(|k| self.left[mi_r + k][0].level.to_string()).collect(); + eprintln!( + "EC_ECDUMP plane=0 mi=({mi_r},{mi_c}) wh=({w_mi},{h_mi}) ctx={ctx} above=[{},] left=[{},]", + ab.join(","), lf.join(",") + ); + } if std::env::var_os("EC_AV1_TRACE").is_some() { eprintln!( "TRACE luma_skip_ctx mi=({mi_r},{mi_c}) side_mi={side_mi} top={top} left={left} ctx={ctx} band={:?}", @@ -6036,6 +6046,9 @@ impl Neighbours { let (mi_r, mi_c) = at_mi; let states: [Neighbour; 3] = std::array::from_fn(|plane| neighbour_state(&grids[plane])); let (w_mi, h_mi) = (w / MI, h / MI); + if std::env::var_os("EC_ECPUB").is_some() { + eprintln!("EC_ECPUB blk mi=({mi_r},{mi_c}) wh=({w},{h}) lvl={}", states[0].level); + } for cell in 0..h_mi { if let Some(slot) = self.left_side_mi.get_mut(mi_r + cell) { *slot = h; @@ -6141,6 +6154,9 @@ impl Neighbours { grid: &[i32], ) { let state = neighbour_state(grid); + if std::env::var_os("EC_ECPUB").is_some() { + eprintln!("EC_ECPUB tu mi=({mi_r},{mi_c}) wh=({w_px},{h_px}) lvl={}", state.level); + } for cell in 0..h_px / MI { if mi_r + cell < self.mi_rows { self.left[mi_r + cell][0] = state; @@ -7717,13 +7733,17 @@ fn decode_intra_rect_in_inter( // palette (>64) do not exist at this size and are refused by name there. // lane-inter128intra r1: OPT-IN ONLY (`EC_INTRA128_IN_INTER=1`) until a // gate exists. The body below is believed right (it is the key frame's own - // proven body plus the three inter-frame differences), but the three 1080p - // cuts that reach this shape reach it AFTER a pre-existing desync (see the - // lane report: their frame 2 diverges from aomdec inside the superblock at - // mi(0,320), long before mi(128,416)), and no aomenc recipe found so far - // emits a 128-root HORZ/VERT half coded intra in an inter frame -- so - // nothing can currently prove this arm. A refusal is lifted only with a - // gate (COMMON), so the default path still refuses by name below. + // proven body plus the three inter-frame differences), but nothing proves + // it: no aomenc recipe found so far emits a 128-root HORZ/VERT half coded + // intra in an inter frame. A refusal is lifted only with a gate (COMMON), + // so the default path still refuses by name below. + // + // lane-t900 r17: the opt-in STAYS. `intra128_in_inter_witness.obu` was + // built as this arm's witness and r16 measured three hits in it -- but + // every one of them was an artifact of the skipped-128-block entropy + // desync fixed this round (class `counter-from-refused-stream`). With the + // stream decoding byte-exact the arm fires ZERO times, so the witness does + // not carry the shape at all and the lift has no gate. if bw.max(bh) == 128 && std::env::var_os("EC_INTRA128_IN_INTER").is_some() { if allow_screen_content_tools { return Err(unsupported( @@ -7731,6 +7751,13 @@ fn decode_intra_rect_in_inter( is consumed for square blocks only)", )); } + if coeff_trace_on() { + // lane-t900 r16: which decode-order frame this arm fires in -- + // interleaved with the `EC_COEFF_FRAME` markers, this is what + // proves the hit is counted out of a frame that compares exact + // (class `counter-from-refused-stream`). + eprintln!("EC_INTRA128 mi_row={r} mi_col={c} bw={bw} bh={bh}"); + } INTRA_IN_INTER_MODE.with(|c| c.set(Some((3, skip)))); let res = decode_block_128rect( dec, @@ -12058,6 +12085,18 @@ thread_local! { /// (an intra-coded PARTITION_HORZ/VERT half of a 128 superblock inside an /// inter frame) -- (128x64, 64x128). pub(crate) static INTRA128_IN_INTER_HITS: std::cell::Cell<[usize; 2]> = const { std::cell::Cell::new([0; 2]) }; + /// lane-t900 r17: skipped INTER blocks whose `read_block_tx_size` still + /// handed back var-tx leaves, so the per-transform-unit luma publication + /// loop never ran and the block has to clear its own luma coefficient + /// contexts (libaom `av1_reset_entropy_context`). Every 128 root under + /// `TX_MODE_LARGEST` is one; the counter is what keeps that reset's gate + /// non-vacuous. + pub(crate) static SKIP_VARTX_LUMA_RESET_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// [`SKIP_VARTX_LUMA_RESET_HITS`], for a gate's own before/after delta. +pub fn skip_vartx_luma_reset_hits() -> usize { + SKIP_VARTX_LUMA_RESET_HITS.with(std::cell::Cell::get) } /// [`INTRA128_IN_INTER_HITS`], for a gate's own before/after delta. @@ -23462,6 +23501,25 @@ fn decode_inter_block( (left, above) }); if vartx_leaves.is_some() { + // lane-t900 r17 root cause (class early-return-skips-tail): the + // "plane 0 is already correct per transform unit" premise below holds + // only when the per-TU luma loop RAN. A SKIP inter block takes the + // `if skip` arm above, which reconstructs straight from the predictor + // and never enters that loop -- yet `read_block_tx_size` still hands + // back four TX_64X64 leaves for a 128 root under `TX_MODE_LARGEST` + // (and for any block under it), so `vartx_leaves` is `Some` and the + // luma coefficient contexts were left at the PREVIOUS block's values. + // libaom calls `av1_reset_entropy_context` for every skipped block, + // zeroing all three planes over its own footprint; `luma_grid` is the + // all-zero grid on this arm, so publishing it is exactly that reset. + // Witnessed on a 10-bit 512x512 --sb-size=128 stream: the 128x128 + // block at mi(32,64) of decode-order frame 1 read `txb_skip_ctx` 2 + // where aomdec reads 1, because the skipped 128x128 block at + // mi(32,32) never cleared `left[32..48]`. + if skip { + SKIP_VARTX_LUMA_RESET_HITS.with(|c| c.set(c.get() + 1)); + neighbours.record_mi_luma_rect(at, write_w, write_h, &luma_grid); + } // Plane 0 is already correct per transform unit // ([`Neighbours::record_mi_luma`] above); this writes everything else // [`Neighbours::record_rect`] would. diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 3fbc8cae..32b93a18 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -30637,6 +30637,122 @@ mod tests { ); } + /// lane-t900 r16/r17: a 10-bit 512x512 `--sb-size=128` stream in which + /// every 128 root is a var-tx block, and the gate for the SKIPPED-128-block + /// luma entropy reset (r17). It was BUILT as an intra-128-in-inter witness + /// and r16 measured three hits of that arm in it -- every one of them an + /// artifact of the desync fixed here (class `counter-from-refused-stream`). + /// Decoding exactly, the arm fires ZERO times, so this stream does not + /// carry that shape and the `EC_INTRA128_IN_INTER` opt-in stays. Renamed + /// out of `an_intra_coded_128x64_block_inside_an_inter_frame_...` for that + /// reason -- the fixture keeps the original intent in its own name. + /// + /// `crates/ec-av1/fixtures/intra128_in_inter_witness.obu`, 13066 bytes, + /// sha256 `dd41fc39367a3d38bf8a8a8106dc30d91b716b2a9123fdfa4716930f4f98caf9`, + /// produced by this repository's aomenc oracle: + /// + /// ```text + /// aomenc --codec=av1 -w 512 -h 512 --input-bit-depth=10 --bit-depth=10 \ + /// --sb-size=128 --min-partition-size=64 --max-partition-size=128 \ + /// --enable-rect-partitions=1 --kf-max-dist=9999 --lag-in-frames=0 \ + /// --cpu-used=1 --end-usage=q --cq-level=24 --threads=1 --obu -o s.obu src.y4m + /// ``` + /// + /// The source is 10 frames of 10-bit 512x512 whose left two superblock + /// columns carry 128-wide bands 64 rows apart (so the 128 root's cheapest + /// split is `PARTITION_HORZ`) and whose right two carry 64-wide vertical + /// bands (`PARTITION_VERT`), with two hard scene cuts at frames 4 and 7 and + /// `--kf-max-dist=9999` so those cuts must be coded as INTER frames whose + /// content no reference holds. It is the first stream found in this + /// repository that makes the encoder code a 128-root HORZ/VERT half INTRA + /// inside an inter frame at all: `intra128_in_inter` fires 1x 128x64 + + /// 2x 64x128. Three recipes that do NOT fire it, so the shape matters: a + /// small new patch on a static background (the frame costs 80 bytes, the + /// encoder skips), unstructured texture (the 128 root always SPLITs), and + /// cyclically repeating phases (GOLDEN holds an earlier phase, so the cut + /// is predicted rather than coded intra). + /// + /// r16 could not lift the opt-in: the three hits landed in a frame this + /// decoder did not decode exactly, and a counter read out of a desynced + /// frame proves nothing (class `counter-from-refused-stream`). The blocker + /// was a SEPARATE defect on the inter path, not this arm -- the same source + /// re-encoded with every optional tool disabled fired the arm 0 times and + /// desynced on exactly the same frames, and the same source at + /// `--sb-size=64` decoded all 10 frames byte-exact. + /// + /// r17 root cause, and what this gate now pins (class + /// `early-return-skips-tail`): a SKIPPED inter block + /// whose `read_block_tx_size` still hands back var-tx leaves -- which every + /// 128 root does under `TX_MODE_LARGEST` -- took `decode_inter_block`'s + /// `if skip` arm, so the per-transform-unit luma publication loop never + /// ran, and the block-level `record_split_luma_rect_mi` deliberately writes + /// no plane 0. The skipped block therefore left the PREVIOUS block's luma + /// coefficient levels standing where libaom's `av1_reset_entropy_context` + /// zeroes all three planes over the block. First-bad before the fix + /// (`EC_TRACE_COEFF` on both decoders, prefiltered to the + /// `all_zero`/`eob`/`after_bases` tags, filtered index 426): frame 1, the + /// 128x128 `is_inter=1 skip=0` block at mi(32,64), its first luma TU + /// (`bc=0 br=0`, TX_64X64) -- aomdec `txb_skip` ctx 1 (`top == 0 && + /// left == 0`), ours ctx 2, entry range equal on both, because the skipped + /// 128x128 block at mi(32,32) never cleared `left[32..48]` (ours 1, + /// aomdec 0). With the publication restored the whole 10-frame filtered + /// ladder matches 1397/1397 steps. + /// + #[test] + fn a_128_superblock_stream_whose_skipped_blocks_are_var_tx_decodes_pixel_exact() { + const NAME: &str = "a_128_superblock_stream_whose_skipped_blocks_are_var_tx_decodes_pixel_exact"; + if !have_ffmpeg() { + eprintln!("SKIP {NAME}: no ffmpeg"); + return; + } + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("fixtures/intra128_in_inter_witness.obu"); + let stream = std::fs::read(&path) + .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); + let (width, height) = (512usize, 512usize); + let before = crate::decode::skip_vartx_luma_reset_hits(); + let intra128_before = intra128_in_inter_counters(); + let frames = match decode_stream(&stream) { + Ok(frames) => frames, + Err(e) => panic!("{NAME}: decode_stream refused: {e}"), + }; + let fired = crate::decode::skip_vartx_luma_reset_hits() - before; + assert!( + fired > 0, + "{NAME}: no skipped var-tx block cleared its own luma coefficient \ + contexts -- the gate would be vacuous for the defect it pins" + ); + let intra128_now = intra128_in_inter_counters(); + assert_eq!( + [ + intra128_now[0] - intra128_before[0], + intra128_now[1] - intra128_before[1] + ], + [0, 0], + "{NAME}: the intra-128-in-inter arm fired on a stream that decodes \ + exactly -- the opt-in now HAS a witness and should be lifted" + ); + assert_eq!(frames.len(), 10, "{NAME}: 10 shown frames"); + assert_eq!((frames[0].width, frames[0].height), (width, height)); + let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()); + assert_eq!( + ffmpeg_frames.len(), + frames.len(), + "{NAME}: ffmpeg returned {} frames, we decoded {}", + ffmpeg_frames.len(), + frames.len() + ); + for (i, (ours, theirs)) in frames.iter().zip(&ffmpeg_frames).enumerate() { + assert_eq!(ours.y, theirs.y, "{NAME}: frame {i} luma vs ffmpeg"); + assert_eq!(ours.u, theirs.u, "{NAME}: frame {i} U vs ffmpeg"); + assert_eq!(ours.v, theirs.v, "{NAME}: frame {i} V vs ffmpeg"); + } + eprintln!( + "{NAME}: 10 shown frames pixel-exact on every plane; \ + skip_vartx_luma_reset={fired}" + ); + } + /// lane-t900 r10: the small-side GLOBALMV / rect warp-reach witness. /// `crates/ec-av1/fixtures/gm_small_side_witness.obu`, 1158066 bytes, /// sha256 `f1cdbcbb8d6d469c7957d70252ab42b24ab75f48a717600ffa25991458775dca`: