diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 8a365834..9fc389b9 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -21218,12 +21218,13 @@ pub(crate) mod tests { /// `mc::predict_compound_intermediate`. `compound_warp_hits() > 0` is a /// hard assert: a run where the encoder never emitted one proves nothing. /// A decode error or a pixel mismatch is a FAILURE, never a skip. - fn run_compound_global_warp_gate(name: &str, bd: u32) { + fn run_compound_global_warp_gate(name: &str, bd: u32, min_part: u32, leaf8_assert: bool) { let _gate_lock = lock_gate_counters(); assert!(have_ffmpeg(), "{name}: ffmpeg required"); assert!(have_aomenc(), "{name}: no aomenc at {}", aomenc_path().display()); let (width, height, frame_count) = (64usize, 64usize, 24usize); let before = crate::decode::compound_warp_hits(); + let before8 = crate::decode::compound_warp_hits_8(); let mut matched = 0u32; let mut named_refusals = 0u32; let mut attempts = 0u32; @@ -21303,12 +21304,13 @@ pub(crate) mod tests { "--enable-cdef=0", "--enable-restoration=0", "--max-partition-size=32", - "--min-partition-size=32", "--enable-palette=0", "--enable-intrabc=0", "--enable-cfl-intra=0", "--enable-ref-frame-mvs=0", ]; + let min_part_arg = format!("--min-partition-size={min_part}"); + args.push(min_part_arg.as_str()); if bd != 8 { args.extend_from_slice(&[ in_depth_arg.as_str(), @@ -21365,15 +21367,25 @@ pub(crate) mod tests { } } let hits = crate::decode::compound_warp_hits() - before; + let hits8 = crate::decode::compound_warp_hits_8() - before8; eprintln!( "{name}: {matched}/{attempts} pixel-exact, {named_refusals} named refusals, \ - compound_warp_hits={hits}" - ); - assert!( - hits > 0, - "{name}: no compound block was predicted through a per-ref global warp \ - ({matched} matches, {named_refusals} refusals of {attempts}) -- gate vacuous" + compound_warp_hits={hits} compound_warp_hits_8={hits8}" ); + if leaf8_assert { + assert!( + hits8 > 0, + "{name}: no 8x8 COMPOUND leaf was predicted through a per-ref global \ + warp ({hits} bigger compound warp blocks, {matched} matches, \ + {named_refusals} refusals of {attempts}) -- gate vacuous" + ); + } else { + assert!( + hits > 0, + "{name}: no compound block was predicted through a per-ref global warp \ + ({matched} matches, {named_refusals} refusals of {attempts}) -- gate vacuous" + ); + } assert!(matched > 0, "{name}: every attempt refused -- no pixel comparison ran"); } @@ -21596,7 +21608,12 @@ pub(crate) mod tests { /// 8-bit arm of [`run_compound_global_warp_gate`]. #[test] fn a_real_compound_global_warp_stream_decodes_pixel_exact() { - run_compound_global_warp_gate("a_real_compound_global_warp_stream_decodes_pixel_exact", 8); + run_compound_global_warp_gate( + "a_real_compound_global_warp_stream_decodes_pixel_exact", + 8, + 32, + false, + ); } /// 10-bit arm of [`run_compound_global_warp_gate`] -- both of his films are @@ -21616,6 +21633,8 @@ pub(crate) mod tests { run_compound_global_warp_gate( "a_real_compound_global_warp_10bit_stream_decodes_pixel_exact", 10, + 32, + false, ); } @@ -21631,6 +21650,26 @@ pub(crate) mod tests { run_compound_global_warp_gate( "a_real_compound_global_warp_12bit_stream_decodes_pixel_exact", 12, + 32, + false, + ); + } + + /// 12-bit 8x8 compound-warp LEAF arm (lane-av112bitw, reviewer gap): the + /// same recipe with the 32x32 partition pin dropped to min 8, so the RD + /// can code an 8x8 `GLOBAL_GLOBALMV` leaf whose two references warp per + /// slot -- `decode_inter_block8`'s `COMPOUND_WARP_HITS_8` path, which + /// the 32x32-pinned compound witness structurally cannot reach. Hard- + /// asserts `compound_warp_hits_8() > 0` (an 8x8 compound warp leaf bumps + /// it alongside [`decode::compound_warp_hits`]; a 16x16+ one cannot), so + /// a stream of only bigger warped blocks fails this gate. + #[test] + fn a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact() { + run_compound_global_warp_gate( + "a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact", + 12, + 8, + true, ); } diff --git a/lanes/av112bitw.report.md b/lanes/av112bitw.report.md index 3c343ddf..7b89461b 100644 --- a/lanes/av112bitw.report.md +++ b/lanes/av112bitw.report.md @@ -66,6 +66,15 @@ content refused by name. (below), and `run_compound_global_warp_gate` was generalised `ten_bit: bool` -> `bd: u32` with a third caller. The 8/10-bit arms are byte-identical recipes (8-bit still passes NO depth flags). +- **stream.rs, reviewer round (post-cbb3a9b9)** — Elif's FAIL: the + compound witness pins `--min/--max-partition-size=32`, so it structurally + cannot emit an 8x8 compound-warp LEAF, and it asserts + `compound_warp_hits()`, not `compound_warp_hits_8()` — the 8x8 arm was + unwitnessed (its only prior gate was 8-bit). The helper gained + `min_part: u32` + `leaf8_assert: bool`; the new + `a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact` + drops the pin to min 8 and hard-asserts `compound_warp_hits_8() > 0` + (only an 8x8 compound warp leaf bumps it). ## The witnesses @@ -88,6 +97,12 @@ fixtures are untouched (no new fixture needed). the gate's own hard asserts (`hits > 0`, `matched > 0`, no refusal may contain "warp"). Pre-lift the same gate FAILED with the warp refusal on attempt 1 — non-vacuity both directions. +3. **8x8 compound-warp LEAF** (reviewer round) + `a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact` + — the same recipe with the partition pin dropped to min 8: **6/6 + pixel-exact, compound_warp_hits = 128, compound_warp_hits_8 = 81**, the + leaf counter hard-asserted `> 0`. This closes the 8x8 + `decode_inter_block8` compound-warp arm at 12 bits. ## Results @@ -95,7 +110,8 @@ fixtures are untouched (no new fixture needed). byte-exact; `a_12bit_screen_content_stream_is_refused_by_name` and `a_12bit_film_grain_stream_is_refused_by_name` still refuse by name. - Warp family: 8-bit and 10-bit cwarp gates green (the parameterisation is - a no-op at bd <= 10, proven not just claimed), both fimv + a no-op at bd <= 10, proven not just claimed), the 12-bit compound and + 12-bit 8x8-leaf cwarp gates green, both fimv force-integer-mv warp-alphabet gates green, both 10-bit film fixture gates with warp green (`a_10bit_128sb_film_frames_with_warp_cdef_and_interintra...`, `a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach...`). @@ -109,7 +125,7 @@ fixtures are untouched (no new fixture needed). `warp_affine` filter, bit-depth-independent model source, both pieces witnessed. A stream whose single-ref blocks warp under a ROTZOOM global model would close it outright; the mandelbrot content produces those - models only on compound blocks here. + models only on compound blocks here. STAYS OPEN per Main. 2. **Grain and screen content stay refused by name** (untouched, per charter): `film grain synthesis at 12 bits ...` and `a 12-bit frame with screen content tools ...` with their real-stream @@ -119,5 +135,5 @@ fixtures are untouched (no new fixture needed). Exactly one new file: this report. Touched: `warp.rs` (the parameterisation), `decode.rs` (three refusal deletions + header comment), `stream.rs` (witness -gate swap + gate generalisation), `refusal_inventory.rs` (two row removals + -notes). No fixture, no junk file. +gate swap + gate generalisation + the 8x8-leaf arm), `refusal_inventory.rs` +(two row removals + notes). No fixture, no junk file.