diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index f2c14a6c..cc88ffac 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -728,6 +728,56 @@ pub(crate) fn deblock_hits() -> usize { DEBLOCK_HITS.with(|c| c.get()) } +// lane-defon r1: how many COMPOUND_REFERENCE blocks read a +// `UNIDIR_COMP_REFERENCE` pair (both references on the same temporal side, +// spec 5.11.25 `comp_reference_type == 0`) -- the gate's proof that a +// stream built with `--enable-onesided-comp=1` really exercised the +// `uni_comp_ref` alphabet rather than only bidirectional pairs. +thread_local! { + static UNI_COMP_HITS: std::cell::Cell = + const { std::cell::Cell::new(0) }; +} + +/// Current value of [`UNI_COMP_HITS`]. +pub(crate) fn uni_comp_hits() -> usize { + UNI_COMP_HITS.with(|c| c.get()) +} + +// lane-defon r1: how many blocks blended through a `COMPOUND_DIFFWTD` mask +// (`mc::diffwtd_mask`) -- the narrower half of `MASKED_COMPOUND_HITS`, the +// gate's proof that `--enable-diff-wtd-comp=1` reached the difference-weighted +// blend and not only the wedge arm. +thread_local! { + static DIFFWTD_HITS: std::cell::Cell = + const { std::cell::Cell::new(0) }; +} + +/// Current value of [`DIFFWTD_HITS`]. +pub(crate) fn diffwtd_hits() -> usize { + DIFFWTD_HITS.with(|c| c.get()) +} + +// lane-defon r1: how many FORWARD KEYFRAMES were decoded -- a KEY frame coded +// with `show_frame == 0`, output later by a `show_existing_frame` header +// (aomenc `--enable-fwd-kf=1 --fwd-kf-dist=N`). Counted from +// `stream::decode_stream`, which is where the frame header is consumed; the +// gate's proof that the on-value really reached the bitstream rather than +// being dropped by the rate control. +thread_local! { + static FWD_KF_HITS: std::cell::Cell = + const { std::cell::Cell::new(0) }; +} + +/// Current value of [`FWD_KF_HITS`]. +pub(crate) fn fwd_kf_hits() -> usize { + FWD_KF_HITS.with(|c| c.get()) +} + +/// Records one decoded forward keyframe (see [`FWD_KF_HITS`]). +pub(crate) fn note_fwd_kf() { + FWD_KF_HITS.with(|c| c.set(c.get() + 1)); +} + // How many [`read_tx_size`] reads resolved a `tx_depth` strictly less than // the block's own side, across every call on the current thread -- the same // before/after counter pattern as [`FILTER_INTRA_HITS`], proving a stream @@ -12628,6 +12678,7 @@ fn read_compound_ref_frames( let type_ctx = comp_reference_type_ctx(above, left); let unidir = dec.symbol(&mut cdfs.comp_ref_type[type_ctx]) == 0; if unidir { + UNI_COMP_HITS.with(|c| c.set(c.get() + 1)); // uni_comp_ref (p0): forward vs. backward -- av1_get_pred_context_- // uni_comp_ref_p is single_ref_p1's own forward/backward vote. let bit = dec.symbol(&mut cdfs.uni_comp_ref[single_ref_p1_ctx(a, a1, l, l1)][0]); @@ -13649,6 +13700,7 @@ fn decode_inter_block( // either way, only the mask source differs. let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type { diffwtd_mask_y = vec![0u8; side * side]; + DIFFWTD_HITS.with(|c| c.set(c.get() + 1)); mc::diffwtd_mask(&inter0_y, &inter1_y, mask_type == 1, &mut diffwtd_mask_y); Some(diffwtd_mask_y.as_slice()) } else { @@ -15598,6 +15650,7 @@ fn decode_inter_block8( let mut diffwtd_mask_y = Vec::new(); let mask_y: Option<&[u8]> = if let Some(mask_type) = diffwtd_mask_type { diffwtd_mask_y = vec![0u8; SIDE * SIDE]; + DIFFWTD_HITS.with(|c| c.set(c.get() + 1)); mc::diffwtd_mask(&inter0_y, &inter1_y, mask_type == 1, &mut diffwtd_mask_y); Some(diffwtd_mask_y.as_slice()) } else { diff --git a/crates/ec-av1/src/gate_coverage.rs b/crates/ec-av1/src/gate_coverage.rs index 18e03151..42a08351 100644 --- a/crates/ec-av1/src/gate_coverage.rs +++ b/crates/ec-av1/src/gate_coverage.rs @@ -230,59 +230,14 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[ /// OFF in every gate that names it (a hard hole -- no stream can carry it) or /// merely defaulted (unknown, and unknown is not coverage). #[cfg(test)] -const NEVER_ON_8BIT: &[(&str, &str)] = &[ - ( - "deblocking", - "on in no 8-bit gate: 7 pin --loopfilter-control=0, the other 34 default (on) -- and defaulted is unknown, so no stream is proven to run the loop filter", - ), - ( - "enable-diff-wtd-comp", - "on in no 8-bit gate: 6 pin =0, 35 default; difference-weighted compound masks are unproven", - ), - ( - "enable-directional-intra", - "on in no 8-bit gate: pinned =0 in 32 of 41, defaulted in 9 -- the directional gates drive the modes through other flags, never this one", - ), - ( - "enable-fwd-kf", - "on in no 8-bit gate: 11 pin =0, 30 default (aomenc's default is off), so forward keyframes are never coded", - ), - ( - "enable-onesided-comp", - "on in no 8-bit gate: 17 pin =0, 24 default; one-sided compound prediction is unproven", - ), - ( - "enable-tx-size-search", - "on in no 8-bit gate: pinned =0 in 34 of 41 -- the pin that hid a real-stream PANIC from lane-ab16 until TX_MODE_SELECT was landed by lane-txselect; its gates spell the tool through the recipe, not this flag", - ), -]; +const NEVER_ON_8BIT: &[(&str, &str)] = &[]; /// [`DEFAULT_ON_TOOLS`] entries no 10-bit gate spells on, with the reason. #[cfg(test)] const NEVER_ON_10BIT: &[(&str, &str)] = &[ - ( - "deblocking", - "hole at both depths, see the 8-bit list (1 of the 15 10-bit gates pins =0, 14 default)", - ), ( "enable-diff-wtd-comp", - "hole at both depths, see the 8-bit list (1 pinned off, 14 defaulted)", - ), - ( - "enable-fwd-kf", - "hole at both depths, see the 8-bit list (3 pinned off, 12 defaulted)", - ), - ( - "enable-interintra-wedge", - "on in no 10-bit gate: 5 pin =0, 10 default -- wedge interintra masks are exercised at 8 bits only, the shape that cost lane-hbdinter two 10-bit-only defects", - ), - ( - "enable-onesided-comp", - "hole at both depths, see the 8-bit list (5 pinned off, 10 defaulted)", - ), - ( - "enable-tx-size-search", - "hole at both depths, see the 8-bit list (11 of 15 pin =0)", + "on in no 10-bit gate: 1 pinned off, 14 defaulted -- lane-defon r1 closed the 8-bit hole on the masked-compound gate (diffwtd_hits) and added a 10-bit one-sided-compound gate, but the 10-bit fixture source is `gradients`, whose smooth content never wins a difference-weighted mask (measured 8/8 pixel-exact, diffwtd_hits == 0); it needs a mandelbrot fixture in ten_bit_tool_gate", ), ]; @@ -461,6 +416,19 @@ mod tests { /// helper, an explicit `--bit-depth=10`/`--input-bit-depth=10`, or a /// `yuv420p10le` fixture handed to aomenc. Everything else is aomenc's /// 8-bit default. + /// lane-defon r1: a gate helper parameterised on `bit_depth` builds BOTH + /// an 8-bit and a 10-bit stream from one recipe, so its flags cover both + /// depths -- classifying it by the 10-bit strings inside its conditional + /// alone hid `--enable-tx-size-search=1` from the 8-bit list. + fn covers_both_depths(body: &str) -> bool { + body.contains("if bit_depth == 10") + } + + /// Whether a gate body drives a stream at this depth. + fn covers_depth(body: &str, ten_bit: bool) -> bool { + covers_both_depths(body) || is_ten_bit(body) == ten_bit + } + fn is_ten_bit(body: &str) -> bool { body.contains("encode_10bit_gradients") || body.contains("ten_bit_tool_gate(") @@ -473,7 +441,7 @@ mod tests { fn enabled_at(ten_bit: bool) -> BTreeSet { let mut on = BTreeSet::new(); for gate in gate_bodies() { - if is_ten_bit(gate) != ten_bit { + if !covers_depth(gate, ten_bit) { continue; } for (flag, value) in flags_in(gate) { @@ -561,7 +529,7 @@ mod tests { fn default_on_settings(ten_bit: bool) -> (usize, BTreeMap<&'static str, (usize, usize, usize)>) { let gates: Vec<&str> = gate_bodies() .into_iter() - .filter(|b| is_ten_bit(b) == ten_bit) + .filter(|b| covers_depth(b, ten_bit)) .collect(); let mut per_tool = BTreeMap::new(); for &(tool, spellings, _, on) in DEFAULT_ON_TOOLS { diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index ca48b25d..d9073e39 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -807,6 +807,13 @@ pub fn decode_stream(data: &[u8]) -> Result> { order_hint_slots[i] = header.order_hint; } } + // lane-defon r1: a forward keyframe (aomenc `--enable-fwd-kf`) is a + // KEY frame coded with `show_frame == 0`, output later by a + // `show_existing_frame` header -- counted only once its tiles have + // decoded, so the gate's assert covers decoded-and-compared frames. + if header.frame_type == FrameType::Key && !header.show_frame { + decode::note_fwd_kf(); + } if header.show_frame { let output = if header.film_grain.apply_grain { let mc_identity = parser @@ -1918,6 +1925,14 @@ mod tests { let input_depth_arg = format!("--input-bit-depth={bit_depth}"); let mut child = Command::new(aomenc_path()) .args([ + // lane-defon r1: the repo's only gate that decodes hidden + // frames is also the only place a FORWARD KEYFRAME can be + // proven -- a KEY frame with `show_frame == 0`, which is + // exactly the shape this gate already compares in decode + // order. On-values go before the base list (aomenc keeps + // the FIRST occurrence of a repeated flag). + "--enable-fwd-kf=1", + "--fwd-kf-dist=8", "--codec=av1", "--passes=1", "--end-usage=q", @@ -1983,17 +1998,28 @@ mod tests { String::from_utf8_lossy(&out.stderr) ); let stream = out.stdout; + let fwd_kf_before = crate::decode::fwd_kf_hits(); let (total, hidden) = decode_all_frames_vs_oracle(&stream, &format!("altref-hidden-{bit_depth}bit")); + let fwd_kf = crate::decode::fwd_kf_hits() - fwd_kf_before; assert!( hidden >= 2, "{NAME}: the {bit_depth}-bit recipe produced only {hidden} hidden frame(s) of \ {total} decoded -- the gate would be vacuous (class \ gate-blind-to-hidden-frames)" ); + // lane-defon r1: `--enable-fwd-kf=1` is spelled on this recipe, so + // a KEY frame with `show_frame == 0` must actually have been + // decoded -- otherwise the on-value proves nothing. + assert!( + fwd_kf > 0, + "{NAME}: the {bit_depth}-bit recipe decoded {total} frames ({hidden} hidden) but \ + zero forward keyframes -- --enable-fwd-kf=1 --fwd-kf-dist=8 never reached the \ + bitstream" + ); eprintln!( - "{NAME} {bit_depth}-bit: {total} frames decoded, {hidden} hidden, all \ - pixel-exact vs the oracle in decode order" + "{NAME} {bit_depth}-bit: {total} frames decoded, {hidden} hidden, {fwd_kf} \ + forward keyframes, all pixel-exact vs the oracle in decode order" ); } } @@ -2438,6 +2464,9 @@ mod tests { ); let mut child = Command::new(aomenc_path()) .args([ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--loopfilter-control=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -3271,6 +3300,9 @@ mod tests { ); let mut child = Command::new(aomenc_path()) .args([ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--loopfilter-control=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -3623,6 +3655,9 @@ mod tests { let mut child = Command::new(aomenc_path()) .args(depth_args) .args([ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--enable-tx-size-search=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -4149,6 +4184,9 @@ mod tests { ); let mut child = Command::new(aomenc_path()) .args([ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--enable-directional-intra=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -4276,6 +4314,7 @@ mod tests { /// level of the inter partition tree -- `min_part` is aomenc's /// `--min-partition-size`, and `hits`/`what` name the counter that proves /// the arm under test really fired. + #[track_caller] fn inter_sb_none_gate( name: &str, ten_bit: bool, @@ -4764,6 +4803,9 @@ mod tests { ); let mut child = Command::new(aomenc_path()) .args([ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--loopfilter-control=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -7059,7 +7101,7 @@ mod tests { "--tune-content=default", "--enable-masked-comp=0", "--enable-interintra-comp=1", - "--enable-onesided-comp=0", + "--enable-onesided-comp=1", "--enable-interintra-wedge=0", "--enable-smooth-interintra=1", "--enable-rect-partitions=0", @@ -7172,9 +7214,18 @@ mod tests { "{NAME}: {matched} matches but zero interintra blocks fired -- the gate decodes \ these streams without ever taking interintra, so it proves nothing" ); + // lane-defon r1: `--enable-onesided-comp=1` is spelled on this + // recipe, so a UNIDIR_COMP_REFERENCE pair must actually have been + // read -- otherwise the on-value proves nothing. + assert!( + crate::decode::uni_comp_hits() > 0, + "{NAME}: {matched} matches but zero UNIDIR_COMP_REFERENCE pairs read -- \ + --enable-onesided-comp=1 never reached the uni_comp_ref alphabet" + ); eprintln!( - "{NAME}: {named_refusals} other-capability refusals, {matched} pixel-exact matches out of {n_attempts}, interintra_hits={}", - crate::decode::interintra_hits() + "{NAME}: {named_refusals} other-capability refusals, {matched} pixel-exact matches out of {n_attempts}, interintra_hits={} uni_comp_hits={}", + crate::decode::interintra_hits(), + crate::decode::uni_comp_hits() ); } @@ -7414,6 +7465,143 @@ mod tests { } } + /// lane-defon r1: the 10-bit one-sided-compound hole -- + /// `--enable-onesided-comp` was spelled on in no 10-bit gate (5 of the 15 + /// pin it off, the rest default), so the UNIDIR_COMP_REFERENCE alphabet + /// was proven at 8 bits only while both of his films are 10-bit 4:2:0. + /// `--enable-diff-wtd-comp=1` is deliberately NOT spelled here (a flag a + /// gate turns on without asserting it fired is coverage theatre, class + /// gate-blind-to-feature): measured this round, the 10-bit `gradients` + /// fixture decodes 8/8 pixel-exact with `diffwtd_hits == 0` -- smooth + /// gradients never win + /// a difference-weighted mask (the 8-bit gate needs `mandelbrot`'s hard + /// diagonal edge, and [`ten_bit_tool_gate`] has no mandelbrot source), so + /// hard-asserting it here would fail on encoder choice, not on a decoder + /// defect. + #[test] + fn a_real_aomenc_10bit_stream_with_onesided_compound_decodes_pixel_exact() { + const NAME: &str = "a_real_aomenc_10bit_stream_with_onesided_compound_decodes_pixel_exact"; + let _gate_lock = lock_gate_counters(); + if !have_ffmpeg() { + eprintln!("SKIP {NAME}: no ffmpeg"); + return; + } + if !have_aomenc() { + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); + return; + } + ten_bit_tool_gate( + NAME, + 64, + 64, + 24, + &[ + "--enable-onesided-comp=1", + "--enable-masked-comp=1", + "--enable-dist-wtd-comp=0", + "--cq-level=45", + "--kf-max-dist=1000", + "--auto-alt-ref=1", + "--lag-in-frames=16", + "--enable-fwd-kf=0", + "--enable-order-hint=1", + "--enable-global-motion=0", + "--enable-warped-motion=1", + "--enable-obmc=1", + "--tune-content=default", + "--enable-interintra-comp=0", + "--enable-interintra-wedge=0", + "--enable-smooth-interintra=0", + "--enable-rect-partitions=0", + "--enable-ab-partitions=0", + "--enable-1to4-partitions=0", + "--enable-filter-intra=0", + "--enable-smooth-intra=0", + "--enable-paeth-intra=0", + "--enable-directional-intra=0", + "--enable-angle-delta=0", + "--enable-tx-size-search=0", + "--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", + ], + &[42, 43, 44, 45, 46, 47, 48, 49], + &[("uni_comp_hits", crate::decode::uni_comp_hits as fn() -> usize)], + ); + } + + /// lane-defon r1: the 10-bit sibling of + /// [`a_real_aomenc_stream_with_interintra_wedge_decodes_pixel_exact`] -- + /// `--enable-interintra-wedge=1` was spelled on in no 10-bit gate (5 of + /// the 15 pin it off), and his two films are 10-bit, so the 8-bit + /// gate alone proves nothing about the streams that matter. Same tool + /// set as the 8-bit recipe (`--enable-masked-comp=0` keeps inter blocks + /// off the COMPOUND_WEDGE path, fixed 32x32 partitions), driven through + /// [`ten_bit_tool_gate`], which hard-asserts `wii_hits` moved and + /// compares every plane against ffmpeg's own 10-bit decode. + #[test] + fn a_real_aomenc_10bit_stream_with_interintra_wedge_decodes_pixel_exact() { + const NAME: &str = "a_real_aomenc_10bit_stream_with_interintra_wedge_decodes_pixel_exact"; + let _gate_lock = lock_gate_counters(); + if !have_ffmpeg() { + eprintln!("SKIP {NAME}: no ffmpeg"); + return; + } + if !have_aomenc() { + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); + return; + } + ten_bit_tool_gate( + NAME, + 64, + 64, + 24, + &[ + "--enable-interintra-wedge=1", + "--enable-interintra-comp=1", + "--enable-smooth-interintra=1", + "--cq-level=45", + "--kf-max-dist=1000", + "--auto-alt-ref=1", + "--lag-in-frames=16", + "--enable-fwd-kf=0", + "--enable-order-hint=1", + "--enable-warped-motion=1", + "--enable-obmc=1", + "--tune-content=default", + "--enable-masked-comp=0", + "--enable-onesided-comp=0", + "--enable-rect-partitions=0", + "--enable-ab-partitions=0", + "--enable-1to4-partitions=0", + "--enable-filter-intra=0", + "--enable-smooth-intra=0", + "--enable-paeth-intra=0", + "--enable-directional-intra=0", + "--enable-angle-delta=0", + "--enable-tx-size-search=0", + "--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", + ], + &[42, 43, 44, 45, 46, 47, 48, 49], + &[ + ("wii_hits", crate::decode::wii_hits as fn() -> usize), + ("interintra_hits", crate::decode::interintra_hits as fn() -> usize), + ], + ); + } + /// lane-wii r2: `--enable-interintra-wedge=1` streams must DECODE /// pixel-exact -- the wedge-interintra syntax (adapting `wedge_index` /// CDF symbol, fixed sign 0) and the wedge mask blend are ported over @@ -9562,6 +9750,9 @@ mod tests { String::from_utf8_lossy(&y4m.stderr) ); let args: Vec<&str> = vec![ + // lane-defon r1: explicit on-value (aomenc keeps the FIRST + // occurrence, so overrides go before the base list). + "--enable-diff-wtd-comp=1", "--codec=av1", "--passes=1", "--end-usage=q", @@ -9717,6 +9908,13 @@ mod tests { "{NAME}: zero masked-compound blocks fired ({matched} matches, {named_refusals} \ other refusals out of {n_attempts}) -- gate proved nothing this run" ); + // lane-defon r1: `--enable-diff-wtd-comp=1` is now spelled on this + // recipe, so the DIFFWTD half of MASKED_COMPOUND_HITS must fire. + assert!( + crate::decode::diffwtd_hits() > 0, + "{NAME}: zero COMPOUND_DIFFWTD blends ({matched} matches, {named_refusals} \ + other refusals out of {n_attempts}) -- --enable-diff-wtd-comp=1 proved nothing" + ); // r3: wedge_hits() is soft-skipped, not hard-asserted -- the recipe // search (dist-wtd-comp=0 + diagonal mandelbrot content) is not // proven to fire wedge on every run; charter's fallback is to land diff --git a/lanes/defon-r1.report.md b/lanes/defon-r1.report.md new file mode 100644 index 00000000..55b711c4 --- /dev/null +++ b/lanes/defon-r1.report.md @@ -0,0 +1,89 @@ +# lane-defon r1 — NEVER_ON default-on tools spelled on, and proven to fire + +Branch `lane-defon` off main 61c6a5b. Two commits: 46df1fc (six tools, written by the +first agent before a session limit killed it mid-suite) and 6e32d5e (this round: the two +tools that commit left open, plus a coverage-classification bug it introduced). + +Premise at 61c6a5b (`cargo test -p ec-av1 --lib gate_coverage -- --nocapture`): +NEVER_ON_8BIT 6/10, NEVER_ON_10BIT 7/10. `aomenc --help` (oracle build) confirms +`--loopfilter-control` takes 0/1/2/3 with `1 = ... (default)` and that +`--fwd-kf-dist=-1` (no repetitive forward keyframes) is the default. + +## Tool -> gate -> counter -> result + +| tool (on-value spelled) | gate | counter hard-asserted | result | +|---|---|---|---| +| `--loopfilter-control=1` 8-bit | `a_real_aomenc_intra_stream_with_deblocking_decodes_pixel_exact` | `deblock_hits()` delta (pre-existing) | PASS | +| `--loopfilter-control=1` 8-bit | `a_real_aomenc_inter_sequence_with_deblocking_decodes_pixel_exact` | `deblock_hits()` | PASS | +| `--loopfilter-control=1` 10-bit | `a_real_aomenc_10bit_inter_sequence_decodes_pixel_exact` | `deblock_hits()` | PASS | +| `--enable-tx-size-search=1` 8+10-bit (one `bit_depth`-parameterised helper) | `a_real_aomenc_inter_sequence_with_tx_select_decodes_pixel_exact{,_10bit}` | `txfm_split_hits()` per attempt | PASS | +| `--enable-directional-intra=1` 8-bit | `a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact` | `directional_uv_hits()` | PASS | +| `--enable-diff-wtd-comp=1` 8-bit | `a_real_aomenc_stream_with_masked_compound_decodes_pixel_exact` | NEW `diffwtd_hits() > 0` | PASS (80/80 pixel-exact, masked_compound_hits=7898 wedge_hits=4254) | +| `--enable-onesided-comp=1` 8-bit (flipped from `=0`) | `a_real_aomenc_stream_with_interintra_decodes_pixel_exact` | NEW `uni_comp_hits() > 0` | PASS | +| `--enable-fwd-kf=1 --fwd-kf-dist=8` **8-bit and 10-bit** | `a_real_aomenc_altref_sequence_hidden_frames_decode_pixel_exact` (the only gate that decodes `show_frame == 0` frames, and it loops both depths) | NEW `fwd_kf_hits()` delta per depth | PASS — 42 frames decoded, 2 hidden, **3 forward keyframes**, all pixel-exact vs the oracle in decode order, at each depth | +| `--enable-interintra-wedge=1` **10-bit** | NEW `a_real_aomenc_10bit_stream_with_interintra_wedge_decodes_pixel_exact` | `wii_hits`, `interintra_hits` (both via `ten_bit_tool_gate`) | PASS — 8/8 attempts pixel-exact, wii_hits=3 interintra_hits=8 | +| `--enable-onesided-comp=1` **10-bit** | NEW `a_real_aomenc_10bit_stream_with_onesided_compound_decodes_pixel_exact` | `uni_comp_hits` | PASS — 8/8 attempts pixel-exact, uni_comp_hits=5 | +| `--enable-diff-wtd-comp=1` 10-bit | — | — | NOT LANDED, see residue | + +EVIDENCE: $HOME/.cache/defon-suite.log | `EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j3 -- --nocapture` (and each gate above run by name first) | see the per-gate stdout lines quoted in the result column + +## What changed this round (6e32d5e) +- `crates/ec-av1/src/decode.rs` — `FWD_KF_HITS` thread-local + `fwd_kf_hits()` / `note_fwd_kf()`, + same before/after pattern as the other gate counters. +- `crates/ec-av1/src/stream.rs` (`decode_stream`, just before the `if header.show_frame` output + arm) — `if header.frame_type == FrameType::Key && !header.show_frame { decode::note_fwd_kf(); }`. + Counted after the tiles decode, so the assert covers decoded-and-compared frames only. +- `crates/ec-av1/src/stream.rs` — `--enable-fwd-kf=1 --fwd-kf-dist=8` at the head of the altref + hidden-frames recipe (aomenc keeps the FIRST occurrence of a repeated flag) + a hard + `fwd_kf > 0` assert per bit depth; two new 10-bit gates through `ten_bit_tool_gate`. +- `crates/ec-av1/src/gate_coverage.rs` — `NEVER_ON_8BIT` is now `&[]`; `NEVER_ON_10BIT` keeps + `enable-diff-wtd-comp` (with the measurement that justifies it) and `multi-tile`. + +## Defect found and fixed inside the instrument +`gate_coverage` splits gate bodies on `"\n #["`, so a doc comment lands in the PRECEDING +gate's chunk. My first draft of the two new docs used the literal `yuv420p10le`, which +`is_ten_bit()` treats as a 10-bit marker — it silently reclassified the gate above as 10-bit +(8-bit gate count 45 -> 44, 10-bit 15 -> 18). Reworded to "10-bit"; counts back to 45/17 +(15 pre-existing + my 2). Class: [[gate-blind-to-feature]]'s instrument twin — prose in a +gate file is parsed as recipe. + +## Coverage after (verbatim) +``` +gate_coverage: 59 real-aomenc gates, 17 of them 10-bit +NEVER_ON_8BIT (0 of 10, over 45 8BIT gates): +NEVER_ON_10BIT (2 of 10, over 17 10BIT gates): + enable-diff-wtd-comp (--enable-diff-wtd-comp): off in 1, defaulted in 16, on in 0 + multi-tile (--tile-columns,tile-rows): off in 0, defaulted in 17, on in 0 +``` + +## Refusals lifted +None. No decode behaviour changed; this lane only makes the gates drive the default-on tools +explicitly and hard-assert that they fired. + +## Residue +- deferred: `enable-diff-wtd-comp` at 10 bits — MEASURED, not assumed: a 10-bit + masked-compound gate with `--enable-diff-wtd-comp=1 --enable-masked-comp=1 + --enable-dist-wtd-comp=0` decoded 8/8 attempts pixel-exact with `diffwtd_hits == 0`. + That is encoder choice, not a decoder defect: `ten_bit_tool_gate`'s only fixture source is + `gradients`, whose smooth content never wins a difference-weighted mask, while the 8-bit + gate needs `mandelbrot`'s hard diagonal edge. The flag was deliberately REMOVED from the + landed 10-bit recipe rather than left spelled-on-unasserted (a flag a gate turns on without + proving it fired is coverage theatre). What unblocks it: a mandelbrot (or otherwise + hard-edged) 10-bit source in `ten_bit_tool_gate`. +- accepted: `multi-tile` at 10 bits — covbd2's finding, outside this charter. + +## Suite totals +`EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-defon nice -n 10 cargo test -p ec-av1 --lib -j3 -- --nocapture` +(log: `$HOME/.cache/defon-suite.log`, 1141 s): + +``` +test result: FAILED. 299 passed; 1 failed; 27 ignored; 0 measured; 0 filtered out +``` + +The one failure is **not this lane's** and is not a gate: +`decode::tests::nz_map_ctx_offset_tables_match_the_rect_rule` (decode.rs:16368) — +`32x64 nz_map offset at display (row 0, col 2): left: 6, right: 11`. It compares two static +tables; this lane's diff against its base 61c6a5b touches no table, scan or offset line in +decode.rs (only a new `FWD_KF_HITS` thread-local), and every real-aomenc gate passed. +Disposition: flagged, inherited from the branch base — whoever merges should re-run it on +main's tip, where a sibling lane may already own it.