lane-av112bitw: witness the 12-bit 8x8 compound-warp leaf (reviewer gap)
Browse files at this commit5c27968c4487b7a59c38fba246afe6bed8182a71Parent: a2555a92 changed files +68 -13
- crates/ec-av1/src/stream.rs +48 -9
- lanes/av112bitw.report.md +20 -4
crates/ec-av1/src/stream.rsmodified+48 -9
| @@ -21218,12 +21218,13 @@ pub(crate) mod tests { | |||
| 21218 | /// `mc::predict_compound_intermediate`. `compound_warp_hits() > 0` is a | 21218 | /// `mc::predict_compound_intermediate`. `compound_warp_hits() > 0` is a |
| 21219 | /// hard assert: a run where the encoder never emitted one proves nothing. | 21219 | /// hard assert: a run where the encoder never emitted one proves nothing. |
| 21220 | /// A decode error or a pixel mismatch is a FAILURE, never a skip. | 21220 | /// A decode error or a pixel mismatch is a FAILURE, never a skip. |
| 21221 | - fn run_compound_global_warp_gate(name: &str, bd: u32) { | 21221 | + fn run_compound_global_warp_gate(name: &str, bd: u32, min_part: u32, leaf8_assert: bool) { |
| 21222 | let _gate_lock = lock_gate_counters(); | 21222 | let _gate_lock = lock_gate_counters(); |
| 21223 | assert!(have_ffmpeg(), "{name}: ffmpeg required"); | 21223 | assert!(have_ffmpeg(), "{name}: ffmpeg required"); |
| 21224 | assert!(have_aomenc(), "{name}: no aomenc at {}", aomenc_path().display()); | 21224 | assert!(have_aomenc(), "{name}: no aomenc at {}", aomenc_path().display()); |
| 21225 | let (width, height, frame_count) = (64usize, 64usize, 24usize); | 21225 | let (width, height, frame_count) = (64usize, 64usize, 24usize); |
| 21226 | let before = crate::decode::compound_warp_hits(); | 21226 | let before = crate::decode::compound_warp_hits(); |
| 21227 | + let before8 = crate::decode::compound_warp_hits_8(); | ||
| 21227 | let mut matched = 0u32; | 21228 | let mut matched = 0u32; |
| 21228 | let mut named_refusals = 0u32; | 21229 | let mut named_refusals = 0u32; |
| 21229 | let mut attempts = 0u32; | 21230 | let mut attempts = 0u32; |
| @@ -21303,12 +21304,13 @@ pub(crate) mod tests { | |||
| 21303 | "--enable-cdef=0", | 21304 | "--enable-cdef=0", |
| 21304 | "--enable-restoration=0", | 21305 | "--enable-restoration=0", |
| 21305 | "--max-partition-size=32", | 21306 | "--max-partition-size=32", |
| 21306 | - "--min-partition-size=32", | ||
| 21307 | "--enable-palette=0", | 21307 | "--enable-palette=0", |
| 21308 | "--enable-intrabc=0", | 21308 | "--enable-intrabc=0", |
| 21309 | "--enable-cfl-intra=0", | 21309 | "--enable-cfl-intra=0", |
| 21310 | "--enable-ref-frame-mvs=0", | 21310 | "--enable-ref-frame-mvs=0", |
| 21311 | ]; | 21311 | ]; |
| 21312 | + let min_part_arg = format!("--min-partition-size={min_part}"); | ||
| 21313 | + args.push(min_part_arg.as_str()); | ||
| 21312 | if bd != 8 { | 21314 | if bd != 8 { |
| 21313 | args.extend_from_slice(&[ | 21315 | args.extend_from_slice(&[ |
| 21314 | in_depth_arg.as_str(), | 21316 | in_depth_arg.as_str(), |
| @@ -21365,15 +21367,25 @@ pub(crate) mod tests { | |||
| 21365 | } | 21367 | } |
| 21366 | } | 21368 | } |
| 21367 | let hits = crate::decode::compound_warp_hits() - before; | 21369 | let hits = crate::decode::compound_warp_hits() - before; |
| 21370 | + let hits8 = crate::decode::compound_warp_hits_8() - before8; | ||
| 21368 | eprintln!( | 21371 | eprintln!( |
| 21369 | "{name}: {matched}/{attempts} pixel-exact, {named_refusals} named refusals, \ | 21372 | "{name}: {matched}/{attempts} pixel-exact, {named_refusals} named refusals, \ |
| 21370 | - compound_warp_hits={hits}" | 21373 | + compound_warp_hits={hits} compound_warp_hits_8={hits8}" |
| 21371 | - ); | ||
| 21372 | - assert!( | ||
| 21373 | - hits > 0, | ||
| 21374 | - "{name}: no compound block was predicted through a per-ref global warp \ | ||
| 21375 | - ({matched} matches, {named_refusals} refusals of {attempts}) -- gate vacuous" | ||
| 21376 | ); | 21374 | ); |
| 21375 | + if leaf8_assert { | ||
| 21376 | + assert!( | ||
| 21377 | + hits8 > 0, | ||
| 21378 | + "{name}: no 8x8 COMPOUND leaf was predicted through a per-ref global \ | ||
| 21379 | + warp ({hits} bigger compound warp blocks, {matched} matches, \ | ||
| 21380 | + {named_refusals} refusals of {attempts}) -- gate vacuous" | ||
| 21381 | + ); | ||
| 21382 | + } else { | ||
| 21383 | + assert!( | ||
| 21384 | + hits > 0, | ||
| 21385 | + "{name}: no compound block was predicted through a per-ref global warp \ | ||
| 21386 | + ({matched} matches, {named_refusals} refusals of {attempts}) -- gate vacuous" | ||
| 21387 | + ); | ||
| 21388 | + } | ||
| 21377 | assert!(matched > 0, "{name}: every attempt refused -- no pixel comparison ran"); | 21389 | assert!(matched > 0, "{name}: every attempt refused -- no pixel comparison ran"); |
| 21378 | } | 21390 | } |
| 21379 | 21391 | ||
| @@ -21596,7 +21608,12 @@ pub(crate) mod tests { | |||
| 21596 | /// 8-bit arm of [`run_compound_global_warp_gate`]. | 21608 | /// 8-bit arm of [`run_compound_global_warp_gate`]. |
| 21597 | #[test] | 21609 | #[test] |
| 21598 | fn a_real_compound_global_warp_stream_decodes_pixel_exact() { | 21610 | fn a_real_compound_global_warp_stream_decodes_pixel_exact() { |
| 21599 | - run_compound_global_warp_gate("a_real_compound_global_warp_stream_decodes_pixel_exact", 8); | 21611 | + run_compound_global_warp_gate( |
| 21612 | + "a_real_compound_global_warp_stream_decodes_pixel_exact", | ||
| 21613 | + 8, | ||
| 21614 | + 32, | ||
| 21615 | + false, | ||
| 21616 | + ); | ||
| 21600 | } | 21617 | } |
| 21601 | 21618 | ||
| 21602 | /// 10-bit arm of [`run_compound_global_warp_gate`] -- both of his films are | 21619 | /// 10-bit arm of [`run_compound_global_warp_gate`] -- both of his films are |
| @@ -21616,6 +21633,8 @@ pub(crate) mod tests { | |||
| 21616 | run_compound_global_warp_gate( | 21633 | run_compound_global_warp_gate( |
| 21617 | "a_real_compound_global_warp_10bit_stream_decodes_pixel_exact", | 21634 | "a_real_compound_global_warp_10bit_stream_decodes_pixel_exact", |
| 21618 | 10, | 21635 | 10, |
| 21636 | + 32, | ||
| 21637 | + false, | ||
| 21619 | ); | 21638 | ); |
| 21620 | } | 21639 | } |
| 21621 | 21640 | ||
| @@ -21631,6 +21650,26 @@ pub(crate) mod tests { | |||
| 21631 | run_compound_global_warp_gate( | 21650 | run_compound_global_warp_gate( |
| 21632 | "a_real_compound_global_warp_12bit_stream_decodes_pixel_exact", | 21651 | "a_real_compound_global_warp_12bit_stream_decodes_pixel_exact", |
| 21633 | 12, | 21652 | 12, |
| 21653 | + 32, | ||
| 21654 | + false, | ||
| 21655 | + ); | ||
| 21656 | + } | ||
| 21657 | + | ||
| 21658 | + /// 12-bit 8x8 compound-warp LEAF arm (lane-av112bitw, reviewer gap): the | ||
| 21659 | + /// same recipe with the 32x32 partition pin dropped to min 8, so the RD | ||
| 21660 | + /// can code an 8x8 `GLOBAL_GLOBALMV` leaf whose two references warp per | ||
| 21661 | + /// slot -- `decode_inter_block8`'s `COMPOUND_WARP_HITS_8` path, which | ||
| 21662 | + /// the 32x32-pinned compound witness structurally cannot reach. Hard- | ||
| 21663 | + /// asserts `compound_warp_hits_8() > 0` (an 8x8 compound warp leaf bumps | ||
| 21664 | + /// it alongside [`decode::compound_warp_hits`]; a 16x16+ one cannot), so | ||
| 21665 | + /// a stream of only bigger warped blocks fails this gate. | ||
| 21666 | + #[test] | ||
| 21667 | + fn a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact() { | ||
| 21668 | + run_compound_global_warp_gate( | ||
| 21669 | + "a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact", | ||
| 21670 | + 12, | ||
| 21671 | + 8, | ||
| 21672 | + true, | ||
| 21634 | ); | 21673 | ); |
| 21635 | } | 21674 | } |
| 21636 | 21675 | ||
lanes/av112bitw.report.mdmodified+20 -4
| @@ -66,6 +66,15 @@ content refused by name. | |||
| 66 | (below), and `run_compound_global_warp_gate` was generalised | 66 | (below), and `run_compound_global_warp_gate` was generalised |
| 67 | `ten_bit: bool` -> `bd: u32` with a third caller. The 8/10-bit arms are | 67 | `ten_bit: bool` -> `bd: u32` with a third caller. The 8/10-bit arms are |
| 68 | byte-identical recipes (8-bit still passes NO depth flags). | 68 | byte-identical recipes (8-bit still passes NO depth flags). |
| 69 | +- **stream.rs, reviewer round (post-cbb3a9b9)** — Elif's FAIL: the | ||
| 70 | + compound witness pins `--min/--max-partition-size=32`, so it structurally | ||
| 71 | + cannot emit an 8x8 compound-warp LEAF, and it asserts | ||
| 72 | + `compound_warp_hits()`, not `compound_warp_hits_8()` — the 8x8 arm was | ||
| 73 | + unwitnessed (its only prior gate was 8-bit). The helper gained | ||
| 74 | + `min_part: u32` + `leaf8_assert: bool`; the new | ||
| 75 | + `a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact` | ||
| 76 | + drops the pin to min 8 and hard-asserts `compound_warp_hits_8() > 0` | ||
| 77 | + (only an 8x8 compound warp leaf bumps it). | ||
| 69 | 78 | ||
| 70 | ## The witnesses | 79 | ## The witnesses |
| 71 | 80 | ||
| @@ -88,6 +97,12 @@ fixtures are untouched (no new fixture needed). | |||
| 88 | the gate's own hard asserts (`hits > 0`, `matched > 0`, no refusal may | 97 | the gate's own hard asserts (`hits > 0`, `matched > 0`, no refusal may |
| 89 | contain "warp"). Pre-lift the same gate FAILED with the warp refusal on | 98 | contain "warp"). Pre-lift the same gate FAILED with the warp refusal on |
| 90 | attempt 1 — non-vacuity both directions. | 99 | attempt 1 — non-vacuity both directions. |
| 100 | +3. **8x8 compound-warp LEAF** (reviewer round) | ||
| 101 | + `a_real_compound_global_warp_12bit_8x8_leaf_stream_decodes_pixel_exact` | ||
| 102 | + — the same recipe with the partition pin dropped to min 8: **6/6 | ||
| 103 | + pixel-exact, compound_warp_hits = 128, compound_warp_hits_8 = 81**, the | ||
| 104 | + leaf counter hard-asserted `> 0`. This closes the 8x8 | ||
| 105 | + `decode_inter_block8` compound-warp arm at 12 bits. | ||
| 91 | 106 | ||
| 92 | ## Results | 107 | ## Results |
| 93 | 108 | ||
| @@ -95,7 +110,8 @@ fixtures are untouched (no new fixture needed). | |||
| 95 | byte-exact; `a_12bit_screen_content_stream_is_refused_by_name` and | 110 | byte-exact; `a_12bit_screen_content_stream_is_refused_by_name` and |
| 96 | `a_12bit_film_grain_stream_is_refused_by_name` still refuse by name. | 111 | `a_12bit_film_grain_stream_is_refused_by_name` still refuse by name. |
| 97 | - Warp family: 8-bit and 10-bit cwarp gates green (the parameterisation is | 112 | - Warp family: 8-bit and 10-bit cwarp gates green (the parameterisation is |
| 98 | - a no-op at bd <= 10, proven not just claimed), both fimv | 113 | + a no-op at bd <= 10, proven not just claimed), the 12-bit compound and |
| 114 | + 12-bit 8x8-leaf cwarp gates green, both fimv | ||
| 99 | force-integer-mv warp-alphabet gates green, both 10-bit film fixture | 115 | force-integer-mv warp-alphabet gates green, both 10-bit film fixture |
| 100 | gates with warp green (`a_10bit_128sb_film_frames_with_warp_cdef_and_interintra...`, | 116 | gates with warp green (`a_10bit_128sb_film_frames_with_warp_cdef_and_interintra...`, |
| 101 | `a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach...`). | 117 | `a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach...`). |
| @@ -109,7 +125,7 @@ fixtures are untouched (no new fixture needed). | |||
| 109 | `warp_affine` filter, bit-depth-independent model source, both pieces | 125 | `warp_affine` filter, bit-depth-independent model source, both pieces |
| 110 | witnessed. A stream whose single-ref blocks warp under a ROTZOOM global | 126 | witnessed. A stream whose single-ref blocks warp under a ROTZOOM global |
| 111 | model would close it outright; the mandelbrot content produces those | 127 | model would close it outright; the mandelbrot content produces those |
| 112 | - models only on compound blocks here. | 128 | + models only on compound blocks here. STAYS OPEN per Main. |
| 113 | 2. **Grain and screen content stay refused by name** (untouched, per | 129 | 2. **Grain and screen content stay refused by name** (untouched, per |
| 114 | charter): `film grain synthesis at 12 bits ...` and | 130 | charter): `film grain synthesis at 12 bits ...` and |
| 115 | `a 12-bit frame with screen content tools ...` with their real-stream | 131 | `a 12-bit frame with screen content tools ...` with their real-stream |
| @@ -119,5 +135,5 @@ fixtures are untouched (no new fixture needed). | |||
| 119 | 135 | ||
| 120 | Exactly one new file: this report. Touched: `warp.rs` (the parameterisation), | 136 | Exactly one new file: this report. Touched: `warp.rs` (the parameterisation), |
| 121 | `decode.rs` (three refusal deletions + header comment), `stream.rs` (witness | 137 | `decode.rs` (three refusal deletions + header comment), `stream.rs` (witness |
| 122 | -gate swap + gate generalisation), `refusal_inventory.rs` (two row removals + | 138 | +gate swap + gate generalisation + the 8x8-leaf arm), `refusal_inventory.rs` |
| 123 | -notes). No fixture, no junk file. | 139 | +(two row removals + notes). No fixture, no junk file. |