diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 1e132312..5de42315 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -2016,6 +2016,21 @@ pub(crate) fn obmc_hits() -> usize { OBMC_HITS.with(|c| c.get()) } +// lane-t900 r27: OBMC blends that actually READ a recorded switchable filter +// off the neighbour band -- the positive half of the proof for "an OBMC +// neighbour whose switchable interp filter was never recorded". A +// fixed-filter frame returns before this point (its neighbours legitimately +// carry the `[3, 3]` sentinel), so every bump is a neighbour whose own +// `interp_filter` symbols were published by `record_inter_rect_mi`. +thread_local! { + static OBMC_FILTER_BAND_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Current value of [`OBMC_FILTER_BAND_READS`]. +pub(crate) fn obmc_filter_band_reads() -> usize { + OBMC_FILTER_BAND_READS.with(|c| c.get()) +} + // lane-scaledref r1: per-case firing counts for the scaled-reference gate // (class `gate-blind-to-feature`) -- a pixel match under an UNSCALED // reference would pass just as well and prove nothing, so the gate @@ -19723,6 +19738,7 @@ fn neighbour_filter( "an OBMC neighbour whose switchable interp filter was never recorded", )); } + OBMC_FILTER_BAND_READS.with(|c| c.set(c.get() + 1)); Ok(( mc::InterpFilterKind::from_switchable_symbol(sym[1] as usize), mc::InterpFilterKind::from_switchable_symbol(sym[0] as usize), @@ -31104,6 +31120,131 @@ mod tests { assert_eq!((h, v), (mc::InterpFilterKind::Smooth, mc::InterpFilterKind::Smooth)); } + /// lane-t900 r27, structural audit for "an OBMC neighbour whose switchable + /// interp filter was never recorded": the `[3, 3]` sentinel is only ever + /// PUBLISHED for a cell an OBMC blend cannot pick up. + /// + /// `Neighbours::record_inter_rect_mi` is the single writer of + /// `above_filter`/`left_filter` (every other recorder routes through it), + /// so the whole domain of published values is its call sites' 7th + /// argument. Two publications are safe: an INTRA cell (`is_inter = false`, + /// skipped by `overlappable_above`/`overlappable_left`'s own `is_inter` + /// gate) and a fixed-filter frame (`resolve_interp_filter` returns the + /// sentinel when `interp_fixed` is `Some`, which `neighbour_filter` + /// answers before ever looking at the symbols). What this scans for is the + /// third case -- an INTER cell stamped with a literal sentinel, which is + /// what the refusal actually fires on. Arguments are tokenised + /// positionally, never `contains()`d. + #[test] + fn every_inter_record_publishes_an_obmc_readable_filter() { + let src = include_str!("decode.rs"); + let mut calls = 0usize; + for (start, _) in src.match_indices("record_inter_rect_mi(") { + // Skip the definition and the wrapper's own forwarding call. + let line_start = src[..start].rfind('\n').map_or(0, |i| i + 1); + let head = &src[line_start..start]; + // The definition, the wrapper's own forwarding call, and this + // test's own mentions of the name (doc comment, scan pattern, + // assert message) are not publication sites. + if head.contains("fn ") || head.contains("///") || head.ends_with('"') { + continue; + } + let mut i = start + "record_inter_rect_mi(".len(); + let (mut depth, mut arg, mut args) = (0i32, String::new(), Vec::new()); + let bytes = src.as_bytes(); + while i < bytes.len() { + let c = bytes[i] as char; + match c { + '(' | '[' => depth += 1, + ')' | ']' if depth == 0 && c == ')' => break, + ')' | ']' => depth -= 1, + ',' if depth == 0 => { + args.push(std::mem::take(&mut arg)); + i += 1; + continue; + } + _ => {} + } + arg.push(c); + i += 1; + } + if !arg.trim().is_empty() { + args.push(arg); + } + assert_eq!( + args.len(), + 8, + "record_inter_rect_mi gained an argument -- re-index this audit: {args:?}" + ); + calls += 1; + let (is_inter, filter) = (args[4].trim(), args[6].trim()); + if filter.starts_with('[') { + assert_eq!( + filter.replace(' ', ""), + "[3,3]", + "a literal filter other than the sentinel is published at call {calls}" + ); + assert_eq!( + is_inter, "false", + "an INTER cell is stamped with the [3, 3] sentinel (call {calls}): an OBMC \ + blend picking it up refuses by name. Publish the block's own resolved \ + switchable symbols instead." + ); + } + } + assert!( + calls >= 6, + "the audit found only {calls} publication sites -- it is broken, not the decoder" + ); + } + + /// lane-t900 r27, negative gate for "a reference frame selected with no + /// picture at this frame's own ref_frame_idx slot for it": every + /// non-`LAST_FRAME` reference resolves through `ref_planes`, and an empty + /// slot is refused BY NAME there rather than predicting from `LAST`. + /// + /// Direct-call, not a stream: with this crate's writers the case is + /// unreachable end to end. A SHOWN key frame refreshes all eight slots + /// (spec 5.9.2 forces `refresh_frame_flags`, `write_frame_header` does the + /// same) and nothing ever clears a slot, so once a stream has a key frame + /// every slot holds a picture; a stream that OPENS on an inter frame is + /// stopped one guard earlier, by `decode_stream`'s own `LAST` lookup + /// ("an inter frame with no key frame before it", gated by + /// `an_inter_frame_opening_a_stream_is_refused_by_name`). The reachable + /// premise is a HIDDEN key frame refreshing only some slots, which + /// `write_frame_header` refuses to write (`show_frame` must be set) -- + /// so the stream-level witness needs a hidden-frame writer, noted as the + /// open half of this proof. + #[test] + fn a_selected_reference_with_an_empty_ref_frame_idx_slot_refuses_by_name() { + const REFUSAL: &str = + "a reference frame selected with no picture at this frame's own ref_frame_idx slot"; + let plane = PlaneBuf { + data: vec![0u16; 16], + width: 4, + height: 4, + true_width: 4, + true_height: 4, + tile_x0: 0, + tile_y0: 0, + tile_x1: 4, + tile_y1: 4, + }; + let empty: RefSlots = [None; 8]; + for ref_frame in [LAST2_FRAME, LAST3_FRAME, GOLDEN_FRAME, BWDREF_FRAME, ALTREF2_FRAME, ALTREF_FRAME] { + let err = match ref_planes(ref_frame, &plane, &plane, &plane, &empty) { + Ok(_) => panic!("ref {ref_frame}: an empty slot resolved to a picture"), + Err(e) => e.to_string(), + }; + assert!(err.contains(REFUSAL), "ref {ref_frame}: expected {REFUSAL:?}, got: {err}"); + } + // `LAST_FRAME` never consults the slots: `decode_stream` checked it. + let Ok((y, _, _)) = ref_planes(LAST_FRAME, &plane, &plane, &plane, &empty) else { + panic!("LAST_FRAME resolves to the frame's own reference planes") + }; + assert_eq!(y.width, 4); + } + #[test] fn record_compound_ctx_stamps_ref1_for_the_next_block_to_read() { let mut n = Neighbours::new(4, 4, 16, 16); diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index f7c17394..0e53cbb4 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -314,6 +314,53 @@ const PROVEN: &[(&str, &str)] = &[ // by name (a 64x32 inter frame over a 64x64 reference; a stream opening on // a non-error-resilient inter frame whose primary_ref slot is empty, over // all 8 slots) with the picture/CDF slot invariant enumerated alongside. + // lane-t900 r27, negative gate + structural note: every non-`LAST_FRAME` + // reference resolves through `ref_planes`, where an empty slot refuses by + // name (swept over all six such references). The STREAM-level witness is + // out of reach of this crate's writers -- a shown key frame refreshes all + // eight slots and nothing ever clears one, and a stream opening on an + // inter frame is stopped one guard earlier -- so the reachable premise is + // a HIDDEN key frame with a partial `refresh_frame_flags`, which + // `write_frame_header` cannot write. That gap is the open half. + ( + "a reference frame selected with no picture at this frame's own ref_frame_idx slot for it", + "a_selected_reference_with_an_empty_ref_frame_idx_slot_refuses_by_name", + ), + // lane-t900 r27, negative gate + census: a written key frame carrying + // each of the three mode-overriding features (over three segment ids) is + // refused by name with no picture; and six real aomenc recipes + // (`--aq-mode=1/2/3`, `--deltaq-mode=1`, plus a baseline for arrival) + // never enable one -- only `--aq-mode=3` changes the stream at all, and + // what it codes is `segment_id` symbols under `SEG_LVL_ALT_Q`. + ( + "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV (this decoder reads segment_id but never lets a segment override a block's reference, skip or mode)", + "a_frame_whose_segmentation_overrides_a_block_mode_is_refused_by_name", + ), + // lane-t900 r27, structural audit + witness: `record_inter_rect_mi` is the + // single writer of the interp-filter neighbour band, and no call site + // stamps the `[3, 3]` sentinel on an INTER cell (the audit tokenises each + // site's arguments); two real `--enable-obmc=1 --enable-dual-filter=1 + // --cpu-used=0` streams then decode with 237 band reads over ~115 OBMC + // blocks each and the refusal firing 0 times (gate + // `a_real_obmc_stream_reads_a_recorded_switchable_filter_for_every_neighbour`). + // At `--cpu-used=4` aomenc settles on a frame-level fixed filter and the + // band is never read -- the speed is load-bearing in that gate. + ( + "an OBMC neighbour whose switchable interp filter was never recorded", + "every_inter_record_publishes_an_obmc_readable_filter", + ), + // lane-t900 r27, census: this one is a REAL capability gap, and the gate + // proves it fires by name on real streams -- four fixed-denominator + // `--superres-mode=1` encodes (denoms 10/12/16, warped motion and OBMC + // on) all stop here, while the two `--superres-mode=3` auto encodes pick + // denominator 8 and carry no scaling at all. Its two siblings ("warp + // prediction with a scaled reference", "a sub-8x8 inter block under a + // scaled reference") stay UNPROVEN: this refusal sits in front of them, + // so nothing measures them until the 8x8-leaf gap is lifted. + ( + "an 8x8 partition leaf under a scaled reference (superres, unimplemented)", + "a_superres_census_over_six_real_streams_records_which_scaled_refusals_fire", + ), ( "a reference picture whose height does not match this frame's own true size", "an_inter_frame_shorter_than_its_reference_is_refused_by_name", diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 1b4e4792..595fd0d5 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -1228,6 +1228,340 @@ mod tests { ); } + /// lane-t900 r27, negative gate: a frame whose segmentation enables one of + /// the three MODE-OVERRIDING features -- `SEG_LVL_REF_FRAME` (forces a + /// block's reference), `SEG_LVL_SKIP` and `SEG_LVL_GLOBALMV` (both + /// suppress symbols `decode_inter_block` reads unconditionally) -- is + /// refused BY NAME and outputs no picture, rather than desyncing on the + /// first block that would have obeyed the override. + /// + /// Written, not hand-built: `write_segmentation_params` (spec 5.9.14) + /// codes `feature_enabled`/`feature_data` for every segment, so a real + /// key frame carrying the flag is a two-line change to the header the + /// encoder already produced. Swept over all three features and over the + /// first, a middle and the last segment id. + #[test] + fn a_frame_whose_segmentation_overrides_a_block_mode_is_refused_by_name() { + const REFUSAL: &str = + "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV"; + let picture = test_card(64, 64); + let encoded = encode_key_frame(&picture, 100, 0.5).unwrap(); + let (seq, key) = crate::encode::key_frame_headers(64, 64, 100).unwrap(); + for feature in [SEG_LVL_REF_FRAME, SEG_LVL_SKIP, SEG_LVL_GLOBALMV] { + for segment in [0usize, 3, 7] { + let mut header = key.clone(); + header.segmentation.enabled = true; + header.segmentation.update_map = true; + header.segmentation.update_data = true; + header.segmentation.feature_enabled[segment][feature] = true; + header.segmentation.feature_data[segment][feature] = 1; + let mut stream = crate::sequence::sequence_header_obu(&seq).unwrap(); + stream.extend_from_slice( + &crate::frame::frame_obu(&seq, &header, &encoded.tile).unwrap(), + ); + let mut shown = 0; + let err = decode_stream_with(&stream, |_, _, _| { + shown += 1; + Ok(()) + }) + .unwrap_err() + .to_string(); + assert!( + err.contains(REFUSAL), + "feature {feature} segment {segment}: expected {REFUSAL:?}, got: {err}" + ); + assert_eq!( + shown, 0, + "feature {feature} segment {segment}: a refused frame produced a picture" + ); + } + } + } + + /// One census attempt: encode `frames` frames of `source` with real + /// aomenc plus `extra` args, decode with THIS decoder, and return the + /// stream's byte length with either the picture count or the refusal (any + /// decode error) it produced. A census is about what the encoder emits, + /// so a refusal is data here, not a failure. + fn census_attempt( + source: &str, + width: usize, + height: usize, + frames: usize, + extra: &[&str], + ) -> (usize, std::result::Result) { + let duration = format!("{}", frames as f64 / 25.0); + let src = format!("{source}=size={width}x{height}:rate=25"); + let y4m = Command::new("ffmpeg") + .args([ + "-v", "error", "-f", "lavfi", "-i", &src, "-t", &duration, "-pix_fmt", "yuv420p", + "-strict", "-1", "-f", "yuv4mpegpipe", "-", + ]) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .output() + .expect("ffmpeg failed to run"); + assert!(y4m.status.success(), "ffmpeg refused the {width}x{height} fixture"); + let limit = format!("--limit={frames}"); + let mut args: Vec = [ + "--codec=av1", + "--passes=1", + "--end-usage=q", + "--threads=1", + "--row-mt=0", + "--kf-max-dist=9999", + "--lag-in-frames=0", + ] + .iter() + .map(|s| (*s).to_owned()) + .collect(); + args.push(limit); + args.extend(extra.iter().map(|s| (*s).to_owned())); + args.extend(["--obu".to_owned(), "-o".to_owned(), "-".to_owned(), "-".to_owned()]); + let mut child = Command::new(aomenc_path()) + .args(&args) + .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 {args:?}: {}", String::from_utf8_lossy(&out.stderr)); + let stream = out.stdout; + let result = match decode_stream(&stream) { + Ok(pictures) => Ok(pictures.len()), + Err(e) => Err(e.to_string()), + }; + (stream.len(), result) + } + + /// lane-t900 r27 CENSUS behind the negative gate above: does a real + /// aomenc ever ENABLE one of the three mode-overriding segmentation + /// features? Measured over the recipes that turn segmentation on -- + /// `--aq-mode=1/2/3` (variance, complexity and cyclic-refresh AQ) and + /// `--deltaq-mode=1` -- with the refusal as the instrument: if one of + /// those features appeared, the decode would stop by name. + #[test] + fn a_segmentation_census_over_real_aq_streams_finds_no_mode_overriding_feature() { + if !have_aomenc() { + eprintln!("SKIP a_segmentation_census_over_real_aq_streams: no aomenc"); + return; + } + const REFUSAL: &str = + "a frame whose segmentation enables SEG_LVL_REF_FRAME/SKIP/GLOBALMV"; + let recipes: [(&str, Vec<&str>); 6] = [ + ("baseline", vec!["--cpu-used=4", "--cq-level=40"]), + ("aq-mode=1", vec!["--cpu-used=4", "--aq-mode=1", "--cq-level=40"]), + ("aq-mode=2", vec!["--cpu-used=4", "--aq-mode=2", "--cq-level=40"]), + ("aq-mode=3", vec!["--cpu-used=4", "--aq-mode=3", "--cq-level=40"]), + ("aq-mode=3 cq10", vec!["--cpu-used=4", "--aq-mode=3", "--cq-level=10"]), + ("deltaq-mode=1", vec!["--cpu-used=4", "--deltaq-mode=1", "--cq-level=40"]), + ]; + // Arrival, not intent (class knob-never-reached-the-tool): a recipe + // whose stream is byte-for-byte the baseline's changed nothing, and a + // census over such arms would be vacuous. Measured r27: only + // `--aq-mode=3` (cyclic refresh) does -- aq-mode 1/2 and deltaq-mode=1 + // all reproduce the baseline's 7147 B at this recipe. + let mut baseline_bytes = 0usize; + let mut segment_symbols = 0usize; + let mut refused = 0usize; + let mut decoded = 0usize; + for (name, extra) in &recipes { + let before = crate::decode::segment_id_hits(); + let (bytes, result) = census_attempt("mandelbrot", 192, 128, 8, extra); + match result { + Ok(pictures) => { + decoded += 1; + let symbols = crate::decode::segment_id_hits() - before; + segment_symbols += symbols; + if *name == "baseline" { + baseline_bytes = bytes; + } + eprintln!( + "SEGCENSUS {name}: {bytes} B{}, {pictures} pictures, segment_id symbols {symbols}", + if bytes == baseline_bytes && *name != "baseline" { + " (== baseline: the flag changed nothing)" + } else { + "" + } + ); + } + Err(e) => { + eprintln!("SEGCENSUS {name}: {bytes} B, refused: {e}"); + assert!( + !e.contains(REFUSAL), + "{name}: a real aomenc stream DOES enable a mode-overriding \ + segmentation feature -- the refusal is a capability gap, not a \ + claim about the encoder: {e}" + ); + refused += 1; + } + } + } + eprintln!( + "SEGCENSUS: {} recipes, {decoded} decoded, {refused} refused for other reasons", + recipes.len() + ); + assert_eq!(decoded, recipes.len(), "every recipe must decode; {refused} refused"); + assert!( + segment_symbols > 0, + "no recipe coded a single segment_id symbol -- segmentation never arrived, so \ + this census measures nothing about the three mode-overriding features" + ); + } + + /// lane-t900 r27, WITNESS half of the proof for "an OBMC neighbour whose + /// switchable interp filter was never recorded" (the structural half is + /// `decode::tests::every_inter_record_publishes_an_obmc_readable_filter`, + /// which shows no INTER cell is ever stamped with the `[3, 3]` + /// sentinel): real OBMC streams whose frames use a SWITCHABLE (and dual) + /// interp filter decode with the refusal firing 0 times while OBMC blends + /// really read the neighbour band -- a decode that never read one would + /// pass just as well and prove nothing (class gate-blind-to-feature). + #[test] + fn a_real_obmc_stream_reads_a_recorded_switchable_filter_for_every_neighbour() { + if !have_aomenc() { + eprintln!("SKIP a_real_obmc_stream_reads_a_recorded_switchable_filter: no aomenc"); + return; + } + // `--cpu-used=0` is load-bearing: at speed 4 aomenc settles on a + // FRAME-level fixed interp filter, every neighbour then legitimately + // carries the sentinel, and the band is never read at all (measured + // r27: 0 reads over two speed-4 streams). + let base = vec![ + "--cpu-used=0", + "--enable-obmc=1", + "--enable-dual-filter=1", + "--min-partition-size=8", + "--max-partition-size=16", + "--enable-palette=0", + "--enable-intrabc=0", + ]; + let recipes: [(&str, usize, usize, Vec<&str>); 2] = [ + ("obmc dual cq40", 192, 128, [vec!["--cq-level=40"], base.clone()].concat()), + ("obmc dual cq20", 192, 128, [vec!["--cq-level=20"], base.clone()].concat()), + ]; + let mut reads = 0usize; + let mut decoded = 0usize; + for (name, w, h, extra) in &recipes { + let before = crate::decode::obmc_filter_band_reads(); + let obmc_before = crate::decode::obmc_hits(); + let (bytes, result) = census_attempt("mandelbrot", *w, *h, 8, extra); + match result { + Ok(pictures) => { + decoded += 1; + let got = crate::decode::obmc_filter_band_reads() - before; + reads += got; + eprintln!( + "OBMCFILT {name}: {bytes} B, {pictures} pictures, {got} band reads, \ + {} OBMC blocks", + crate::decode::obmc_hits() - obmc_before + ); + } + Err(e) => { + assert!( + !e.contains("an OBMC neighbour whose switchable interp filter was never recorded"), + "{name}: a real OBMC stream reached the unrecorded-filter refusal -- \ + a publication site is missing: {e}" + ); + eprintln!("OBMCFILT {name}: {bytes} B, refused for another reason: {e}"); + } + } + } + assert!(decoded > 0, "no OBMC recipe decoded -- the witness is vacuous"); + assert!( + reads > 0, + "every OBMC blend took the fixed-filter path: the band was never read, so this \ + proves nothing about the refusal" + ); + } + + /// lane-t900 r27 CENSUS for the three SUPERRES refusals -- "warp + /// prediction with a scaled reference", "a sub-8x8 inter block under a + /// scaled reference" and "an 8x8 partition leaf under a scaled reference". + /// Six real `--superres-mode` encodes (fixed denominators and the auto + /// mode, warped motion and OBMC on), decoded by this decoder: the table it + /// prints is which of the three a real encoder actually reaches. + /// + /// Every one of them is a REAL capability gap (unlike the enumerated + /// refusals elsewhere in the inventory), so this gate asserts the measured + /// shape rather than "no refusal": at least one recipe must decode (else + /// the census says nothing), and any refusal must be one of the three + /// named superres ones -- a fourth string would be a new gap this round + /// did not measure. + #[test] + fn a_superres_census_over_six_real_streams_records_which_scaled_refusals_fire() { + if !have_aomenc() { + eprintln!("SKIP a_superres_census_over_six_real_streams: no aomenc"); + return; + } + const WARP: &str = "warp prediction with a scaled reference"; + const SUB8: &str = "a sub-8x8 inter block under a scaled reference"; + const LEAF8: &str = "an 8x8 partition leaf under a scaled reference"; + let common = [ + "--enable-warped-motion=1", + "--enable-obmc=1", + "--enable-palette=0", + "--enable-intrabc=0", + ]; + let recipes: [(&str, usize, usize, Vec<&str>); 6] = [ + ("denom12 320x180 cq32", 320, 180, vec!["--cpu-used=4", "--superres-mode=1", "--superres-denominator=12", "--cq-level=32"]), + ("denom12 320x180 cq50", 320, 180, vec!["--cpu-used=4", "--superres-mode=1", "--superres-denominator=12", "--cq-level=50"]), + ("denom16 320x180 cq32", 320, 180, vec!["--cpu-used=4", "--superres-mode=1", "--superres-denominator=16", "--cq-level=32"]), + ("denom10 192x128 cq32", 192, 128, vec!["--cpu-used=4", "--superres-mode=1", "--superres-denominator=10", "--cq-level=32"]), + ("auto 320x180 cq50", 320, 180, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]), + ("auto 192x128 cq50", 192, 128, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]), + ]; + let (mut decoded, mut warp, mut sub8, mut leaf8, mut other) = (0, 0, 0, 0, 0); + for (name, w, h, extra) in &recipes { + let mut args = extra.clone(); + args.extend_from_slice(&common); + let before = crate::mc::predict_scaled_hits(); + let (bytes, result) = census_attempt("mandelbrot", *w, *h, 10, &args); + match result { + Ok(pictures) => { + decoded += 1; + eprintln!( + "SUPERRES {name}: {bytes} B, {pictures} pictures, scaled MC blocks {}", + crate::mc::predict_scaled_hits() - before + ); + } + Err(e) => { + eprintln!("SUPERRES {name}: {bytes} B, refused: {e}"); + if e.contains(WARP) { + warp += 1; + } else if e.contains(SUB8) { + sub8 += 1; + } else if e.contains(LEAF8) { + leaf8 += 1; + } else { + other += 1; + panic!("{name}: a superres stream stopped on a string this census does not know: {e}"); + } + } + } + } + eprintln!( + "SUPERRES CENSUS: 6 streams, {decoded} decoded, warp {warp}x, sub8 {sub8}x, leaf8 {leaf8}x, other {other}x" + ); + // Measured r27: the four FIXED-denominator recipes all stop at the + // 8x8-leaf refusal, and the two `--superres-mode=3` (auto) streams + // decode with ZERO scaled MC blocks -- auto picked denominator 8, so + // those two arms carry no scaling at all and prove nothing. The warp + // and sub-8x8 refusals never fire because the 8x8-leaf one sits in + // front of them: whichever partition path a scaled frame takes, the + // leaf guard is reached first. Lifting the leaf gap is what makes the + // other two measurable, so this gate pins the ORDER, not just a count. + assert!(decoded > 0, "no superres recipe decoded -- the census is vacuous"); + assert!( + leaf8 > 0, + "no fixed-denominator recipe reached the 8x8-leaf refusal any more: either the \ + capability landed (drop the refusal) or the recipes stopped scaling" + ); + } + /// lane-t900 r25, negative gate: a `show_existing_frame` header naming a /// slot no frame has refreshed is refused BY NAME, and outputs no picture. ///