forge
Explore
Log in

Don't you dare go Hollow

lane-av1-444: 10-bit film regression fix -- sub8 group uv stamps gated !chroma_444 && !intra_chroma (port of lane-av1-cfl 7c6dad53); three same-class per-unit chroma re-stamps (decode_rect_split chroma_tiled, decode_block_rect64 bigger arm, read_inter_rect_chroma multi arm -> mu_chroma_units replay); report continuation 8 attribution corrected: both 10-bit film gates are THIS LANE's regression (fail at 1ad7e0fc/b9530604, pass on main 73f3ac64), now green

Browse files at this commit

f6ca882b18cbd5558887761bb379dd6fdef835aaAhmet Kaan GümüşParent: e44e6aa
Gates re-run on lane-av1-444-film (CARGO_TARGET_DIR=~/.cache/cargo-target-av1444film):
- a_10bit_128sb_film_frames_with_warp_cdef_and_interintra_decode_pixel_exact: ok (15 frames pixel-exact)
- a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach_decode_pixel_exact: ok (33 frames pixel-exact)
crates/ec-av1/src/decode.rsmodified+84 -7
@@ -10031,6 +10031,15 @@ fn decode_rect_split(
10031 // next block then read `dc_sign_ctx` 1 where libaom reads 0). They are10031 // next block then read `dc_sign_ctx` 1 where libaom reads 0). They are
10032 // collected here and replayed after that record.10032 // collected here and replayed after that record.
10033 let mut ll_chroma_units: Vec<((usize, usize), usize, Grid)> = Vec::new();10033 let mut ll_chroma_units: Vec<((usize, usize), usize, Grid)> = Vec::new();
10034+ // The chroma_tiled arm below stamps each unit's coefficient context
10035+ // immediately (so the NEXT unit reads it), then the whole-strip
10036+ // `record_split_luma_rect_mi` rewrites every chroma cell with ONE
10037+ // whole-strip state and the per-unit DC signs and levels are lost
10038+ // (class `override-slot-on-one-arm`). The units are collected here and
10039+ // replayed after that record, the way the lossless arm's
10040+ // `ll_chroma_units` and `decode_inter_block`'s `mu_chroma_units` tail
10041+ // already do.
10042+ let mut tiled_chroma_units: Vec<((usize, usize), usize, Grid, usize, usize)> = Vec::new();
10034 let ac = m.alpha.map(|_| cfl_src_rect(px, py, bw, bh));10043 let ac = m.alpha.map(|_| cfl_src_rect(px, py, bw, bh));
10035 let reach = block_reach;10044 let reach = block_reach;
10036 let (u_grid, v_grid) = if mono(fctx) {10045 let (u_grid, v_grid) = if mono(fctx) {
@@ -10179,6 +10188,13 @@ fn decode_rect_split(
10179 levels10188 levels
10180 };10189 };
10181 neighbours.record_mi_chroma(cu_mi, luma_span_x, luma_span_y, plane_idx, &levels);10190 neighbours.record_mi_chroma(cu_mi, luma_span_x, luma_span_y, plane_idx, &levels);
10191+ tiled_chroma_units.push((
10192+ cu_mi,
10193+ plane_idx,
10194+ levels.clone(),
10195+ luma_span_x,
10196+ luma_span_y,
10197+ ));
10182 last[plane_idx - 1] = levels;10198 last[plane_idx - 1] = levels;
10183 }10199 }
10184 }10200 }
@@ -10270,6 +10286,9 @@ fn decode_rect_split(
10270 for (cu_mi, plane, unit) in &ll_chroma_units {10286 for (cu_mi, plane, unit) in &ll_chroma_units {
10271 neighbours.record_mi_chroma(*cu_mi, 8, 8, *plane, unit);10287 neighbours.record_mi_chroma(*cu_mi, 8, 8, *plane, unit);
10272 }10288 }
10289+ for (cu_mi, plane, unit, span_w, span_h) in &tiled_chroma_units {
10290+ neighbours.record_mi_chroma(*cu_mi, *span_w, *span_h, *plane, unit);
10291+ }
10273 neighbours.fill_skip_grid_rect((mi_r, mi_c), bw / MI, bh / MI, m.skip);10292 neighbours.fill_skip_grid_rect((mi_r, mi_c), bw / MI, bh / MI, m.skip);
10274 neighbours.fill_lf_grid_rect((mi_r, mi_c), bw / MI, bh / MI, tx_w as u8, tx_h as u8, 0, fctx);10293 neighbours.fill_lf_grid_rect((mi_r, mi_c), bw / MI, bh / MI, tx_w as u8, tx_h as u8, 0, fctx);
10275 if crate::envflags::env_flag!("EC_AV1_TRACE") {10294 if crate::envflags::env_flag!("EC_AV1_TRACE") {
@@ -13320,6 +13339,13 @@ fn decode_block_rect64(
13320 let bigger = nw * nh > 1;13339 let bigger = nw * nh > 1;
13321 let mut u_levels = vec![0i32; chroma_w * chroma_h];13340 let mut u_levels = vec![0i32; chroma_w * chroma_h];
13322 let mut v_levels = vec![0i32; chroma_w * chroma_h];13341 let mut v_levels = vec![0i32; chroma_w * chroma_h];
13342+ // The tiled units below stamp their own coefficient context
13343+ // immediately, then the whole-strip `record_rect` rewrite paints
13344+ // every chroma cell with ONE whole-strip state and the per-unit DC
13345+ // signs and levels are lost (class `override-slot-on-one-arm`, same
13346+ // shape as `decode_rect_split`'s chroma_tiled clobber). Collected
13347+ // here and replayed after that record, the c8 `mu_chroma_units` way.
13348+ let mut tiled_chroma_units: Vec<((usize, usize), usize, Grid, usize, usize)> = Vec::new();
13323 for plane_idx in 1..=2 {13349 for plane_idx in 1..=2 {
13324 for cu_row in 0..nh {13350 for cu_row in 0..nh {
13325 for cu_col in 0..nw {13351 for cu_col in 0..nw {
@@ -13387,11 +13413,24 @@ fn decode_block_rect64(
13387 (mi_r + cu_row * (lsy / MI), mi_c + cu_col * (lsx / MI)),13413 (mi_r + cu_row * (lsy / MI), mi_c + cu_col * (lsx / MI)),
13388 lsx, lsy, plane_idx, &levels,13414 lsx, lsy, plane_idx, &levels,
13389 );13415 );
13416+ tiled_chroma_units.push((
13417+ (mi_r + cu_row * (lsy / MI), mi_c + cu_col * (lsx / MI)),
13418+ plane_idx,
13419+ levels.clone(),
13420+ lsx,
13421+ lsy,
13422+ ));
13390 }13423 }
13391 }13424 }
13392 }13425 }
13393 }13426 }
13394 neighbours.record_rect(at, bw, bh, mode, uv_predict_mode, &[&luma_levels[..], &u_levels[..], &v_levels[..]]);13427 neighbours.record_rect(at, bw, bh, mode, uv_predict_mode, &[&luma_levels[..], &u_levels[..], &v_levels[..]]);
13428+ // The per-unit re-stamp: `record_rect` above wrote the whole strip's
13429+ // chroma cells from the assembled grids' one whole-strip state,
13430+ // overwriting exactly the stamps the tiled loop just made.
13431+ for (cu_mi, plane, unit, span_w, span_h) in &tiled_chroma_units {
13432+ neighbours.record_mi_chroma(*cu_mi, *span_w, *span_h, *plane, unit);
13433+ }
13395 hit!(RECT_COEFF_HITS);13434 hit!(RECT_COEFF_HITS);
13396 }13435 }
13397 let (py_size, py_colors) = palette_y.as_ref().map_or((0, [0u16; 8]), |p| (p.size, p.colors));13436 let (py_size, py_colors) = palette_y.as_ref().map_or((0, [0u16; 8]), |p| (p.size, p.colors));
@@ -19704,12 +19743,19 @@ fn read_inter_rect_chroma(
19704 mode_for_tx: usize,19743 mode_for_tx: usize,
19705 luma_tx_type: TxType,19744 luma_tx_type: TxType,
19706 fctx: &crate::decode::FrameCtx,19745 fctx: &crate::decode::FrameCtx,
19707-) -> Result<(Grid, Grid)> {19746+) -> Result<(Grid, Grid, Vec<((usize, usize), usize, Grid, usize, usize)>)> {
19708 let (uw, uh) = (write_chroma_w.min(32), write_chroma_h.min(32));19747 let (uw, uh) = (write_chroma_w.min(32), write_chroma_h.min(32));
19709 let (nx, ny) = (write_chroma_w / uw, write_chroma_h / uh);19748 let (nx, ny) = (write_chroma_w / uw, write_chroma_h / uh);
19710 let multi = nx * ny > 1;19749 let multi = nx * ny > 1;
19711 let set = rect_inter_chroma_set(uw, uh)?;19750 let set = rect_inter_chroma_set(uw, uh)?;
19712 let mut assembled: [Vec<i32>; 2] = [Vec::new(), Vec::new()];19751 let mut assembled: [Vec<i32>; 2] = [Vec::new(), Vec::new()];
19752+ // The multi-unit stamps below are rewritten by the caller's whole-block
19753+ // record (`record_rect_mi`/`record_split_luma_rect_mi` write ONE
19754+ // whole-block chroma state, class `override-slot-on-one-arm`). The
19755+ // block tail's square-mu derivation cannot express a non-square strip's
19756+ // units, so the TRUE units travel back for the tail's `mu_chroma_units`
19757+ // replay (the c8 re-stamp, at the strip's own tiling).
19758+ let mut units: Vec<((usize, usize), usize, Grid, usize, usize)> = Vec::new();
19713 if multi {19759 if multi {
19714 hit!(CHROMA_SPLIT_TX_HITS);19760 hit!(CHROMA_SPLIT_TX_HITS);
19715 assembled = [19761 assembled = [
@@ -19760,6 +19806,7 @@ fn read_inter_rect_chroma(
19760 let start = (cu_row * uh + rr) * chroma_side + cu_col * uw;19806 let start = (cu_row * uh + rr) * chroma_side + cu_col * uw;
19761 dst[start..start + uw].copy_from_slice(&cu_grid[rr * uw..][..uw]);19807 dst[start..start + uw].copy_from_slice(&cu_grid[rr * uw..][..uw]);
19762 }19808 }
19809+ units.push((cu_mi, plane_idx, cu_grid, span_x, span_y));
19763 } else {19810 } else {
19764 assembled[plane_idx - 1] = embed_rect_grid(&cu_grid, uw, uh, chroma_side);19811 assembled[plane_idx - 1] = embed_rect_grid(&cu_grid, uw, uh, chroma_side);
19765 }19812 }
@@ -19767,7 +19814,7 @@ fn read_inter_rect_chroma(
19767 }19814 }
19768 }19815 }
19769 let [ug, vg] = assembled;19816 let [ug, vg] = assembled;
19770- Ok((Grid::Own(ug), Grid::Own(vg)))19817+ Ok((Grid::Own(ug), Grid::Own(vg), units))
19771 }19818 }
19772 19819
19773 /// [`read_inter_plane`] for a rectangular transform unit (lane-inter4 r2):19820 /// [`read_inter_plane`] for a rectangular transform unit (lane-inter4 r2):
@@ -28296,6 +28343,12 @@ fn decode_inter_block(
28296 let mode_for_tx;28343 let mode_for_tx;
28297 let uv_predict_mode;28344 let uv_predict_mode;
28298 let (luma_grid, u_grid, v_grid);28345 let (luma_grid, u_grid, v_grid);
28346+ // The rect_tu arms' chroma helper returns its TRUE per-unit coefficient
28347+ // context stamps (see `read_inter_rect_chroma`); they are appended to
28348+ // `mu_chroma_units` below so the block tail replays them after the
28349+ // whole-block record. `mu_chroma`'s own square-mu derivation cannot
28350+ // express a non-square strip's units.
28351+ let mut rect_chroma_units: Vec<((usize, usize), usize, Grid, usize, usize)> = Vec::new();
28299 let block_filter;28352 let block_filter;
28300 let ref_frame_for_lf;28353 let ref_frame_for_lf;
28301 let globalmv_for_lf;28354 let globalmv_for_lf;
@@ -29509,7 +29562,7 @@ fn decode_inter_block(
29509 } else if rect_tu {29562 } else if rect_tu {
29510 // One chroma read for the whole strip at 4:2:0, two29563 // One chroma read for the whole strip at 4:2:0, two
29511 // 32-capped units at 4:4:4 -- see the helper.29564 // 32-capped units at 4:4:4 -- see the helper.
29512- (u_grid, v_grid) = read_inter_rect_chroma(29565+ (u_grid, v_grid, rect_chroma_units) = read_inter_rect_chroma(
29513 dec,29566 dec,
29514 cdfs,29567 cdfs,
29515 neighbours,29568 neighbours,
@@ -30892,7 +30945,7 @@ fn decode_inter_block(
30892 } else if rect_tu {30945 } else if rect_tu {
30893 // One chroma read for the whole strip at 4:2:0, two30946 // One chroma read for the whole strip at 4:2:0, two
30894 // 32-capped units at 4:4:4 -- see the helper.30947 // 32-capped units at 4:4:4 -- see the helper.
30895- (u_grid, v_grid) = read_inter_rect_chroma(30948+ (u_grid, v_grid, rect_chroma_units) = read_inter_rect_chroma(
30896 dec,30949 dec,
30897 cdfs,30950 cdfs,
30898 neighbours,30951 neighbours,
@@ -31794,7 +31847,7 @@ fn decode_inter_block(
31794 // the partial right superblock read row 1 where libaom reads row 2). The31847 // the partial right superblock read row 1 where libaom reads row 2). The
31795 // units are collected here and re-stamped after that record, in mu-chunk31848 // units are collected here and re-stamped after that record, in mu-chunk
31796 // order so a later unit still wins over an earlier one.31849 // order so a later unit still wins over an earlier one.
31797- let mu_chroma_units: Vec<((usize, usize), usize, Grid, usize, usize)> = if mu_chroma {31850+ let mut mu_chroma_units: Vec<((usize, usize), usize, Grid, usize, usize)> = if mu_chroma {
31798 // lane-lossless2: the unit is TX_32X32 (one per 64x64 mu chunk)31851 // lane-lossless2: the unit is TX_32X32 (one per 64x64 mu chunk)
31799 // normally and TX_4X4 on a lossless frame, where the whole chroma31852 // normally and TX_4X4 on a lossless frame, where the whole chroma
31800 // plane block is a raster of them.31853 // plane block is a raster of them.
@@ -31859,6 +31912,9 @@ fn decode_inter_block(
31859 } else {31912 } else {
31860 Vec::new()31913 Vec::new()
31861 };31914 };
31915+ // The rect_tu strips' true units (`read_inter_rect_chroma`'s return):
31916+ // replayed by the same loop below, after the whole-block record.
31917+ mu_chroma_units.extend(rect_chroma_units);
31862 // libaom `av1_reset_entropy_context` / `av1_set_entropy_contexts`:31918 // libaom `av1_reset_entropy_context` / `av1_set_entropy_contexts`:
31863 // `nplanes = 1 + (num_planes - 1) * xd->is_chroma_ref` -- a block that is31919 // `nplanes = 1 + (num_planes - 1) * xd->is_chroma_ref` -- a block that is
31864 // NOT the chroma reference of its 4:2:0 pair codes no chroma transform at31920 // NOT the chroma reference of its 4:2:0 pair codes no chroma transform at
@@ -32608,7 +32664,20 @@ fn decode_inter_sub8_split4(
32608 // block's `get_intra_edge_filter_type` must see that SMOOTH_H left32664 // block's `get_intra_edge_filter_type` must see that SMOOTH_H left
32609 // neighbour, not the DC_PRED this stamp used to paint over it). So the32665 // neighbour, not the DC_PRED this stamp used to paint over it). So the
32610 // group-level stamp runs only where the 4:2:0 group unit is real.32666 // group-level stamp runs only where the 4:2:0 group unit is real.
32611- if !chroma_444 {32667+ //
32668+ // 4:2:0 "real" means the group unit was painted by the INTER arm below:
32669+ // when the chroma-reference sub-block was INTRA, that leaf's own tail
32670+ // ([`decode_intra_sub8_leaf`]) already recorded the group cell with its
32671+ // real `uv_predict_mode` -- possibly a SMOOTH mode the next block's
32672+ // chroma edge filter must see. The 444 delta's unconditional
32673+ // `!chroma_444` stamp ran after it and painted DC over the mi-exact
32674+ // cell, so every later chroma block read `intra_edge_filter_type` 0
32675+ // where libaom (and the pre-delta tree) read 1 -- 188 chroma ops of the
32676+ // gm_small_side witness flipped their smooth flag and 10-bit film
32677+ // frames mismatched ffmpeg by +-1..7 (class
32678+ // `override-slot-on-one-arm`, this lane's own 10-bit film gate
32679+ // regression at 1ad7e0fc; port of lane-av1-cfl's 7c6dad53).
32680+ if !chroma_444 && !intra_chroma {
32612 neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED);32681 neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED);
32613 }32682 }
32614 // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map32683 // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map
@@ -33883,7 +33952,15 @@ fn decode_inter_sub8_rect2(
33883 // over an intra piece's real `uv_mode` and the next block's33952 // over an intra piece's real `uv_mode` and the next block's
33884 // `get_intra_edge_filter_type` lost the smooth neighbour (same class as33953 // `get_intra_edge_filter_type` lost the smooth neighbour (same class as
33885 // [`decode_inter_sub8_split4`]'s tail, frame 19 of the fixture).33954 // [`decode_inter_sub8_split4`]'s tail, frame 19 of the fixture).
33886- if !chroma_444 {33955+ // 4:2:0 needs the same second half as the split twin: the stamp must run
33956+ // only when the group unit was painted by the INTER arm below. When the
33957+ // chroma-reference sub-block was INTRA, its own
33958+ // [`decode_intra_sub8_leaf`] tail recorded the group cell with the real
33959+ // `uv_predict_mode`, and this DC stamp ran after it and flattened the
33960+ // mi-exact cell (class `override-slot-on-one-arm`, this lane's own
33961+ // 10-bit film gate regression at 1ad7e0fc; port of lane-av1-cfl's
33962+ // 7c6dad53).
33963+ if !chroma_444 && !intra_chroma {
33887 neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED);33964 neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED);
33888 }33965 }
33889 // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map33966 // lane-t900 r23 (class [[new-map-ignores-tile-edge]]: a neighbour map
lanes/av1444.report.mdmodified+17 -7
@@ -250,13 +250,23 @@ shown frames byte-exact vs ffmpeg AND aomdec (three-way sha256
250 the documented kill-child/drain/isolated-rerun protocol).250 the documented kill-child/drain/isolated-rerun protocol).
251 - `a_10bit_128sb_film_frames_with_warp_cdef_and_interintra_...` and251 - `a_10bit_128sb_film_frames_with_warp_cdef_and_interintra_...` and
252 `a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach_...`252 `a_10bit_film_frames_with_small_side_globalmv_and_rect_warp_reach_...`
253- — PRE-EXISTING at the parent commit b9530604 (reproduced in a throwaway253+ — ATTRIBUTION CORRECTED (2026-09-24, lane-av1-444-film): the earlier
254- base worktree, identical failures), i.e. silent regressions from254+ "pre-existing at b9530604" line above was WRONG — the reviewer reran
255- continuations 5-7's shared-code changes that rounds 5-7 never caught255+ all three trees and these two gates FAIL at 1ad7e0fc and b9530604 but
256- because the 10-bit film arms were not rerun. 1920x792 10-bit films,256+ PASS on main 73f3ac64 and fork 7f8d6cf6. They are THIS LANE's
257- scattered reconstruction-level diffs; fix-now deferred to a dedicated257+ regression, and continuation 7 had already diagnosed the mechanism:
258- 10-bit-film round (they are outside this lane's 444 arm list; the258+ the 444 delta moved the sub8 group tails'
259- named 10-bit SQUARE witness passes).259+ `record_uv_mode_mi(gr, gc, 2, 2, DC_PRED)` to a bare `!chroma_444`
260+ gate, which at 4:2:0 stamps DC over an INTRA chroma-reference piece's
261+ real `uv_predict_mode` (continuation 7's trace: pieces 12/11/9/12 at
262+ (42,54..55) wiped to 0) and drops the next block's chroma intra-edge
263+ filter (class `override-slot-on-one-arm`). 1920x792 10-bit films,
264+ scattered +-1..7 reconstruction diffs. FIXED on lane-av1-444-film:
265+ both stamps gated `!chroma_444 && !intra_chroma` (port of
266+ lane-av1-cfl's 7c6dad53), plus three same-class per-unit chroma
267+ re-stamps (decode_rect_split chroma_tiled, decode_block_rect64
268+ bigger arm, read_inter_rect_chroma multi arm) matching the in-tree c8
269+ `mu_chroma_units` pattern.
260 All named regression gates green in this run and the witness table:270 All named regression gates green in this run and the witness table:
261 4:2:2 refused (`a_non_420_subsampled_sequence_header_is_refused_by_name271 4:2:2 refused (`a_non_420_subsampled_sequence_header_is_refused_by_name
262 ok`), qmatrix refused, cdf gates, mono 60f, reelb_* 10-bit — all `ok`.272 ok`), qmatrix refused, cdf gates, mono 60f, reelb_* 10-bit — all `ok`.