forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-t900' (05619ce6): the two gate counters that were never read now print and assert (rect-residual refusals == 0 in the 1:4 sweep; superres census reports unknown strings before failing)

Browse files at this commit

88512b4cd1b3b03884462b0db4918c1780ac4ea2Ahmet Kaan GümüşParent: a5126ca9c001a3
crates/ec-av1/src/stream.rsmodified+32 -4
@@ -2115,7 +2115,13 @@ mod tests {
2115 ("auto 320x180 cq50", 320, 180, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]),2115 ("auto 320x180 cq50", 320, 180, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]),
2116 ("auto 192x128 cq50", 192, 128, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]),2116 ("auto 192x128 cq50", 192, 128, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]),
2117 ];2117 ];
2118- let (mut decoded, mut warp, mut sub8, mut leaf8, mut other) = (0, 0, 0, 0, 0);2118+ let (mut decoded, mut warp, mut sub8, mut leaf8) = (0, 0, 0, 0);
2119+ // lane-t900 r36 (class [[gate-blind-to-feature]]): unknown refusal
2120+ // strings used to `other += 1` and panic on the spot, so the census
2121+ // summary below -- the whole point of the gate -- never printed when
2122+ // one fired. They are collected instead, reported in the summary, and
2123+ // asserted after it.
2124+ let mut other: Vec<String> = Vec::new();
2119 for (name, w, h, extra) in &recipes {2125 for (name, w, h, extra) in &recipes {
2120 let mut args = extra.clone();2126 let mut args = extra.clone();
2121 args.extend_from_slice(&common);2127 args.extend_from_slice(&common);
@@ -2138,14 +2144,19 @@ mod tests {
2138 } else if e.contains(LEAF8) {2144 } else if e.contains(LEAF8) {
2139 leaf8 += 1;2145 leaf8 += 1;
2140 } else {2146 } else {
2141- other += 1;2147+ other.push(format!("{name}: {e}"));
2142- panic!("{name}: a superres stream stopped on a string this census does not know: {e}");
2143 }2148 }
2144 }2149 }
2145 }2150 }
2146 }2151 }
2147 eprintln!(2152 eprintln!(
2148- "SUPERRES CENSUS: 6 streams, {decoded} decoded, warp {warp}x, sub8 {sub8}x, leaf8 {leaf8}x, other {other}x"2153+ "SUPERRES CENSUS: 6 streams, {decoded} decoded, warp {warp}x, sub8 {sub8}x, leaf8 {leaf8}x, other {}x",
2154+ other.len()
2155+ );
2156+ assert!(
2157+ other.is_empty(),
2158+ "{} superres stream(s) stopped on a string this census does not know: {other:?}",
2159+ other.len()
2149 );2160 );
2150 // Measured r27: the four FIXED-denominator recipes all stop at the2161 // Measured r27: the four FIXED-denominator recipes all stop at the
2151 // 8x8-leaf refusal, and the two `--superres-mode=3` (auto) streams2162 // 8x8-leaf refusal, and the two `--superres-mode=3` (auto) streams
@@ -13253,6 +13264,23 @@ mod tests {
13253 but mismatched ffmpeg -- a defect of another shape, not a pass"13264 but mismatched ffmpeg -- a defect of another shape, not a pass"
13254 );13265 );
13255 }13266 }
13267+ // lane-t900 r36 (class [[gate-blind-to-feature]]): this counter was
13268+ // incremented and never read. What it was there to prove is that the
13269+ // VERT_4 / split-tx arms' blocker is still the rect-residual refusal.
13270+ // It no longer is: `decode.rs`'s "a non-skip rectangular
13271+ // (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" still
13272+ // exists but is narrowed (lane-rectres + lane-inter4 +
13273+ // lane-intrarect), and this sweep now reaches it ZERO times at either
13274+ // depth -- attempt 1, the one recipe r5 recorded stopping there,
13275+ // decodes. So the counter is reported and pinned at 0: a non-zero
13276+ // reading means the refusal came back for this shape.
13277+ eprintln!("{NAME}: rect-residual refusals over both depths: {rect_residual_refusals}");
13278+ assert_eq!(
13279+ rect_residual_refusals, 0,
13280+ "{NAME}: {rect_residual_refusals} attempt(s) stopped on \"a non-skip rectangular \
13281+ (HORZ/VERT/HORZ_B) strip needs rectangular residual coding\" -- that refusal was \
13282+ lifted for this shape and must not block the VERT_4 / split-tx arms again"
13283+ );
13256 // Arms 1/3/4 (HORZ_4, the odd-strip `is_chroma_reference` pair, the13284 // Arms 1/3/4 (HORZ_4, the odd-strip `is_chroma_reference` pair, the
13257 // `build_inter_predictors_sub8x8` two-mv chroma build) are proven13285 // `build_inter_predictors_sub8x8` two-mv chroma build) are proven
13258 // outright.13286 // outright.