forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to lanes/av1dcunit.report.mdClear filter

2026-09-30

lane-av1dcunit: record that scripts/pin-gate-audit.py cannot see this gate familyAhmet Kaan Gümüş · d06d31f
lane-av1dcunit: record that scripts/pin-gate-audit.py cannot see this gate family

The audit recovers a pin name only from a literal "/fixtures/..." string, a
crate_pin("X")/pin_dir().join("X") call, or a 3+-item list. The whole r512
family (both pre-existing gates and this lane's two) builds its path as
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join(format!("fixtures/{FILE}"))
off a const FILE, so the audit reports total=9/22 names, uncommitted=0 and
exits 0 -- a true pass for what it inspects and a silent gap for this family.

Recorded as not-done item 6 rather than fixed: widening the detector is its
own change with its own self-test (see scripts/pin-gate-audit.py's
raw-string/embedded-source self-test, lane-av1pinselftest) and belongs in a
lane that owns the audit. The fnv1a64 asserts in both new gates are the real
pin check and they do execute.
4:4:4 2x1/1x2 chroma grids: each unit takes its OWN above-right reachAhmet Kaan Gümüş · e4e6f93
4:4:4 2x1/1x2 chroma grids: each unit takes its OWN above-right reach

The ticket's headline defect -- a 4:4:4 64x64 square block whose 64x64 chroma
plane block is a 2x2 Chroma32 grid, second unit reconstructing its sibling's
flat DC -- was ALREADY FIXED on main by e05a6ceb ("4:4:4 2x2 chroma walk: window
the intra-BC/palette override per unit", merged 2c0fd2b9 at 02:12), 15 minutes
AFTER lanes/av1chromarect-r2.report.md was merged with numbers measured on the
older base 5324a685. `git merge-base --is-ancestor e05a6ceb 5324a685` is false.
This commit does not redo that fix; it re-measures it (below) and fixes the one
cell of the class sweep that was still broken.

Also: the ticket's stated mechanism is wrong for this witness. The seed is
skip=1 on an INTRA-BC block, and libaom never sends an intra-BC block through
av1_predict_intra_block at all. decodeframe.c:1146 folds is_intrabc_block into
inter_block_tx; decodeframe.c:847 predict_inter_block -> :676
dec_build_inter_predictor calls dec_build_inter_predictors ONCE per plane with
bw = xd->plane[plane].width (decodeframe.c:686-688), i.e. the whole chroma
plane block, and reconinter_template.inc:228 makes the intra-BC reference the
destination buffer itself. So the prediction is one whole-plane-block motion
copy with no per-unit DC and no per-unit above/left; the units are then
reconstructed in place on top of it. The crate's whole-plane-block PALETTE_PRED
override IS that copy, and PlaneBuf::reconstruct (decode.rs:20939/21087) uses
the buffer it is handed as the UNIT's own chroma_tx x chroma_tx_h prediction --
which is what e05a6ceb's chroma_window fixes.

RE-MEASURED HERE (mutation M1: chroma_window back to the whole buffer, gate
a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit):

  test result: FAILED. 0 passed; 1 failed
  frame 0 plane U first divergence at sample 229728 of 262144 (x=352, y=448),
  7488 samples wrong

  f0  Y 0 | U 7488  | V 8128      f1  Y 0 | U 22571 | V 41782
  f2  Y 0 | U 0     | V 0        total 79969 of 2359296
  seed [320,384)x[448,512)  U 864/2048  V 1024/2048  first (352,448)
  victim [448,512)x[448,512) U 4096/4096 V 4096/4096 first (448,448)
  f0 U y=448, x=320..512 step 16:
    oracle 241 239 202 202 202 202 203 165 166 166 166 166
    ours   241 239 241 239 202 202 202 202 175 175 171 171

  AFTER the fix: 0 wrong on Y, U and V of all three frames, 0 of 2359296, and
  0 in all three named regions. Pin unchanged, already committed:
  fixtures/r512.obu, 6948 B, sha256 f587f0f980f149abce905e3ef66f2f1634f050c854
  30626eafb9c30a1e25bc21.

  (Correction to the ticket: [384,448)x[448,512) is NOT a clean control under
  this defect -- 1664 U and 1984 V wrong, first (416,448). What r2 measured was
  that its EDGE samples are all ~202, so any DC rule reproduces it; its pixels
  still move because an intra-BC block's reference is the current frame's own
  reconstruction.)

THE CLASS SWEEP, and the cell this commit fixes. Three sites walk a 4:4:4
chroma plane block as Chroma32 units:

  1 decode_block skip arm   (21897) 2x2  window: chroma_window (e05a6ceb)  reach: tu_reach_rect OK
  2 decode_block coded arm  (22182) 2x2  window: palette_window           reach: tu_reach_rect OK
  3 decode_rect_split       (12721) 2x1/1x2/2x2  window: palette_window   reach: BLOCK reach  <-- WRONG

Sites 1 and 2 can never be 2x1/1x2: a square luma block has
chroma_side == chroma_height at every supported subsampling and chroma_tx ==
chroma_tx_h, so cn_cols == cn_rows always. A 2x1/1x2 needs a rect luma block,
which only site 3 walks -- and it passed the BLOCK reach to every unit.

libaom resolves has_top_right PER TRANSFORM UNIT (defined reconintra.c:196,
called from av1_build_intra_predictors at reconintra.c:1847 with the chroma txb
walk's own blk_col/blk_row). The row_off == 0 arm is
`col_off + top_right_count_unit < plane_bw_unit`, so the FIRST unit of a 2-wide
grid reads its above-right out of the already-reconstructed block ABOVE even
when the block's own right edge is the frame's. PlaneBuf::edges (decode.rs:
20840) truncates the above row at own_across when above_right is false, so a
directional unit with angle < 90 (need_right, intra.rs:546) predicted from a
32-sample above row where libaom used 64.

NEW WITNESS fixtures/r512_rect2x1_1x2_444.obu, 2697 B, sha256 a009ec580a1ff
24250be53e11b8d09616da71e095cefd5eb621c941d40a8688b (recipe in the gate's doc
comment): 4:4:4 8-bit 256x256, one key frame, reaching BOTH shapes -- a 64x32
chroma plane block as nw=2 nh=1 of 32x32 and a 32x64 one as nw=1 nh=2.

  RED-BEFORE, per plane, own compare script over EC_AV1_FINAL_DUMP:
    f0  Y 0 wrong   U 130 wrong   V 30 wrong   (of 65536 per plane)
  All 160 sit in the right 6 columns of the cu=(0,0) unit at mi=(48,48)
  px=(192,192). Oracle vs ours for that unit:
    EC_PRED     mi_row=48 mi_col=48 plane=1 row_off=0 col_off=0 txw=32 txh=32
                mode=1 p_angle=84 n_top=32 n_left=32 n_tr=32 n_bl=-1 bsize=11
    EC_PREDOUT8 sum=172662  row0=179,185,190,195,197,198,197,194
    OUR_PRED    sum=171512  row0=[179,185,190,195,197,198,197,194]
  row0 and col0 match exactly and only the SUM differs, so the residual read is
  bit-identical and the divergence is prediction-side, not entropy. Same 130/30
  wrong in the oracle's EC_AV1_PREFILT_DUMP as in EC_AV1_FINAL_DUMP, so it is
  pre-loop-filter. The U per-column delta -1,-5,-9,-14,-18,-19 grows rightward,
  which is a directional prediction reaching further right as it goes.

THE FIX: one expression, both unit readers in that walk (the square read_plane
and the rect push_intra_rect) get the unit's own reach, from the crate's
EXISTING per-unit port -- the same call sites 1 and 2 already use:

  let cu_reach = tu_reach_rect(bw, bh,
      (cu_col * uw) << ss_x(fctx), (cu_row * uh) << ss_y(fctx),
      uw << ss_x(fctx), uh << ss_y(fctx),
      reach, px, py, y.width, y.height, fctx);

AFTER: 0 wrong on all three planes.

GATES, both aomdec-oracle with no silent skip, counters asserted before a
single sample is compared:

  a_444_rect_strip_chroma_tiled_2x1_and_1x2_units_take_their_own_above_right_reach
    asserts >= 4 units in a 2x1 grid AND >= 4 in a 1x2 grid, >= 1 unit whose
    per-unit reach differs from the block's, then full byte-exactness of all
    three planes. Pin fnv1a64 0x2751ccaa079cc422.
  a_444_rect_strip_chroma_tiled_1x2_palette_grid_decodes_byte_exact
    the UV-PALETTE cell lanes/av1chromadc.report.md section 5 left explicitly
    UNMEASURED ("its arm of the sweep is argued from the shared code path, not
    witnessed"). Pin fixtures/r512_rect1x2_444_palette.obu, 2250 B, sha256
    fad03c69087f316c1a117e8d8a70769d161b332bce7b2998e646312bb78fb067, which
    puts a UV-palette block on a 1x2 16x64 chroma grid at mi=(32,12).

MUTATION: M1, both readers back to the block reach -- RED at sample 49374
(x=222, y=192), 130 samples wrong. M2, cu_col/cu_row transposed -- GREEN, and
that is a real limit of the gate, not a pass: this witness's second/bottom
units sit flush against the frame edge, so the Reach clamp truncates the extra
reach back to nothing. The gates pin the reach VALUE, not the offset spelling;
no claim is made about the spelling.

CLASS SWEEP, all 19 set_palette_pred sites: every one is already windowed per
unit (12633, 12784, 16685, 16955, 21953/21975) or is a genuine single-unit read
where the whole buffer IS the window (decode_block_rect 15378/15396/15559/15607,
decode_leaf_rect 15996/16014/16175/16220, decode_block_rect4 16825/16859 which
loops PLANES of a 4x4 block). The one unwindowed site inside a unit loop,
decode.rs:12525's 4:2:2 (4,8) units, is unreachable -- both
chroma_422_pair_wide and chroma_422_oob require ss_x == 1 && ss_y == 0, the
4:2:2 that stream.rs:1783 refuses by name.

RE-QUOTES. cargo check -p ec-av1 --all-targets: 0 errors, 0 warnings.
  a_444 lossless_444 intrabc_rect 444_lossless 420_intrabc_rect4
    ok. 39 passed; 0 failed; 0 ignored  (4:4:4-lossless, intrabc_rect, 4:2:0 twin)
  rect intrabc ibc chroma 444 420 subsampl, once per tree, private target dir:
    base 70ed5601 (detached)  ok. 145 passed; 0 failed; 5 ignored; 623 filtered out
    this tip                  ok. 147 passed; 0 failed; 5 ignored; 623 filtered out
  The delta is exactly these two gates (775 tests on both trees by --list). No
  test renamed, dropped or newly ignored; no floor lowered anywhere.

Report: lanes/av1dcunit.report.md. NOT DONE is listed there in six items, the
first being that the 2x1/1x2 offset spelling is unproven (M2).