forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-oddh': 128x128 superblocks refused by name (were silently decoded as 64x64 -- ReelC's actual wall); odd frame sizes proven pixel-exact

Browse files at this commit

08930e6bfb0a3c14ddb09a4bdb1ecf6ca916d0feAhmet Kaan GümüşParent: 1701408abae99a
crates/ec-av1/fixtures/reelb_head_key_frame.obuadded+0 -0

Binary file changed

crates/ec-av1/src/decode.rsmodified+192 -66
@@ -1044,6 +1044,21 @@ pub(crate) fn horz_vert_intra_hits() -> usize {
10441044 HORZ_VERT_INTRA_HITS.with(|c| c.get())
10451045 }
10461046
1047+// How many blocks were decoded as a frame-edge rect strip -- the single
1048+// coded half of a `PARTITION_HORZ`/`PARTITION_VERT` at the true frame edge
1049+// (lane-oddh r1), i.e. a block living inside the 8px band of a frame whose
1050+// height or width is 8 mod 16 (the user's 3840x1608 film). Intra and inter
1051+// paths share the counter.
1052+thread_local! {
1053+ static EDGE_RECT_STRIP_HITS: std::cell::Cell<usize> =
1054+ const { std::cell::Cell::new(0) };
1055+}
1056+
1057+/// Current value of [`EDGE_RECT_STRIP_HITS`].
1058+pub(crate) fn edge_rect_strip_hits() -> usize {
1059+ EDGE_RECT_STRIP_HITS.with(|c| c.get())
1060+}
1061+
10471062 // How many HORZ/VERT intra strips resolved a SPLIT luma transform
10481063 // (`tx_depth != 0`) and decoded it per transform unit (lane-rectsplit r1) --
10491064 // the case every rect path here refused by name before, and the first
@@ -11801,16 +11816,31 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
1180111816 }
1180211817 p
1180311818 } else {
11819+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
11820+ // bit is the answer, not a formality -- libaom's
11821+ // `ec_read_partition_impl` returns `PARTITION_HORZ` (resp.
11822+ // `PARTITION_VERT`) when it reads 0, and only `PARTITION_SPLIT`
11823+ // when it reads 1. Forcing SPLIT here desynced the last
11824+ // superblock row of every frame whose height is not a multiple
11825+ // of 64 -- the ReelB head (3840x1608) diverges at
11826+ // mi_row=400 mi_col=0, the first block of that row.
1180411827 match (has_cols, has_rows) {
1180511828 (true, false) => {
11806- dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE));
11829+ if dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE)) == 1 {
11830+ PARTITION_SPLIT
11831+ } else {
11832+ PARTITION_HORZ
11833+ }
1180711834 }
1180811835 (false, true) => {
11809- dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE));
11836+ if dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE)) == 1 {
11837+ PARTITION_SPLIT
11838+ } else {
11839+ PARTITION_VERT
11840+ }
1181011841 }
11811- _ => {}
11842+ _ => PARTITION_SPLIT,
1181211843 }
11813- PARTITION_SPLIT
1181411844 };
1181511845 match part {
1181611846 PARTITION_NONE => {
@@ -11867,20 +11897,27 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
1186711897 } else {
1186811898 match (has_cols32, has_rows32) {
1186911899 (true, false) => {
11870- dec.symbol_fixed(&gather(
11871- &cdfs.partition_w32[ctx32],
11872- VERT_ALIKE,
11873- ));
11900+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
11901+ // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT
11902+ // (libaom `ec_read_partition_impl`).
11903+ if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE)) == 1 {
11904+ PARTITION_SPLIT
11905+ } else {
11906+ PARTITION_HORZ
11907+ }
1187411908 }
1187511909 (false, true) => {
11876- dec.symbol_fixed(&gather(
11877- &cdfs.partition_w32[ctx32],
11878- HORZ_ALIKE,
11879- ));
11910+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
11911+ // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT
11912+ // (libaom `ec_read_partition_impl`).
11913+ if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE)) == 1 {
11914+ PARTITION_SPLIT
11915+ } else {
11916+ PARTITION_VERT
11917+ }
1188011918 }
11881- _ => {}
11919+ _ => PARTITION_SPLIT,
1188211920 }
11883- PARTITION_SPLIT
1188411921 };
1188511922 match part32 {
1188611923 PARTITION_NONE => {
@@ -12319,16 +12356,63 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
1231912356 does not code yet",
1232012357 ));
1232112358 }
12322- if has_cols16 {
12359+ // lane-golomb r1 (class
12360+ // `parsed-then-discarded`): the gathered
12361+ // bit IS the partition -- 0 names
12362+ // PARTITION_HORZ (resp. VERT), only 1 is
12363+ // SPLIT (libaom `ec_read_partition_impl`).
12364+ // This path can only walk the four SPLIT
12365+ // leaves, so a 0 refuses by name instead
12366+ // of desyncing.
12367+ let edge_split = if has_cols16 {
1232312368 dec.symbol_fixed(&gather(
1232412369 &cdfs.partition_w16[ctx16],
1232512370 VERT_ALIKE,
12326- ));
12371+ ))
1232712372 } else {
1232812373 dec.symbol_fixed(&gather(
1232912374 &cdfs.partition_w16[ctx16],
1233012375 HORZ_ALIKE,
12331- ));
12376+ ))
12377+ };
12378+ if edge_split == 0 {
12379+ // lane-oddh r1: the strip IS decodable
12380+ // -- libaom's `decode_partition` codes
12381+ // only the FIRST half of an edge
12382+ // HORZ/VERT (the second call is
12383+ // guarded by the same has_rows/
12384+ // has_cols test that made the
12385+ // partition non-square), so one
12386+ // 16x8 (resp. 8x16) strip covers the
12387+ // whole visible band of a frame whose
12388+ // height (resp. width) is 8 mod 16 --
12389+ // the user's 3840x1608 film.
12390+ HORZ_VERT_INTRA_HITS.with(|c| c.set(c.get() + 1));
12391+ EDGE_RECT_STRIP_HITS.with(|c| c.set(c.get() + 1));
12392+ let (mi_row0, mi_col0) =
12393+ (sr as u32 * SUB_MI, sc as u32 * SUB_MI);
12394+ let (bw, bh) = if has_cols16 { (16, 8) } else { (8, 16) };
12395+ let mode = decode_leaf_rect(
12396+ &mut dec,
12397+ &mut cdfs,
12398+ &mut neighbours,
12399+ at16,
12400+ (mi_row0 as usize, mi_col0 as usize),
12401+ bw,
12402+ bh,
12403+ None,
12404+ &mut y,
12405+ &mut u,
12406+ &mut v,
12407+ enable_filter_intra,
12408+ allow_screen_content_tools,
12409+ base_q_idx,
12410+ tx_select,
12411+ reduced_tx_set,
12412+ )?;
12413+ neighbours.above_mode[sc] = mode;
12414+ neighbours.left_mode[sr] = mode;
12415+ continue;
1233212416 }
1233312417 let (mi_row0, mi_col0) =
1233412418 (sr as u32 * SUB_MI, sc as u32 * SUB_MI);
@@ -12878,22 +12962,27 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
1287812962 tx_select,
1287912963 reduced_tx_set,
1288012964 )?;
12881- decode_block_rect64(
12882- &mut dec,
12883- &mut cdfs,
12884- &mut neighbours,
12885- (at.0 + 2, at.1),
12886- 64,
12887- 32,
12888- &mut y,
12889- &mut u,
12890- &mut v,
12891- enable_filter_intra,
12892- allow_screen_content_tools,
12893- base_q_idx,
12894- tx_select,
12895- reduced_tx_set,
12896- )?;
12965+ // lane-golomb r1: at the frame edge only the first half of the
12966+ // strip is coded (libaom `decode_partition` guards the second
12967+ // with the same has_rows test that made this partition non-square).
12968+ if has_rows {
12969+ decode_block_rect64(
12970+ &mut dec,
12971+ &mut cdfs,
12972+ &mut neighbours,
12973+ (at.0 + 2, at.1),
12974+ 64,
12975+ 32,
12976+ &mut y,
12977+ &mut u,
12978+ &mut v,
12979+ enable_filter_intra,
12980+ allow_screen_content_tools,
12981+ base_q_idx,
12982+ tx_select,
12983+ reduced_tx_set,
12984+ )?;
12985+ }
1289712986 }
1289812987 PARTITION_VERT => {
1289912988 // lane-sbpart r2: mirror of PARTITION_HORZ above with
@@ -12914,22 +13003,27 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
1291413003 tx_select,
1291513004 reduced_tx_set,
1291613005 )?;
12917- decode_block_rect64(
12918- &mut dec,
12919- &mut cdfs,
12920- &mut neighbours,
12921- (at.0, at.1 + 2),
12922- 32,
12923- 64,
12924- &mut y,
12925- &mut u,
12926- &mut v,
12927- enable_filter_intra,
12928- allow_screen_content_tools,
12929- base_q_idx,
12930- tx_select,
12931- reduced_tx_set,
12932- )?;
13006+ // lane-golomb r1: at the frame edge only the first half of the
13007+ // strip is coded (libaom `decode_partition` guards the second
13008+ // with the same has_cols test that made this partition non-square).
13009+ if has_cols {
13010+ decode_block_rect64(
13011+ &mut dec,
13012+ &mut cdfs,
13013+ &mut neighbours,
13014+ (at.0, at.1 + 2),
13015+ 32,
13016+ 64,
13017+ &mut y,
13018+ &mut u,
13019+ &mut v,
13020+ enable_filter_intra,
13021+ allow_screen_content_tools,
13022+ base_q_idx,
13023+ tx_select,
13024+ reduced_tx_set,
13025+ )?;
13026+ }
1293313027 }
1293413028 PARTITION_HORZ_A | PARTITION_HORZ_B | PARTITION_VERT_A | PARTITION_VERT_B => {
1293513029 // lane-part32 r4: the four superblock-level AB arms, each
@@ -19271,12 +19365,24 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
1927119365 p
1927219366 }
1927319367 (true, false) => {
19274- dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], VERT_ALIKE));
19275- PARTITION_SPLIT
19368+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19369+ // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT
19370+ // (libaom `ec_read_partition_impl`).
19371+ if dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], VERT_ALIKE)) == 1 {
19372+ PARTITION_SPLIT
19373+ } else {
19374+ PARTITION_HORZ
19375+ }
1927619376 }
1927719377 (false, true) => {
19278- dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], HORZ_ALIKE));
19279- PARTITION_SPLIT
19378+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19379+ // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT
19380+ // (libaom `ec_read_partition_impl`).
19381+ if dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], HORZ_ALIKE)) == 1 {
19382+ PARTITION_SPLIT
19383+ } else {
19384+ PARTITION_VERT
19385+ }
1928019386 }
1928119387 (false, false) => PARTITION_SPLIT,
1928219388 };
@@ -19444,14 +19550,27 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
1944419550 } else {
1944519551 match (has_cols32, has_rows32) {
1944619552 (true, false) => {
19447- dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE));
19553+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19554+ // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT
19555+ // (libaom `ec_read_partition_impl`).
19556+ if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE)) == 1 {
19557+ PARTITION_SPLIT
19558+ } else {
19559+ PARTITION_HORZ
19560+ }
1944819561 }
1944919562 (false, true) => {
19450- dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE));
19563+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19564+ // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT
19565+ // (libaom `ec_read_partition_impl`).
19566+ if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE)) == 1 {
19567+ PARTITION_SPLIT
19568+ } else {
19569+ PARTITION_VERT
19570+ }
1945119571 }
19452- _ => {}
19572+ _ => PARTITION_SPLIT,
1945319573 }
19454- PARTITION_SPLIT
1945519574 };
1945619575 match part32 {
1945719576 PARTITION_NONE => {
@@ -19543,17 +19662,24 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
1954319662 p
1954419663 } else {
1954519664 if has_cols16 {
19546- dec.symbol_fixed(&gather(
19547- &cdfs.partition_w16[ctx16],
19548- VERT_ALIKE,
19549- ));
19665+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19666+ // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT
19667+ // (libaom `ec_read_partition_impl`).
19668+ if dec.symbol_fixed(&gather(&cdfs.partition_w16[ctx16], VERT_ALIKE)) == 1 {
19669+ PARTITION_SPLIT
19670+ } else {
19671+ PARTITION_HORZ
19672+ }
1955019673 } else {
19551- dec.symbol_fixed(&gather(
19552- &cdfs.partition_w16[ctx16],
19553- HORZ_ALIKE,
19554- ));
19674+ // lane-golomb r1 (class `parsed-then-discarded`): the gathered
19675+ // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT
19676+ // (libaom `ec_read_partition_impl`).
19677+ if dec.symbol_fixed(&gather(&cdfs.partition_w16[ctx16], HORZ_ALIKE)) == 1 {
19678+ PARTITION_SPLIT
19679+ } else {
19680+ PARTITION_VERT
19681+ }
1955519682 }
19556- PARTITION_SPLIT
1955719683 };
1955819684 if part16 == PARTITION_NONE {
1955919685 decode_inter_block(
crates/ec-av1/src/refusal_inventory.rsmodified+1 -0
@@ -50,6 +50,7 @@ const REFUSALS: &[&str] = &[
5050 "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)",
5151 "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)",
5252 "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)",
53+ "a sequence using 128x128 superblocks on a frame larger than 64x64 (this decoder's whole partition/CDEF/LR grid is 64x64-superblock only; aomenc picks 128x128 at --cpu-used=0)",
5354 "a frame OBU with no tile group",
5455 "a frame naming primary_ref_frame at a reference slot with no saved CDF state",
5556 "a frame with no mode-info grid",
crates/ec-av1/src/stream.rsmodified+291 -4
@@ -525,6 +525,37 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> {
525525 "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)",
526526 ));
527527 }
528+ // lane-oddh r2: `use_128x128_superblock` reaches every level of the
529+ // decode -- the partition tree starts at BLOCK_128X128, `SB_MI` is 32
530+ // mi units, and the CDEF/LR/deblock grids are per-128 -- and this
531+ // decoder is written for 64x64 superblocks throughout (`SB_MI = 16`,
532+ // no BLOCK_128X128 partition read at all). Until r1 that was SILENT:
533+ // a 64x72 aomenc key frame at `--cpu-used=0` (libaom picks 128x128
534+ // whenever speed is 0, `av1_select_sb_size`) desynced at the very
535+ // first symbol -- aomdec reads a gathered 2-symbol
536+ // BLOCK_128X128 partition (has_cols false at mi_cols=16,
537+ // has_rows true at mi_rows=18) where we read a 10-symbol
538+ // BLOCK_64X64 one from the same byte, giving PARTITION_VERT_4 (9)
539+ // against SPLIT (3). Refuse by name rather than decode wrong pixels.
540+ //
541+ // Scoped, not blanket (measured: a blanket refusal red-lined 29
542+ // previously pixel-exact gates): on a frame of at most 64x64 a
543+ // 128x128 superblock decodes IDENTICALLY to a 64x64 one -- mi (0,0)
544+ // has neither `has_rows` nor `has_cols`, so BLOCK_128X128 is a forced
545+ // SPLIT that reads no symbol, and only one of its four 64x64 children
546+ // is inside the frame. Every sibling inter gate at 64x64 and
547+ // `--cpu-used=0` is exactly that case. The divergence starts the
548+ // moment a superblock has a second child in frame.
549+ if parser
550+ .sequence_header()
551+ .is_some_and(|seq| seq.use_128x128_superblock)
552+ && (header.mi_cols > 16 || header.mi_rows > 16)
553+ {
554+ return Err(Error::unsupported(
555+ "AV1 decode_stream",
556+ "a sequence using 128x128 superblocks on a frame larger than 64x64 (this decoder's whole partition/CDEF/LR grid is 64x64-superblock only; aomenc picks 128x128 at --cpu-used=0)",
557+ ));
558+ }
528559 crate::decode::set_bit_depth(bit_depth);
529560 // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits.
530561 let enable_masked_compound = parser
@@ -936,6 +967,209 @@ mod tests {
936967 );
937968 }
938969
970+ /// lane-oddh r2 GATE: the frame-edge half-strip arms r1 added (a 64x32 /
971+ /// 32x64 superblock-level or 16x8 / 8x16 16-level INTER block where the
972+ /// frame's true edge cuts the strip in half) actually fire and decode
973+ /// pixel-exact, at both bit depths. 160 = two full superblock rows plus
974+ /// 32 pixels, so every superblock in the last row is a half strip; without
975+ /// r1's arms these attempts refused outright, which is why this gate
976+ /// asserts a nonzero `edge_rect_strip_hits` DELTA on attempts that were
977+ /// actually compared -- a refused attempt's hits would prove nothing
978+ /// (class "counter from refused stream").
979+ #[test]
980+ #[ignore = "2026-09-02 lane-oddh r2: no aomenc recipe reaches the INTER edge half-strip arm yet -- rect partitions OFF makes the encoder answer the forced gathered edge symbol SPLIT every time (both bit depths decode 192x160 pixel-exact, edge_rect_strip_hits=0), and rect ON stops at three other lanes' gaps first: at cq 40 'a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding', at cq 62 'an INTER 32x32 partition type this decoder does not code (value=8/9)' (HORZ_4/VERT_4 even with --enable-1to4-partitions=0), and at min-partition 16 'a HORZ/VERT intra strip below 16x16 with a split transform'. The KEY-frame half of the same edge is gated: the tiny size sweep now covers 64x72/72x64/64x136/136x64/192x136"]
981+ fn a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact() {
982+ const NAME: &str = "a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact";
983+ let _gate_lock = lock_gate_counters();
984+ if !have_ffmpeg() || !have_aomenc() {
985+ eprintln!("SKIP {NAME}: no ffmpeg/aomenc");
986+ return;
987+ }
988+ let (width, height, frames) = (192usize, 160usize, 6usize);
989+ let mut compared = 0u32;
990+ let mut strip_hits = 0usize;
991+ let mut refused = 0u32;
992+ for bit_depth in [8u32, 10u32] {
993+ let duration = frames as f64 / 25.0;
994+ let source = format!("testsrc2=size={width}x{height}:duration={duration}:rate=25");
995+ let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" };
996+ let y4m = Command::new("ffmpeg")
997+ .args([
998+ "-v", "error", "-f", "lavfi", "-i", &source, "-t", &duration.to_string(),
999+ "-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-",
1000+ ])
1001+ .stdin(Stdio::null())
1002+ .stdout(Stdio::piped())
1003+ .stderr(Stdio::piped())
1004+ .output()
1005+ .expect("ffmpeg failed to run");
1006+ assert!(
1007+ y4m.status.success(),
1008+ "{NAME}: ffmpeg refused the {bit_depth}-bit fixture: {}",
1009+ String::from_utf8_lossy(&y4m.stderr)
1010+ );
1011+ let depth_arg = format!("--bit-depth={bit_depth}");
1012+ let input_depth_arg = format!("--input-bit-depth={bit_depth}");
1013+ let mut child = Command::new(aomenc_path())
1014+ .args([
1015+ "--codec=av1", "--passes=1", "--end-usage=q", "--cq-level=62",
1016+ // cpu-used >= 1 keeps libaom on 64x64 superblocks at this
1017+ // size (`av1_select_sb_size`: speed >= 1 and <= 480p).
1018+ "--cpu-used=4", "--threads=1", "--row-mt=0", "--kf-max-dist=1000",
1019+ &depth_arg, &input_depth_arg,
1020+ // The tool set every sibling inter gate pins; the edge
1021+ // strip itself needs rect partitions left ON.
1022+ "--enable-warped-motion=0", "--enable-obmc=0", "--enable-masked-comp=0",
1023+ "--enable-interintra-comp=0", "--enable-onesided-comp=0",
1024+ "--enable-interintra-wedge=0", "--enable-smooth-interintra=0",
1025+ // Rect partitions stay ON: the edge strip is a FORCED
1026+ // (gathered) HORZ at the boundary, but with rect coding
1027+ // off the encoder answers that gathered symbol SPLIT every
1028+ // time and the arm never fires (measured, r2).
1029+ "--enable-ab-partitions=0", "--enable-1to4-partitions=0",
1030+ "--enable-palette=0", "--enable-intrabc=0", "--enable-cdef=0",
1031+ "--enable-restoration=0", "--enable-ref-frame-mvs=0",
1032+ "--enable-tx-size-search=0", "--enable-filter-intra=0",
1033+ "--enable-smooth-intra=0", "--enable-paeth-intra=0",
1034+ "--enable-directional-intra=0", "--enable-angle-delta=0",
1035+ "--enable-cfl-intra=0",
1036+ // 16 is the smallest leaf this decoder codes rect strips
1037+ // at; below it the sub-16 strip/1:4 refusals fire first
1038+ // and the gate never reaches the edge arm.
1039+ // 160 = two full superblock rows plus 32, so the forced
1040+ // HORZ at the last row is a 64x32 -- the superblock-level
1041+ // arm -- and a 32 floor keeps the run out of the sub-16
1042+ // rect-strip gap another lane owns.
1043+ "--min-partition-size=32", "--max-partition-size=64",
1044+ "--obu", "-o", "-", "-",
1045+ ])
1046+ .stdin(Stdio::piped())
1047+ .stdout(Stdio::piped())
1048+ .stderr(Stdio::piped())
1049+ .spawn()
1050+ .expect("aomenc failed to start");
1051+ child.stdin.take().expect("aomenc stdin").write_all(&y4m.stdout).expect("write y4m");
1052+ let out = child.wait_with_output().expect("aomenc failed to run");
1053+ assert!(out.status.success(), "aomenc refused: {}", String::from_utf8_lossy(&out.stderr));
1054+ let stream = out.stdout;
1055+
1056+ let before = crate::decode::edge_rect_strip_hits();
1057+ let decoded = match decode_stream(&stream) {
1058+ Ok(f) => f,
1059+ Err(e) => {
1060+ let msg = e.to_string();
1061+ assert!(
1062+ msg.contains("unsupported"),
1063+ "{NAME}: {bit_depth}-bit failed outright, not a named refusal: {msg}"
1064+ );
1065+ eprintln!("{NAME}: {bit_depth}-bit REFUSED {msg}");
1066+ refused += 1;
1067+ continue;
1068+ }
1069+ };
1070+ let reference = if bit_depth == 10 {
1071+ ffmpeg_decode_sequence_10bit(&stream, width, height, frames)
1072+ } else {
1073+ ffmpeg_decode_sequence(&stream, width, height, frames)
1074+ };
1075+ assert_eq!(
1076+ decoded.len(),
1077+ reference.len(),
1078+ "{NAME}: {bit_depth}-bit frame count"
1079+ );
1080+ for (i, (ours, theirs)) in decoded.iter().zip(&reference).enumerate() {
1081+ let nd = |a: &[u16], b: &[u16]| a.iter().zip(b).filter(|(x, y)| x != y).count();
1082+ assert_eq!(
1083+ (nd(&ours.y, &theirs.y), nd(&ours.u, &theirs.u), nd(&ours.v, &theirs.v)),
1084+ (0, 0, 0),
1085+ "{NAME}: {bit_depth}-bit frame {i} differs from ffmpeg"
1086+ );
1087+ }
1088+ compared += 1;
1089+ strip_hits += crate::decode::edge_rect_strip_hits() - before;
1090+ }
1091+ assert!(compared > 0, "{NAME}: every attempt refused ({refused}) -- gate proved nothing");
1092+ assert!(
1093+ strip_hits > 0,
1094+ "{NAME}: {compared} attempts decoded pixel-exact but not one frame-edge half strip \
1095+ fired -- the recipe no longer reaches the arm this gate exists for"
1096+ );
1097+ eprintln!("{NAME}: {compared} attempts pixel-exact, edge_rect_strip_hits={strip_hits}, {refused} refusals");
1098+ }
1099+
1100+ /// lane-oddh r2 GATE: a REAL aomenc stream that uses 128x128 superblocks
1101+ /// is refused by name, not silently mis-decoded. This is the root cause of
1102+ /// r1's pinned 64x72 first-symbol desync: libaom's `av1_select_sb_size`
1103+ /// returns BLOCK_128X128 whenever speed is 0, so a tiny frame encoded at
1104+ /// `--cpu-used=0` carries 128x128 superblocks, and this 64x64-only
1105+ /// decoder read a 10-symbol BLOCK_64X64 partition (value 9, VERT_4) where
1106+ /// aomdec read a gathered 2-symbol BLOCK_128X128 one (value 3, SPLIT) from
1107+ /// the same byte -- the uncompressed header parse was byte-identical
1108+ /// (49 bits, tile data at file offset 20; hand-verified against spec
1109+ /// 5.9.2 field by field).
1110+ ///
1111+ /// The `use_128x128_superblock` assert is the "knob reached the tool"
1112+ /// half: without it, an aomenc that ignored `--sb-size=128` would leave
1113+ /// the gate asserting a refusal that never fires.
1114+ #[test]
1115+ fn a_real_aomenc_128x128_superblock_stream_is_refused_by_name() {
1116+ if !have_ffmpeg() || !have_aomenc() {
1117+ eprintln!("SKIP: no ffmpeg/aomenc");
1118+ return;
1119+ }
1120+ let (width, height) = (64usize, 72usize);
1121+ let y4m = Command::new("ffmpeg")
1122+ .args([
1123+ "-v", "error", "-f", "lavfi", "-i",
1124+ "mandelbrot=size=64x72:rate=25:start_x=-0.6:start_y=-0.4", "-t", "0.04",
1125+ "-pix_fmt", "yuv420p", "-f", "yuv4mpegpipe", "-",
1126+ ])
1127+ .stdin(Stdio::null())
1128+ .stdout(Stdio::piped())
1129+ .stderr(Stdio::piped())
1130+ .output()
1131+ .expect("ffmpeg failed to run");
1132+ assert!(y4m.status.success(), "ffmpeg fixture: {}", String::from_utf8_lossy(&y4m.stderr));
1133+ let mut child = Command::new(aomenc_path())
1134+ .args([
1135+ "--codec=av1", "--passes=1", "--end-usage=q", "--cq-level=32",
1136+ "--cpu-used=0", "--sb-size=128", "--kf-max-dist=0", "--limit=1",
1137+ "--threads=1", "--row-mt=0", "--obu", "-o", "-", "-",
1138+ ])
1139+ .stdin(Stdio::piped())
1140+ .stdout(Stdio::piped())
1141+ .stderr(Stdio::piped())
1142+ .spawn()
1143+ .expect("aomenc failed to start");
1144+ child.stdin.take().expect("aomenc stdin").write_all(&y4m.stdout).expect("write y4m");
1145+ let out = child.wait_with_output().expect("aomenc failed to run");
1146+ assert!(out.status.success(), "aomenc refused: {}", String::from_utf8_lossy(&out.stderr));
1147+ let stream = out.stdout;
1148+
1149+ // The knob actually arrived: this stream's sequence header codes
1150+ // `use_128x128_superblock = 1`.
1151+ let mut parser = Av1Parser::new();
1152+ let mut pos = 0usize;
1153+ let mut sb128 = false;
1154+ while pos < stream.len() {
1155+ let Ok(obu) = parser.parse_obu(&stream[pos..]) else {
1156+ break;
1157+ };
1158+ pos += obu.total_size.max(1);
1159+ if let Some(seq) = parser.sequence_header() {
1160+ sb128 = seq.use_128x128_superblock;
1161+ break;
1162+ }
1163+ }
1164+ assert!(sb128, "aomenc ignored --sb-size=128: this stream is 64x64-superblock");
1165+
1166+ let err = decode_stream(&stream).unwrap_err().to_string();
1167+ assert!(
1168+ err.contains("a sequence using 128x128 superblocks"),
1169+ "expected the 128x128-superblock refusal for {width}x{height}, got: {err}"
1170+ );
1171+ }
1172+
9391173 /// `decode_stream` on a lone key frame's stream matches both the tile
9401174 /// path (`decode_key_frame_tile` called directly on `Encoded::tile`) and
9411175 /// the encoder's own reconstruction, at an even and an odd size.
@@ -2703,6 +2937,41 @@ mod tests {
27032937 eprintln!("{NAME}: pixel-exact, grain_hits={}", crate::film_grain::grain_hits());
27042938 }
27052939
2940+ /// lane-golomb r1: THE FILM ITSELF. `crates/ec-av1/fixtures/reelb_head_key_frame.obu`
2941+ /// is the first frame of the user's ReelB AV1 release (3840x1608
2942+ /// yuv420p10le, `ffmpeg -i <mkv> -c copy -frames:v 1 -f obu`, 147 bytes) --
2943+ /// a real 10-bit key frame whose height is NOT a multiple of the 64-pixel
2944+ /// superblock, so its last superblock row (mi_row=400 of 402) carries the
2945+ /// edge partition symbol this lane fixed: libaom's `ec_read_partition_impl`
2946+ /// returns `PARTITION_HORZ` when the gathered `split_or_horz` bit is 0, and
2947+ /// this decoder used to READ that bit and throw it away, forcing SPLIT
2948+ /// (class `parsed-then-discarded`). The desync surfaced two rows later as
2949+ /// "a Golomb tail longer than this decoder reads" -- a refusal naming the
2950+ /// symptom, never the cause.
2951+ #[test]
2952+ fn the_reelb_head_key_frame_decodes_pixel_exact() {
2953+ const NAME: &str = "the_reelb_head_key_frame_decodes_pixel_exact";
2954+ if !have_ffmpeg() {
2955+ eprintln!("SKIP {NAME}: no ffmpeg");
2956+ return;
2957+ }
2958+ let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
2959+ .join("fixtures/reelb_head_key_frame.obu");
2960+ let stream = std::fs::read(&path)
2961+ .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display()));
2962+ let (width, height) = (3840usize, 1608usize);
2963+ let frames = match decode_stream(&stream) {
2964+ Ok(frames) => frames,
2965+ Err(e) => panic!("{NAME}: decode_stream refused: {e}"),
2966+ };
2967+ assert_eq!(frames.len(), 1, "{NAME}: one key frame");
2968+ assert_eq!((frames[0].width, frames[0].height), (width, height));
2969+ let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, 1);
2970+ assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg");
2971+ assert_eq!(frames[0].u, ffmpeg_frames[0].u, "{NAME}: U vs ffmpeg");
2972+ assert_eq!(frames[0].v, ffmpeg_frames[0].v, "{NAME}: V vs ffmpeg");
2973+ }
2974+
27062975 /// lane-hbd10 r1: a real `aomenc --bit-depth=10 --superres-mode=1
27072976 /// --superres-denominator=12` key frame, decoded pixel-exact against
27082977 /// ffmpeg's own 10-bit decode. Proves `superres::upscale_row`'s
@@ -13165,8 +13434,26 @@ mod tests {
1316513434 eprintln!("SKIP: no ffmpeg/aomenc");
1316613435 return;
1316713436 }
13168- let sizes: &[(usize, usize)] =
13169- &[(8, 8), (16, 16), (32, 32), (16, 32), (32, 16), (64, 64), (48, 48), (24, 24)];
13437+ // lane-oddh r2: the second half of this list is the odd-height /
13438+ // odd-width ladder -- frame sizes whose last superblock row or column
13439+ // is a partial 64 (72 = one full SB plus 8 rows, 136 = two plus 8),
13440+ // which is where the frame-edge half-strip path r1 added is the only
13441+ // way to code the edge. 192x136 is the inter-sized member.
13442+ let sizes: &[(usize, usize)] = &[
13443+ (8, 8),
13444+ (16, 16),
13445+ (32, 32),
13446+ (16, 32),
13447+ (32, 16),
13448+ (64, 64),
13449+ (48, 48),
13450+ (24, 24),
13451+ (64, 72),
13452+ (72, 64),
13453+ (64, 136),
13454+ (136, 64),
13455+ (192, 136),
13456+ ];
1317013457 let mut total_exact = 0u32;
1317113458 for &(width, height) in sizes {
1317213459 let mut ok = 0u32;
@@ -13284,12 +13571,12 @@ mod tests {
1328413571 }
1328513572 // Hit counter: the sweep proved nothing unless every size x seed
1328613573 // attempt really ran end to end (aomenc -> us -> ffmpeg compare).
13287- // Floor (hit counter): 7 of the 8 sizes must decode all 10 seeds
13574+ // Floor (hit counter): 12 of the 13 sizes must decode all 10 seeds
1328813575 // pixel-exact -- only 8x8 is allowed to refuse outright today. If a
1328913576 // future change makes sizes refuse instead of decode, this fails
1329013577 // rather than passing on refusals alone.
1329113578 assert!(
13292- total_exact >= 70,
13579+ total_exact >= 120,
1329313580 "tiny sweep only reached {total_exact} pixel-exact attempts (floor 70) -- \
1329413581 refusals cannot substitute for decodes"
1329513582 );
lanes/golomb-r1.report.mdadded+47 -0
@@ -0,0 +1,47 @@
1+# lane-golomb r1 — the edge partition bit was read and thrown away
2+
3+## Verdict
4+The "a Golomb tail longer than this decoder reads" refusal on the ReelB head was, as
5+suspected (`refusal-from-own-desync`), a symptom. Root cause: at a frame edge the partition
6+symbol is a single *gathered* bit, and this decoder read it and **discarded** it, always
7+inferring `PARTITION_SPLIT`. libaom `ec_read_partition_impl` (decodeframe.c:1255):
8+`!has_rows && has_cols` → `read ? PARTITION_SPLIT : PARTITION_HORZ`; the mirror case →
9+`PARTITION_VERT`. Class: `parsed-then-discarded`.
10+
11+Charter STEP-2 fallback ("libaom read_golomb caps at 32 bits, extend the reader") is FALSE:
12+`~/.cache/aom-oracle/src/av1/decoder/decodetxb.c:22` aborts the frame at `length > 20`, exactly
13+our cap. The cap was never the bug and is unchanged.
14+
15+## First divergent element (EVIDENCE)
16+EVIDENCE: /tmp/.../scratchpad/{ao-all.txt,ours-all.txt} | instrumented aomdec vs decode_probe,
17+EC_TRACE_MODE+EC_TRACE_MODE_STEP+EC_TRACE_COEFF on the 2-frame extract f2.obu, ladders aligned
18+element by element on msac RANGE | first diff at element 12053: key frame, **mi_row=400
19+mi_col=0** (last, 8-pixel-tall superblock row of a 1608-tall frame), `name=skip`
20+oracle rng=34753 vs ours rng=43258. Oracle codes that superblock as one `BLOCK_64X32`
21+(`EC_IMODE ... bsize=11`, PARTITION_HORZ); we forced SPLIT and descended to 16x16.
22+After the fix the range ladder is element-exact for all 13712 shared elements of the key frame
23+(EVIDENCE: /tmp/.../scratchpad/{a4.n,o4.n} | awk first-diff | idx 13713, inside a later INTER
24+frame, i.e. past the whole key frame).
25+
26+## Fix
27+`crates/ec-av1/src/decode.rs` — every edge-partition site, both tile paths, all three levels
28+(64/32/16, intra and inter): the gathered bit now names HORZ/VERT vs SPLIT. The 64-level
29+HORZ/VERT arms only decode the second half when it is inside the frame (`has_rows`/`has_cols`),
30+mirroring libaom `decode_partition`. The intra 16x16 edge site can only walk four SPLIT leaves,
31+so a 0 bit refuses by name there (new string, listed in `refusal_inventory.rs`) instead of
32+desyncing.
33+
34+## Gates
35+- NEW `stream::tests::the_reelb_head_key_frame_decodes_pixel_exact` — the film itself:
36+ `crates/ec-av1/fixtures/reelb_head_key_frame.obu` (147 B, first frame of his 3840x1608
37+ yuv420p10le release) decodes and matches `ffmpeg -pix_fmt yuv420p10le` on Y, U and V.
38+ EVIDENCE: cargo test -p ec-av1 --lib -- the_reelb_head_key_frame | 1 passed |
39+ Y/U/V all equal to ffmpeg's decode, 3840x1608.
40+- Full lib suite: `$HOME/.cache/golomb-suite.log` — **337 passed / 0 failed / 31 ignored**.
41+
42+## Film probes after the fix
43+- `hg-head.obu` (18 frames): key frame + first inter frames now entropy-exact; stops at
44+ "an inter SB-level partition type other than NONE or SPLIT" — the same edge partition, now
45+ correctly decoded as HORZ, on an INTER superblock row the inter path cannot code (rect inter
46+ residual coding does not exist here). Next lane.
47+- `reelb5.obu`: "a 32x32-level 1:4 strip with a split transform (depth=2)" (unchanged by this lane).
lanes/oddh-r1.report.mdadded+76 -0
@@ -0,0 +1,76 @@
1+# lane-oddh r1 — frames whose height/width is 8 mod 16
2+
3+Branch `lane-oddh` off main `b1d8457`. Target: the user's ReelB film shape
4+(3840x1608, `1608 % 16 == 8`), where every inter attempt derailed.
5+
6+## What the round established (measured, not reasoned)
7+
8+1. **The charter's premise is stale in its blame, right in its shape.** The refusal
9+ `"a non-DC chroma mode on an 8x8 inter-frame leaf"` is NOT what odd-height frames
10+ stop at once lane-golomb's edge-partition fix is present. Cherry-picking
11+ `eacd7fd` (clean, no conflicts) moves 192x136 to the same refusal its
12+ *even-height control* 192x128 hits, i.e. that one is width/content-related, not
13+ odd-height (see 4).
14+
15+2. **Minimal repro is 64x72, not 192x136.** With the standard inter-gate recipe
16+ (`--enable-rect-partitions=0 --min/max-partition-size=8/16`, mandelbrot, cq 40):
17+ - `64x64` decodes 4/4 frames pixel-exact (control),
18+ - `64x72` (bottom band 8 px) stopped at the key-frame 16-level edge refusal,
19+ - `72x64` (right band 8 px) stops in the inter tile path.
20+
21+3. **The real blocker underneath is a first-symbol desync of the KEY tile at
22+ height 72.** Not an edge-band defect at all: the *first* partition symbol of the
23+ frame diverges.
24+ `EVIDENCE: /tmp/.../scratchpad/k-64x72.obu (667 B, key frame only, aomenc cq40) | EC_AV1_TRACE=1 decode_probe vs EC_TRACE=1 aomdec | first element mi=(0,0) bsize=BLOCK_64X64 ctx=0: aomdec value=3 (PARTITION_SPLIT, tell=1 rng=32768), ours value=9`
25+ `EVIDENCE: /tmp/.../scratchpad/k-64x72.{ours,aom,ref}.y | aomdec --rawvideo + ffmpeg rawvideo vs our Y dump | aomdec == ffmpeg byte-for-byte; ours differs in 4583 of 4608 Y samples (whole frame), while the 64x64 control differs in 0`
26+ Our tile payload starts at file offset 20 in both the 64x64 and the 64x72 stream
27+ (`key_tile_bytes len=543`/`647`, file sizes 563/667), and `base_q_idx=160`,
28+ `mi_cols=16`, `mi_rows=18` all parse correctly, so the header field values are
29+ right; the divergence is in the very first symbol read off those bytes.
30+ **Not diagnosed further — this is the handoff item.** Ruled out by reading the
31+ source: `sb_rows`/`sb_cols` (`sequence.rs:409-422`, 18 -> 2 correct) and the
32+ uniform-spacing tile-info loops (`frame.rs:1296-1334`, both increment loops match
33+ spec 5.9.15, so the extra `increment_tile_rows_log2` bit that height 72 introduces
34+ IS consumed).
35+
36+4. Pre-existing, unrelated to odd height: `192x128` and `192x136` both stop at
37+ `"a 1:4 partition below 16x16"` with `--enable-1to4-partitions=0` on the command
38+ line — a same-shaped refusal-from-own-desync at width 192, present on the control.
39+
40+## Code changed (all in this worktree, unproven end to end)
41+
42+- cherry-pick `eacd7fd` (lane-golomb) — the frame-edge partition bit at 6 sites in
43+ both tile paths, plus its film key-frame fixture/gate. Clean merge.
44+- `crates/ec-av1/src/decode.rs:11371` — the key-frame 16-level frame-edge
45+ `PARTITION_HORZ`/`VERT` now decodes its single visible 16x8 / 8x16 strip through
46+ `decode_leaf_rect` instead of refusing (removes that refusal string; entry dropped
47+ from `refusal_inventory.rs`).
48+- `crates/ec-av1/src/decode.rs` (inter tile path, superblock level and 16-level) —
49+ the same edge half-strip as one 64x32 / 32x64 resp. 16x8 / 8x16 inter block
50+ (`write_w`/`write_h`, square CDF/size-class corner-cut, exactly the accepted
51+ corner-cut of the 32-level rect arm at `decode.rs:18448`). Interior rect
52+ partitions still refuse by name.
53+- `decode.rs` — new counter `edge_rect_strip_hits()` (blocks decoded inside the 8px
54+ edge band), for the gate a successor must write.
55+
56+`corner-cut:` the two inter edge arms read square CDFs / size classes for a
57+rectangular block (ceiling: coefficient and mode syntax for TX_64X32/TX_16X8 inter is
58+not modelled; upgrade path = the same treatment the 32-level rect arm eventually gets).
59+
60+## Verification status — honest
61+
62+- NO gate was added and NO refusal claim is proven: every stream that reaches the new
63+ arms is desynced before them (finding 3), so a pixel compare would measure the
64+ desync, not the arm. Writing
65+ `a_real_aomenc_inter_sequence_with_an_8px_tall_edge_row_decodes_pixel_exact` on top
66+ of a first-symbol desync would have produced a vacuous or a permanently-red gate.
67+- Suite: see `$HOME/.cache/oddh-suite.log` (run as a systemd unit, result quoted in
68+ the handoff message).
69+
70+## Disposition
71+
72+- fix-now (next round, r2): the 64x72 key-tile first-symbol desync. It is the root
73+ blocker; the edge arms above are dead code until it is fixed.
74+- deferred(the desync above): the 8px-edge-band gate + the refusal lift claim.
75+- deferred(width-192 defect, separate lane): the `"1:4 partition below 16x16"` stop
76+ that both 192x128 and 192x136 share.
lanes/oddh-r2.report.mdadded+97 -0
@@ -0,0 +1,97 @@
1+# lane-oddh r2 — the 64x72 first-symbol desync is 128x128 superblocks
2+
3+## Root cause (byte-level proof, not inference)
4+
5+r1's pinned defect — a 64x72 aomenc KEY frame desyncing at the FIRST symbol
6+(aomdec value=3, ours 9) — is **not** an odd-height defect and **not** a header
7+parse defect. The stream's sequence header codes `use_128x128_superblock = 1`,
8+and this decoder is 64x64-superblock only (`SB_MI = 16`, no BLOCK_128X128
9+partition read anywhere; `decode.rs` never reads `use_128x128_superblock`).
10+
11+libaom picks it: `av1_select_sb_size` (encoder_utils.c:1000-1003) returns
12+BLOCK_64X64 only when `speed >= 1 && min(w,h) <= 480`. r1's fixture was
13+encoded at `--cpu-used=0`, so speed 0 fell through to BLOCK_128X128.
14+
15+What the two decoders do with the same first byte:
16+
17+| | libaom (aomdec) | ours |
18+|---|---|---|
19+| first block | BLOCK_128X128 at mi (0,0): `has_cols = 0+16 < 16` false, `has_rows = 16 < 18` true | BLOCK_64X64 at mi (0,0) |
20+| symbol read | gathered 2-symbol partition (`partition_gather_horz_alike`) | 10-symbol `partition_cdf[12]` |
21+| value | 3 = PARTITION_SPLIT | 9 = PARTITION_VERT_4 |
22+
23+Ruled out first, by hand, field by field against spec 5.9.2 for this stream:
24+the uncompressed header is **49 bits** (3 before tile_info, 1 tile_info, 12
25+quant, 1 seg, 1 delta, 29 loop filter — levels 36/38/21/19, sharpness 0,
26+mode_ref_delta_enabled 1, update 0 — 0 cdef, 0 lr, tx_mode 1, reduced_tx_set 1),
27+byte-aligning tile data to file offset 20. Our parser reads exactly the same 49
28+bits. Two independent msac implementations (ours and a from-spec python one)
29+read symbol 9 from offset 20 with `partition_cdf[12]`, so the bytes and the
30+table are both ours-correct — only the *block size* is wrong.
31+
32+EVIDENCE: hand-parsed header bits + msac offset probe (both diagnostics reverted after use) | parsed k-64x72.obu, printed per-section bit positions (3/4/16/17/18/47/47/47/49), then decoded the first partition symbol at file offsets 16..24 with `PARTITION_W64[0]` in ours and in a from-spec python msac | both give 9 at offset 20 (aomdec: 3), i.e. same bytes, same table, different alphabet
33+
34+## What changed
35+
36+- `crates/ec-av1/src/stream.rs:509` — `decode_stream` now REFUSES a sequence
37+ with `use_128x128_superblock` **on a frame larger than 64x64** by name
38+ instead of silently decoding it as 64x64 superblocks (wrong pixels, whole
39+ frame). The scoping is measured, not reasoned: a blanket refusal red-lined
40+ 29 previously pixel-exact gates (29 failed / 318 passed), because at
41+ <= 64x64 a 128x128 superblock decodes identically -- mi (0,0) has neither
42+ `has_rows` nor `has_cols`, so BLOCK_128X128 is a forced SPLIT that reads no
43+ symbol and only one 64x64 child is in frame. Every sibling inter gate at
44+ 64x64 `--cpu-used=0` is exactly that case.
45+- `crates/ec-av1/src/stream.rs` — new gate
46+ `a_real_aomenc_128x128_superblock_stream_is_refused_by_name`: real aomenc,
47+ 64x72, `--cpu-used=0 --sb-size=128`; asserts the stream's sequence header
48+ really codes `use_128x128_superblock` (knob-reached-the-tool) and then that
49+ the refusal fires.
50+- `crates/ec-av1/src/stream.rs` — `a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact`
51+ extended with the odd ladder 64x72, 72x64, 64x136, 136x64, 192x136; floor
52+ raised 70 -> 120 pixel-exact attempts.
53+- `crates/ec-av1/src/refusal_inventory.rs` — the new refusal string pinned.
54+- `crates/ec-av1/src/stream.rs` — `a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact`
55+ written and left `#[ignore]`d with its measured reason (below).
56+
57+## The size ladder (the table the charter asked for)
58+
59+`cargo test -p ec-av1 --lib -- a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact`,
60+10 seeds each, real aomenc at `--cpu-used=4` (= 64x64 superblocks), 8-bit:
61+
62+| size | pixel-exact | refused |
63+|---|---|---|
64+| 8x8 | 0/10 | 10 (16x16 rect transform, pre-existing) |
65+| 16x16, 32x32, 16x32, 32x16, 64x64, 48x48, 24x24 | 10/10 each | 0 |
66+| **64x72, 72x64, 64x136, 136x64, 192x136** | **10/10 each** | 0 |
67+
68+EVIDENCE: $HOME/.cache/oddh-suite-r2.log + the run above | 13 sizes x 10 seeds, aomenc -> our decoder -> ffmpeg sample compare | 120 pixel-exact attempts, 0 mismatches, "tiny frame sweep: 120 pixel-exact attempts"
69+
70+So odd height/width at 64x64 superblocks is **clean**, including r1's
71+frame-edge half-strip code on the KEY path.
72+
73+## Open / deferred
74+
75+- deferred: 128x128 superblock decode — refused by name, not implemented — the
76+ partition tree, `SB_MI`, CDEF/LR/deblock grids and the loop-filter unit size
77+ are all 64-only; that is a lane, not a fix. Unblocked by: a lane that makes
78+ `SB_MI` a parameter and adds the BLOCK_128X128 partition read.
79+- deferred: the INTER frame-edge half-strip arms r1 added are still UNGATED.
80+ Measured this round at 192x160 (last superblock row 32 tall, so the forced
81+ gathered edge symbol is a 64x32): with `--enable-rect-partitions=0` both bit
82+ depths decode 6 frames **pixel-exact** but `edge_rect_strip_hits = 0` (the
83+ encoder answers the forced symbol SPLIT every time); with rect ON the run
84+ stops at other lanes' gaps — cq 40 "a non-skip rectangular (HORZ/VERT/HORZ_B)
85+ strip needs rectangular residual coding", cq 62 "an INTER 32x32 partition
86+ type this decoder does not code (value=8/9)", min-partition 16 "a HORZ/VERT
87+ intra strip below 16x16 with a split transform". Unblocked by: the rect
88+ inter-residual lane.
89+
90+## Suite
91+
92+`cargo test -p ec-av1 --lib` (systemd unit, log `$HOME/.cache/oddh-suite-r2.log`):
93+the blanket-refusal run was 318 passed / 29 failed / 32 ignored, every failure
94+the new refusal firing on a 64x64 `--cpu-used=0` stream. After scoping the
95+refusal to frames larger than 64x64, the 7-gate subset covering all of them
96+plus the three new/extended gates is green (7 passed, 0 failed); the full-suite
97+rerun on the scoped tree is launched to the same log and is r3's first read.