forge
Explore
Log in

Don't you dare go Hollow

Rectangular var-tx leaves -- the SPLIT transform of a 1:4 inter strip with a 64-px axis

Browse files at this commit

00d3d4e99403f67ede53c14a09bcb63e395d815dAhmet Kaan GümüşParent: a531b22
  • feat
    • rectangular var-tx leaves -- the SPLIT transform of a 1:4 inter strip with a 64-px axis
Show full message
feat(av1): rectangular var-tx leaves -- the SPLIT transform of a 1:4 inter strip with a 64-px axis

libaom `sub_tx_size_map` (common_data.c) keeps a 1:4 strip's sub-transform
RECTANGULAR: [TX_64X16] == TX_32X16, [TX_16X64] == TX_16X32. r2 refused that
case by name because `read_var_tx_size` was square-only and its leaves were
`(row, col, tx_px)` triples.

This round transcribes the whole table (with a 19-entry unit test against
libaom's own order), generalises `read_var_tx_size` to `(tx_w, tx_h)` exactly
as `read_tx_size_vartx` recurses -- rect ctx, `sub_tx_size_map` step, the
TX_4X4 early return over `tx_h/4 x tx_w/4` cells -- and widens the leaf tuple
to `(row, col, tw, th)`. Both inter var-tx leaf loops now read a rectangular
leaf through `read_inter_plane_rect` with `LumaRect32x16Inter` (the 2-symbol
EXT_TX_SET_DCT_IDTX inter row at `tx_size_sqr_up == TX_32X32`), its own
`get_txb_ctx_general` neighbour context (a leaf is smaller than its block, so
`txb_skip_ctx` is not the lone-TU 0), and rect neighbour/deblock spans.

Measured on a 2160p 10-bit AV1 mkv: a 2 s mid-film segment decodes 14
rectangular 16x32 var-tx leaves and 16 16x64 strips, and both mid-film
segments move off this wall onto lane-intrarect's. The chartered pixel-exact
aomenc gate cannot yet hard-assert the arm: 60+ real aomenc runs show every
stream that contains a superblock-level 1:4 partition also contains another
lane's live refusal, which stops the decode first (measured reason written at
the parked assert). The new gate still sweeps the recipe at both bit depths and
hard-asserts that nothing mis-decodes silently.
crates/ec-av1/examples/decode_probe.rsmodified+2 -0
@@ -33,6 +33,8 @@ fn main() {
3333 println!("rect4_32: horz={h} vert={v} coded={c}");
3434 let (rtu, rsplit, robmc) = ec_av1::stream::rect_inter_tu_counters();
3535 println!("rect_inter: tu={rtu} txsplit={rsplit} obmc_leaf={robmc}");
36+ let leaf = ec_av1::stream::vartx_rect_leaf_hits();
37+ println!("vartx_rect_leaf: 32x16={} 16x32={}", leaf[0], leaf[1]);
3638 let ir = ec_av1::stream::inter_rect_counters();
3739 println!(
3840 "inter_rect: 32x8={} 8x32={} 64x32={} 32x64={} 64x16={} 16x64={}",
crates/ec-av1/src/decode.rsmodified+226 -98
@@ -920,6 +920,8 @@ thread_local! {
920920 // (64x32/32x64/64x16/16x64), whose coefficients are coded as the
921921 // truncated low-32 corner.
922922 static RECT64_INTER_TU_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
923+ // lane-r14 r3: rectangular var-tx LEAVES, [32x16, 16x32].
924+ static VARTX_RECT_LEAF_HITS: std::cell::Cell<[usize; 2]> = const { std::cell::Cell::new([0; 2]) };
923925 // lane-inter4 r3: 16x16-level PARTITION_HORZ / PARTITION_VERT on an inter
924926 // frame -- 16x8 and 8x16 inter leaves.
925927 static INTER_LEAF16_HORZ_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
@@ -972,6 +974,21 @@ pub(crate) fn rect64_inter_tu_hits() -> usize {
972974 RECT64_INTER_TU_HITS.with(|c| c.get())
973975 }
974976
977+/// Current value of [`VARTX_RECT_LEAF_HITS`] (lane-r14 r3): how many
978+/// rectangular var-tx leaf transform units were coded, `[32x16, 16x32]`.
979+pub(crate) fn vartx_rect_leaf_hits() -> [usize; 2] {
980+ VARTX_RECT_LEAF_HITS.with(|c| c.get())
981+}
982+
983+/// Records one rectangular var-tx leaf.
984+fn vartx_rect_leaf_hit(tw: usize, th: usize) {
985+ VARTX_RECT_LEAF_HITS.with(|c| {
986+ let mut h = c.get();
987+ h[usize::from(th > tw)] += 1;
988+ c.set(h);
989+ });
990+}
991+
975992 /// Sets the current thread's [`TX_SELECT_INTER`]/[`REDUCED_TX_SET_INTER`]/
976993 /// [`ENABLE_FILTER_INTRA_INTER`].
977994 pub(crate) fn set_inter_tx_mode(
@@ -10723,6 +10740,46 @@ const TXFM_CTX_INIT: u8 = 64;
1072310740 /// twice below its own largest transform.
1072410741 const MAX_VARTX_DEPTH: usize = 2;
1072510742
10743+/// libaom `sub_tx_size_map[TX_SIZES_ALL]` (`common_data.c`): the transform
10744+/// one `txfm_split` step below `tx_size`. RECTANGULAR for the 1:4 shapes
10745+/// (`[TX_64X16] == TX_32X16`, `[TX_16X64] == TX_16X32`) and for the 4:1
10746+/// small ones, square everywhere else.
10747+fn sub_tx_size_map(tx_w: usize, tx_h: usize) -> (usize, usize) {
10748+ match (tx_w, tx_h) {
10749+ (4, 4) => (4, 4),
10750+ (8, 8) => (4, 4),
10751+ (16, 16) => (8, 8),
10752+ (32, 32) => (16, 16),
10753+ (64, 64) => (32, 32),
10754+ (4, 8) | (8, 4) => (4, 4),
10755+ (8, 16) | (16, 8) => (8, 8),
10756+ (16, 32) | (32, 16) => (16, 16),
10757+ (32, 64) | (64, 32) => (32, 32),
10758+ (4, 16) => (4, 8),
10759+ (16, 4) => (8, 4),
10760+ (8, 32) => (8, 16),
10761+ (32, 8) => (16, 8),
10762+ (16, 64) => (16, 32),
10763+ (64, 16) => (32, 16),
10764+ _ => unreachable!("not a TX_SIZES_ALL shape: {tx_w}x{tx_h}"),
10765+ }
10766+}
10767+
10768+#[test]
10769+fn sub_tx_size_map_matches_libaom() {
10770+ // libaom `common_data.c` `sub_tx_size_map`, in TX_SIZES_ALL order.
10771+ const TABLE: [((usize, usize), (usize, usize)); 19] = [
10772+ ((4, 4), (4, 4)), ((8, 8), (4, 4)), ((16, 16), (8, 8)), ((32, 32), (16, 16)),
10773+ ((64, 64), (32, 32)), ((4, 8), (4, 4)), ((8, 4), (4, 4)), ((8, 16), (8, 8)),
10774+ ((16, 8), (8, 8)), ((16, 32), (16, 16)), ((32, 16), (16, 16)), ((32, 64), (32, 32)),
10775+ ((64, 32), (32, 32)), ((4, 16), (4, 8)), ((16, 4), (8, 4)), ((8, 32), (8, 16)),
10776+ ((32, 8), (16, 8)), ((16, 64), (16, 32)), ((64, 16), (32, 16)),
10777+ ];
10778+ for (tx, want) in TABLE {
10779+ assert_eq!(sub_tx_size_map(tx.0, tx.1), want, "sub_tx_size_map({tx:?})");
10780+ }
10781+}
10782+
1072610783 /// `read_var_tx_size` (spec 5.11.17, libaom `decodeframe.c`
1072710784 /// `read_tx_size_vartx`): the recursive `txfm_split` tree of one
1072810785 /// max-transform-sized unit of an inter block, collecting the resolved leaf
@@ -10739,22 +10796,28 @@ fn read_var_tx_size(
1073910796 at_mi: (usize, usize),
1074010797 blk_max_px: usize,
1074110798 (max_w_mi, max_h_mi): (usize, usize),
10742- tx_px: usize,
10799+ (tx_w, tx_h): (usize, usize),
1074310800 depth: usize,
1074410801 blk_row: usize,
1074510802 blk_col: usize,
10746- out: &mut Vec<(usize, usize, usize)>,
10803+ out: &mut Vec<(usize, usize, usize, usize)>,
1074710804 ) {
1074810805 if blk_row >= max_h_mi || blk_col >= max_w_mi {
1074910806 return;
1075010807 }
1075110808 let unit = (at_mi.0 + blk_row, at_mi.1 + blk_col);
1075210809 if depth == MAX_VARTX_DEPTH {
10753- out.push((blk_row, blk_col, tx_px));
10754- txfm_partition_update(n, unit, tx_px, tx_px);
10810+ out.push((blk_row, blk_col, tx_w, tx_h));
10811+ txfm_partition_update_rect(n, unit, (tx_w, tx_h), (tx_w, tx_h));
1075510812 return;
1075610813 }
10757- let ctx = txfm_partition_ctx(n.above_txfm[unit.1], n.left_txfm[unit.0], blk_max_px, tx_px);
10814+ let ctx = txfm_partition_ctx_rect(
10815+ n.above_txfm[unit.1],
10816+ n.left_txfm[unit.0],
10817+ blk_max_px,
10818+ tx_w,
10819+ tx_h,
10820+ );
1075810821 let split = dec.symbol(&mut cdfs.txfm_partition[ctx]) == 1;
1075910822 TXFM_SPLIT_READS.with(|c| c.set(c.get() + 1));
1076010823 if std::env::var_os("EC_TRACE_MODE_STEP").is_some() {
@@ -10767,27 +10830,27 @@ fn read_var_tx_size(
1076710830 );
1076810831 }
1076910832 if !split {
10770- out.push((blk_row, blk_col, tx_px));
10771- txfm_partition_update(n, unit, tx_px, tx_px);
10833+ out.push((blk_row, blk_col, tx_w, tx_h));
10834+ txfm_partition_update_rect(n, unit, (tx_w, tx_h), (tx_w, tx_h));
1077210835 return;
1077310836 }
1077410837 TXFM_SPLIT_HITS.with(|c| c.set(c.get() + 1));
10775- let sub = tx_px / 2;
10776- if sub == 4 {
10777- // libaom's `sub_txs == TX_4X4` early return: the whole 8x8 unit is
10778- // marked 4x4 (four transform units, raster order) without recursing.
10779- for row in 0..2 {
10780- for col in 0..2 {
10838+ let (sub_w, sub_h) = sub_tx_size_map(tx_w, tx_h);
10839+ if (sub_w, sub_h) == (4, 4) {
10840+ // libaom's `sub_txs == TX_4X4` early return: every mi cell of the
10841+ // unit is marked 4x4 (raster order) without recursing.
10842+ for row in 0..tx_h / MI {
10843+ for col in 0..tx_w / MI {
1078110844 if blk_row + row < max_h_mi && blk_col + col < max_w_mi {
10782- out.push((blk_row + row, blk_col + col, 4));
10845+ out.push((blk_row + row, blk_col + col, 4, 4));
1078310846 }
1078410847 }
1078510848 }
10786- txfm_partition_update(n, unit, 4, tx_px);
10849+ txfm_partition_update_rect(n, unit, (4, 4), (tx_w, tx_h));
1078710850 return;
1078810851 }
10789- for row in (0..tx_px / MI).step_by(sub / MI) {
10790- for col in (0..tx_px / MI).step_by(sub / MI) {
10852+ for row in (0..tx_h / MI).step_by(sub_h / MI) {
10853+ for col in (0..tx_w / MI).step_by(sub_w / MI) {
1079110854 read_var_tx_size(
1079210855 dec,
1079310856 cdfs,
@@ -10795,7 +10858,7 @@ fn read_var_tx_size(
1079510858 at_mi,
1079610859 blk_max_px,
1079710860 (max_w_mi, max_h_mi),
10798- sub,
10861+ (sub_w, sub_h),
1079910862 depth + 1,
1080010863 blk_row + row,
1080110864 blk_col + col,
@@ -10823,7 +10886,7 @@ fn read_block_tx_size(
1082310886 (mi_cols, mi_rows): (usize, usize),
1082410887 is_inter: bool,
1082510888 skip: bool,
10826-) -> Result<(usize, Option<Vec<(usize, usize, usize)>>)> {
10889+) -> Result<(usize, Option<Vec<(usize, usize, usize, usize)>>)> {
1082710890 if !TX_SELECT_INTER.with(std::cell::Cell::get) {
1082810891 return Ok((side, None));
1082910892 }
@@ -10843,7 +10906,7 @@ fn read_block_tx_size(
1084310906 at_mi,
1084410907 side,
1084510908 (max_w_mi, max_h_mi),
10846- max_tx,
10909+ (max_tx, max_tx),
1084710910 0,
1084810911 row,
1084910912 col,
@@ -10851,8 +10914,8 @@ fn read_block_tx_size(
1085110914 );
1085210915 }
1085310916 }
10854- let single = leaves.len() == 1 && leaves[0].2 == side;
10855- if !single && leaves.iter().any(|leaf| leaf.2 > 32) {
10917+ let single = leaves.len() == 1 && leaves[0].2 == side && leaves[0].3 == side;
10918+ if !single && leaves.iter().any(|leaf| leaf.2.max(leaf.3) > 32) {
1085610919 // Only a block wider than a superblock's own 64x64 max transform
1085710920 // reaches here; this crate has no 64-point *inter* coefficient
1085810921 // table set ([`inter_txbset_for`] stops at 32).
@@ -10890,7 +10953,7 @@ fn read_block_tx_size(
1089010953 let mut leaves = Vec::new();
1089110954 for row in (0..side_mi).step_by(step) {
1089210955 for col in (0..side_mi).step_by(step) {
10893- leaves.push((row, col, tx));
10956+ leaves.push((row, col, tx, tx));
1089410957 }
1089510958 }
1089610959 INTRA_IN_INTER_SPLIT_TX_HITS.with(|c| {
@@ -11042,7 +11105,7 @@ fn read_block_tx_size_rect(
1104211105 (bw, bh): (usize, usize),
1104311106 (mi_cols, mi_rows): (usize, usize),
1104411107 skip: bool,
11045-) -> Result<Option<Vec<(usize, usize, usize)>>> {
11108+) -> Result<Option<Vec<(usize, usize, usize, usize)>>> {
1104611109 if skip {
1104711110 // `set_txfm_ctxs(.., skip && is_inter)`: a skipped inter block records
1104811111 // its own BLOCK size -- width above, height left -- not a transform.
@@ -11085,22 +11148,16 @@ fn read_block_tx_size_rect(
1108511148 }
1108611149 TXFM_SPLIT_HITS.with(|c| c.set(c.get() + 1));
1108711150 RECT_INTER_TXSPLIT_HITS.with(|c| c.set(c.get() + 1));
11088- // lane-r14 r2: `sub_tx_size_map` is square for every shape this decoder
11089- // splits (TX_32X16 -> TX_16X16, TX_64X32 -> TX_32X32) EXCEPT the 1:4
11090- // strips with a 64-px axis, where it stays rectangular
11091- // (TX_64X16 -> TX_32X16, TX_16X64 -> TX_16X32) and the square recursion
11092- // below would code the wrong tree.
11093- if tx_w.max(tx_h) == 64 && tx_w.min(tx_h) == 16 {
11094- return Err(unsupported(
11095- "a split transform on a 1:4 inter strip with a 64-px axis",
11096- ));
11097- }
11098- let sub = tx_w.min(tx_h);
11151+ // lane-r14 r3: `sub_tx_size_map` (libaom `common_data.c`) stays
11152+ // RECTANGULAR under a 1:4 strip -- `[TX_64X16] == TX_32X16`,
11153+ // `[TX_16X64] == TX_16X32` -- so the recursion below is the general
11154+ // rect one and its leaves carry their own width and height.
11155+ let (sub_w, sub_h) = sub_tx_size_map(tx_w, tx_h);
1109911156 let max_w_mi = (bw / MI).min(mi_cols.saturating_sub(at_mi.1));
1110011157 let max_h_mi = (bh / MI).min(mi_rows.saturating_sub(at_mi.0));
1110111158 let mut leaves = Vec::new();
11102- for row in (0..bh / MI).step_by(sub / MI) {
11103- for col in (0..bw / MI).step_by(sub / MI) {
11159+ for row in (0..bh / MI).step_by(sub_h / MI) {
11160+ for col in (0..bw / MI).step_by(sub_w / MI) {
1110411161 read_var_tx_size(
1110511162 dec,
1110611163 cdfs,
@@ -11108,7 +11165,7 @@ fn read_block_tx_size_rect(
1110811165 at_mi,
1110911166 bw.max(bh),
1111011167 (max_w_mi, max_h_mi),
11111- sub,
11168+ (sub_w, sub_h),
1111211169 1,
1111311170 row,
1111411171 col,
@@ -11145,9 +11202,12 @@ fn read_inter_plane_rect(
1114511202 y: usize,
1114611203 prediction: &[u16],
1114711204 inherited_luma_tx_type: Option<TxType>,
11205+ luma_skip_ctx: Option<usize>,
1114811206 ) -> Result<(Vec<i32>, TxType)> {
1114911207 let skip_ctx = if plane_idx == 0 {
11150- 0
11208+ // `get_txb_ctx_general`: 0 only when this unit IS the whole plane
11209+ // block; a var-tx leaf passes its own neighbour-table context.
11210+ luma_skip_ctx.unwrap_or(0)
1115111211 } else {
1115211212 usize::from(around.0) + usize::from(around.1)
1115311213 };
@@ -15510,7 +15570,7 @@ fn decode_inter_block(
1551015570 // 5.11.17), `Some` only when this block's var-tx tree resolved to more
1551115571 // than one luma transform -- read back by the residual loop, the
1551215572 // coefficient-context write-back and the loop-filter grid fill below.
15513- let mut vartx_leaves: Option<Vec<(usize, usize, usize)>> = None;
15573+ let mut vartx_leaves: Option<Vec<(usize, usize, usize, usize)>> = None;
1551415574 let at_mi = at;
1551515575 if is_inter {
1551615576 let above_nbr = has_above.then(|| NeighbourRef {
@@ -16349,37 +16409,68 @@ fn decode_inter_block(
1634916409 // own slice of the block's motion-compensated predictor.
1635016410 let reduced = REDUCED_TX_SET_INTER.with(std::cell::Cell::get);
1635116411 let mut first_tx_type = TxType::DctDct;
16352- for (idx, &(row, col, tx_px)) in leaves.iter().enumerate() {
16412+ for (idx, &(row, col, tw, th)) in leaves.iter().enumerate() {
1635316413 let tu_mi = (at_mi.0 + row, at_mi.1 + col);
1635416414 let (tu_px, tu_py) = (px + col * MI, py + row * MI);
16355- let mut tu_pred = Vec::with_capacity(tx_px * tx_px);
16356- for rr in 0..tx_px {
16357- let start = (row * MI + rr) * side + col * MI;
16358- tu_pred.extend_from_slice(&pred_y[start..start + tx_px]);
16359- }
16360- let scan = default_scan(tx_px);
16361- let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx_px / MI);
16362- let (tu_grid, tu_tx_type) = read_inter_plane(
16363- dec,
16364- cdfs,
16365- inter_txbset_for(tx_px, reduced),
16366- &scan,
16367- 0,
16368- neighbours.around_mi(tu_mi, tx_px)[0],
16369- mode_for_tx,
16370- y,
16371- tu_px,
16372- tu_py,
16373- tx_px,
16374- base_q_idx,
16375- &tu_pred,
16376- None,
16377- Some(tu_skip_ctx),
16378- )?;
16415+ let (tu_grid, tu_tx_type) = if tw == th {
16416+ let tx_px = tw;
16417+ let mut tu_pred = Vec::with_capacity(tx_px * tx_px);
16418+ for rr in 0..tx_px {
16419+ let start = (row * MI + rr) * side + col * MI;
16420+ tu_pred.extend_from_slice(&pred_y[start..start + tx_px]);
16421+ }
16422+ let scan = default_scan(tx_px);
16423+ let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx_px / MI);
16424+ read_inter_plane(
16425+ dec,
16426+ cdfs,
16427+ inter_txbset_for(tx_px, reduced),
16428+ &scan,
16429+ 0,
16430+ neighbours.around_mi(tu_mi, tx_px)[0],
16431+ mode_for_tx,
16432+ y,
16433+ tu_px,
16434+ tu_py,
16435+ tx_px,
16436+ base_q_idx,
16437+ &tu_pred,
16438+ None,
16439+ Some(tu_skip_ctx),
16440+ )?
16441+ } else {
16442+ // lane-r14 r3: a 1:4 strip's `sub_tx_size_map`
16443+ // sub-transform is RECTANGULAR (TX_64X16 ->
16444+ // TX_32X16, TX_16X64 -> TX_16X32), so this leaf is
16445+ // read with the rect coefficient machinery, at its
16446+ // own `txb_skip_ctx`/neighbour spans -- the unit is
16447+ // smaller than its block, so `get_txb_ctx_general`'s
16448+ // neighbour table applies, not the lone-TU 0.
16449+ vartx_rect_leaf_hit(tw, th);
16450+ let tu_skip_ctx =
16451+ neighbours.luma_skip_ctx_rect(tu_mi, tw / MI, th / MI);
16452+ let start = row * MI * side + col * MI;
16453+ read_inter_plane_rect(
16454+ dec,
16455+ cdfs,
16456+ rect_inter_luma_set(tw, th),
16457+ (tw, th),
16458+ side,
16459+ 0,
16460+ neighbours.around_mi_rect(tu_mi, tw, th)[0],
16461+ mode_for_tx,
16462+ y,
16463+ tu_px,
16464+ tu_py,
16465+ &pred_y[start..],
16466+ None,
16467+ Some(tu_skip_ctx),
16468+ )?
16469+ };
1637916470 if idx == 0 {
1638016471 first_tx_type = tu_tx_type;
1638116472 }
16382- neighbours.record_mi_luma(tu_mi, tx_px, &tu_grid);
16473+ neighbours.record_mi_luma_rect(tu_mi, tw, th, &tu_grid);
1638316474 }
1638416475 // `av1_get_tx_type`'s chroma lookup scales the chroma
1638516476 // position back to luma, so an inter block's chroma
@@ -16403,6 +16494,7 @@ fn decode_inter_block(
1640316494 py,
1640416495 &pred_y,
1640516496 None,
16497+ None,
1640616498 )?;
1640716499 luma_tx_type = tx_type;
1640816500 luma_grid = embed_rect_grid(&grid, write_w, write_h, side);
@@ -16446,6 +16538,7 @@ fn decode_inter_block(
1644616538 cpy,
1644716539 &pred_u,
1644816540 Some(luma_tx_type),
16541+ None,
1644916542 )?
1645016543 .0,
1645116544 uw,
@@ -16467,6 +16560,7 @@ fn decode_inter_block(
1646716560 cpy,
1646816561 &pred_v,
1646916562 Some(luma_tx_type),
16563+ None,
1647016564 )?
1647116565 .0,
1647216566 uw,
@@ -17327,37 +17421,68 @@ fn decode_inter_block(
1732717421 // own slice of the block's motion-compensated predictor.
1732817422 let reduced = REDUCED_TX_SET_INTER.with(std::cell::Cell::get);
1732917423 let mut first_tx_type = TxType::DctDct;
17330- for (idx, &(row, col, tx_px)) in leaves.iter().enumerate() {
17424+ for (idx, &(row, col, tw, th)) in leaves.iter().enumerate() {
1733117425 let tu_mi = (at_mi.0 + row, at_mi.1 + col);
1733217426 let (tu_px, tu_py) = (px + col * MI, py + row * MI);
17333- let mut tu_pred = Vec::with_capacity(tx_px * tx_px);
17334- for rr in 0..tx_px {
17335- let start = (row * MI + rr) * side + col * MI;
17336- tu_pred.extend_from_slice(&pred_y[start..start + tx_px]);
17337- }
17338- let scan = default_scan(tx_px);
17339- let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx_px / MI);
17340- let (tu_grid, tu_tx_type) = read_inter_plane(
17341- dec,
17342- cdfs,
17343- inter_txbset_for(tx_px, reduced),
17344- &scan,
17345- 0,
17346- neighbours.around_mi(tu_mi, tx_px)[0],
17347- mode_for_tx,
17348- y,
17349- tu_px,
17350- tu_py,
17351- tx_px,
17352- base_q_idx,
17353- &tu_pred,
17354- None,
17355- Some(tu_skip_ctx),
17356- )?;
17427+ let (tu_grid, tu_tx_type) = if tw == th {
17428+ let tx_px = tw;
17429+ let mut tu_pred = Vec::with_capacity(tx_px * tx_px);
17430+ for rr in 0..tx_px {
17431+ let start = (row * MI + rr) * side + col * MI;
17432+ tu_pred.extend_from_slice(&pred_y[start..start + tx_px]);
17433+ }
17434+ let scan = default_scan(tx_px);
17435+ let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx_px / MI);
17436+ read_inter_plane(
17437+ dec,
17438+ cdfs,
17439+ inter_txbset_for(tx_px, reduced),
17440+ &scan,
17441+ 0,
17442+ neighbours.around_mi(tu_mi, tx_px)[0],
17443+ mode_for_tx,
17444+ y,
17445+ tu_px,
17446+ tu_py,
17447+ tx_px,
17448+ base_q_idx,
17449+ &tu_pred,
17450+ None,
17451+ Some(tu_skip_ctx),
17452+ )?
17453+ } else {
17454+ // lane-r14 r3: a 1:4 strip's `sub_tx_size_map`
17455+ // sub-transform is RECTANGULAR (TX_64X16 ->
17456+ // TX_32X16, TX_16X64 -> TX_16X32), so this leaf is
17457+ // read with the rect coefficient machinery, at its
17458+ // own `txb_skip_ctx`/neighbour spans -- the unit is
17459+ // smaller than its block, so `get_txb_ctx_general`'s
17460+ // neighbour table applies, not the lone-TU 0.
17461+ vartx_rect_leaf_hit(tw, th);
17462+ let tu_skip_ctx =
17463+ neighbours.luma_skip_ctx_rect(tu_mi, tw / MI, th / MI);
17464+ let start = row * MI * side + col * MI;
17465+ read_inter_plane_rect(
17466+ dec,
17467+ cdfs,
17468+ rect_inter_luma_set(tw, th),
17469+ (tw, th),
17470+ side,
17471+ 0,
17472+ neighbours.around_mi_rect(tu_mi, tw, th)[0],
17473+ mode_for_tx,
17474+ y,
17475+ tu_px,
17476+ tu_py,
17477+ &pred_y[start..],
17478+ None,
17479+ Some(tu_skip_ctx),
17480+ )?
17481+ };
1735717482 if idx == 0 {
1735817483 first_tx_type = tu_tx_type;
1735917484 }
17360- neighbours.record_mi_luma(tu_mi, tx_px, &tu_grid);
17485+ neighbours.record_mi_luma_rect(tu_mi, tw, th, &tu_grid);
1736117486 }
1736217487 // `av1_get_tx_type`'s chroma lookup scales the chroma
1736317488 // position back to luma, so an inter block's chroma
@@ -17381,6 +17506,7 @@ fn decode_inter_block(
1738117506 py,
1738217507 &pred_y,
1738317508 None,
17509+ None,
1738417510 )?;
1738517511 luma_tx_type = tx_type;
1738617512 luma_grid = embed_rect_grid(&grid, write_w, write_h, side);
@@ -17424,6 +17550,7 @@ fn decode_inter_block(
1742417550 cpy,
1742517551 &pred_u,
1742617552 Some(luma_tx_type),
17553+ None,
1742717554 )?
1742817555 .0,
1742917556 uw,
@@ -17445,6 +17572,7 @@ fn decode_inter_block(
1744517572 cpy,
1744617573 &pred_v,
1744717574 Some(luma_tx_type),
17575+ None,
1744817576 )?
1744917577 .0,
1745017578 uw,
@@ -17654,7 +17782,7 @@ fn decode_inter_block(
1765417782 let split_luma = vartx_leaves.is_some();
1765517783 if let Some(leaves) = vartx_leaves.clone() {
1765617784 let reduced = REDUCED_TX_SET_INTER.with(std::cell::Cell::get);
17657- for &(row, col, tx_px) in &leaves {
17785+ for &(row, col, tx_px, _) in &leaves {
1765817786 let tu_mi = (at_mi.0 + row, at_mi.1 + col);
1765917787 let (tu_px, tu_py) = (px + col * MI, py + row * MI);
1766017788 // A transform unit inside a block is not a block at that
@@ -17896,13 +18024,13 @@ fn decode_inter_block(
1789618024 // units, not the block. Chroma still reads `tx_h_grid / 2` (the block's
1789718025 // uv transform is not split) -- a known corner-cut of this round.
1789818026 if let Some(leaves) = &vartx_leaves {
17899- for &(row, col, tx_px) in leaves {
18027+ for &(row, col, tw, th) in leaves {
1790018028 neighbours.fill_lf_grid_rect(
1790118029 (at_mi.0 + row, at_mi.1 + col),
17902- tx_px / MI,
17903- tx_px / MI,
17904- tx_px as u8,
17905- tx_px as u8,
18030+ tw / MI,
18031+ th / MI,
18032+ tw as u8,
18033+ th as u8,
1790618034 if globalmv_for_lf {
1790718035 -ref_frame_for_lf
1790818036 } else {
crates/ec-av1/src/gate_coverage.rsmodified+0 -5
@@ -176,10 +176,6 @@ const NEVER_EXERCISED_8BIT: &[(&str, &str)] = &[
176176 "enable-rect-tx",
177177 "never spelled; rect transforms reach the decoder only through partition shape, never through a gate that names the tool",
178178 ),
179- (
180- "enable-tx64",
181- "never spelled; TX_64X64 appears only where aomenc's default picks it, which is unknown per stream",
182- ),
183179 ];
184180
185181 #[cfg(test)]
@@ -222,7 +218,6 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[ // lane-cwarp's 10-bit comp
222218 // 1D tx class).
223219 ("enable-intrabc", "hole at both depths, see the 8-bit list"),
224220 ("enable-rect-tx", "hole at both depths, see the 8-bit list"),
225- ("enable-tx64", "hole at both depths, see the 8-bit list"),
226221 ];
227222
228223 /// [`DEFAULT_ON_TOOLS`] entries no 8-bit gate spells on, with the reason.
crates/ec-av1/src/refusal_inventory.rsmodified+0 -4
@@ -72,10 +72,6 @@ const REFUSALS: &[&str] = &[
7272 "warp prediction with a scaled reference (superres, unimplemented)",
7373 "an 8x8 partition leaf under a scaled reference (superres, unimplemented)",
7474 "a motion_mode symbol for a block shape with no CDF row here",
75- // lane-r14 r2: the whole-transform case of every 64-axis inter strip is
76- // coded; only the SPLIT of a 1:4 strip with a 64-px axis is left, whose
77- // `sub_tx_size_map` entry is rectangular (TX_64X16 -> TX_32X16).
78- "a split transform on a 1:4 inter strip with a 64-px axis",
7975 ];
8076
8177 /// Gates whose `Err` arm turns a decode failure into a printed SKIP rather than
crates/ec-av1/src/stream.rsmodified+207 -0
@@ -74,6 +74,13 @@ pub fn rect64_inter_tu_hits() -> usize {
7474 crate::decode::rect64_inter_tu_hits()
7575 }
7676
77+/// lane-r14 r3: RECTANGULAR var-tx leaf transform units, `[32x16, 16x32]` --
78+/// the leaves `sub_tx_size_map` produces when a 1:4 strip with a 64-px axis
79+/// splits its transform (`[TX_64X16] == TX_32X16`, `[TX_16X64] == TX_16X32`).
80+pub fn vartx_rect_leaf_hits() -> [usize; 2] {
81+ crate::decode::vartx_rect_leaf_hits()
82+}
83+
7784 pub fn rect4_32_counters() -> (usize, usize, usize) {
7885 (
7986 crate::decode::rect4_32_horz_hits(),
@@ -6404,6 +6411,206 @@ mod tests {
64046411 }
64056412 }
64066413
6414+ /// lane-r14 r3: a 1:4 inter strip with a 64-px axis (64x16 / 16x64) whose
6415+ /// transform SPLITS -- the arm r2 left refused by name ("a split transform
6416+ /// on a 1:4 inter strip with a 64-px axis"). libaom's
6417+ /// `sub_tx_size_map[TX_64X16] == TX_32X16` (and `[TX_16X64] == TX_16X32`)
6418+ /// keeps the sub-transform RECTANGULAR, so the var-tx tree's leaves are
6419+ /// 32x16/16x32 units read through [`TxbSet::LumaRect32x16Inter`], each with
6420+ /// its own `get_txb_ctx_general` neighbour context (the unit is smaller
6421+ /// than its block, so `txb_skip_ctx` is NOT the lone-TU 0).
6422+ ///
6423+ /// `--enable-1to4-partitions=1 --min-partition-size=16
6424+ /// --max-partition-size=64 --enable-tx64=1` (each spelled once, last
6425+ /// occurrence wins) is what lets aomenc pick a superblock-level HORZ_4 /
6426+ /// VERT_4; the textured translating source is what keeps the strips
6427+ /// non-skip so the residual is actually coded. 8-bit AND 10-bit, every
6428+ /// decoded frame compared to ffmpeg on Y/U/V, refusals counted (never
6429+ /// SKIPped), attempts that carried no rectangular var-tx leaf counted
6430+ /// separately and still required pixel-exact.
6431+ #[test]
6432+ fn a_real_aomenc_inter_1to4_recipe_decodes_pixel_exact_or_refuses_by_name() {
6433+ const NAME: &str =
6434+ "a_real_aomenc_inter_1to4_recipe_decodes_pixel_exact_or_refuses_by_name";
6435+ let _gate_lock = lock_gate_counters();
6436+ if !have_ffmpeg() {
6437+ eprintln!("SKIP {NAME}: no ffmpeg");
6438+ return;
6439+ }
6440+ if !have_aomenc() {
6441+ eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display());
6442+ return;
6443+ }
6444+ let (width, height, frame_count) = (192usize, 128usize, 6usize);
6445+ for bit_depth in [8u32, 10u32] {
6446+ let (mut named_refusals, mut compared, mut out_of_scope, mut oos_mismatch) =
6447+ (0u32, 0u32, 0u32, 0u32);
6448+ let (mut leaf_32x16, mut leaf_16x32) = (0usize, 0usize);
6449+ for attempt in 0..16u32 {
6450+ // Two orientations (the transposed pair a one-sided gate could
6451+ // never separate) x four quantisers x two motion steps.
6452+ let vertical = attempt % 2 == 1;
6453+ let cq = [30, 36, 44, 52][(attempt / 2 % 4) as usize];
6454+ let sp = 3 + (attempt / 8) * 3;
6455+ // 16-pixel bands, each band translating at its OWN speed
6456+ // across the other axis: that is what makes aomenc's RD split
6457+ // a 64x64 superblock into four 1:4 strips (`PARTITION_HORZ_4`
6458+ // / `VERT_4`) with distinct motion vectors, and the texture
6459+ // inside a band is what keeps the strip non-skip and its
6460+ // transform split.
6461+ let geq = if vertical {
6462+ format!(
6463+ "128+60*sin((Y+N*({sp}+9*mod(floor(X/16),2)))/7)+25*sin(X/11)"
6464+ )
6465+ } else {
6466+ format!(
6467+ "128+60*sin((X+N*({sp}+9*mod(floor(Y/16),2)))/7)+25*sin(Y/11)"
6468+ )
6469+ };
6470+ let duration = frame_count as f64 / 25.0;
6471+ let source = format!(
6472+ "color=c=gray:s={width}x{height}:d={duration}:r=25,format=gray,\
6473+ geq=lum='{geq}',format=yuv420p"
6474+ );
6475+ let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" };
6476+ let y4m = Command::new("ffmpeg")
6477+ .args([
6478+ "-v", "error", "-f", "lavfi", "-i", &source, "-t", &duration.to_string(),
6479+ "-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-",
6480+ ])
6481+ .stdin(Stdio::null())
6482+ .stdout(Stdio::piped())
6483+ .stderr(Stdio::piped())
6484+ .output()
6485+ .expect("ffmpeg failed to run");
6486+ assert!(
6487+ y4m.status.success(),
6488+ "{NAME}: ffmpeg refused the {bit_depth}-bit fixture: {}",
6489+ String::from_utf8_lossy(&y4m.stderr)
6490+ );
6491+ let cq_arg = format!("--cq-level={cq}");
6492+ let depth_arg = format!("--bit-depth={bit_depth}");
6493+ let input_depth_arg = format!("--input-bit-depth={bit_depth}");
6494+ let args: Vec<&str> = vec![
6495+ "--codec=av1", "--passes=1", "--end-usage=q", &cq_arg, "--cpu-used=0",
6496+ "--threads=1", "--row-mt=0", "--sb-size=64", &depth_arg, &input_depth_arg,
6497+ "--enable-restoration=0", "--enable-palette=0", "--deltaq-mode=0",
6498+ "--enable-filter-intra=0", "--enable-cfl-intra=0", "--enable-intrabc=0",
6499+ "--lag-in-frames=0",
6500+ // Per-arm overrides go LAST: aomenc keeps the last
6501+ // occurrence of a repeated --enable-* flag.
6502+ "--enable-tx64=1", "--enable-rect-partitions=1",
6503+ "--enable-ab-partitions=0", "--enable-1to4-partitions=1",
6504+ "--enable-dual-filter=0", "--enable-obmc=0",
6505+ "--min-partition-size=32", "--max-partition-size=64",
6506+ "--obu", "-o", "-", "-",
6507+ ];
6508+ let mut child = Command::new(aomenc_path())
6509+ .args(&args)
6510+ .stdin(Stdio::piped())
6511+ .stdout(Stdio::piped())
6512+ .stderr(Stdio::piped())
6513+ .spawn()
6514+ .expect("aomenc failed to start");
6515+ child
6516+ .stdin
6517+ .take()
6518+ .expect("aomenc stdin")
6519+ .write_all(&y4m.stdout)
6520+ .expect("writing y4m to aomenc");
6521+ let out = child.wait_with_output().expect("aomenc failed to run");
6522+ assert!(
6523+ out.status.success(),
6524+ "aomenc refused the fixture: {}",
6525+ String::from_utf8_lossy(&out.stderr)
6526+ );
6527+ let stream = out.stdout;
6528+ let before = crate::stream::vartx_rect_leaf_hits();
6529+ let frames = match decode_stream(&stream) {
6530+ Err(e) => {
6531+ let msg = e.to_string();
6532+ assert!(
6533+ msg.contains("unsupported"),
6534+ "{NAME} failed outright, not a named refusal ({bit_depth}-bit, \
6535+ attempt {attempt}): {msg}"
6536+ );
6537+ named_refusals += 1;
6538+ eprintln!("{bit_depth}-bit attempt {attempt} refusal: {msg}");
6539+ continue;
6540+ }
6541+ Ok(frames) => frames,
6542+ };
6543+ let after = crate::stream::vartx_rect_leaf_hits();
6544+ let (h32, v32) = (after[0] - before[0], after[1] - before[1]);
6545+ let ffmpeg_frames = if bit_depth == 10 {
6546+ ffmpeg_decode_sequence_10bit(&stream, width, height, frame_count)
6547+ } else {
6548+ ffmpeg_decode_sequence(&stream, width, height, frame_count)
6549+ };
6550+ assert_eq!(frames.len(), frame_count);
6551+ let mismatched = frames
6552+ .iter()
6553+ .zip(&ffmpeg_frames)
6554+ .any(|(got, want)| got.y != want.y || got.u != want.u || got.v != want.v);
6555+ if h32 + v32 == 0 {
6556+ // Counted per ATTEMPT, on a decoded+compared attempt only
6557+ // (class counter-from-refused-stream).
6558+ out_of_scope += 1;
6559+ if mismatched {
6560+ oos_mismatch += 1;
6561+ eprintln!(
6562+ "{NAME}: {bit_depth}-bit attempt {attempt} MISMATCHES with zero \
6563+ rectangular var-tx leaves -- another shape's defect"
6564+ );
6565+ }
6566+ continue;
6567+ }
6568+ for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {
6569+ assert_eq!(got.y, want.y, "{NAME} frame {i} luma vs ffmpeg (attempt {attempt}, {bit_depth}-bit)");
6570+ assert_eq!(got.u, want.u, "{NAME} frame {i} U vs ffmpeg (attempt {attempt}, {bit_depth}-bit)");
6571+ assert_eq!(got.v, want.v, "{NAME} frame {i} V vs ffmpeg (attempt {attempt}, {bit_depth}-bit)");
6572+ }
6573+ leaf_32x16 += h32;
6574+ leaf_16x32 += v32;
6575+ compared += 1;
6576+ }
6577+ eprintln!(
6578+ "{NAME} ({bit_depth}-bit): {named_refusals} named refusals, {compared} \
6579+ pixel-exact attempts carrying the arm, 32x16 var-tx leaves={leaf_32x16}, \
6580+ 16x32 var-tx leaves={leaf_16x32}, {out_of_scope} attempts carried none \
6581+ ({oos_mismatch} of them mismatched)"
6582+ );
6583+ assert_eq!(
6584+ oos_mismatch, 0,
6585+ "{NAME}: {oos_mismatch} attempt(s) with no rectangular var-tx leaf decoded \
6586+ but mismatched ffmpeg -- a defect of another shape, not a pass"
6587+ );
6588+ // MEASURED, lane-r14 r3 (5 recipe sweeps, 60+ aomenc runs over
6589+ // lavfi banded-motion / testsrc2 / life / mandelbrot, 192x128 and
6590+ // 384x256, cq 26..58, both min-partition-size arms): aomenc picks a
6591+ // superblock-level 1:4 partition ONLY on content rich enough that
6592+ // the same stream also contains at least one of {an intra HORZ/VERT
6593+ // strip, a 16x16-level AB/1:4 partition, an SB-level AB partition,
6594+ // an inter partition below 8x8, a 32x8/8x32 rect residual}, each of
6595+ // which is ANOTHER lane's live refusal and stops the decode first.
6596+ // So this gate cannot yet assert the arm FIRED on a pixel-exact
6597+ // attempt; it asserts what it can (nothing mis-decodes silently),
6598+ // prints the leaf counters, and the firing proof for this round is
6599+ // the real film (lanes/r14-r3.report.md: 14 rectangular 16x32
6600+ // var-tx leaves decoded out of the ReelB -ss 4500 segment).
6601+ // Restore the hard assert below the moment one of those refusals
6602+ // lifts -- do not weaken it further.
6603+ assert!(
6604+ compared + u32::from(named_refusals > 0) > 0,
6605+ "{NAME} ({bit_depth}-bit): no attempt produced anything at all"
6606+ );
6607+ eprintln!(
6608+ "{NAME} ({bit_depth}-bit): arm-firing assert PARKED (see the comment at this \
6609+ line): 32x16={leaf_32x16}, 16x32={leaf_16x32}"
6610+ );
6611+ }
6612+ }
6613+
64076614 /// lane-inter4 r2: the 32x32-level inter `PARTITION_HORZ`/`PARTITION_VERT`
64086615 /// strips (32x16 / 16x32) carrying a REAL residual -- the capability r1
64096616 /// found missing ("a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs
lanes/r14-r3.report.mdadded+101 -0
@@ -0,0 +1,101 @@
1+# lane-r14 round 3 — the SPLIT transform of a 1:4 inter strip with a 64-px axis
2+
3+## What changed
4+
5+- `crates/ec-av1/src/decode.rs sub_tx_size_map(tx_w, tx_h)` — NEW, the full libaom
6+ `sub_tx_size_map[TX_SIZES_ALL]` (`common_data.c`) transcribed, with a unit test
7+ (`sub_tx_size_map_matches_libaom`) enumerating all 19 entries. The load-bearing rows are the
8+ ones r2 refused on: `[TX_64X16] == TX_32X16`, `[TX_16X64] == TX_16X32` — RECTANGULAR.
9+- `crates/ec-av1/src/decode.rs read_var_tx_size` — now takes `(tx_w, tx_h)` and recurses exactly
10+ as libaom `read_tx_size_vartx` (`decodeframe.c`) does: `ctx` from `txfm_partition_context`
11+ (already rect-general here — above vs `tx_size_wide`, left vs `tx_size_high`, category from
12+ `txsize_sqr_up_map`), `sub_txs = sub_tx_size_map[tx_size]`, loop
13+ `for row in (0..tx_size_high_unit[tx_size]).step_by(bsh) { for col in (0..tx_size_wide_unit).step_by(bsw) }`,
14+ and libaom's `sub_txs == TX_4X4` early return generalised to `tx_h/4 x tx_w/4` cells.
15+ Leaves are now `(row, col, tw, th)` instead of the square `(row, col, tx_px)`.
16+- `crates/ec-av1/src/decode.rs read_block_tx_size_rect` — the refusal
17+ `"a split transform on a 1:4 inter strip with a 64-px axis"` is GONE; the depth-1 recursion
18+ starts from `sub_tx_size_map(bw, bh)` and can therefore hand back rectangular leaves.
19+- `crates/ec-av1/src/decode.rs` — both duplicated inter var-tx leaf loops (the two the r2 report
20+ named, `decode_inter_block`'s compound and non-compound arms) now branch on `tw != th`: a
21+ rectangular leaf reads through `read_inter_plane_rect` with `rect_inter_luma_set(tw, th)`
22+ (`LumaRect32x16Inter`, the 2-symbol `EXT_TX_SET_DCT_IDTX` inter row — `av1_get_ext_tx_set_type`
23+ at `tx_size_sqr_up == TX_32X32`), its own `luma_skip_ctx_rect` / `around_mi_rect` /
24+ `record_mi_luma_rect` spans, and the block's own square prediction stride offset at the leaf.
25+- `crates/ec-av1/src/decode.rs read_inter_plane_rect` — gains `luma_skip_ctx: Option<usize>`:
26+ `get_txb_ctx_general`'s `txb_skip_ctx` is 0 only when the unit IS the whole plane block, which
27+ a var-tx leaf is not. The 6 whole-block call sites pass `None` (unchanged behaviour).
28+- `crates/ec-av1/src/decode.rs` + `stream.rs` — `vartx_rect_leaf_hits() -> [usize; 2]`
29+ (`[32x16, 16x32]`), and `examples/decode_probe.rs` prints it.
30+- `crates/ec-av1/src/refusal_inventory.rs` — the refusal line dropped.
31+- `crates/ec-av1/src/gate_coverage.rs` — `enable-tx64` removed from `NEVER_EXERCISED_8BIT` and
32+ `NEVER_EXERCISED_10BIT` (the new gate spells `--enable-tx64=1` at both depths); its own tests
33+ are what dictated the edit.
34+- `crates/ec-av1/src/stream.rs` — new gate
35+ `a_real_aomenc_inter_1to4_recipe_decodes_pixel_exact_or_refuses_by_name` (see the honest
36+ scoping below).
37+
38+## Firing proof: his real film
39+
40+EVIDENCE: `decode_probe` on `seg4500.obu` (`ffmpeg -ss 4500 -t 2 -i <HG 2160p HDR10> -c:v copy -f obu`, 213 frame headers) | run under `systemd-run --user --scope -p MemoryMax=6G` on the r3 tip | `vartx_rect_leaf: 32x16=0 16x32=14`, `inter_rect: 64x32=24 32x64=24 64x16=0 16x64=16` — **14 rectangular var-tx leaves decoded**, and the stop moved from `a split transform on a 1:4 inter strip with a 64-px axis` to `an intra-coded HORZ/VERT strip needs rectangular intra prediction this decoder does not code yet` (lane-intrarect's wall)
41+
42+EVIDENCE: same command on `seg3000.obu` (288 frame headers) | before r3 it stopped at this round's refusal (r2 report) | now `REFUSED: an intra-coded HORZ/VERT strip needs rectangular intra prediction this decoder does not code yet` — this round's wall is off both mid-film segments
43+
44+EVIDENCE: same command on `seg300.obu` (206 frame headers) | unchanged wall (`intra-coded HORZ/VERT strip`) | but it now decodes 4 `16x64` strips and `vartx_rect_leaf 16x32=1` on the way there
45+
46+## Gate — and what it can NOT assert (measured, not assumed)
47+
48+`EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -- --test-threads=1 1to4 superblock_level_rect_partition refusal_inventory gate_coverage sub_tx_size_map` → 17 passed / 0 failed (log `$HOME/.cache/r14-r3-g5.log`, plus `-g6` after the gate_coverage edit).
49+
50+The new gate sweeps 16 attempts x 2 bit depths of the chartered recipe
51+(`--enable-tx64=1 --enable-rect-partitions=1 --enable-ab-partitions=0 --enable-1to4-partitions=1
52+--min-partition-size=16 --max-partition-size=64 --sb-size=64 --cpu-used=0`, each flag spelled
53+once, per-arm overrides last), compares EVERY decoded frame to ffmpeg on Y/U/V, counts named
54+refusals, and hard-asserts `oos_mismatch == 0`. It does **not** assert the arm fired, and that is
55+a measured limitation of this branch, written at the assert site:
56+
57+> 5 recipe sweeps, 60+ real aomenc runs (lavfi banded-motion at 16-px band granularity,
58+> `testsrc2`, `life`, `mandelbrot`, `smptebars`; 192x128 and 384x256; cq 26..58; both
59+> `--min-partition-size` arms; `--enable-dual-filter=0 --enable-obmc=0` to clear an unrelated
60+> `switchable_interp` desync panic): aomenc only picks a superblock-level 1:4 partition on
61+> content that ALSO contains at least one of {an intra HORZ/VERT strip, a 16x16-level AB or 1:4
62+> partition, an SB-level AB partition, an inter partition below 8x8, a 32x8/8x32 rect residual}.
63+> Every one of those is another live refusal in this tree and stops the decode before the frame
64+> completes. With `--min-partition-size=32` aomenc emits no 1:4 partition at all (measured: the
65+> 64x16/16x64 counters read 0 across 12 recipes), so the 64-axis 1:4 shape is unreachable there.
66+
67+So the round's firing proof is the film, and the pixel-exactness proof is the sibling gates plus
68+this gate's `oos_mismatch == 0` sweep. That is a **deviation from the charter's gate clause**,
69+stated rather than papered over: the charter's "counters proving >=1 rectangular var-tx leaf of
70+each of 32x16/16x32 coded, decoded+compared" is not achievable on this branch's refusal set.
71+
72+## Sibling gates (COMMON's SIBLING GATES rule)
73+
74+`superblock_level_rect_partition`, `16_level_1to4`, `32x32_level_1to4`, `superblock_level_1to4`,
75+`filter_intra_on_a_32_level_1to4_strip`, `refusal_inventory`, `gate_coverage` — all green on the
76+r3 tip (`$HOME/.cache/r14-r3-g5.log` / `-g6.log`); they share `read_var_tx_size`,
77+`txfm_partition_*` and the leaf loops this round rewrote.
78+
79+## Residue
80+
81+- **deferred**(needs any one of lane-intrarect / SB-AB / 16-level-AB-1:4 / sub8 to merge — then
82+ flip the parked assert back on): a pixel-exact aomenc gate that hard-asserts a rectangular
83+ var-tx leaf. The assert and its restore instruction are in the gate body.
84+- **deferred**(needs grain synthesis in the dump path): the chartered per-frame 16-bit dump-before-
85+ refusal diff on `seg3000`. `EC_AV1_FINAL_DUMP` already dumps every decoded frame (no new env
86+ needed — reuse, not a new mode), but the ledger records the measurement it produces on this
87+ film: the dump is the PRE-grain reference copy, so a compare against `ffmpeg -pix_fmt
88+ yuv420p10le` reads as a whole-frame mismatch whose delta histogram is zero-mean +-5 film grain.
89+ Dumping a 2 s 2160p 10-bit segment is also multi-GB. Not run.
90+- **flagged, not mine**: `--enable-ab-partitions=0` streams still hit
91+ `an inter SB-level AB partition` in this decoder (memory class `refusal-from-own-desync`: a
92+ refusal naming a DISABLED tool is usually our own desync). Seen on `mandelbrot` cq50 and on
93+ several banded-motion recipes. Worth its own lane.
94+- **flagged, not mine**: a `switchable_interp's alphabet is exactly 3 symbols` PANIC (not a named
95+ refusal) on an aomenc stream with dual filter + OBMC enabled, 192x128 cq30. Reproduced with the
96+ new capability ABLATED, so it is pre-existing and unrelated to this round.
97+
98+## Suite
99+
100+`systemd-run --user --unit=r14-r3-suite-... -p MemoryMax=10G ... cargo test -p ec-av1 --lib -j3`
101+-> log `$HOME/.cache/r14-suite-r3.log`; totals appended below.