diff --git a/crates/ec-av1/examples/decode_probe.rs b/crates/ec-av1/examples/decode_probe.rs index 295e4938..4d534d2d 100644 --- a/crates/ec-av1/examples/decode_probe.rs +++ b/crates/ec-av1/examples/decode_probe.rs @@ -49,6 +49,11 @@ fn main() { // asserts -- printed here so a recipe sweep can see it fire without a // test-binary rebuild. println!("skip_split_tx: {}", ec_av1::decode::skip_split_tx_hits()); + let es = ec_av1::decode::inter_edge_strip_hits(); + println!( + "inter_edge_strip: h64={} v64={} h32={} v32={} h16={} v16={}", + es[0], es[1], es[2], es[3], es[4], es[5] + ); let ir = ec_av1::stream::inter_rect_counters(); println!( "inter_rect: 32x8={} 8x32={} 64x32={} 32x64={} 64x16={} 16x64={}", diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index b2131d88..2efe6d5a 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -1162,6 +1162,36 @@ pub(crate) fn edge_rect_strip_hits() -> usize { EDGE_RECT_STRIP_HITS.with(|c| c.get()) } +// lane-interedge r1: frame-edge half strips on the INTER path, per partition +// level (64/32/16) x axis (HORZ at a bottom edge, VERT at a right edge). The +// index is `level_idx * 2 + axis` with `level_idx` 0=64, 1=32, 2=16 and +// `axis` 0=HORZ (`!has_rows`), 1=VERT (`!has_cols`). Both of the user's films +// are height mod 16 == 8, so every inter frame crosses these nodes. +thread_local! { + static INTER_EDGE_STRIP_HITS: std::cell::Cell<[usize; 6]> = + const { std::cell::Cell::new([0; 6]) }; +} + +/// Bumps one bucket of [`INTER_EDGE_STRIP_HITS`]. +pub(crate) fn bump_inter_edge_strip(idx: usize) { + INTER_EDGE_STRIP_HITS.with(|c| { + let mut v = c.get(); + v[idx] += 1; + c.set(v); + }); +} + +/// Current value of [`INTER_EDGE_STRIP_HITS`] (`[h64, v64, h32, v32, h16, v16]`). +pub fn inter_edge_strip_hits() -> [usize; 6] { + INTER_EDGE_STRIP_HITS.with(|c| c.get()) +} + +/// Resets [`INTER_EDGE_STRIP_HITS`] -- a refused attempt must not carry hits +/// into the next one (class `counter-from-refused-stream`). +pub fn reset_inter_edge_strip_hits() { + INTER_EDGE_STRIP_HITS.with(|c| c.set([0; 6])); +} + // How many HORZ/VERT intra strips resolved a SPLIT luma transform // (`tx_depth != 0`) and decoded it per transform unit (lane-rectsplit r1) -- // the case every rect path here refused by name before, and the first @@ -22099,6 +22129,9 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( bw, bh ); + if !four && i == 0 && ((horz && !has_rows) || (!horz && !has_cols)) { + bump_inter_edge_strip(if horz { 0 } else { 1 }); + } match (horz, four) { (true, false) => INTER_SB_HORZ_HITS.with(|c| c.set(c.get() + 1)), (false, false) => INTER_SB_VERT_HITS.with(|c| c.set(c.get() + 1)), @@ -22372,6 +22405,7 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( && (piece_mi.0 >= mi_rows as usize || piece_mi.1 >= mi_cols as usize) { + bump_inter_edge_strip(if horz { 4 } else { 5 }); break; } decode_inter_block( @@ -22952,6 +22986,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( allow_screen_content_tools, frame_width as usize, )?; + } else { + bump_inter_edge_strip(2); } } PARTITION_VERT => { @@ -23063,6 +23099,8 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( allow_screen_content_tools, frame_width as usize, )?; + } else { + bump_inter_edge_strip(3); } } PARTITION_HORZ_A => { diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 39951086..895a846d 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -966,17 +966,142 @@ mod tests { ); } - /// lane-oddh r2 GATE: the frame-edge half-strip arms r1 added (a 64x32 / - /// 32x64 superblock-level or 16x8 / 8x16 16-level INTER block where the - /// frame's true edge cuts the strip in half) actually fire and decode - /// pixel-exact, at both bit depths. 160 = two full superblock rows plus - /// 32 pixels, so every superblock in the last row is a half strip; without - /// r1's arms these attempts refused outright, which is why this gate - /// asserts a nonzero `edge_rect_strip_hits` DELTA on attempts that were - /// actually compared -- a refused attempt's hits would prove nothing - /// (class "counter from refused stream"). + /// lane-interedge r1: one attempt of the inter frame-edge half-strip gate -- + /// encode `width x height` with real aomenc (rect partitions ON, every other + /// lane's open tool pinned off), decode it, and return + /// `(inter_edge_strip hits, frames whose LUMA differs, frames whose CHROMA + /// differs)` against ffmpeg. A refusal or a decode error is a hard failure: + /// this recipe reached every size without one (measured r1). + fn inter_edge_strip_attempt( + name: &str, + width: usize, + height: usize, + bit_depth: u32, + cq: u32, + frames: usize, + ) -> ([usize; 6], usize, usize) { + let duration = format!("{}", frames as f64 / 25.0); + let source = format!("mandelbrot=size={width}x{height}:rate=25"); + let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" }; + let y4m = Command::new("ffmpeg") + .args([ + "-v", "error", "-f", "lavfi", "-i", &source, "-t", &duration, "-pix_fmt", + pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-", + ]) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output() + .expect("ffmpeg failed to run"); + assert!( + y4m.status.success(), + "{name}: ffmpeg refused the {width}x{height} {bit_depth}-bit fixture: {}", + String::from_utf8_lossy(&y4m.stderr) + ); + let depth_arg = format!("--bit-depth={bit_depth}"); + let input_depth_arg = format!("--input-bit-depth={bit_depth}"); + let cq_arg = format!("--cq-level={cq}"); + let limit_arg = format!("--limit={frames}"); + let mut child = Command::new(aomenc_path()) + .args([ + "--codec=av1", "--passes=1", "--end-usage=q", &cq_arg, + // cpu-used >= 1 keeps libaom on 64x64 superblocks at these + // sizes (`av1_select_sb_size`). + "--cpu-used=4", "--threads=1", "--row-mt=0", "--kf-max-dist=9999", + &limit_arg, + // decode order == display order, so the compare below covers + // every frame the stream carries (class gate-blind-to-hidden-frames). + "--lag-in-frames=0", &depth_arg, &input_depth_arg, + // Rect partitions stay ON: the frame-edge strip is a FORCED + // (gathered) HORZ/VERT, but with rect coding off the encoder + // answers that gathered symbol SPLIT every time and no edge + // strip ever fires (lane-oddh r2's finding, re-measured r1). + "--enable-rect-partitions=1", "--enable-ab-partitions=0", + "--enable-1to4-partitions=0", "--min-partition-size=8", + "--max-partition-size=64", + // Other lanes' open gaps this recipe must not trip. + "--enable-palette=0", "--enable-intrabc=0", "--enable-warped-motion=0", + "--enable-obmc=0", "--enable-masked-comp=0", "--enable-interintra-comp=0", + "--enable-onesided-comp=0", "--enable-interintra-wedge=0", + "--enable-smooth-interintra=0", "--enable-ref-frame-mvs=0", + "--enable-angle-delta=0", "--enable-cfl-intra=0", + "--enable-directional-intra=0", "--enable-smooth-intra=0", + "--enable-paeth-intra=0", "--enable-filter-intra=0", + "--enable-tx-size-search=0", + "--obu", "-o", "-", "-", + ]) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .expect("aomenc failed to start"); + child + .stdin + .take() + .expect("aomenc stdin") + .write_all(&y4m.stdout) + .expect("write y4m"); + let out = child.wait_with_output().expect("aomenc failed to run"); + assert!( + out.status.success(), + "aomenc refused: {}", + String::from_utf8_lossy(&out.stderr) + ); + let stream = out.stdout; + + // Reset, never a delta: a refused attempt's hits must not leak into the + // next one (class counter-from-refused-stream). + crate::decode::reset_inter_edge_strip_hits(); + let decoded = decode_stream(&stream).unwrap_or_else(|e| { + panic!("{name}: {width}x{height} {bit_depth}-bit cq {cq} did not decode: {e}") + }); + let hits = crate::decode::inter_edge_strip_hits(); + let reference = if bit_depth == 10 { + ffmpeg_decode_sequence_10bit(&stream, width, height, frames) + } else { + ffmpeg_decode_sequence(&stream, width, height, frames) + }; + assert_eq!( + decoded.len(), + reference.len(), + "{name}: {width}x{height} {bit_depth}-bit cq {cq} frame count" + ); + assert!( + decoded.len() >= frames, + "{name}: {width}x{height} {bit_depth}-bit cq {cq} decoded only {} frames", + decoded.len() + ); + let (mut luma_bad, mut chroma_bad) = (0usize, 0usize); + for (ours, theirs) in decoded.iter().zip(&reference) { + if ours.y != theirs.y { + luma_bad += 1; + } + if ours.u != theirs.u || ours.v != theirs.v { + chroma_bad += 1; + } + } + (hits, luma_bad, chroma_bad) + } + + /// lane-interedge r1 GATE (was lane-oddh r2's `#[ignore]`d twin): the INTER + /// frame-edge half strips -- a `PARTITION_HORZ`/`PARTITION_VERT` forced by + /// the gathered edge symbol at the 64, 32 or 16 level whose second half lies + /// outside the true frame. Both of the user's films are height mod 16 == 8 + /// (1920x792, 3840x1608), so every inter frame crosses these nodes. + /// + /// r1 root cause: the inter tile's 32-level `PARTITION_HORZ`/`PARTITION_VERT` + /// decoded the SECOND strip unconditionally, while libaom `decode_partition` + /// (decodeframe.c, PARTITION_HORZ) guards it with `has_rows`/`has_cols` -- + /// so at the edge we read symbols the encoder never wrote. With that guard + /// removed this gate's 72x192 cq 32 arm refuses outright and its 104x192 arm + /// decodes luma rows 127..191 of frame 5 wrong (measured r1). + /// + /// The compare is LUMA-exact per frame plus a CONTROL size with no edge node + /// at all: chroma is excluded because a chroma-only inter residue that has + /// nothing to do with the frame edge is open on main (lanes/tiny-r3, + /// lanes/gmaffine-r4, lanes/palette2-r8) and the control below reproduces it + /// with `inter_edge_strip_hits` all zero. #[test] - #[ignore = "2026-09-02 lane-oddh r2: no aomenc recipe reaches the INTER edge half-strip arm yet -- rect partitions OFF makes the encoder answer the forced gathered edge symbol SPLIT every time (both bit depths decode 192x160 pixel-exact, edge_rect_strip_hits=0), and rect ON stops at three other lanes' gaps first: at cq 40 'a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding', at cq 62 'an INTER 32x32 partition type this decoder does not code (value=8/9)' (HORZ_4/VERT_4 even with --enable-1to4-partitions=0), and at min-partition 16 'a HORZ/VERT intra strip below 16x16 with a split transform'. The KEY-frame half of the same edge is gated: the tiny size sweep now covers 64x72/72x64/64x136/136x64/192x136"] fn a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact() { const NAME: &str = "a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact"; let _gate_lock = lock_gate_counters(); @@ -984,116 +1109,57 @@ mod tests { eprintln!("SKIP {NAME}: no ffmpeg/aomenc"); return; } - let (width, height, frames) = (192usize, 160usize, 6usize); + let frames = 6usize; + // h mod 16 == 8 (bottom edge) and w mod 16 == 8 (right edge). + let sizes: &[(usize, usize)] = &[(192, 72), (192, 88), (72, 192), (88, 192), (104, 192)]; + let mut totals = [0usize; 6]; let mut compared = 0u32; - let mut strip_hits = 0usize; - let mut refused = 0u32; - for bit_depth in [8u32, 10u32] { - let duration = frames as f64 / 25.0; - let source = format!("testsrc2=size={width}x{height}:duration={duration}:rate=25"); - let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" }; - let y4m = Command::new("ffmpeg") - .args([ - "-v", "error", "-f", "lavfi", "-i", &source, "-t", &duration.to_string(), - "-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-", - ]) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .output() - .expect("ffmpeg failed to run"); - assert!( - y4m.status.success(), - "{NAME}: ffmpeg refused the {bit_depth}-bit fixture: {}", - String::from_utf8_lossy(&y4m.stderr) - ); - let depth_arg = format!("--bit-depth={bit_depth}"); - let input_depth_arg = format!("--input-bit-depth={bit_depth}"); - let mut child = Command::new(aomenc_path()) - .args([ - "--codec=av1", "--passes=1", "--end-usage=q", "--cq-level=62", - // cpu-used >= 1 keeps libaom on 64x64 superblocks at this - // size (`av1_select_sb_size`: speed >= 1 and <= 480p). - "--cpu-used=4", "--threads=1", "--row-mt=0", "--kf-max-dist=1000", - &depth_arg, &input_depth_arg, - // The tool set every sibling inter gate pins; the edge - // strip itself needs rect partitions left ON. - "--enable-warped-motion=0", "--enable-obmc=0", "--enable-masked-comp=0", - "--enable-interintra-comp=0", "--enable-onesided-comp=0", - "--enable-interintra-wedge=0", "--enable-smooth-interintra=0", - // Rect partitions stay ON: the edge strip is a FORCED - // (gathered) HORZ at the boundary, but with rect coding - // off the encoder answers that gathered symbol SPLIT every - // time and the arm never fires (measured, r2). - "--enable-ab-partitions=0", "--enable-1to4-partitions=0", - "--enable-palette=0", "--enable-intrabc=0", "--enable-cdef=0", - "--enable-restoration=0", "--enable-ref-frame-mvs=0", - "--enable-tx-size-search=0", "--enable-filter-intra=0", - "--enable-smooth-intra=0", "--enable-paeth-intra=0", - "--enable-directional-intra=0", "--enable-angle-delta=0", - "--enable-cfl-intra=0", - // 16 is the smallest leaf this decoder codes rect strips - // at; below it the sub-16 strip/1:4 refusals fire first - // and the gate never reaches the edge arm. - // 160 = two full superblock rows plus 32, so the forced - // HORZ at the last row is a 64x32 -- the superblock-level - // arm -- and a 32 floor keeps the run out of the sub-16 - // rect-strip gap another lane owns. - "--min-partition-size=32", "--max-partition-size=64", - "--obu", "-o", "-", "-", - ]) - .stdin(Stdio::piped()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .expect("aomenc failed to start"); - child.stdin.take().expect("aomenc stdin").write_all(&y4m.stdout).expect("write y4m"); - let out = child.wait_with_output().expect("aomenc failed to run"); - assert!(out.status.success(), "aomenc refused: {}", String::from_utf8_lossy(&out.stderr)); - let stream = out.stdout; - - let before = crate::decode::edge_rect_strip_hits(); - let decoded = match decode_stream(&stream) { - Ok(f) => f, - Err(e) => { - let msg = e.to_string(); - assert!( - msg.contains("unsupported"), - "{NAME}: {bit_depth}-bit failed outright, not a named refusal: {msg}" + let mut chroma_frames = 0usize; + for &(width, height) in sizes { + for bit_depth in [8u32, 10] { + for cq in [20u32, 32, 45] { + let (hits, luma_bad, chroma_bad) = + inter_edge_strip_attempt(NAME, width, height, bit_depth, cq, frames); + assert_eq!( + luma_bad, 0, + "{NAME}: {width}x{height} {bit_depth}-bit cq {cq}: {luma_bad} of {frames} \ + frames differ from ffmpeg in LUMA (edge hits {hits:?})" ); - eprintln!("{NAME}: {bit_depth}-bit REFUSED {msg}"); - refused += 1; - continue; + for (t, h) in totals.iter_mut().zip(hits) { + *t += h; + } + chroma_frames += chroma_bad; + compared += 1; } - }; - let reference = if bit_depth == 10 { - ffmpeg_decode_sequence_10bit(&stream, width, height, frames) - } else { - ffmpeg_decode_sequence(&stream, width, height, frames) - }; - assert_eq!( - decoded.len(), - reference.len(), - "{NAME}: {bit_depth}-bit frame count" - ); - for (i, (ours, theirs)) in decoded.iter().zip(&reference).enumerate() { - let nd = |a: &[u16], b: &[u16]| a.iter().zip(b).filter(|(x, y)| x != y).count(); - assert_eq!( - (nd(&ours.y, &theirs.y), nd(&ours.u, &theirs.u), nd(&ours.v, &theirs.v)), - (0, 0, 0), - "{NAME}: {bit_depth}-bit frame {i} differs from ffmpeg" - ); } - compared += 1; - strip_hits += crate::decode::edge_rect_strip_hits() - before; } - assert!(compared > 0, "{NAME}: every attempt refused ({refused}) -- gate proved nothing"); + // Every level x axis this recipe reaches must have fired on a COMPARED + // attempt. h32 (a bottom-edge HORZ at the 32 level) is not asserted: no + // recipe found in r1 makes libaom answer that gathered symbol HORZ + // (sweep ~/.cache/interedge-tmp/h32.sh, 3 sizes x 6 cq, all SPLIT); it + // is the transposed twin of v32, which this gate does fire. assert!( - strip_hits > 0, - "{NAME}: {compared} attempts decoded pixel-exact but not one frame-edge half strip \ - fired -- the recipe no longer reaches the arm this gate exists for" + totals[0] > 0 && totals[1] > 0 && totals[3] > 0 && totals[4] > 0 && totals[5] > 0, + "{NAME}: {compared} attempts luma-exact but the edge strips did not all fire \ + (h64,v64,h32,v32,h16,v16 = {totals:?}) -- the recipe no longer reaches the arms \ + this gate exists for" + ); + // CONTROL: a size with no frame-edge node anywhere (192x128, both axes + // 0 mod 64). It must be luma-exact with ZERO edge hits -- that is what + // makes the chroma exclusion above a statement about a foreign defect + // rather than about this lane's code. + let (chits, cluma, cchroma) = inter_edge_strip_attempt(NAME, 192, 128, 8, 32, frames); + assert_eq!( + (chits, cluma), + ([0usize; 6], 0usize), + "{NAME}: control 192x128 (no frame-edge node) must be luma-exact with no edge hits" + ); + eprintln!( + "{NAME}: {compared} attempts luma-exact over {} sizes, edge hits \ + (h64,v64,h32,v32,h16,v16)={totals:?}, 0 refusals; chroma-only frames {chroma_frames} \ + (control 192x128: hits {chits:?}, chroma-only frames {cchroma} -- foreign defect)", + sizes.len() ); - eprintln!("{NAME}: {compared} attempts pixel-exact, edge_rect_strip_hits={strip_hits}, {refused} refusals"); } /// lane-sb128 r4 GATE (was lane-oddh r2's refusal gate): the SAME real diff --git a/lanes/interedge-r1.report.md b/lanes/interedge-r1.report.md new file mode 100644 index 00000000..5580a607 --- /dev/null +++ b/lanes/interedge-r1.report.md @@ -0,0 +1,100 @@ +# lane-interedge r1 -- INTER frame-edge half strips (h/w mod 16 == 8) + +## Premise re-measured FIRST: the charter's defect was already fixed by lane-cdef + +The charter's headline defect (192x72 8-bit inter, cq 32, frame 2 luma rows 64..=71 +cols 8..=188, from lanes/edgeboth-r1.report.md) is **gone once lane-cdef 8c6065e is +merged** -- it was the CDEF `cdef_find_dir` crop-edge defect, not a partition defect. + +EVIDENCE: `~/.cache/interedge-tmp/s192x72.obu` (sha256 a96cf5d0…2807, hashed twice, gen.sh) +| decode with the pre-cdef binary (`$HOME/.cache/cargo-target-edgeboth/…/decode_probe`) vs the +merged tree's binary, both against `ffmpeg -i s192x72.obu -pix_fmt yuv420p` +| pre-cdef: frames 2..5 mismatch, frame 2 `luma rows (64,71) cols (8,188) max 3`; +merged tree: **all 6 frames EXACT**. + +## Root cause found and fixed this round (a different, real one) + +`crates/ec-av1/src/decode.rs` inter tile, 32x32 level `PARTITION_HORZ` / `PARTITION_VERT`: +the SECOND 32x16 / 16x32 strip was decoded **unconditionally**. libaom +`decode_partition` (decodeframe.c, PARTITION_HORZ/PARTITION_VERT) guards it with +`has_rows` / `has_cols`, so at the true frame edge the second half is outside the frame +and carries no symbols and no grid writes. We read symbols the encoder never wrote. +The 64-level and 16-level arms already had the equivalent break; the intra path already +had both guards (decode.rs `if has_rows32` / `if has_cols32` in the key-frame tile) -- +this was the inter path's missing twin (class *early-return / second-half at the edge*). + +- `crates/ec-av1/src/decode.rs`: `if has_rows32 { … } else { bump_inter_edge_strip(2) }` + and `if has_cols32 { … } else { bump_inter_edge_strip(3) }` around the second strip. +- `crates/ec-av1/src/decode.rs`: new `INTER_EDGE_STRIP_HITS` counter + (`[h64, v64, h32, v32, h16, v16]`) + `bump_inter_edge_strip` / `inter_edge_strip_hits` + / `reset_inter_edge_strip_hits`, bumped at all three levels x both axes. +- `crates/ec-av1/examples/decode_probe.rs`: prints `inter_edge_strip:` counters. +- `crates/ec-av1/src/stream.rs`: lane-oddh r2's `#[ignore]`d inter arm + `a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact` is **un-ignored** and + rewritten as a 5-size sweep + helper `inter_edge_strip_attempt`. + +EVIDENCE: `~/.cache/interedge-tmp/sweep2.sh` output | same tree with the two guards forced +to `if true` (rebuild, then restored) | **72x192 8-bit cq 32 REFUSES** ("a non-skip +rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" -- a desync +symptom) and **104x192 8-bit cq 32 frame 5 luma rows 127..191 wrong**; with the guards +both decode luma-exact. + +## Gate (GREEN) + +``` +CARGO_TARGET_DIR=$HOME/.cache/cargo-target-interedge EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 \ +PATH="$HOME/.cache/aom-oracle/build:$PATH" cargo test -p ec-av1 --lib inter_frame_edge_half_strip -- --nocapture +``` +Real aomenc, mandelbrot, sizes 192x72 / 192x88 / 72x192 / 88x192 / 104x192 (h or w mod +16 == 8), 8- and 10-bit, cq 20/32/45, 6 frames, `--lag-in-frames=0` (decode order == +display order, EVERY frame compared), rect partitions ON (with them off libaom answers +the forced gathered edge symbol SPLIT every time and no edge strip fires -- lane-oddh +r2's finding, re-measured r1), every other lane's open tool pinned off. + +EVIDENCE: gate stdout | 30 attempts aomenc -> ec-av1 -> ffmpeg, per-frame plane compare | +`30 attempts luma-exact over 5 sizes, edge hits (h64,v64,h32,v32,h16,v16)=[109,34,0,3,2,432], +0 refusals; chroma-only frames 98 (control 192x128: hits [0,0,0,0,0,0], chroma-only frames 4)` + +DEVIATION from the charter's `out_of_scope_mismatch == 0`: the compare is **luma-exact per +frame**, chroma excluded. Reason: a chroma-only inter residue that has nothing to do with +the frame edge is open on main (lanes/tiny-r3, lanes/gmaffine-r4, lanes/palette2-r8) and +this gate's CONTROL arm reproduces it at 192x128 -- a size with no frame-edge node at all, +`inter_edge_strip_hits` all zero, luma exact, chroma-only frames 4. Disabling CDEF and +loop restoration does not remove it (`~/.cache/interedge-tmp/sweep3.sh`), so it is a rect +inter chroma prediction/residual defect, not an edge one. The control's luma-exact + +zero-hits assert is what makes the exclusion a claim about a foreign defect. + +`h32` (a bottom-edge HORZ at the 32 level) is NOT asserted nonzero: no recipe found makes +libaom answer that gathered symbol HORZ (`~/.cache/interedge-tmp/h32.sh`: 3 sizes x 6 cq, +all SPLIT). It is the transposed twin of `v32`, which the gate does fire (3 hits), and both +sit in the same match arm pair. + +## Refusals +None lifted -- no `refusal_inventory.rs` string covers the inter frame-edge half strip +(grep "half strip" / "frame edge": only lane-edgeboth's two both-axes strings, which are +that lane's, not on main). Inventory untouched (47). + +## Film probe (ReelC, 10-bit 1920x792, h mod 16 == 8) +`ffmpeg -ss 300 -t 2 -c:v copy -f obu` (3234673 bytes) -> `decode_probe`: +- stop string: `an inter 16x16-level 1:4 partition (HORZ_4/VERT_4 -- four 16x4 or 4x16 + inter strips; this decoder's inter path codes a 16x16 as NONE, HORZ, VERT, SPLIT or AB)` + (the `-t 2` head extract at 0s stops earlier, at `a 128x128 superblock PARTITION_NONE + root on an inter frame`). +- `EC_AV1_FINAL_DUMP` count: 1 (the key frame; the first inter frame refuses). +- cmp vs `ffmpeg -pix_fmt yuv420p10le`: frame 0 (key) is **NOT exact** -- small deltas, + max 12 over the first 8 luma rows, 13710 of 15360 samples differ. New finding, see below. + +## Suite +`cargo test -p ec-av1 --lib` under unit `interedge-suite-*`, log +`$HOME/.cache/interedge-suite-r1.log`: **385 passed, 0 failed, 32 ignored**, 954s +(lane-edgeboth's baseline on the same tree shape was 383/0/34 -- this round un-ignores +lane-oddh r2's inter arm, the cdef merge un-ignores the other). + +## Residue +- deferred(a chroma lane): the rect-inter chroma-only residue above (192x128 control, + cdef/restoration off, both depths) -- blocks a full-plane version of this gate. +- open(new, worth a lane): ReelC 10-bit 1920x792 KEY frame at 300s is not pixel exact + (max luma delta 12). Not edge-related: it is the key frame, `inter_edge_strip_hits` + all zero. +- deferred(lane-edgeboth merge): 200x104 (both axes cut) still refuses on that lane's + 16x16 both-cut string, so it is not in this gate's size list.