av1: close the enable-intrabc gate-integrity entry with a 10-bit engagement witness
Browse files at this commit5 changed files +222 -42
- crates/ec-av1/examples/decode_probe.rs +1 -0
- crates/ec-av1/src/decode.rs +4 -1
- crates/ec-av1/src/gate_coverage.rs +27 -6
- crates/ec-av1/src/stream.rs +93 -35
- lanes/av1-intrabc-r1.report.md +97 -0
crates/ec-av1/examples/decode_probe.rsmodified+1 -0
| @@ -47,6 +47,7 @@ fn main() { | |||
| 47 | ec_av1::stream::rect64_corner_tu_hits(1) | 47 | ec_av1::stream::rect64_corner_tu_hits(1) |
| 48 | ); | 48 | ); |
| 49 | println!("leaf8_intrabc_hits: {}", ec_av1::stream::leaf8_intrabc_hits()); | 49 | println!("leaf8_intrabc_hits: {}", ec_av1::stream::leaf8_intrabc_hits()); |
| 50 | + println!("intrabc_hits: {}", ec_av1::stream::intrabc_hits()); | ||
| 50 | let (rtu, rsplit, robmc) = ec_av1::stream::rect_inter_tu_counters(); | 51 | let (rtu, rsplit, robmc) = ec_av1::stream::rect_inter_tu_counters(); |
| 51 | println!("rect_inter: tu={rtu} txsplit={rsplit} obmc_leaf={robmc}"); | 52 | println!("rect_inter: tu={rtu} txsplit={rsplit} obmc_leaf={robmc}"); |
| 52 | println!("sub8_inter_split: groups={}", ec_av1::decode::sub8_inter_split_hits()); | 53 | println!("sub8_inter_split: groups={}", ec_av1::decode::sub8_inter_split_hits()); |
crates/ec-av1/src/decode.rsmodified+4 -1
| @@ -3583,7 +3583,10 @@ thread_local! { | |||
| 3583 | /// [`decode_block`] off the call stack (same idiom as [`PALETTE_PRED`], | 3583 | /// [`decode_block`] off the call stack (same idiom as [`PALETTE_PRED`], |
| 3584 | /// which the alternative -- a tenth tuple member through every caller -- | 3584 | /// which the alternative -- a tenth tuple member through every caller -- |
| 3585 | /// already avoids). Always `.take()`n by the block that reads it. | 3585 | /// already avoids). Always `.take()`n by the block that reads it. |
| 3586 | - /// How many blocks decoded `use_intrabc == 1` -- the gate's hit counter. | 3586 | + /// How many blocks read `use_intrabc == 1` and took the DV path -- the |
| 3587 | + /// gate's hit counter. Bumped on the READ, before the rect-strip refusal | ||
| 3588 | + /// returns too, so it counts reads, not reconstructions (a refused block | ||
| 3589 | + /// is never reconstructed). | ||
| 3587 | static INTRABC_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | 3590 | static INTRABC_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 3588 | } | 3591 | } |
| 3589 | // The `tx_type` the last plane-0 [`read_plane`] actually coded, kept so | 3592 | // The `tx_type` the last plane-0 [`read_plane`] actually coded, kept so |
crates/ec-av1/src/gate_coverage.rsmodified+27 -6
| @@ -49,6 +49,13 @@ const NEVER_EXERCISED: &[(&str, &str)] = &[ | |||
| 49 | // `a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips` | 49 | // `a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips` |
| 50 | // spells `--enable-intrabc=1` and decodes three such 8-bit streams whole- | 50 | // spells `--enable-intrabc=1` and decodes three such 8-bit streams whole- |
| 51 | // frame pixel-exact against ffmpeg, with the block counter asserted > 0. | 51 | // frame pixel-exact against ffmpeg, with the block counter asserted > 0. |
| 52 | + // Re-verified 2026-09-17 (lane-av1-intrabc) at main f715d70c: 185 rect | ||
| 53 | + // `use_intrabc` symbols read, and 5 blocks took the DV path -- 4 of them | ||
| 54 | + // DECODED whole-frame pixel-exact across 4 arms (7 frames compared, 0 | ||
| 55 | + // mismatches). The fifth is the testsrc2 rectangle-strip arm, which reads | ||
| 56 | + // the symbol and then refuses by name (the `intrabc_hits` bump happens on | ||
| 57 | + // the READ), so "5 blocks decoded" would overcount: 4 decoded + 1 refused, | ||
| 58 | + // exactly the single `refused == 1` the gate asserts. | ||
| 52 | ]; | 59 | ]; |
| 53 | 60 | ||
| 54 | /// The `--enable-*` tools this decoder cares about, whether or not any gate | 61 | /// The `--enable-*` tools this decoder cares about, whether or not any gate |
| @@ -204,11 +211,17 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[ // lane-cwarp's 10-bit comp | |||
| 204 | // flip/identity/1D transform types are proven to reach a real 10-bit stream | 211 | // flip/identity/1D transform types are proven to reach a real 10-bit stream |
| 205 | // this decoder reconstructs exactly (10 of its rect coefficient TUs carry a | 212 | // this decoder reconstructs exactly (10 of its rect coefficient TUs carry a |
| 206 | // 1D tx class). | 213 | // 1D tx class). |
| 207 | - // `enable-intrabc` LEFT this 10-bit list on 2026-09-02 (lane-kf900 r6): | 214 | + // `enable-intrabc` LEFT this 10-bit list on 2026-09-02 (lane-kf900 r6). |
| 208 | - // `a_real_aomenc_rect_strip_palette_decodes_pixel_exact`'s new | 215 | + // The entry it first rested on was a flag spelling -- the palette gate's |
| 209 | - // `smptebars-screen-txs-cq40/cq55` arms spell `--enable-intrabc=1` and are | 216 | + // `smptebars-screen-txs-cq40/cq55` arms pass `--enable-intrabc=1` -- and |
| 210 | - // decoded and pixel-compared at 10 bit as well as 8, so the tool reaches a | 217 | + // lane-av1-intrabc MEASURED that those arms decode ZERO intrabc blocks at |
| 211 | - // real 10-bit stream this decoder reconstructs exactly. | 218 | + // both depths, so they retired the entry without a stream carrying the |
| 219 | + // tool (class `tool-disabled-in-every-gate`, the same defect this list | ||
| 220 | + // exists for). The closing evidence is now | ||
| 221 | + // `an_sb128_screen_stream_with_intrabc_decodes_pixel_exact`: its sb128 | ||
| 222 | + // screen recipes run at 10 bits and hard-assert a decoded intrabc block | ||
| 223 | + // per depth (4-6 per arm), every frame pixel-compared against ffmpeg's own | ||
| 224 | + // 10-bit decode. | ||
| 212 | ("enable-rect-tx", "hole at both depths, see the 8-bit list"), | 225 | ("enable-rect-tx", "hole at both depths, see the 8-bit list"), |
| 213 | ]; | 226 | ]; |
| 214 | 227 | ||
| @@ -407,8 +420,16 @@ mod tests { | |||
| 407 | /// that loops `for depth in [8usize, 10]` builds BOTH streams from one | 420 | /// that loops `for depth in [8usize, 10]` builds BOTH streams from one |
| 408 | /// recipe, but its `yuv420p10le` arm made `is_ten_bit` classify it as | 421 | /// recipe, but its `yuv420p10le` arm made `is_ten_bit` classify it as |
| 409 | /// 10-bit only, hiding `--enable-cfl-intra=1` from the 8-bit list. | 422 | /// 10-bit only, hiding `--enable-cfl-intra=1` from the 8-bit list. |
| 423 | + /// lane-av1-intrabc r1: the shared recipe helper | ||
| 424 | + /// `screen_intrabc_stream_at_depth` is parameterised on `depth` and sits in | ||
| 425 | + /// the segment that opens at the PRECEDING gate's `#[test]`, so without | ||
| 426 | + /// this marker that gate's own 8-bit-only flags read as 10-bit-only -- the | ||
| 427 | + /// lane-defon/reelckf blind spot with `depth` spelled instead of | ||
| 428 | + /// `bit_depth`. Three gates share the helper, at both depths. | ||
| 410 | fn covers_both_depths(body: &str) -> bool { | 429 | fn covers_both_depths(body: &str) -> bool { |
| 411 | - body.contains("if bit_depth == 10") || body.contains("for depth in [8usize, 10]") | 430 | + body.contains("if bit_depth == 10") |
| 431 | + || body.contains("if depth == 10") | ||
| 432 | + || body.contains("for depth in [8usize, 10]") | ||
| 412 | } | 433 | } |
| 413 | 434 | ||
| 414 | /// Whether a gate body drives a stream at this depth. | 435 | /// Whether a gate body drives a stream at this depth. |
crates/ec-av1/src/stream.rsmodified+93 -35
| @@ -177,6 +177,16 @@ pub fn leaf8_intrabc_hits() -> usize { | |||
| 177 | crate::decode::leaf8_intrabc_hits() | 177 | crate::decode::leaf8_intrabc_hits() |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | +/// Blocks whose `use_intrabc` symbol came out 1 and took the DV path, at ANY | ||
| 181 | +/// shape -- the engagement counter the intrabc gates assert on. It counts | ||
| 182 | +/// "read a `use_intrabc` DV", not "reconstructed": a block the rect-strip | ||
| 183 | +/// reader REFUSES for an unported shape bumps it too (the symbol and the DV | ||
| 184 | +/// are parsed before the refusal). [`leaf8_intrabc_hits`] is its 8x8-leaf | ||
| 185 | +/// subset. | ||
| 186 | +pub fn intrabc_hits() -> usize { | ||
| 187 | + crate::decode::intrabc_hits() | ||
| 188 | +} | ||
| 189 | + | ||
| 180 | /// lane-sb128c r8: the 128 root's INTRA (key-frame) rect arm -- (128x64 | 190 | /// lane-sb128c r8: the 128 root's INTRA (key-frame) rect arm -- (128x64 |
| 181 | /// blocks, 64x128 blocks, blocks per resolved intra `tx_depth` 0/1/2). | 191 | /// blocks, 64x128 blocks, blocks per resolved intra `tx_depth` 0/1/2). |
| 182 | pub fn intra_sb128_counters() -> (usize, usize, [usize; 3]) { | 192 | pub fn intra_sb128_counters() -> (usize, usize, [usize; 3]) { |
| @@ -5968,13 +5978,32 @@ pub(crate) mod tests { | |||
| 5968 | square_only: bool, | 5978 | square_only: bool, |
| 5969 | extra: &[&str], | 5979 | extra: &[&str], |
| 5970 | ) -> Vec<u8> { | 5980 | ) -> Vec<u8> { |
| 5981 | + screen_intrabc_stream_at_depth(src, cq, txs, tiled, square_only, 8, extra) | ||
| 5982 | + } | ||
| 5983 | + | ||
| 5984 | + /// [`screen_intrabc_stream_with`] at an explicit bit depth (8 or 10): the | ||
| 5985 | + /// lavfi source is rendered straight to that depth's yuv4mpegpipe pixel | ||
| 5986 | + /// format and aomenc is told to encode at the matching | ||
| 5987 | + /// `--bit-depth`/`--input-bit-depth`, so a 10-bit arm produces a genuine | ||
| 5988 | + /// high-bit-depth stream rather than an 8-bit one in disguise. | ||
| 5989 | + fn screen_intrabc_stream_at_depth( | ||
| 5990 | + src: &str, | ||
| 5991 | + cq: &str, | ||
| 5992 | + txs: &str, | ||
| 5993 | + tiled: bool, | ||
| 5994 | + square_only: bool, | ||
| 5995 | + depth: usize, | ||
| 5996 | + extra: &[&str], | ||
| 5997 | + ) -> Vec<u8> { | ||
| 5998 | + assert!(depth == 8 || depth == 10, "unsupported bit depth {depth}"); | ||
| 5999 | + let pix_fmt = if depth == 10 { "yuv420p10le" } else { "yuv420p" }; | ||
| 5971 | let mut ff = Command::new("ffmpeg"); | 6000 | let mut ff = Command::new("ffmpeg"); |
| 5972 | ff.args(["-v", "error", "-f", "lavfi", "-i", src, "-t", "0.2"]); | 6001 | ff.args(["-v", "error", "-f", "lavfi", "-i", src, "-t", "0.2"]); |
| 5973 | if tiled { | 6002 | if tiled { |
| 5974 | ff.args(["-vf", "tile=2x2"]); | 6003 | ff.args(["-vf", "tile=2x2"]); |
| 5975 | } | 6004 | } |
| 5976 | let out = ff | 6005 | let out = ff |
| 5977 | - .args(["-pix_fmt", "yuv420p", "-strict", "-1", "-f", "yuv4mpegpipe", "-"]) | 6006 | + .args(["-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-"]) |
| 5978 | .stdin(Stdio::null()) | 6007 | .stdin(Stdio::null()) |
| 5979 | .stdout(Stdio::piped()) | 6008 | .stdout(Stdio::piped()) |
| 5980 | .stderr(Stdio::piped()) | 6009 | .stderr(Stdio::piped()) |
| @@ -5983,10 +6012,9 @@ pub(crate) mod tests { | |||
| 5983 | assert!(out.status.success(), "ffmpeg failed for {src}"); | 6012 | assert!(out.status.success(), "ffmpeg failed for {src}"); |
| 5984 | let y4m = out.stdout; | 6013 | let y4m = out.stdout; |
| 5985 | let mut child = Command::new(aomenc_path()) | 6014 | let mut child = Command::new(aomenc_path()) |
| 6015 | + .args(["--codec=av1"]) | ||
| 6016 | + .args([format!("--bit-depth={depth}"), format!("--input-bit-depth={depth}")]) | ||
| 5986 | .args([ | 6017 | .args([ |
| 5987 | - "--codec=av1", | ||
| 5988 | - "--bit-depth=8", | ||
| 5989 | - "--input-bit-depth=8", | ||
| 5990 | "--passes=1", | 6018 | "--passes=1", |
| 5991 | "--end-usage=q", | 6019 | "--end-usage=q", |
| 5992 | "--cpu-used=0", | 6020 | "--cpu-used=0", |
| @@ -6079,6 +6107,17 @@ pub(crate) mod tests { | |||
| 6079 | /// [`crate::decode::read_intrabc_dv`] hardcoded 64. Every arm is compared | 6107 | /// [`crate::decode::read_intrabc_dv`] hardcoded 64. Every arm is compared |
| 6080 | /// to ffmpeg and the decoded-intrabc-block counter is asserted non-zero, | 6108 | /// to ffmpeg and the decoded-intrabc-block counter is asserted non-zero, |
| 6081 | /// so a stream that stopped using intrabc could not make this vacuous. | 6109 | /// so a stream that stopped using intrabc could not make this vacuous. |
| 6110 | + /// | ||
| 6111 | + /// lane-av1-intrabc (2026-09-17): the four recipes now run at 10 bits as | ||
| 6112 | + /// well, and both depths must SHOW the engagement -- `blocks_at_depth` | ||
| 6113 | + /// below hard-asserts a decoded intrabc block per depth. The 10-bit | ||
| 6114 | + /// coverage the guard records for `enable-intrabc` used to rest on a gate | ||
| 6115 | + /// that only SPELLED `--enable-intrabc=1`: measured (same round), all five | ||
| 6116 | + /// arms of `a_real_aomenc_rect_strip_palette_decodes_pixel_exact` decode | ||
| 6117 | + /// ZERO intrabc blocks at BOTH depths, so the spelling proved nothing and | ||
| 6118 | + /// the entry was one encoder-RD change away from being vacuous again | ||
| 6119 | + /// (class `tool-disabled-in-every-gate`). An arm here that stops engaging | ||
| 6120 | + /// intrabc now fails this gate instead of retiring the entry unproven. | ||
| 6082 | #[test] | 6121 | #[test] |
| 6083 | fn an_sb128_screen_stream_with_intrabc_decodes_pixel_exact() { | 6122 | fn an_sb128_screen_stream_with_intrabc_decodes_pixel_exact() { |
| 6084 | const NAME: &str = "an_sb128_screen_stream_with_intrabc_decodes_pixel_exact"; | 6123 | const NAME: &str = "an_sb128_screen_stream_with_intrabc_decodes_pixel_exact"; |
| @@ -6089,40 +6128,52 @@ pub(crate) mod tests { | |||
| 6089 | let (width, height) = (256usize, 192usize); | 6128 | let (width, height) = (256usize, 192usize); |
| 6090 | let _guard = lock_gate_counters(); | 6129 | let _guard = lock_gate_counters(); |
| 6091 | let (mut blocks_total, mut frames_compared) = (0usize, 0u32); | 6130 | let (mut blocks_total, mut frames_compared) = (0usize, 0u32); |
| 6092 | - for txs in ["0", "1"] { | 6131 | + let mut blocks_at_depth = [0usize; 2]; |
| 6093 | - for cq in ["30", "45"] { | 6132 | + for depth in [8usize, 10] { |
| 6094 | - let arm = format!("sb128 txs={txs} cq={cq}"); | 6133 | + for txs in ["0", "1"] { |
| 6095 | - let stream = screen_intrabc_stream_with( | 6134 | + for cq in ["30", "45"] { |
| 6096 | - "smptebars=size=128x96:rate=25", | 6135 | + let arm = format!("sb128 {depth}-bit txs={txs} cq={cq}"); |
| 6097 | - cq, | 6136 | + let stream = screen_intrabc_stream_at_depth( |
| 6098 | - txs, | 6137 | + "smptebars=size=128x96:rate=25", |
| 6099 | - true, | 6138 | + cq, |
| 6100 | - true, | 6139 | + txs, |
| 6101 | - &["--sb-size=128"], | 6140 | + true, |
| 6102 | - ); | 6141 | + true, |
| 6103 | - let (sb128, intrabc_frames) = sb128_and_intrabc_frames(&stream); | 6142 | + depth, |
| 6104 | - assert!( | 6143 | + &["--sb-size=128"], |
| 6105 | - sb128 && intrabc_frames > 0, | 6144 | + ); |
| 6106 | - "{NAME}: {arm} no longer codes sb128 + allow_intrabc" | 6145 | + let (sb128, intrabc_frames) = sb128_and_intrabc_frames(&stream); |
| 6107 | - ); | ||
| 6108 | - crate::decode::reset_intrabc_hits(); | ||
| 6109 | - let frames = decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME}: {arm}: {e}")); | ||
| 6110 | - let blocks = crate::decode::intrabc_hits(); | ||
| 6111 | - blocks_total += blocks; | ||
| 6112 | - let theirs = ffmpeg_decode_sequence(&stream, width, height, frames.len()); | ||
| 6113 | - assert_eq!(frames.len(), theirs.len(), "{NAME}: {arm} frame count"); | ||
| 6114 | - for (i, (ours, ref_frame)) in frames.iter().zip(theirs.iter()).enumerate() { | ||
| 6115 | assert!( | 6146 | assert!( |
| 6116 | - ours.y == ref_frame.y && ours.u == ref_frame.u && ours.v == ref_frame.v, | 6147 | + sb128 && intrabc_frames > 0, |
| 6117 | - "{NAME}: {arm} frame {i} does not match ffmpeg" | 6148 | + "{NAME}: {arm} no longer codes sb128 + allow_intrabc" |
| 6149 | + ); | ||
| 6150 | + crate::decode::reset_intrabc_hits(); | ||
| 6151 | + let frames = | ||
| 6152 | + decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME}: {arm}: {e}")); | ||
| 6153 | + let blocks = crate::decode::intrabc_hits(); | ||
| 6154 | + blocks_total += blocks; | ||
| 6155 | + blocks_at_depth[usize::from(depth == 10)] += blocks; | ||
| 6156 | + let theirs = if depth == 10 { | ||
| 6157 | + ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | ||
| 6158 | + } else { | ||
| 6159 | + ffmpeg_decode_sequence(&stream, width, height, frames.len()) | ||
| 6160 | + }; | ||
| 6161 | + assert_eq!(frames.len(), theirs.len(), "{NAME}: {arm} frame count"); | ||
| 6162 | + for (i, (ours, ref_frame)) in frames.iter().zip(theirs.iter()).enumerate() { | ||
| 6163 | + assert!( | ||
| 6164 | + ours.y == ref_frame.y | ||
| 6165 | + && ours.u == ref_frame.u | ||
| 6166 | + && ours.v == ref_frame.v, | ||
| 6167 | + "{NAME}: {arm} frame {i} does not match ffmpeg" | ||
| 6168 | + ); | ||
| 6169 | + frames_compared += 1; | ||
| 6170 | + } | ||
| 6171 | + eprintln!( | ||
| 6172 | + "{NAME}: {arm} intrabc_frames={intrabc_frames} intrabc_blocks={blocks} \ | ||
| 6173 | + DECODED {} frame(s) exact", | ||
| 6174 | + frames.len() | ||
| 6118 | ); | 6175 | ); |
| 6119 | - frames_compared += 1; | ||
| 6120 | } | 6176 | } |
| 6121 | - eprintln!( | ||
| 6122 | - "{NAME}: {arm} intrabc_frames={intrabc_frames} intrabc_blocks={blocks} \ | ||
| 6123 | - DECODED {} frame(s) exact", | ||
| 6124 | - frames.len() | ||
| 6125 | - ); | ||
| 6126 | } | 6177 | } |
| 6127 | } | 6178 | } |
| 6128 | assert!(frames_compared > 0, "{NAME}: no frame was compared"); | 6179 | assert!(frames_compared > 0, "{NAME}: no frame was compared"); |
| @@ -6130,6 +6181,13 @@ pub(crate) mod tests { | |||
| 6130 | blocks_total > 0, | 6181 | blocks_total > 0, |
| 6131 | "{NAME}: gate is vacuous -- no arm decoded a single intrabc block" | 6182 | "{NAME}: gate is vacuous -- no arm decoded a single intrabc block" |
| 6132 | ); | 6183 | ); |
| 6184 | + assert!( | ||
| 6185 | + blocks_at_depth[0] > 0 && blocks_at_depth[1] > 0, | ||
| 6186 | + "{NAME}: 8-bit={} 10-bit={} -- an arm at that depth no longer decodes an intrabc \ | ||
| 6187 | + block, so `enable-intrabc` coverage there would rest on the flag spelling alone", | ||
| 6188 | + blocks_at_depth[0], | ||
| 6189 | + blocks_at_depth[1] | ||
| 6190 | + ); | ||
| 6133 | } | 6191 | } |
| 6134 | 6192 | ||
| 6135 | /// lane-t900 r33, CENSUS for "a sub-8x8 leaf that uses intrabc". | 6193 | /// lane-t900 r33, CENSUS for "a sub-8x8 leaf that uses intrabc". |
lanes/av1-intrabc-r1.report.mdadded+97 -0
| @@ -0,0 +1,97 @@ | |||
| 1 | +# lane-av1-intrabc r1 — the fifth gate-integrity entry closes with an engagement counter, not a flag | ||
| 2 | + | ||
| 3 | +Branch `lane-av1-intrabc`, base `f715d70c`. Closes the last clause of | ||
| 4 | +`debt|gate-integrity|ec-av1: five aomenc coding tools …` (deleted from | ||
| 5 | +`~/.omp/agent/debts/DEBTS-home-user-Documents-Code-Rust-edith_codecs.md`). | ||
| 6 | + | ||
| 7 | +## What the debt premise got wrong at HEAD | ||
| 8 | + | ||
| 9 | +`--enable-intrabc` is NOT off in all real-aomenc gates at `f715d70c`. lane-kf900 r6/r7 and | ||
| 10 | +lane-t900 r31-r34 landed between 2026-09-02 and HEAD: | ||
| 11 | + | ||
| 12 | +- `stream::tests::a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips` — | ||
| 13 | + `--enable-intrabc=1`, assert `rect_intrabc_reads > 0 && intrabc_hits > 0 && leaf8_intrabc_hits > 0`, | ||
| 14 | + one named refusal expected (rect-strip intrabc). | ||
| 15 | +- `stream::tests::an_sb128_screen_stream_with_intrabc_decodes_pixel_exact` | ||
| 16 | +- `stream::tests::an_intrabc_block_under_tx_mode_select_decodes_pixel_exact` | ||
| 17 | +- `stream::tests::a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal` | ||
| 18 | + and `an_intrabc_vartx_census_measures_the_mixed_leaf_refusal` (censuses). | ||
| 19 | + | ||
| 20 | +Re-run at HEAD (all pass, one command, `--nocapture`): | ||
| 21 | + | ||
| 22 | + cargo test -p ec-av1 --release --lib -- --nocapture --test-threads=1 intrabc | ||
| 23 | + -> 7 passed; 0 failed; 1 ignored. `a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips`: | ||
| 24 | + 185 rect use_intrabc symbol(s) read, 5 intrabc block(s) decoded across 4 arm(s), | ||
| 25 | + 1 refused by name, 7 frames compared, 3 out of scope (0 mismatched), 1 intrabc block at an 8x8 leaf. | ||
| 26 | + | ||
| 27 | +## The real hole this round found and closed: the 10-bit entry rested on a SPELLING | ||
| 28 | + | ||
| 29 | +`gate_coverage.rs`'s 10-bit `enable-intrabc` closure cited | ||
| 30 | +`a_real_aomenc_rect_strip_palette_decodes_pixel_exact`'s `smptebars-screen-txs-cq40/cq55` arms, which | ||
| 31 | +merely pass `--enable-intrabc=1`. Measured with a temporary per-arm delta print: those arms decode | ||
| 32 | +**0** intrabc blocks at both depths (all 5 arms × 2 depths), i.e. the entry was retired by a flag on a | ||
| 33 | +command line — the exact defect the guard exists for. | ||
| 34 | + | ||
| 35 | +Fix: `screen_intrabc_stream_at_depth` (depth-aware twin of `screen_intrabc_stream_with`) + | ||
| 36 | +`an_sb128_screen_stream_with_intrabc_decodes_pixel_exact` now runs its four sb128 screen recipes at | ||
| 37 | +8 AND 10 bits and hard-asserts a decoded intrabc block per depth (`blocks_at_depth[0] > 0 && | ||
| 38 | +blocks_at_depth[1] > 0`), every frame pixel-compared against ffmpeg's own decode at that depth | ||
| 39 | +(`ffmpeg_decode_sequence_10bit` at 10 bits). Observed: | ||
| 40 | + | ||
| 41 | + sb128 8-bit txs=0/1 × cq=30/45: intrabc_frames=1, intrabc_blocks=4/4/5/4, exact | ||
| 42 | + sb128 10-bit txs=0/1 × cq=30/45: intrabc_frames=1, intrabc_blocks=4/4/6/5, exact | ||
| 43 | + | ||
| 44 | +Engagement is encoder-side too: libaom resets `allow_intrabc` when no block selected intrabc | ||
| 45 | +(encodeframe.c:2335-2337), so a frame header that keeps `allow_intrabc=1` proves the encoder picked | ||
| 46 | +it; the gate asserts `intrabc_frames > 0` off the parsed header as well. | ||
| 47 | + | ||
| 48 | +`gate_coverage.rs` comments updated: the 8-bit paragraph records the re-verified counts; the 10-bit | ||
| 49 | +paragraph records that the palette-gate citation was a measured zero-engagement spelling and names | ||
| 50 | +the new closing witness. Case closed in report. | ||
| 51 | + | ||
| 52 | +`decode::intrabc_hits()` is now exposed as `ec_av1::stream::intrabc_hits()` and printed by | ||
| 53 | +`examples/decode_probe.rs`, so the standalone pair below prints the counter. | ||
| 54 | + | ||
| 55 | +## Standalone command pair (prints engagement + comparison) | ||
| 56 | + | ||
| 57 | +Fixture (outside git, `~/.cache/intrabc-fixture/`): | ||
| 58 | + | ||
| 59 | + ffmpeg -v error -f lavfi -i 'smptebars=size=128x96:rate=25' -t 0.2 -vf tile=2x2 \ | ||
| 60 | + -pix_fmt yuv420p10le -strict -1 -f yuv4mpegpipe - \ | ||
| 61 | + | ~/.cache/aom-oracle/build/aomenc --codec=av1 --bit-depth=10 --input-bit-depth=10 --passes=1 \ | ||
| 62 | + --end-usage=q --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1 --limit=1 --threads=1 \ | ||
| 63 | + --tile-columns=0 --min-partition-size=8 --max-partition-size=32 --sb-size=64 \ | ||
| 64 | + --tune-content=screen --enable-intrabc=1 --enable-palette=0 --cq-level=30 \ | ||
| 65 | + --enable-tx-size-search=1 --enable-rect-partitions=0 --enable-1to4-partitions=0 --sb-size=128 \ | ||
| 66 | + --obu -o sb128-10bit-cq30.obu - | ||
| 67 | + | ||
| 68 | +Engagement + result: | ||
| 69 | + | ||
| 70 | + EC_PROBE_HDR=1 cargo run --release --example decode_probe -- sb128-10bit-cq30.obu | ||
| 71 | + -> HDR 0: type=Key … screen_tools=true intrabc=true … tx_mode=Select | ||
| 72 | + OK: 1 frames decoded, 256x192 ; intrabc_hits: 6 | ||
| 73 | + cargo run --release --example dump_yuv -- sb128-10bit-cq30.obu ours | ||
| 74 | + ffmpeg -v error -i sb128-10bit-cq30.obu -pix_fmt yuv420p10le -f rawvideo ref.yuv | ||
| 75 | + cmp ours.f0.yuv ref.yuv -> BYTE-EXACT-10BIT | ||
| 76 | + sha256 de0d83756d22e422b19413e9e1c20325b9bd68fe2f27aae872da2d4736f6a007 (both files) | ||
| 77 | + | ||
| 78 | +The arbiter agrees, and the oracle's own decoder accepts the stream | ||
| 79 | +(`aomdec --i420 --output-bit-depth=10 --md5`: md5 `f1b7222466d15d1dda3e25fdbd8577fe`). | ||
| 80 | + | ||
| 81 | +## Refusals — genuine capability gaps, all pinned | ||
| 82 | + | ||
| 83 | +- `intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not ported at this shape)` — | ||
| 84 | + the reader consumes the symbol and refuses by name; gate asserts exactly one such refusal | ||
| 85 | + (`a_real_aomenc_screen_key_frame_reads_use_intrabc_on_rect_strips`, `refused == 1`). | ||
| 86 | +- sub-8x8 leaf intrabc and intrabc var-tx mixed-leaf shapes have their own censuses that assert the | ||
| 87 | + premise is reached before reading anything into the refusal firing. Current run: var-tx census | ||
| 88 | + decoded 5 intrabc blocks through the var-tx tree, 0 mixed-leaf resolutions, 4 frames exact. | ||
| 89 | + No bug localized; no arm with a decoded intrabc block mismatched ffmpeg (0 mismatches). | ||
| 90 | + | ||
| 91 | +## Gates run | ||
| 92 | + | ||
| 93 | + EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --release --lib -- --nocapture --test-threads=1 intrabc | ||
| 94 | + -> 7 passed / 0 failed / 1 ignored | ||
| 95 | + cargo test -p ec-av1 --release --lib -- --exact gate_coverage::tests::never_exercised_8bit_matches_the_gate_recipes gate_coverage::tests::never_exercised_10bit_matches_the_gate_recipes | ||
| 96 | + -> ok (derived hole set unchanged: 8-bit 5 holes, 10-bit 2; `enable-intrabc` in neither) | ||
| 97 | + cargo check -p ec-av1 --all-targets -> 0 warnings | ||