diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 62afe159..09e58ea7 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -2710,6 +2710,15 @@ pub fn skip_split_tx_hits() -> usize { // witness this path, so a gate that wants it needs the counter. thread_local! { static SKIP_SPLIT_TX_OVERRIDE_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// lane-av1chromadc: chroma units of a skipped block whose intra-BC / + /// UV-palette override had to be WINDOWED to the unit's own extent -- + /// i.e. `cn_cols * cn_rows > 1`, which at 4:2:0 never happens (the chroma + /// plane block is one 32x32 unit) and at 4:4:4 is every block of 64 and + /// above. Counts UNITS, not blocks. EXCLUSIVE to this walk: the other two + /// override sites (the luma slot and `decode_intrabc_owned_rect`) have + /// their own windows. + static SKIP_CHROMA_OVERRIDE_WINDOW_HITS: std::cell::Cell = + const { std::cell::Cell::new(0) }; } /// Current value of [`SKIP_SPLIT_TX_OVERRIDE_HITS`] (blocks). @@ -2717,6 +2726,18 @@ pub fn skip_split_tx_override_hits() -> usize { SKIP_SPLIT_TX_OVERRIDE_HITS.with(|c| c.get()) } +/// lane-av1chromadc: [`SKIP_CHROMA_OVERRIDE_WINDOW_HITS`]. +#[allow(dead_code)] // read only from the `#[cfg(test)]` gates +pub fn skip_chroma_override_window_hits() -> usize { + SKIP_CHROMA_OVERRIDE_WINDOW_HITS.with(|c| c.get()) +} + +/// Zeroes [`SKIP_CHROMA_OVERRIDE_WINDOW_HITS`] before a gate's own decode. +#[allow(dead_code)] // read only from the `#[cfg(test)]` gates +pub fn reset_skip_chroma_override_window_hits() { + SKIP_CHROMA_OVERRIDE_WINDOW_HITS.with(|c| c.set(0)); +} + /// Zeroes [`SKIP_SPLIT_TX_OVERRIDE_HITS`] before a gate's own decode attempt. pub fn reset_skip_split_tx_override_hits() { SKIP_SPLIT_TX_OVERRIDE_HITS.with(|c| c.set(0)); @@ -21671,8 +21692,42 @@ fn decode_block( ) }; let (cu_x, cu_y) = (cpx + cu_col * chroma_tx, cpy + cu_row * chroma_tx_h); + // lane-av1chromadc: the chroma override is a whole + // `chroma_side x chroma_height` buffer and + // `PlaneBuf::reconstruct` uses the buffer it takes as the + // UNIT's own `chroma_tx x chroma_tx_h` prediction, so a + // multi-unit plane block must hand each unit its own window of + // it. Handing the whole buffer (the pre-fix shape) made every + // unit predict from the top-left one: at 4:2:0 the chroma plane + // block is a single 32x32 unit, so the whole buffer IS that + // unit's window and the bug is invisible -- which is why every + // 4:2:0 gate stayed green -- and at 4:4:4 a 64x64 block's 64x64 + // plane block is a 2x2 grid whose right and bottom columns were + // a copy of its top-left unit. + // MEASURED on `fixtures/r512.obu` (4:4:4 8-bit 512x512, three + // frames): frame 0's skipped 64x64 intra-BC block at + // `mi=(112,80)` `px=(320,448)` reconstructed its `cu=(1,0)` + // unit at `px=(352,448)` as a flat 241 where the oracle has + // 202 -- byte-identical to its `cu=(0,0)` prediction, sum + // 882176 and all -- and the coded 64x64 to its right then read + // 202/175 against the oracle's 165/166. Gate: + // `a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit`. + let chroma_window = |buf: &[u16]| -> Vec { + if cn_cols == 1 && cn_rows == 1 { + return buf.to_vec(); + } + let mut window = Vec::with_capacity(chroma_tx * chroma_tx_h); + for row in 0..chroma_tx_h { + let at = (cu_row * chroma_tx_h + row) * chroma_side + cu_col * chroma_tx; + window.extend_from_slice(&buf[at..at + chroma_tx]); + } + window + }; if let Some((ub, _)) = &palette_uv_bufs { - set_palette_pred(ub.clone(), fctx); + if cn_cols * cn_rows > 1 { + hit!(SKIP_CHROMA_OVERRIDE_WINDOW_HITS); + } + set_palette_pred(chroma_window(ub), fctx); } push_intra_unit( 1, @@ -21690,7 +21745,7 @@ fn decode_block( fctx, ); if let Some((_, vb)) = &palette_uv_bufs { - set_palette_pred(vb.clone(), fctx); + set_palette_pred(chroma_window(vb), fctx); } push_intra_unit( 2, diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 46528c9c..0fd6c54e 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -157,6 +157,20 @@ pub fn reset_ibc_owned_rect_chroma_footprint_444_hits() { crate::decode::reset_ibc_owned_rect_chroma_footprint_444_hits() } +/// lane-av1chromadc: chroma units of a skipped block whose intra-BC / UV +/// palette override had to be windowed to the unit's own extent -- `cn_cols * +/// cn_rows > 1`, which at 4:2:0 never happens and at 4:4:4 is every block of +/// 64 and above. Counts UNITS. EXCLUSIVE to `decode_block`'s skipped square +/// block chroma walk. +pub fn skip_chroma_override_window_hits() -> usize { + crate::decode::skip_chroma_override_window_hits() +} + +/// Gate-side reset for the lane-av1chromadc counter above. +pub fn reset_skip_chroma_override_window_hits() { + crate::decode::reset_skip_chroma_override_window_hits() +} + /// `(y, uv)` palette blocks RECONSTRUCTED inside an inter frame (lane-t900 /// r22) -- the counter a screen-content witness gate reads to prove it /// exercises the inter-frame palette path, not the key frame's. @@ -49282,19 +49296,21 @@ pub(crate) mod tests { /// was deleted: `rect_inter_chroma_set` still refuses (32, 64) and the /// string is still in the source, it is just not on this path any more. /// - /// The assertion is a per-(frame, plane) EXACT PREFIX against the - /// instrumented aomdec, the same shape as the sibling - /// `a_444_intrabc_rect_chroma_plane_block_is_the_block_footprint`. The - /// floors are MEASURED, and each one only grows: - /// - /// * luma is byte-exact on ALL THREE frames (786432/786432 samples). - /// Before the fix frame 0 luma was 166229 samples wrong from 65728 -- - /// the halving's chroma misread desynced the tile. - /// * frame 2 is byte-exact on all three planes. Before the fix it was - /// 9216 U + 8192 V wrong. - /// * frames 0 and 1 carry an OPEN chroma fork at a DIFFERENT site (see - /// lanes/av1chromarect.report.md); the floors below are the exact - /// prefixes, not a claim that the tail is right. + /// The floors were RAISED to full byte-exactness on all three planes of + /// all three frames by lane-av1chromadc, which closed the "open chroma + /// fork" this gate used to carry: a skipped 64x64 square block at 4:4:4 + /// has a 64x64 chroma plane block, libaom walks it as a 2x2 grid of + /// `TX_32X32` units, and the intra-BC chroma override was handed to every + /// unit whole instead of windowed per unit (see + /// `a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit` + /// and lanes/av1chromadc.report.md). The history of these floors: + /// + /// * lane-av1chromarect, after the ss-derived extent and the multi-unit + /// walk: `[[262144, 229728, 229728], [262144, 65704, 65704], + /// [262144, 262144, 262144]]` -- luma exact on all three frames, frame 2 + /// exact on all three planes, 79969 chroma samples still wrong. + /// * lane-av1chromadc: `[[262144; 3]; 3]` -- every plane of every frame + /// byte-exact against aomdec. Floors only ever grow. #[test] fn a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes() { const NAME: &str = @@ -49303,12 +49319,9 @@ pub(crate) mod tests { const LEN: usize = 6948; /// 512x512 8-bit 4:4:4, one plane. const PLANE: usize = 512 * 512; - /// First differing sample per (frame, plane), decode order. - const EXACT_PREFIX: [[usize; 3]; 3] = [ - [PLANE, 229728, 229728], - [PLANE, 65704, 65704], - [PLANE, PLANE, PLANE], - ]; + /// Exact prefix per (frame, plane), decode order. FULL: every plane of + /// every frame is byte-exact against the oracle. + const EXACT_PREFIX: [[usize; 3]; 3] = [[PLANE; 3]; 3]; let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(format!("fixtures/{FILE}")); let stream = std::fs::read(&path) @@ -49398,4 +49411,114 @@ pub(crate) mod tests { } let _ = std::fs::remove_dir_all(&dir); } + + /// lane-av1chromadc: a SKIPPED 64x64 square block at 4:4:4 has a 64x64 + /// chroma plane block, which libaom walks as a 2x2 grid of `TX_32X32` units + /// (`get_vartx_max_txsize`: `av1_get_adjusted_tx_size(TX_64X64) = + /// TX_32X32`). The intra-BC / UV-palette chroma override + /// ([`decode_block`]'s `intrabc_bufs` / `palette_uv_bufs`, the + /// `PALETTE_PRED` slot) is a whole-`chroma_side x chroma_height` buffer and + /// must be WINDOWED per unit: `PlaneBuf::reconstruct` uses the buffer it + /// takes as the unit's own `side x side` prediction. At 4:2:0 the chroma + /// plane block is one 32x32 unit, so the whole buffer IS that unit's + /// window and the bug is invisible -- which is why it survived every 4:2:0 + /// gate. At 4:4:4 every unit was handed the buffer's FIRST 32x32, so the + /// block's right and bottom chroma columns were a copy of its top-left + /// unit. + /// + /// The witness: `fixtures/r512.obu`, 4:4:4 8-bit 512x512, three frames. The + /// seed is frame 0, `mi=(112,80)`, `px=(320,448)`, `side=64`, `skip=1`, + /// `mode=0`, `uv_mode=0` -- a skipped intra-BC block at the frame's bottom + /// edge. Its chroma unit `cu=(1,0)` at `px=(352,448)` reconstructs a flat + /// 241 (U) / 110 (V) where the oracle has 202 / 222, because it read the + /// same override window as `cu=(0,0)`. + /// + /// This gate asserts FULL frame exactness on all three planes of all three + /// frames. It is the red-before: on the unpatched tree it fails at + /// `(352,448)` of frame 0, which is the seed's second chroma unit. + #[test] + fn a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit() { + const NAME: &str = "a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit"; + const FILE: &str = "r512.obu"; + const LEN: usize = 6948; + const PLANE: usize = 512 * 512; + let path = + std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(format!("fixtures/{FILE}")); + let stream = std::fs::read(&path) + .unwrap_or_else(|e| panic!("{NAME}: pinned fixture {FILE} missing: {e}")); + assert_eq!(stream.len(), LEN, "{NAME}: {FILE} length moved"); + assert_444_header(&stream, NAME, 8); + + let _guard = lock_gate_counters(); + reset_skip_chroma_override_window_hits(); + let dir = std::env::temp_dir().join(format!("ec-av1-{NAME}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).expect("scratch dir"); + let obu = dir.join("in.obu"); + std::fs::write(&obu, &stream).expect("writing the stream"); + let aom_prefix = dir.join("aom"); + let out = Command::new(aomdec_path()) + .args(["--codec=av1", "-o"]) + .arg(dir.join("out.y4m")) + .arg(&obu) + .env("EC_AV1_FINAL_DUMP", &aom_prefix) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output() + .expect("aomdec failed to run"); + assert!( + out.status.success(), + "{NAME}: the oracle aomdec refused the stream: {}", + String::from_utf8_lossy(&out.stderr) + ); + let ours_prefix = dir.join("ours"); + set_final_dump_prefix(Some(ours_prefix.display().to_string())); + if let Err(e) = decode_stream(&stream) { + panic!("{NAME}: this decoder refused the witness: {e}"); + } + set_final_dump_prefix(None); + // Non-vacuity: the windowed arm must have run, or the exactness below + // is measuring a witness that never reached the 2x2 chroma walk. + let windows = skip_chroma_override_window_hits(); + assert!( + windows >= 8, + "{NAME}: {windows} windowed chroma override unit(s) on this witness, expected at \ + least 8 (two skipped 64x64 intra-BC blocks x 2x2 units x 2 planes) -- the witness \ + stopped exercising the arm, so the exactness below is vacuous" + ); + for f in 0..3 { + let aom_dump = std::fs::read(format!("{}.f{f}", aom_prefix.display())) + .unwrap_or_else(|e| panic!("{NAME}: oracle dump f{f} missing: {e}")); + let our_dump = std::fs::read(format!("{}.f{f}", ours_prefix.display())) + .unwrap_or_else(|e| panic!("{NAME}: our dump f{f} missing: {e}")); + assert_eq!( + our_dump.len(), + 3 * PLANE, + "{NAME}: frame {f} is not 8-bit 4:4:4 512x512" + ); + for (plane, name) in [(0usize, "Y"), (1, "U"), (2, "V")] { + let at = plane * PLANE; + if our_dump[at..at + PLANE] == aom_dump[at..at + PLANE] { + continue; + } + let first = (0..PLANE) + .find(|&s| our_dump[at + s] != aom_dump[at + s]) + .unwrap_or(PLANE); + let wrong = (0..PLANE) + .filter(|&s| our_dump[at + s] != aom_dump[at + s]) + .count(); + panic!( + "{NAME}: decode-order frame {f} plane {name} is byte-exact nowhere -- first \ + divergence at sample {first} of {PLANE} (x={}, y={}), {wrong} samples \ + wrong. The seed is frame 0, mi=(112,80) px=(320,448) side=64 skip=1, whose \ + chroma unit cu=(1,0) at px=(352,448) must be the SECOND 32x32 window of \ + the block's chroma override and not a copy of cu=(0,0)'s.", + first % 512, + first / 512 + ); + } + } + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/lanes/av1chromadc.report.md b/lanes/av1chromadc.report.md new file mode 100644 index 00000000..34de59a7 --- /dev/null +++ b/lanes/av1chromadc.report.md @@ -0,0 +1,205 @@ +# lane-av1chromadc — the 4:4:4 2x2 chroma override window (79969 → 0) + +Worktree `~/.cache/wt/av1chromadc`, branch `lane-av1chromadc`, base `57834ee2` +("Merge lane-av1chromarect-r2"). All edits absolute-pathed inside this worktree; +`git -C ~/Documents/Code/Rust/edith_codecs status --porcelain` printed nothing +after every edit batch. + +Fixes the residual `lanes/av1chromarect-r2.report.md` narrowed, in +`decode_block`'s SQUARE path, and closes the witness to **full byte-exactness on +every plane of every frame**. `decode_intrabc_owned_rect` (the strip arm) is not +touched. + +## 1. Red-before, on the UNPATCHED tree + +Gate `a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit` +(`crates/ec-av1/src/stream.rs`), added first, asserting full frame exactness on +`fixtures/r512.obu` against the instrumented aomdec: + + $ EC_AV1_REQUIRE_AOMDEC=1 cargo test -p ec-av1 --lib a_444_skipped_64x64 -- --nocapture + thread 'stream::tests::a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit' panicked: + a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit: decode-order frame 0 + plane U is byte-exact nowhere -- first divergence at sample 229728 of 262144 (x=352, y=448), + 7488 samples wrong. The seed is frame 0, mi=(112,80) px=(320,448) side=64 skip=1, whose + chroma unit cu=(1,0) at px=(352,448) must be the SECOND 32x32 window of the block's chroma + override and not a copy of cu=(0,0)'s. + test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 768 filtered out + +That is the unpatched decode diverging at the seed's exact sample, not a mutation +red. The 79969 total from r2 is the same measurement: 7488 + 8128 on frame 0, +22571 + 41782 on frame 1, 0 on frame 2. + +## 2. The defect + +A skipped 64x64 square block at 4:4:4 has a **64x64 chroma plane block**, which +libaom walks as a 2x2 grid of `TX_32X32` units (`get_vartx_max_txsize` → +`av1_get_adjusted_tx_size(TX_64X64) = TX_32X32`, decodeframe.c:994-1004). + +Its chroma prediction is not edge-derived: it is the intra-BC / UV-palette +**override**, a whole-`chroma_side x chroma_height` buffer carried on the +`PALETTE_PRED` slot (`decode_block`'s `intrabc_bufs` / `palette_uv_bufs` → +`set_palette_pred` → `PlaneBuf::reconstruct`'s `pred`). `reconstruct` uses the +buffer it takes as the **unit's own** `chroma_tx x chroma_tx_h` prediction -- +`let prediction = if let Some(buf) = pred { buf } else { … }` -- so a multi-unit +plane block must hand each unit its own WINDOW of that buffer. + +The pre-fix call was `set_palette_pred(ub.clone(), fctx)`: the whole buffer, for +every unit. At 4:2:0 the chroma plane block of a 64x64 block is a single 32x32 +unit, so the whole buffer IS that unit's window and the bug is **invisible** -- +which is why every 4:2:0 gate stayed green. At 4:4:4 every unit took the buffer's +first 32x32. + +The code already said so, at the site, for LUMA: *"its per-TU windowing is the +non-skip loop's own `palette_y_buf` slice, untested for skip and unreachable in +these streams"*, and `lane-svt1` had armed the whole-block luma buffer on the +skip arm for a related reason. The chroma half never got the same treatment, and +`r512.obu` is the stream that makes it reachable. + +**Measured proof, before the fix** (`EC_PRED`, the per-unit prediction trace; +identical sums and identical `row0`/`col0` are the signature of a copied window): + + OUR_PRED x=320 y=448 plane=1 side=32 mode=0 sum=882176 row0=[241,241,241,241,241,241,241,241] col0=[241,202,241,202,241,202,241,202] + OUR_PRED x=352 y=448 plane=1 side=32 mode=0 sum=882176 row0=[241,241,241,241,241,241,241,241] col0=[241,202,241,202,241,202,241,202] + OUR_PRED x=320 y=448 plane=2 side=32 mode=0 sum=751936 row0=[110,110,110,110,110,110,110,110] col0=[110,222,110,222,110,222,110,222] + OUR_PRED x=352 y=448 plane=2 side=32 mode=0 sum=751936 row0=[110,110,110,110,110,110,110,110] col0=[110,222,110,222,110,222,110,222] + +and `EC_DEBUG_EDGES` printed **nothing** for x=320/352 at y=448, i.e. `edges()` +was never called -- the prediction came from the override, not from the edges. +(`EDGES_SQ` DOES print for the coded sibling at x=448, whose units therefore went +through the per-unit DC path and were already right.) + +## 3. The fix + +`decode_block`'s skip-arm chroma unit loop, both planes: one `chroma_window` +closure that returns the buffer whole when the plane block is a single unit and +otherwise slices rows `cu_row*chroma_tx_h .. +chroma_tx_h` × cols +`cu_col*chroma_tx .. +chroma_tx` at the buffer's own `chroma_side` stride. + +Nothing else changes: the single-unit case (every 4:2:0 shape, every 4:4:4 shape +below 64) takes the identical path it took before, and the strip arm is +untouched. + +## 4. Result + + $ EC_AV1_REQUIRE_AOMDEC=1 cargo test -p ec-av1 --lib -- a_444_intrabc_owned_rect a_444_skipped_64x64 + test stream::tests::a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit ... ok + test stream::tests::a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes ... ok + test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 767 filtered out + +Per (frame, plane), wrong samples, before → after: + +| frame | Y | U | V | +| --- | --- | --- | --- | +| 0 | 0 → 0 | 7488 → **0** | 8128 → **0** | +| 1 | 0 → 0 | 22571 → **0** | 41782 → **0** | +| 2 | 0 → 0 | 0 → 0 | 0 → 0 | + +**79969 → 0.** Every plane of every frame is byte-exact against the aomdec +oracle, 2359296/2359296 samples. The floors in +`a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes` were +RAISED from `[[262144, 229728, 229728], [262144, 65704, 65704], [262144, 262144, +262144]]` to `[[262144; 3]; 3]`; both floors' history is recorded in the test's +doc comment. No floor was lowered. + +## 5. Class sweep — all four unit positions, and which were already right + +Every multi-unit chroma-override walk on the witness, with the window head the fix +now hands each unit (temporary `EC_ZZSRC` probe, removed before the commit; +`win_head` = the unit window's first eight samples): + +| frame | block | skip | source | cu(0,0) | cu(1,0) | cu(0,1) | cu(1,1) | pre-fix state | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| 0 | px=(320,448) side=64 | true | intrabc | 241 | 202 | 241 | 202 | **(1,0) and (1,1) WRONG** (both got 241) | +| 0 | px=(384,448) side=64 | true | intrabc | 202 | 203 | 202 | 203 | all four right -- the buffer is flat, so the copy was indistinguishable | +| 1 | px=(128,128) side=64 | true | intrabc | 54 | 54 | 54 | 54 | (1,0)/(1,1) wrong further into the window -- see §6 | +| 1 | px=(320,448) side=64 | true | intrabc | 240 | 202 | 240 | 202 | **(1,0) and (1,1) WRONG** | +| 1 | px=(448,384) side=64 | true | intrabc | 166 | 166 | 166 | 166 | all four right -- flat buffer | + +The rule the sweep establishes: the bug is invisible when the override buffer is +constant across the plane block (rows 2 and 5 above, and both `cu_col == 0` +positions always), and wrong at exactly the `(1,0)` and `(1,1)` positions +whenever the buffer varies. `(0,0)` and `(0,1)` were never wrong -- they read +offset 0, which is their own window. That is why the dirty map in r2 §1 starts at +x=352 = 320 + 32 and not at x=320. + +**Both edge families:** the intra-BC and UV-palette sources share one line +(`palette_uv_bufs` is `intrabc_bufs`' chroma half when intrabc is present, else +the palette map), so the fix is structurally shared. MEASURED, though: every +multi-unit walk on this witness is `src=intrabc`; the UV-palette source never +reaches a multi-unit chroma walk here, so its arm of the sweep is argued from +the shared code path, not witnessed. That is the one cell of the class this lane +does not have a measurement for. + +Non-vacuity: new counter `SKIP_CHROMA_OVERRIDE_WINDOW_HITS` counts chroma units +whose override had to be windowed (`cn_cols * cn_rows > 1`), exclusive to this +walk. The gate asserts `>= 8` (two skipped 64x64 intra-BC blocks × 2×2 units × 2 +planes) before it compares a single sample, so the exactness cannot be vacuous. + +## 6. The f1 hypothesis: CONFIRMED + +r2 §5 predicted f1's dirty column `x=128..192` (first dirty cell `(168,128)`, +56 of 64 samples wrong) was the skipped 64x64 at `px=(128,128)`. It is. That is +the only multi-unit override walk in that column, it is `skip=1 side=64 src=intrabc`, +and frame 1 goes from 22571 U + 41782 V wrong to **0** with this fix and no other +change. Its four windows' first eight samples are all `54`, so the difference is +further into the unit window than the head I printed — the block is flat near its +top-left and not flat at `(168,128)`, which is exactly the invisible-until-it-isn't +shape the sweep above describes. + +## 7. Gates + +`cargo check -p ec-av1 --all-targets` clean (0 errors, 0 warnings) before every +run, on a private `CARGO_TARGET_DIR`; a green gate next to a build error would +have been a stale binary. + + $ EC_AV1_REQUIRE_AOMDEC=1 EC_AV1_REQUIRE_AOMENC=1 \ + cargo test -p ec-av1 --lib -- a_444 lossless_444 intrabc_rect 444_lossless -- --nocapture + test result: ok. 34 passed; 0 failed; 0 ignored; 0 measured; 735 filtered out + +34 = the 33 of lane-av1chromarect's r5 quote plus this lane's new gate. The set +carries the 4:4:4-lossless family (`a_lossless_444_*`, +`a_444_lossless_sb64_intrabc_rect_chroma_walks_4x4_units`, +`a_real_aomenc_lossless_444_key_frame_decodes_sample_exact`), the intrabc_rect +family, and the 4:2:0 identity arm +(`a_444_intrabc_rect_chroma_plane_block_is_the_block_footprint`, whose +`420_intrabc_rect4_witness.obu` twin goes through `decode_all_frames_vs_oracle`). + +One filtered run per tree, same filter string, same env, private +`CARGO_TARGET_DIR` each: + + $ EC_AV1_REQUIRE_AOMDEC=1 EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib \ + -- rect intrabc ibc chroma 444 420 subsampl -- --nocapture + +| tree | result | +| --- | --- | +| base `57834ee2` (`~/.cache/wt/av1chromadc-base`, detached) | `ok. 140 passed; 0 failed; 5 ignored; 0 measured; 623 filtered out; finished in 284.66s` | +| tip `lane-av1chromadc` | `ok. 141 passed; 0 failed; 5 ignored; 0 measured; 623 filtered out; finished in 288.94s` | + +The set difference of the two passing-test lists is exactly this lane's new +gate and nothing else: + +``` +> test stream::tests::a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit +``` + +The same 5 tests are `#[ignore]`d in both trees. + +### Mutation proofs, each reverted + +| # | mutation | result | +| --- | --- | --- | +| M1 | `chroma_window` returns the whole buffer unconditionally (the pre-fix shape) | **RED** — `frame 0 plane U … first divergence at sample 229728 (x=352, y=448), 7488 samples wrong` | +| M2 | the window's row stride `chroma_side` → `chroma_tx` | **RED** — `frame 0 plane U … first divergence at sample 229824 (x=448, y=448), 7488 samples wrong` | +| M3 | `cu_row`/`cu_col` transposed in the window offset | **RED** — `frame 0 plane U … first divergence at sample 229728 (x=352, y=448), 7488 samples wrong` | + +## 8. Not done + +1. The UV-palette arm of the class sweep has no witness here (§5). It shares the + fixed line, but a 4:4:4 `--enable-palette=1` stream with a skipped block of 64 + and above would be the measurement, and I did not encode one. +2. `decode_intrabc_rect` (decode.rs:13646) and the other rect paths read their + chroma through `read_inter_rect_chroma` / the intrabc split walk, which + already window per unit; I did not re-verify each of them against a + multi-unit override, only that the wide family is unchanged. +3. No heavy encodes: the witness came from the pin and the gate families are + fixture-driven. No server fleet run was requested or consumed.