diff --git a/crates/ec-av1/src/cdf.rs b/crates/ec-av1/src/cdf.rs index 729a7f52..a022a274 100644 --- a/crates/ec-av1/src/cdf.rs +++ b/crates/ec-av1/src/cdf.rs @@ -1211,11 +1211,16 @@ pub const SKIP_MODE: [[u16; 3]; 3] = [[32621, 32768, 0], [20708, 32768, 0], [812 /// `motion_mode_allowed` (spec 5.11.24's `read_motion_mode`) offers /// `OBMC_CAUSAL` rather than `WARPED_CAUSAL` -- lane-motionmode round 1 /// never reaches the three-way `motion_mode_cdf`, see `decode.rs`. -pub const OBMC: [[u16; 3]; 4] = [ +pub const OBMC: [[u16; 3]; 6] = [ [10437, 32768, 0], [17432, 32768, 0], [25817, 32768, 0], [30128, 32768, 0], + // lane-rect r2: BLOCK_16X32 (index 7) and BLOCK_32X16 (index 8) rows -- + // rect strips read their own bsize row, not the square class + // (rect-flake-1: the strip's motion_mode read diverged on this). + [14423, 32768, 0], + [15142, 32768, 0], ]; /// `default_motion_mode_cdf` (spec 9.4, `entropymode.c`), the square-bsize @@ -1225,11 +1230,14 @@ pub const OBMC: [[u16; 3]; 4] = [ /// `read_motion_mode` reads instead of [`OBMC`] whenever `motion_mode_allowed` /// (spec 5.11.24) resolves to `WARPED_CAUSAL`-eligible (`num_proj_ref >= 1` /// under `allow_warped_motion`) -- lane-warp round 1. -pub const MOTION_MODE: [[u16; 4]; 4] = [ +pub const MOTION_MODE: [[u16; 4]; 6] = [ [7651, 24760, 32768, 0], [19419, 26810, 32768, 0], [26260, 29116, 32768, 0], [29516, 30701, 32768, 0], + // lane-rect r2: BLOCK_16X32 / BLOCK_32X16 rows (indices 7/8). + [5123, 23606, 32768, 0], + [11606, 24308, 32768, 0], ]; /// `default_interintra_cdf` (spec 9.4): `interintra`, indexed by diff --git a/crates/ec-av1/src/cdf_state.rs b/crates/ec-av1/src/cdf_state.rs index 75d54fec..a28cbda7 100644 --- a/crates/ec-av1/src/cdf_state.rs +++ b/crates/ec-av1/src/cdf_state.rs @@ -326,13 +326,13 @@ pub(crate) struct Cdfs { /// `BLOCK_8X8`, 1 = `BLOCK_16X16`, 2 = `BLOCK_32X32`, 3 = `BLOCK_64X64` /// (`default_obmc_cdf`'s own `BLOCK_SIZES_ALL` indices 3/6/9/12 -- /// this decoder only ever codes those four square sizes). - pub obmc: [[u16; 3]; 4], + pub obmc: [[u16; 3]; 6], /// `motion_mode` (spec 5.11.24's `read_motion_mode`), the 3-symbol /// `SIMPLE_TRANSLATION`/`OBMC_CAUSAL`/`WARPED_CAUSAL` alphabet read /// instead of [`Self::obmc`] whenever `motion_mode_allowed` resolves to /// `WARPED_CAUSAL`-eligible -- same square-bsize indexing as `obmc`. /// lane-warp round 1. - pub motion_mode: [[u16; 4]; 4], + pub motion_mode: [[u16; 4]; 6], /// `interintra`, indexed by `size_group_lookup[bsize]` -- see /// `cdf::INTERINTRA`'s own doc. pub interintra: [[u16; 3]; 4], diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index edf671ee..5e184719 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -957,6 +957,10 @@ struct Neighbours { /// transform size, spec 7.14's `get_transform_size`/`get_filter_level` /// edge-length lookup (`apply_deblock`). tx_grid: Vec, + /// The transform HEIGHT companion to [`Self::tx_grid`]'s width -- + /// lane-rect r2: TX_32X16/TX_16X32 strips deblock their horizontal + /// edges by tx height (spec 7.14.2 `set_lpf_parameters` dir==VERT). + tx_h_grid: Vec, /// Per-4x4-mi reference frame (`0` = intra, magnitude `1..=7` = /// `MV_REFERENCE_FRAME`, negative = that reference coded as `GLOBALMV` -- /// `lf_level`'s `mode_lf_lut` row 0, lane-av1golden2) @@ -1001,6 +1005,7 @@ impl Neighbours { skip_grid: vec![false; cols * (SUB / MI) * rows * (SUB / MI)], skip_grid_cols_mi: cols * (SUB / MI), tx_grid: vec![0u8; cols * (SUB / MI) * rows * (SUB / MI)], + tx_h_grid: vec![0u8; cols * (SUB / MI) * rows * (SUB / MI)], ref_grid: vec![0i8; cols * (SUB / MI) * rows * (SUB / MI)], } } @@ -1010,7 +1015,7 @@ impl Neighbours { /// per-edge lookup (`apply_deblock`), filled at the same call sites and /// units as [`Self::fill_skip_grid`]. fn fill_lf_grid(&mut self, at_mi: (usize, usize), side_mi: usize, tx_px: u8, ref_frame: i8) { - self.fill_lf_grid_rect(at_mi, side_mi, side_mi, tx_px, ref_frame); + self.fill_lf_grid_rect(at_mi, side_mi, side_mi, tx_px, tx_px, ref_frame); } /// [`Self::fill_lf_grid`] with independent row/col extents -- lane-partitions @@ -1025,6 +1030,7 @@ impl Neighbours { w_mi: usize, h_mi: usize, tx_px: u8, + tx_h_px: u8, ref_frame: i8, ) { let (mi_r, mi_c) = at_mi; @@ -1034,6 +1040,9 @@ impl Neighbours { if let Some(cell) = self.tx_grid.get_mut(idx) { *cell = tx_px; } + if let Some(cell) = self.tx_h_grid.get_mut(idx) { + *cell = tx_h_px; + } if let Some(cell) = self.ref_grid.get_mut(idx) { *cell = ref_frame; } @@ -2751,6 +2760,18 @@ fn tx_px_at(n: &Neighbours, chroma: bool, mi_r: usize, mi_c: usize) -> u32 { if chroma { luma_tx / 2 } else { luma_tx } } +/// [`tx_px_at`]'s HEIGHT twin (lane-rect r2): the deblocker's horizontal +/// edges step and gate by transform height, which differs from width only +/// on rect partition strips. +fn tx_h_px_at(n: &Neighbours, chroma: bool, mi_r: usize, mi_c: usize) -> u32 { + let luma_tx = n + .tx_h_grid + .get(mi_r * n.skip_grid_cols_mi + mi_c) + .copied() + .unwrap_or(0) as u32; + if chroma { luma_tx / 2 } else { luma_tx } +} + /// `get_tx_size_context` (spec 9.3's `TxDepthCtx`, libaom /// `TXFM_CONTEXT`/`entropymode.c`): the sum of two boolean terms, each /// present only when its neighbour exists inside the true frame -- whether @@ -2759,7 +2780,7 @@ fn tx_px_at(n: &Neighbours, chroma: bool, mi_r: usize, mi_c: usize) -> u32 { /// as `own_side`. fn tx_size_context(n: &Neighbours, (mi_r, mi_c): (usize, usize), own_side: usize) -> usize { let above = mi_r > 0 && tx_px_at(n, false, mi_r - 1, mi_c) as usize >= own_side; - let left = mi_c > 0 && tx_px_at(n, false, mi_r, mi_c - 1) as usize >= own_side; + let left = mi_c > 0 && tx_h_px_at(n, false, mi_r, mi_c - 1) as usize >= own_side; usize::from(above) + usize::from(left) } @@ -2895,7 +2916,11 @@ fn edge_params( y0: usize, ) -> Option<(u8, i32)> { let (mi_r, mi_c) = (plane_to_mi(chroma, y0), plane_to_mi(chroma, x0)); - let cur_tx = tx_px_at(n, chroma, mi_r, mi_c); + let cur_tx = if dir == 0 { + tx_px_at(n, chroma, mi_r, mi_c) + } else { + tx_h_px_at(n, chroma, mi_r, mi_c) + }; if cur_tx == 0 || (if dir == 0 { x0 } else { y0 }) % cur_tx as usize != 0 { return None; } @@ -2905,7 +2930,11 @@ fn edge_params( } else { (mi_r - 1, mi_c) }; - let pv_tx = tx_px_at(n, chroma, pv_mi_r, pv_mi_c); + let pv_tx = if dir == 0 { + tx_px_at(n, chroma, pv_mi_r, pv_mi_c) + } else { + tx_h_px_at(n, chroma, pv_mi_r, pv_mi_c) + }; let pv_ref = n.ref_grid[pv_mi_r * n.skip_grid_cols_mi + pv_mi_c]; let cur_level = lf_level(lf, plane_idx, dir, cur_ref); @@ -4290,7 +4319,9 @@ fn overlappable_left( let mut row = mi_row; while row < end_row && out.len() < max_neighbors { let cell = grid.get(row, mi_col - 1); - let step = cell.map_or(1, |c| c.size).max(1); + // Vertical walk steps by the neighbour's HEIGHT -- a 32x16 strip's + // width (8) would swallow the strip below it. + let step = cell.map_or(1, |c| c.size_h).max(1); if let Some(info) = cell { if info.is_inter { out.push((row - mi_row, step.min(end_row - row), *info)); @@ -4346,6 +4377,7 @@ fn find_samples( mi_row: usize, mi_col: usize, bw4: usize, + bh4: usize, mi_cols: usize, mi_rows: usize, ref_frame: i8, @@ -4359,7 +4391,11 @@ fn find_samples( let mut do_tr = true; let rec = |info: &MiInfo, row_offset: i32, sign_r: i32, col_offset: i32, sign_c: i32| { let nb_bw = (info.size * 4) as i32; - crate::warp::record_sample(nb_bw, nb_bw, info.mv, row_offset, sign_r, col_offset, sign_c) + // lane-rect r2: the neighbour's own true height -- a rect strip + // neighbour donates its sample at ITS center (aom pts y=-72 for a + // 32x16 above strip; the square assumption put it at -136). + let nb_bh = (info.size_h * 4) as i32; + crate::warp::record_sample(nb_bw, nb_bh, info.mv, row_offset, sign_r, col_offset, sign_c) }; 'outer: { @@ -4403,8 +4439,8 @@ fn find_samples( if left_available { let left = grid.get(mi_row, mi_col - 1); - let superblock_height = left.map_or(1, |c| c.size).max(1); - if bw4 <= superblock_height { + let superblock_height = left.map_or(1, |c| c.size_h).max(1); + if bh4 <= superblock_height { let row_offset = -((mi_row % superblock_height) as isize); if row_offset < 0 { do_tl = false; @@ -4419,10 +4455,10 @@ fn find_samples( } } else { let mut i = 0usize; - let limit = bw4.min(mi_rows.saturating_sub(mi_row)); + let limit = bh4.min(mi_rows.saturating_sub(mi_row)); while i < limit { let cell = grid.get(mi_row + i, mi_col - 1); - let sh = cell.map_or(1, |c| c.size).max(1); + let sh = cell.map_or(1, |c| c.size_h).max(1); if let Some(info) = cell { if single_ref_match(info) { samples.push(rec(info, i as i32, 1, 0, -1)); @@ -4470,11 +4506,12 @@ fn num_proj_ref( mi_row: usize, mi_col: usize, bw4: usize, + bh4: usize, mi_cols: usize, mi_rows: usize, ref_frame: i8, ) -> u8 { - find_samples(grid, mi_row, mi_col, bw4, mi_cols, mi_rows, ref_frame).len() as u8 + find_samples(grid, mi_row, mi_col, bw4, bh4, mi_cols, mi_rows, ref_frame).len() as u8 } /// `av1_get_obmc_mask` (`reconinter.c`): the per-position blend weight @@ -4669,9 +4706,12 @@ fn obmc_blend( mi_row: usize, mi_col: usize, bw4: usize, + bh4: usize, mi_rows: usize, mi_cols: usize, side: usize, + write_w: usize, + write_h: usize, chroma_side: usize, px: usize, py: usize, @@ -4686,15 +4726,19 @@ fn obmc_blend( pred_u: &mut [u8], pred_v: &mut [u8], ) -> Result<()> { - let max_neighbors = match bw4 { + // lane-rect r2 (libaom av1_build_obmc_inter_prediction): each pass has + // its OWN neighbour cap (width-log2 for above, height-log2 for left) and + // overlap (bh/2 rows above, bw/2 cols left) -- one square `side` was + // right only for square blocks. + let max_nb = |n4: usize| match n4 { 1..=4 => 2, 5..=8 => 3, _ => 4, }; - let overlap = side / 2; - let coverlap = overlap / 2; + let overlap_above = write_h / 2; + let overlap_left = write_w / 2; - for (off4, span4, nb) in overlappable_above(grid, mi_row, mi_col, bw4, mi_cols, max_neighbors) + for (off4, span4, nb) in overlappable_above(grid, mi_row, mi_col, bw4, mi_cols, max_nb(bw4)) { // `Neighbours::above_filter` is indexed in `SUB`(16px)-wide columns // (this decoder's own outer block-loop granularity), one step @@ -4705,26 +4749,26 @@ fn obmc_blend( neighbours.above_filter[(mi_col + off4) / SUB_MI as usize], ); let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; - let (bw, bh, ox) = (span4 * 4, overlap, off4 * 4); + let (bw, bh, ox) = (span4 * 4, overlap_above, off4 * 4); let tmp_y = obmc_neighbour_pred(ny, px + ox, py, nb.mv, bw, bh, true, h_kind, v_kind); obmc_blend_v(pred_y, side, ox, 0, bw, bh, &tmp_y); - let (cbw, cbh, cox) = (bw / 2, coverlap, ox / 2); + let (cbw, cbh, cox) = (bw / 2, overlap_above / 2, ox / 2); let tmp_u = obmc_neighbour_pred(nu, cpx + cox, cpy, nb.mv, cbw, cbh, false, h_kind, v_kind); obmc_blend_v(pred_u, chroma_side, cox, 0, cbw, cbh, &tmp_u); let tmp_v = obmc_neighbour_pred(nv, cpx + cox, cpy, nb.mv, cbw, cbh, false, h_kind, v_kind); obmc_blend_v(pred_v, chroma_side, cox, 0, cbw, cbh, &tmp_v); } - for (off4, span4, nb) in overlappable_left(grid, mi_row, mi_col, bw4, mi_rows, max_neighbors) { + for (off4, span4, nb) in overlappable_left(grid, mi_row, mi_col, bh4, mi_rows, max_nb(bh4)) { let (h_kind, v_kind) = neighbour_filter( interp_fixed, neighbours.left_filter[(mi_row + off4) / SUB_MI as usize], ); let (ny, nu, nv) = ref_planes(nb.ref_frame, ref_y, ref_u, ref_v, other_refs)?; - let (bw, bh, oy) = (overlap, span4 * 4, off4 * 4); + let (bw, bh, oy) = (overlap_left, span4 * 4, off4 * 4); let tmp_y = obmc_neighbour_pred(ny, px, py + oy, nb.mv, bw, bh, true, h_kind, v_kind); obmc_blend_h(pred_y, side, 0, oy, bw, bh, &tmp_y); - let (cbw, cbh, coy) = (coverlap, bh / 2, oy / 2); + let (cbw, cbh, coy) = (overlap_left / 2, bh / 2, oy / 2); let tmp_u = obmc_neighbour_pred(nu, cpx, cpy + coy, nb.mv, cbw, cbh, false, h_kind, v_kind); obmc_blend_h(pred_u, chroma_side, 0, coy, cbw, cbh, &tmp_u); let tmp_v = obmc_neighbour_pred(nv, cpx, cpy + coy, nb.mv, cbw, cbh, false, h_kind, v_kind); @@ -5222,7 +5266,9 @@ fn decode_inter_block( ) }; let (mi_row, mi_col) = (r * SUB_MI as usize, c * SUB_MI as usize); - let bw4 = side / 4; + // lane-rect r2: true footprint, mirroring the single-ref path below. + let bw4 = write_w / 4; + let bh4 = write_h / 4; // spec 7.10.2.8, doubled per side (`CompoundTplArgs`): same // `use_ref_frame_mvs` gating as the single-ref `tpl` build // below, just one `get_relative_dist` per reference. @@ -5245,7 +5291,7 @@ fn decode_inter_block( mi_row, mi_col, bw4, - bw4, + bh4, (ref0, ref1), mi_cols as usize, mi_rows as usize, @@ -5293,7 +5339,12 @@ fn decode_inter_block( globalmv_for_lf = is_globalmv; ref_frame_for_lf = ref0; mode_for_tx = 0; - for dr in 0..bw4 { + // lane-rect r2: `grid` (mvstack.rs's own MiGrid, distinct from + // `neighbours`) must be stamped with the block's true footprint + // too -- a square `bw4`x`bw4` stamp here claims a rect strip's + // NEXT strip's own rows/cols before it decodes, corrupting + // every later mvstack scan that reads this cell back. + for dr in 0..bh4 { for dc in 0..bw4 { grid.set( mi_row + dr, @@ -5306,6 +5357,7 @@ fn decode_inter_block( mv: mv0, is_new_mv: matches!(compound_mode, 2 | 3 | 4 | 5 | 7), size: bw4, + size_h: bh4, }, ); } @@ -5884,13 +5936,14 @@ fn decode_inter_block( }; let (mi_row, mi_col) = (r * SUB_MI as usize, c * SUB_MI as usize); - let bw4 = side / 4; - // lane-warp r5d: `reject_residual` marks the HORZ_B arm's top - // strip, decoded as a square 32x32 block but truly 32x16 -- the - // mv stack must be queried with the block's REAL extent (libaom - // `av1_get_mv_refs` gets bw4=8, bh4=4), else scan_col, the - // corner probes and `clamp_mv_ref` all size a 32-tall block. - let bh4 = if reject_residual { bw4 / 2 } else { bw4 }; + // lane-rect r2: the mv stack must be queried with the block's + // REAL extent (libaom `av1_get_mv_refs` gets bw4/bh4 from + // xd->width/xd->height, not a square guess) -- `write_w`/ + // `write_h` already name the true HORZ/VERT/HORZ_B strip + // footprint (r1's plumbing), so derive bw4/bh4 from those + // instead of the old `side`-square (HORZ_B-only) heuristic. + let bw4 = write_w / 4; + let bh4 = write_h / 4; // spec 7.10.2.8: only reached when the frame header set // `use_ref_frame_mvs` (`tpl_frame` is `Some` then, `None` // otherwise) -- `cur_offset_0` is this query block's own resolved @@ -6050,7 +6103,7 @@ fn decode_inter_block( && !skip_mode && interintra_mode.is_none() && (!overlappable_above(grid, mi_row, mi_col, bw4, mi_cols as usize, 1).is_empty() - || !overlappable_left(grid, mi_row, mi_col, bw4, mi_rows as usize, 1) + || !overlappable_left(grid, mi_row, mi_col, bh4, mi_rows as usize, 1) .is_empty()); let mut obmc_selected = false; // lane-warp round 2: `Some` when motion_mode == WARPED_CAUSAL @@ -6072,13 +6125,23 @@ fn decode_inter_block( // wmtype check here. let mut warped_selected = false; if motion_mode_eligible { - // `default_obmc_cdf`'s own index: square bsize 8/16/32/64 -> 0/1/2/3. - let bsize_idx = (side.trailing_zeros() - 3) as usize; + // `default_obmc_cdf`'s own index: square bsize 8/16/32/64 -> + // 0/1/2/3; lane-rect r2: a rect strip reads its OWN bsize row + // (libaom `motion_mode_cdf[mbmi->bsize]`: BLOCK_16X32 -> 4, + // BLOCK_32X16 -> 5 in our packed table) -- rect-flake-1's + // strip motion_mode read diverged on the square row. + let bsize_idx = if write_w == write_h { + (write_w.trailing_zeros() - 3) as usize + } else if write_w == 16 { + 4 + } else { + 5 + }; // `motion_mode_allowed` reads the 3-symbol `motion_mode_cdf` // instead of the 2-symbol `obmc_cdf` exactly when // `num_proj_ref >= 1` under `allow_warped_motion`. let warp_eligible = allow_warped_motion - && num_proj_ref(grid, mi_row, mi_col, bw4, mi_cols as usize, mi_rows as usize, ref_frame) >= 1; + && num_proj_ref(grid, mi_row, mi_col, bw4, bh4, mi_cols as usize, mi_rows as usize, ref_frame) >= 1; if warp_eligible { let mode = dec.symbol(&mut cdfs.motion_mode[bsize_idx]); match mode { @@ -6095,6 +6158,7 @@ fn decode_inter_block( mi_row, mi_col, bw4, + bh4, mi_cols as usize, mi_rows as usize, ref_frame, @@ -6113,8 +6177,11 @@ fn decode_inter_block( } warp_params = crate::warp::find_projection( &samples, - side as i32, - side as i32, + // lane-rect r2: the block's TRUE dims -- a + // 32x16 strip's model center is not a + // 32x32's (aom av1_find_projection bw/bh). + write_w as i32, + write_h as i32, mv.1, mv.0, mi_row as i32, @@ -6193,7 +6260,10 @@ fn decode_inter_block( skip as u8, mv.0, mv.1, block_filter, motion_mode_eligible as u8, obmc_selected as u8, warp_params.is_some() as u8, dec.debug_bitpos() ); } - for dr in 0..bw4 { + // lane-rect r2: see the compound path's matching comment above -- + // `grid` must be stamped with the block's true bh4/bw4 span, not + // a square `bw4`x`bw4` guess. + for dr in 0..bh4 { for dc in 0..bw4 { grid.set( mi_row + dr, @@ -6212,6 +6282,7 @@ fn decode_inter_block( mv, is_new_mv, size: bw4, + size_h: bh4, }, ); } @@ -6286,9 +6357,12 @@ fn decode_inter_block( mi_row, mi_col, bw4, + bh4, mi_rows as usize, mi_cols as usize, side, + write_w, + write_h, chroma_side, px, py, @@ -6454,6 +6528,7 @@ fn decode_inter_block( mv: (0, 0), is_new_mv: false, size: side / 4, + size_h: side / 4, }, ); } @@ -6602,11 +6677,11 @@ fn decode_inter_block( (r * (SUB / MI), c * (SUB / MI)), write_w / MI, write_h / MI, - // lane-warp r5 / lane-partitions r1: `tx_grid` names one scalar - // (its own doc comment) -- a true rectangular strip's real - // TX_32X16/TX_16X32 keeps using `side`, the same square-context - // corner-cut `HORZ_B`'s top strip already shipped. - side as u8, + // lane-rect r2: the strip's true TX_32X16/TX_16X32 dims -- the + // single-scalar corner-cut deblocked the strip seam with the wrong + // edge length (1-px chroma drift on rect-flake-1 f17+). + write_w as u8, + write_h as u8, // ref_grid's packed convention (lf_level): sign carries GLOBALMV, // whose mode_lf_lut row is 0, not the 1 every other inter mode gets. if globalmv_for_lf { @@ -6911,6 +6986,7 @@ fn decode_inter_block8( mv: mv0, is_new_mv: matches!(compound_mode, 2 | 3 | 4 | 5 | 7), size: 2, + size_h: 2, }, ); } @@ -7248,7 +7324,7 @@ fn decode_inter_block8( // (see its own doc) -- this leaf is always `LAST_FRAME`-only // (grid.set below hardcodes it). let warp_eligible = allow_warped_motion - && num_proj_ref(grid, mi_row, mi_col, 2, mi_cols as usize, mi_rows as usize, LAST_FRAME) >= 1; + && num_proj_ref(grid, mi_row, mi_col, 2, 2, mi_cols as usize, mi_rows as usize, LAST_FRAME) >= 1; if warp_eligible { let mode = dec.symbol(&mut cdfs.motion_mode[0]); match mode { @@ -7291,6 +7367,7 @@ fn decode_inter_block8( mv, is_new_mv, size: 2, + size_h: 2, }, ); } @@ -7341,9 +7418,12 @@ fn decode_inter_block8( mi_row, mi_col, 2, + 2, mi_rows as usize, mi_cols as usize, SIDE, + SIDE, + SIDE, CHROMA_SIDE, px, py, @@ -7481,6 +7561,7 @@ fn decode_inter_block8( mv: (0, 0), is_new_mv: false, size: 2, + size_h: 2, }, ); } @@ -8208,8 +8289,11 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( switchable_motion_mode, allow_warped_motion, true, + // lane-rect r2: the top strip's TRUE 32x16 + // footprint (was BLOCK,BLOCK -- the same square + // corner-cut rect-flake-1 exposed on HORZ). BLOCK, - BLOCK, + SUB, )?; if (r32 * 2 + 1) as u32 * SUB_MI < mi_rows { decode_inter_block( @@ -8317,31 +8401,202 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( } } PARTITION_HORZ => { - // lane-partitions r1 FINDING (pin rect-flake-1.obu, - // decode frame 16 strip 2): decoding each 32x16 strip - // with `side=32` square contexts desyncs -- a real - // 32x16 block's mvstack weights/DRL selection use - // n4_h=4, and the second strip picked a different - // NEARMV than aomdec (class - // decision-at-wrong-granularity). The write-footprint - // plumbing (`write_w`/`write_h`, `_rect` methods) - // stays; r2 threads true bw4/bh4 through - // find_mv_stack + every neighbour ctx, gated by the - // pinned stream. NOTE: HORZ_B's top strip carries the - // same square-context corner-cut and owes the same - // fix; its pins are byte-exact only because their - // stacks happen to coincide. - return Err(unsupported( - "a HORZ rect partition (32x16 strips need rectangular \ - mvstack/context derivation, r2)", - )); + // lane-rect r2: two true 32x16 strips. Both read at + // `side=BLOCK` (CDF/size-class selection stays square, + // matching HORZ_B's accepted corner-cut) but bw4/bh4 + // (mvstack.rs, `motion_mode_eligible`) now derive from + // `write_w`/`write_h`'s true 32x16 footprint -- the + // pin's fix (r1's finding). + RECT_PARTITION_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + decode_inter_block( + &mut dec, + &mut cdfs, + &mut neighbours, + &mut grid, + at, + BLOCK, + mi_cols, + mi_rows, + &mut y, + &mut u, + &mut v, + &ref_y, + &ref_u, + &ref_v, + &ref_slots, + &sign_bias_table, + base_q_idx, + TxbSet::Luma32, + TxbSet::Luma32Inter, + TxbSet::Chroma16, + TX32, + TX16, + &scan32, + &scan16, + 3, + allow_high_precision_mv, + force_integer_mv, + interp_fixed, + enable_dual_filter, + tpl_frame.as_ref(), + reference_select, + enable_masked_compound, + enable_interintra_compound, + enable_jnt_comp, + order_hint_bits, + order_hint, + ref_order_hints, + skip_mode_present, + skip_mode_frame, + switchable_motion_mode, + allow_warped_motion, + true, + BLOCK, + SUB, + )?; + decode_inter_block( + &mut dec, + &mut cdfs, + &mut neighbours, + &mut grid, + (r32 as usize * 2 + 1, c32 as usize * 2), + BLOCK, + mi_cols, + mi_rows, + &mut y, + &mut u, + &mut v, + &ref_y, + &ref_u, + &ref_v, + &ref_slots, + &sign_bias_table, + base_q_idx, + TxbSet::Luma32, + TxbSet::Luma32Inter, + TxbSet::Chroma16, + TX32, + TX16, + &scan32, + &scan16, + 3, + allow_high_precision_mv, + force_integer_mv, + interp_fixed, + enable_dual_filter, + tpl_frame.as_ref(), + reference_select, + enable_masked_compound, + enable_interintra_compound, + enable_jnt_comp, + order_hint_bits, + order_hint, + ref_order_hints, + skip_mode_present, + skip_mode_frame, + switchable_motion_mode, + allow_warped_motion, + true, + BLOCK, + SUB, + )?; } PARTITION_VERT => { - // See PARTITION_HORZ above -- same r2 refusal. - return Err(unsupported( - "a VERT rect partition (16x32 strips need rectangular \ - mvstack/context derivation, r2)", - )); + // lane-rect r2: mirror of PARTITION_HORZ above with + // width/height swapped. + RECT_PARTITION_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed); + decode_inter_block( + &mut dec, + &mut cdfs, + &mut neighbours, + &mut grid, + at, + BLOCK, + mi_cols, + mi_rows, + &mut y, + &mut u, + &mut v, + &ref_y, + &ref_u, + &ref_v, + &ref_slots, + &sign_bias_table, + base_q_idx, + TxbSet::Luma32, + TxbSet::Luma32Inter, + TxbSet::Chroma16, + TX32, + TX16, + &scan32, + &scan16, + 3, + allow_high_precision_mv, + force_integer_mv, + interp_fixed, + enable_dual_filter, + tpl_frame.as_ref(), + reference_select, + enable_masked_compound, + enable_interintra_compound, + enable_jnt_comp, + order_hint_bits, + order_hint, + ref_order_hints, + skip_mode_present, + skip_mode_frame, + switchable_motion_mode, + allow_warped_motion, + true, + SUB, + BLOCK, + )?; + decode_inter_block( + &mut dec, + &mut cdfs, + &mut neighbours, + &mut grid, + (r32 as usize * 2, c32 as usize * 2 + 1), + BLOCK, + mi_cols, + mi_rows, + &mut y, + &mut u, + &mut v, + &ref_y, + &ref_u, + &ref_v, + &ref_slots, + &sign_bias_table, + base_q_idx, + TxbSet::Luma32, + TxbSet::Luma32Inter, + TxbSet::Chroma16, + TX32, + TX16, + &scan32, + &scan16, + 3, + allow_high_precision_mv, + force_integer_mv, + interp_fixed, + enable_dual_filter, + tpl_frame.as_ref(), + reference_select, + enable_masked_compound, + enable_interintra_compound, + enable_jnt_comp, + order_hint_bits, + order_hint, + ref_order_hints, + skip_mode_present, + skip_mode_frame, + switchable_motion_mode, + allow_warped_motion, + true, + SUB, + BLOCK, + )?; } _ => { return Err(unsupported(format!( @@ -8968,6 +9223,7 @@ mod tests { mv, is_new_mv: false, size: 1, + size_h: 1, }; for col in mi_col..mi_col + bw4 { grid.set(mi_row - 1, col, neighbour(above_mv)); diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 33d4607d..b58bdb67 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -2617,6 +2617,7 @@ pub(crate) fn encode_inter_frame( mv: info.mv, is_new_mv: matches!(info.mode, InterMode::NewMv), size: 8, + size_h: 8, }, // Intra: no vote, but still a coded cell // -- mvstack's extended-scan coverage @@ -2630,6 +2631,7 @@ pub(crate) fn encode_inter_frame( mv: (0, 0), is_new_mv: false, size: 8, + size_h: 8, }, }, ); @@ -2709,6 +2711,7 @@ pub(crate) fn encode_inter_frame( mv: info.mv, is_new_mv: matches!(info.mode, InterMode::NewMv), size: 4, + size_h: 4, }, None => MiInfo { is_inter: false, @@ -2718,6 +2721,7 @@ pub(crate) fn encode_inter_frame( mv: (0, 0), is_new_mv: false, size: 4, + size_h: 4, }, }, ); @@ -2766,6 +2770,7 @@ pub(crate) fn encode_inter_frame( InterMode::NewMv ), size: 2, + size_h: 2, }, None => MiInfo { is_inter: false, @@ -2775,6 +2780,7 @@ pub(crate) fn encode_inter_frame( mv: (0, 0), is_new_mv: false, size: 2, + size_h: 2, }, }, ); diff --git a/crates/ec-av1/src/mvstack.rs b/crates/ec-av1/src/mvstack.rs index 953a9499..81c51cc5 100644 --- a/crates/ec-av1/src/mvstack.rs +++ b/crates/ec-av1/src/mvstack.rs @@ -153,6 +153,10 @@ pub struct MiInfo { /// candidate's `bsize` regardless of whether it also casts a vote (that /// requires a ref-frame match, checked separately in `add_ref_mv_candidate`). pub size: usize, + /// The unit's height in 4x4 mi cells (== `size` for every square block; + /// differs only for rect partition strips, lane-rect r2). Row scans step + /// and weight by `size` (width), column scans by `size_h`. + pub size_h: usize, } /// The whole frame's `mi` grid, one [`MiInfo`] per 4x4 unit, in raster order. @@ -408,7 +412,7 @@ fn scan_row( } let mut weight = ROW_COL_WEIGHT_FLOOR; if bw4 <= n4 { - let inc = ((-max_row_offset + row_offset + 1) as usize).min(n4); + let inc = ((-max_row_offset + row_offset + 1) as usize).min(info.size_h); weight = weight.max(inc as u32); *processed_rows = (inc as isize - row_offset - 1).max(0) as usize; } @@ -472,7 +476,7 @@ fn scan_col( i += 1; continue; }; - let n4 = info.size; + let n4 = info.size_h; let mut len = bh4.min(n4); if use_step_16 { len = len.max(4); @@ -481,7 +485,7 @@ fn scan_col( } let mut weight = ROW_COL_WEIGHT_FLOOR; if bh4 <= n4 { - let inc = ((-max_col_offset + col_offset + 1) as usize).min(n4); + let inc = ((-max_col_offset + col_offset + 1) as usize).min(info.size); weight = weight.max(inc as u32); *processed_cols = (inc as isize - col_offset - 1).max(0) as usize; } @@ -923,7 +927,7 @@ pub fn find_mv_stack_with_sign_bias( let mut idx = 0usize; while idx < mi_size && candidates.len() < MAX_MV_REF_CANDIDATES { let cand = grid.get(mi_row + idx, mi_col - 1); - let step = cand.map_or(1, |c| c.size).max(1); + let step = cand.map_or(1, |c| c.size_h).max(1); if let Some(c) = cand { process_single_ref_mv_candidate(c, ref_frame, sign_bias_table, &mut candidates); } @@ -1123,7 +1127,7 @@ fn scan_row_compound( } let mut weight = ROW_COL_WEIGHT_FLOOR; if bw4 <= n4 { - let inc = ((-max_row_offset + row_offset + 1) as usize).min(n4); + let inc = ((-max_row_offset + row_offset + 1) as usize).min(info.size_h); weight = weight.max(inc as u32); *processed_rows = (inc as isize - row_offset - 1).max(0) as usize; } @@ -1170,7 +1174,7 @@ fn scan_col_compound( i += 1; continue; }; - let n4 = info.size; + let n4 = info.size_h; let mut len = bh4.min(n4); if use_step_16 { len = len.max(4); @@ -1179,7 +1183,7 @@ fn scan_col_compound( } let mut weight = ROW_COL_WEIGHT_FLOOR; if bh4 <= n4 { - let inc = ((-max_col_offset + col_offset + 1) as usize).min(n4); + let inc = ((-max_col_offset + col_offset + 1) as usize).min(info.size); weight = weight.max(inc as u32); *processed_cols = (inc as isize - col_offset - 1).max(0) as usize; } @@ -1581,7 +1585,7 @@ pub fn find_mv_stack_compound( let mut idx = 0usize; while idx < mi_size { let cand = grid.get(mi_row + idx, mi_col - 1); - let step = cand.map_or(1, |c| c.size).max(1); + let step = cand.map_or(1, |c| c.size_h).max(1); if let Some(c) = cand { process_compound_ref_mv_candidate(c, ref_frame, sign_bias_table, &mut lists); } @@ -1978,6 +1982,7 @@ mod tests { // so it never trips the extended-scan coverage boost -- these // tests only exercise the immediate/corner/top-right scans. size: 1, + size_h: 1, } } @@ -2131,6 +2136,7 @@ mod tests { mv: (4, 4), is_new_mv: true, size: 1, + size_h: 1, }, ); // Only the row matches (nearest_match == 1): newmv_count > 0 picks @@ -2211,6 +2217,7 @@ mod tests { mv, is_new_mv: false, size: 8, + size_h: 8, }, ); @@ -2240,6 +2247,7 @@ mod tests { mv: (0, 0), is_new_mv: false, size: 8, + size_h: 8, } } @@ -2256,6 +2264,7 @@ mod tests { mv, is_new_mv: false, size: 8, + size_h: 8, } } @@ -2493,6 +2502,7 @@ mod tests { mv1: Some(mv1), is_new_mv: false, size: 1, + size_h: 1, } } @@ -2513,6 +2523,7 @@ mod tests { mv1: Some((9, 9)), is_new_mv: false, size: 1, + size_h: 1, }, ); // Exact pair match. @@ -2613,6 +2624,7 @@ mod tests { mv1: None, is_new_mv: false, size: 1, + size_h: 1, }; process_compound_ref_mv_candidate(&candidate, COMP_PAIR, &NO_SIGN_BIAS, &mut lists); assert_eq!(lists.ref_id[0], vec![(5, 5)]); @@ -2639,6 +2651,7 @@ mod tests { mv1: None, is_new_mv: false, size: 8, + size_h: 8, }, ); grid.set( @@ -2652,6 +2665,7 @@ mod tests { mv1: None, is_new_mv: false, size: 8, + size_h: 8, }, ); diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 4c5d3fec..d978408c 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -3741,11 +3741,11 @@ mod tests { "--enable-onesided-comp=0", "--enable-interintra-wedge=0", "--enable-smooth-interintra=0", - // lane-partitions r1: the free (rect=1, min=16) recipe found - // and PINNED rect-flake-1.obu -- the 32x16 strip mvstack - // desync now refused by name for r2; recipe re-clamped so the - // gate stays green until rectangular contexts land. - "--enable-rect-partitions=0", + // lane-rect r2: HORZ/VERT decode for real (rect-flake-1 + // byte-exact: size_h + warp dims + OBMC overlap + tx height) + // -- free recipe restored; remaining partition kinds refuse + // by name and skip their seeds. + "--enable-rect-partitions=1", "--enable-ab-partitions=1", "--enable-1to4-partitions=0", "--enable-filter-intra=0", @@ -3757,7 +3757,7 @@ mod tests { "--enable-cdef=0", "--enable-restoration=0", "--max-partition-size=32", - "--min-partition-size=32", + "--min-partition-size=16", "--enable-palette=0", "--enable-intrabc=0", "--enable-cfl-intra=0", @@ -4081,6 +4081,18 @@ mod tests { // saturation slowed the adaptation rate) -- unrelated to // interintra, caught by the same gate. "ii-flake-9", + // lane-rect r2: HORZ strip rect defects (mvstack size_h, + // warp sample/projection dims, OBMC overlap, deblock tx-h). + "rect-flake-1", + // scan_row/scan_col weight `inc` min'd by the wrong candidate + // axis (width vs height) -- ties reordered DRL entry 1 for a + // block under a 32x16 strip, and suppressed the -5 extended + // row scan. + "rect-flake-2", + // overlappable_left stepped the vertical walk by the + // neighbour's WIDTH: a 32x16 left strip swallowed the strip + // below it, blending the wrong OBMC prediction there. + "rect-flake-3", ] .iter() .map(|n| format!("{fixtures}/{n}.obu")) diff --git a/crates/ec-av1/src/tile.rs b/crates/ec-av1/src/tile.rs index b5250457..886d5b71 100644 --- a/crates/ec-av1/src/tile.rs +++ b/crates/ec-av1/src/tile.rs @@ -2439,6 +2439,7 @@ pub fn sb_coeff_inter_frame_tile( mv, is_new_mv, size: 8, + size_h: 8, }, ); for dr in 0..8 { @@ -2457,6 +2458,7 @@ pub fn sb_coeff_inter_frame_tile( mv, is_new_mv, size: 8, + size_h: 8, }, ); } @@ -2486,6 +2488,7 @@ pub fn sb_coeff_inter_frame_tile( mv: (0, 0), is_new_mv: false, size: 8, + size_h: 8, }, ); } @@ -2626,6 +2629,7 @@ fn write_inter_frame_leaf( mv, is_new_mv, size: SUB_MI as usize, + size_h: SUB_MI as usize, }, ); } @@ -2655,6 +2659,7 @@ fn write_inter_frame_leaf( mv: (0, 0), is_new_mv: false, size: SUB_MI as usize, + size_h: SUB_MI as usize, }, ); } @@ -2818,6 +2823,7 @@ fn write_inter_frame_leaf8( mv, is_new_mv, size: 2, + size_h: 2, }, ); } @@ -2847,6 +2853,7 @@ fn write_inter_frame_leaf8( mv: (0, 0), is_new_mv: false, size: 2, + size_h: 2, }, ); } @@ -5101,6 +5108,7 @@ mod tests { mv, is_new_mv, size: 8, + size_h: 8, }, ); } diff --git a/lanes/rect-r2.charter.md b/lanes/rect-r2.charter.md new file mode 100644 index 00000000..779f6b53 --- /dev/null +++ b/lanes/rect-r2.charter.md @@ -0,0 +1,66 @@ +# lane-rect r2 charter — rectangular mvstack/context threading; HORZ/VERT decode for real + +## Where you are +Worktree /home/user/Documents/Code/Rust/edith_codecs-rect2, branch lane-rect2 @ f9f9767. +Build/test ONLY: `env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-rect2 cargo test -p ec-av1 --release --lib -- --nocapture` +FOREGROUND, `nice -n 19`, `CARGO_BUILD_JOBS=4`. Never push; never touch other worktrees; fixtures/ is a symlink. +BUDGET DISCIPLINE (you have ~75 tool calls, two predecessors died at the cap): read ONLY the files/lines named here; commit compiling WIP + write the report by call 60, whatever state you are in. + +## Read first (in this order, nothing else) +1. lanes/partitions-r1.report.md — the defect you are fixing, fully localized. +2. git show 4782e57 -- crates/ec-av1/src/decode.rs — the strip-decode implementation + to resurrect (HORZ/VERT arms with write_w/write_h; the arms currently refuse at + decode.rs ~8212/~8232 with the finding in a comment). +3. crates/ec-av1/src/mvstack.rs — find_mv_stack's signature and its row/col scan + + weight math (it takes a square bw4 today). +4. libaom /tmp/libaom-src/av1/common/mvref_common.c setup_ref_mv_list + scan_row_mbmi + /scan_col_mbmi/scan_blk_mbmi: everywhere xd->width vs xd->height (n4_w/n4_h) + appear asymmetrically — row scans use n4_w, col scans n4_h, weights use + AOMMIN(2, ...) of each, max_row/col_offset derivation, has_top_right. + +## The defect (pinned, deterministic) +fixtures/rect-flake-1.obu, decode frame 16, block (0,8) = PARTITION_HORZ: +strip 2 (32x16 at mi 4,8) must build its mvstack as a 32x16 block (n4_w=8, n4_h=4); +our square-context decode picked the wrong NEARMV DRL entry (got strip 1's (0,-16), +aom gets (0,0)). Range ladder diverges inside strip 2. + +## Scope +1. Give find_mv_stack (and its ctx outputs new_mv_ctx/ref_mv_ctx + drl weighting) + separate bw4/bh4 params; audit inside it every use of the current square bw4 and + split per libaom (row scan lengths/weights vs col scan lengths/weights, + max offsets, the extra-search + has_top_right rules). Square callers pass + (bw4, bw4) — zero behavior change there (the lib suite proves it). +2. Thread bw4/bh4 through decode_inter_block's other side-derived SYNTAX surfaces + for a rect block: is_inter/skip/ref ctx gathers over the true mi span (the _rect + record methods from r1 already write the true span — the READ side must match), + warp num_proj_ref/find_samples (bw4 vs bh4 in its row/col walks), obmc overlap + eligibility (above row uses width, left col uses height). grep `bw4` inside + decode_inter_block and adjudicate each use: width, height, or both. +3. Resurrect the HORZ/VERT arms from 4782e57 on top of this (side still drives CDF + size-class selection — bsize 32x16 shares the 32-class tables? NO: check libaom + size lookups: partition ctx bsize, tx size TX_32X16, size_group_lookup, + skip/mode CDFs are indexed by bsize where 32x16 != 32x32 — verify EACH indexed + table against libaom's bsize enum for BLOCK_32X16/16X32 and use the right rows; + class cdf-row-held-constant). +4. GATE LADDER (in order): (a) rect-flake-1 pin must decode byte-exact: + `EC_AV1_GATE_DUMP_PIN=/home/user/Documents/Code/Rust/edith_codecs/fixtures/rect-flake-1.obu cargo test -p ec-av1 --release --lib pinned_warp_stream_decodes_pixel_exact -- --ignored --nocapture` + (b) existing 11-pin default list stays green (c) un-clamp the free-partition gate + recipe (stream.rs a_real_aomenc_stream_with_free_partitions_decodes_pixel_exact: + set --enable-rect-partitions=1 and --min-partition-size=16; the comment there + documents this) and hammer 6x with EC_AV1_GATE_DUMP self-pin + (/tmp/claude-1000/rect-flake-N.obu) — new mismatches: pin + localize via the + report's ladder (recon dump → range ladder ours[k]=aom[k+1] → EC_AV1_TELL). + (d) full lib suite. +5. Sweep HORZ_B's top strip (same class, latent): its arm should build the strip's + stack as 32x16 too once find_mv_stack is rect-capable — flip it and confirm the + 3 warp pins + ii pins stay byte-exact (they contain HORZ_B). +6. Add rect-flake-1 to the pinned test's default fixture list ONLY once it passes. + +## Done criteria +1. rect-flake-1 byte-exact; free gate un-clamped green 6/6 (or new pins + localization + for anything beyond HORZ/VERT scope, refusing by name is fine for HORZ_A etc.); + 12-fixture pin list green; lib suite green. +2. Committed to lane-rect2 (wip commits as you go — commit after EVERY green + milestone); REPORT lanes/rect-r2.report.md, verdict FIRST line. +If the full ctx audit cannot finish: land find_mv_stack rect-capability + the pin +green + arms still refusing the residue you did not audit, report what is left. diff --git a/lanes/rect-r2.report.md b/lanes/rect-r2.report.md new file mode 100644 index 00000000..f456c8a6 --- /dev/null +++ b/lanes/rect-r2.report.md @@ -0,0 +1,38 @@ +# lane-rect r2 report + +VERDICT: PASS — HORZ/VERT decode for real; rect-flake-1/2/3 byte-exact; free gate un-clamped 6/6; 14-pin list green; lib 220/0. + +## What landed (lane-rect2, on f9f9767) +- c5b21ad/faadb91 (builder): find_mv_stack bw4/bh4 split; grid.set stamps the true + rect footprint; HORZ/VERT arms resurrected from 4782e57. +- 20f93eb: motion_mode/obmc CDFs gain BLOCK_16X32/32X16 rows (class + cdf-row-held-constant). +- 64a20c7 (rect-flake-1, 4 root causes): MiInfo.size_h everywhere (col scans step + and weight by it); find_samples/find_projection true dims (warp samples at the + neighbour's real center); obmc_blend per-pass caps + overlap (above=write_h/2, + left=write_w/2); tx_h_grid so deblock horizontal edges gate on tx HEIGHT + (1-px chroma seam). HORZ_B top strip flipped to a true (BLOCK, SUB) 32x16. +- 6d5c75d (rect-flake-2): scan_row/scan_col weight `inc` must min by the + candidate's CROSS axis (libaom mi_size_high in the row scan, mi_size_wide in + the col scan) — all 4 sites (single + compound). Square candidates hide it; a + 32x16 strip above tied weights, reordering DRL entry 1 and suppressing the -5 + extended row scan. EVIDENCE: aom EC_DRL w0=688 w1=672 + EC_ROWSCAN + row_offset=-5 weight=2 vs our tie 688/688; pin byte-exact after. +- 441003d (rect-flake-3): overlappable_left stepped the vertical walk by the + neighbour's WIDTH; a 32x16 left strip swallowed the strip below it and rows + 48-63 blended strip1's OBMC prediction. EVIDENCE: recon diff exactly the + second strip's band, ranges exact everywhere. Class sweep: all other grid + walks step by the matching axis (mvstack 919/1577 + decode 4293/4404/4426 are + horizontal, correctly width-stepped). + +## Gates +- 14 pins green (warp-mismatch, warp-flake-5/7, ii-flake-1..3,5..9, + rect-flake-1/2/3) — EVIDENCE: default pin test inside lib run. +- Free-partition gate un-clamped (--enable-rect-partitions=1 + --min-partition-size=16): 6/6 with EC_AV1_GATE_DUMP self-pin armed. +- Full lib: 220 passed / 0 failed. + +## Residue +- HORZ_A/VERT_A/VERT_B/HORZ_4/VERT_4 still refuse by name (machinery is now + rect-capable; next lane). +- rect-flake-2/3 fixture .bak copies + /tmp dumps are scratch, not repo.