forge
Explore
Log in

Don't you dare go Hollow

Three refusals claimed the encoder never writes what it writes

Browse files at this commit

177de6ad43147e5c4e848cd78fb91a4875b3f7a4Ahmet Kaan GümüşParent: 2cf5984
  • fix
    • three refusals claimed the encoder never writes what it writes
Show full message
fix(av1): three refusals claimed the encoder never writes what it writes

Measured, not reasoned: five default-settings aomenc streams through the
decoder, one command each. testsrc2 192x128 at --cpu-used=0 refuses with "a
partition type this encoder never writes" -- a claim about the world, disproved
by the stream that produced it. The same family sits at the 32x32 level for
both the intra and inter paths.

All three now say what this decoder does not code, which is the true and useful
statement:
  "a superblock-level partition type other than NONE or SPLIT (this decoder's
   intra tile path codes only those two at 64x64)"
  "a 32x32 partition type this decoder does not code (value={part32})"
  "an INTER 32x32 partition type this decoder does not code (value={part32})"

Finding those needed a fix to the inventory itself: its scanner stopped at
`unsupported(` and so never saw `unsupported(format!("..."))`. Two refusals were
invisible to it, one of them the INTER claim above. It steps through format!
now, and both are pinned.

Where a default-settings stream stops today, measured this run: palette (Y);
delta_q/delta_lf, twice; the inter path's non-SPLIT superblock partition; and
the intra path's, at cpu-used=0. Four of the five are owned by live lanes; the
superblock-level partition family is not, and is the next lane to arm.

Suite 243 passed / 0 failed.
crates/ec-av1/examples/decode_probe.rsadded+9 -0
@@ -0,0 +1,9 @@
1+//! Temporary probe: decode an IVF and print what the decoder says.
2+fn main() {
3+ let path = std::env::args().nth(1).expect("usage: decode_probe <file.ivf>");
4+ let data = std::fs::read(&path).expect("read");
5+ match ec_av1::stream::decode_stream(&data) {
6+ Ok(frames) => println!("OK: {} frames decoded", frames.len()),
7+ Err(e) => println!("REFUSED: {e}"),
8+ }
9+}
crates/ec-av1/src/decode.rsmodified+6 -3
@@ -5283,14 +5283,17 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
5283 }5283 }
5284 _ => {5284 _ => {
5285 return Err(unsupported(format!(5285 return Err(unsupported(format!(
5286- "a partition type this encoder never writes (value={part32})"5286+ "a 32x32 partition type this decoder does not code (value={part32})"
5287 )));5287 )));
5288 }5288 }
5289 }5289 }
5290 }5290 }
5291 }5291 }
5292 _ => {5292 _ => {
5293- return Err(unsupported("a partition type this encoder never writes"));5293+ return Err(unsupported(
5294+ "a superblock-level partition type other than NONE or SPLIT (this \
5295+ decoder's intra tile path codes only those two at 64x64)",
5296+ ));
5294 }5297 }
5295 }5298 }
5296 }5299 }
@@ -10885,7 +10888,7 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
10885 }10888 }
10886 _ => {10889 _ => {
10887 return Err(unsupported(format!(10890 return Err(unsupported(format!(
10888- "an INTER 32x32 partition type this encoder never writes (value={part32})"10891+ "an INTER 32x32 partition type this decoder does not code (value={part32})"
10889 )));10892 )));
10890 }10893 }
10891 }10894 }
crates/ec-av1/src/refusal_inventory.rsmodified+8 -1
@@ -29,7 +29,6 @@ const CAPABILITY_CLAIMS: &[&str] = &[
29 "a nonzero angle delta (this encoder never writes one)",29 "a nonzero angle delta (this encoder never writes one)",
30 "a partition below 16x16 other than a clean split (this encoder never writes one)",30 "a partition below 16x16 other than a clean split (this encoder never writes one)",
31 "a partition below 8x8 (this encoder never writes one)",31 "a partition below 8x8 (this encoder never writes one)",
32- "a partition type this encoder never writes",
33 "a tx_type symbol on a rectangular transform (never expected at this size)",32 "a tx_type symbol on a rectangular transform (never expected at this size)",
34 ];33 ];
35 34
@@ -38,7 +37,11 @@ const REFUSALS: &[&str] = &[
38 "GLOBALMV (round 3)",37 "GLOBALMV (round 3)",
39 "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet",38 "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet",
40 "a 16x16 inter block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet",39 "a 16x16 inter block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet",
40+ "a 32x32 partition type this decoder does not code (value={part32})",
41 "a Golomb tail longer than this decoder reads",41 "a Golomb tail longer than this decoder reads",
42+ "a tx_type symbol outside its CDF's own set: {t}",
43+ "an INTER 32x32 partition type this decoder does not code (value={part32})",
44+ "a superblock-level partition type other than NONE or SPLIT (this decoder's intra tile path codes only those two at 64x64)",
42 "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)",45 "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)",
43 "a HORZ/VERT intra strip with a split transform (per-unit rect prediction is not ported)",46 "a HORZ/VERT intra strip with a split transform (per-unit rect prediction is not ported)",
44 "a block that actually uses a palette (UV) -- reconstruction is out of scope",47 "a block that actually uses a palette (UV) -- reconstruction is out of scope",
@@ -107,6 +110,10 @@ mod tests {
107 for (start, _) in src.match_indices("unsupported(") {110 for (start, _) in src.match_indices("unsupported(") {
108 // `Error::unsupported(` and the bare helper both end here.111 // `Error::unsupported(` and the bare helper both end here.
109 let mut i = start + "unsupported(".len();112 let mut i = start + "unsupported(".len();
113+ // `unsupported(format!("..."))` is the same refusal, one layer in.
114+ if src[i..].starts_with("format!(") {
115+ i += "format!(".len();
116+ }
110 let mut last: Option<String> = None;117 let mut last: Option<String> = None;
111 loop {118 loop {
112 while i < bytes.len() && (bytes[i] as char).is_whitespace() {119 while i < bytes.len() && (bytes[i] as char).is_whitespace() {