Two gate counters incremented and never read now report and assert
Browse files at this commit9c001a3dc30366234b6ad9b39a957a4ec971029cParent: d6f9cd4- test
- two gate counters incremented and never read now report and assert
1 changed file +32 -4
- crates/ec-av1/src/stream.rs +32 -4
crates/ec-av1/src/stream.rsmodified+32 -4
| @@ -1854,7 +1854,13 @@ mod tests { | ||
| 1854 | 1854 | ("auto 320x180 cq50", 320, 180, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]), |
| 1855 | 1855 | ("auto 192x128 cq50", 192, 128, vec!["--cpu-used=4", "--superres-mode=3", "--cq-level=50"]), |
| 1856 | 1856 | ]; |
| 1857 | - let (mut decoded, mut warp, mut sub8, mut leaf8, mut other) = (0, 0, 0, 0, 0); | |
| 1857 | + let (mut decoded, mut warp, mut sub8, mut leaf8) = (0, 0, 0, 0); | |
| 1858 | + // lane-t900 r36 (class [[gate-blind-to-feature]]): unknown refusal | |
| 1859 | + // strings used to `other += 1` and panic on the spot, so the census | |
| 1860 | + // summary below -- the whole point of the gate -- never printed when | |
| 1861 | + // one fired. They are collected instead, reported in the summary, and | |
| 1862 | + // asserted after it. | |
| 1863 | + let mut other: Vec<String> = Vec::new(); | |
| 1858 | 1864 | for (name, w, h, extra) in &recipes { |
| 1859 | 1865 | let mut args = extra.clone(); |
| 1860 | 1866 | args.extend_from_slice(&common); |
| @@ -1877,14 +1883,19 @@ mod tests { | ||
| 1877 | 1883 | } else if e.contains(LEAF8) { |
| 1878 | 1884 | leaf8 += 1; |
| 1879 | 1885 | } else { |
| 1880 | - other += 1; | |
| 1881 | - panic!("{name}: a superres stream stopped on a string this census does not know: {e}"); | |
| 1886 | + other.push(format!("{name}: {e}")); | |
| 1882 | 1887 | } |
| 1883 | 1888 | } |
| 1884 | 1889 | } |
| 1885 | 1890 | } |
| 1886 | 1891 | eprintln!( |
| 1887 | - "SUPERRES CENSUS: 6 streams, {decoded} decoded, warp {warp}x, sub8 {sub8}x, leaf8 {leaf8}x, other {other}x" | |
| 1892 | + "SUPERRES CENSUS: 6 streams, {decoded} decoded, warp {warp}x, sub8 {sub8}x, leaf8 {leaf8}x, other {}x", | |
| 1893 | + other.len() | |
| 1894 | + ); | |
| 1895 | + assert!( | |
| 1896 | + other.is_empty(), | |
| 1897 | + "{} superres stream(s) stopped on a string this census does not know: {other:?}", | |
| 1898 | + other.len() | |
| 1888 | 1899 | ); |
| 1889 | 1900 | // Measured r27: the four FIXED-denominator recipes all stop at the |
| 1890 | 1901 | // 8x8-leaf refusal, and the two `--superres-mode=3` (auto) streams |
| @@ -12992,6 +13003,23 @@ mod tests { | ||
| 12992 | 13003 | but mismatched ffmpeg -- a defect of another shape, not a pass" |
| 12993 | 13004 | ); |
| 12994 | 13005 | } |
| 13006 | + // lane-t900 r36 (class [[gate-blind-to-feature]]): this counter was | |
| 13007 | + // incremented and never read. What it was there to prove is that the | |
| 13008 | + // VERT_4 / split-tx arms' blocker is still the rect-residual refusal. | |
| 13009 | + // It no longer is: `decode.rs`'s "a non-skip rectangular | |
| 13010 | + // (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" still | |
| 13011 | + // exists but is narrowed (lane-rectres + lane-inter4 + | |
| 13012 | + // lane-intrarect), and this sweep now reaches it ZERO times at either | |
| 13013 | + // depth -- attempt 1, the one recipe r5 recorded stopping there, | |
| 13014 | + // decodes. So the counter is reported and pinned at 0: a non-zero | |
| 13015 | + // reading means the refusal came back for this shape. | |
| 13016 | + eprintln!("{NAME}: rect-residual refusals over both depths: {rect_residual_refusals}"); | |
| 13017 | + assert_eq!( | |
| 13018 | + rect_residual_refusals, 0, | |
| 13019 | + "{NAME}: {rect_residual_refusals} attempt(s) stopped on \"a non-skip rectangular \ | |
| 13020 | + (HORZ/VERT/HORZ_B) strip needs rectangular residual coding\" -- that refusal was \ | |
| 13021 | + lifted for this shape and must not block the VERT_4 / split-tx arms again" | |
| 13022 | + ); | |
| 12995 | 13023 | // Arms 1/3/4 (HORZ_4, the odd-strip `is_chroma_reference` pair, the |
| 12996 | 13024 | // `build_inter_predictors_sub8x8` two-mv chroma build) are proven |
| 12997 | 13025 | // outright. |