forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

av1422a2a4.report.md8.5 KiBHistoryRawDownload

lane/av1422a2a4 — Re-measure the refused 4:2:2 hunt streams A2 and A4 on current main

Base: efd1adf0 (the lane/av1422ibctxsel merge). Worktree: /home/user/.cache/wt/av1422a2a4, private target $HOME/.cache/tgt-av1422a2a4. No re-encode: both pinned shas verified before any work.

1. Re-measurement (disposition of the two named streams)

Fixture bytes verified this turn, both sha256-match the charter:

stream sha256 size our verdict (pre-fix) ffmpeg aomdec
A2 1a165ef9d3d040a5ed29bd2cf41a16178f6cdd44dfff1b5f5596cb993118953b 4567 B OK, 4/4 frames, byte-exact both oracles OK 4 frames OK 4 frames
A4 e680b6386a8a3a961f45424dfe7a8b7faa0e43789cce38eb92f4264af20e036e 30937 B REFUSED mid-tile, same subsize string OK 2 frames OK 2 frames

The pair-rule fix that closed E6/E7 also un-refused A2 on this main: A2 now decodes all 4 frames byte-exact against ffmpeg rawvideo yuv422p AND against aomdec --rawvideo. Geometry from the sequence header (384x288 8-bit 4:2:2), not the filename. Report-only per the charter: A2 reaches no arm beyond the ones already gated (chroma422_square/chroma422_rect counters already covered by committed pins) — not pinned.

A4 is the E6/E7 class: both oracles decode the same bytes to completion (2 shown frames, 344064 B raw); we refused mid-tile with

a block size 4x8, 8x16 or 16x4 (or 8x4 at 4:4:0) has no chroma plane block at
this frame's subsampling mode (libaom: "Block size %dx%d invalid with this
subsampling mode", av1/decoder/decodeframe.c:1456, refusing by the same rule)

i.e. a desync symptom, not an invalid shape (oracle rule re-read from ~/.cache/aom-oracle/src/av1/common/common_data.c av1_ss_size_lookup[1][0]: 4x8 IS invalid at 4:2:2 — our predicate table is faithful; libaom simply never selects that subsize on a synced decode).

Liveness control for the zero/count claims: the compare oracle is ffmpeg; the A4 verdict moved REFUSED→byte-exact after the fix, and the pinned gate's pixel compare reads ours.len() == 3 frames (2 shown + 1 hidden alt-ref) and asserts every plane against ffmpeg — a flipped oracle sample moves that assert by construction (the assert names frame/plane/sample on mismatch; exercised by the two mutation proofs below, each red with a Y-plane sample mismatch).

2. A3 (charter's compare-only extra)

/home/user/.cache/av1422ibcrect/A3.obu exists. It decoded on the old tree; on this main it decodes 4/4 frames and is byte-exact against both oracles (ffmpeg and aomdec). No divergence, so compare-only stands; no edit, no pin (its arms are the square-chroma ones the A1/A2 class already covers).

3. Class sweep (bounded to the two named directories)

Every *.obu in /home/user/.cache/av1422ibcrect/ and /home/user/.cache/ibcrect-hunt/ was decoded with the pre-fix probe and grepped for refusals: A4 is the only file in either directory refused with that string (and the only refusal of any kind). 183 files executed, 0 other refusals. Nothing else to disposition.

4. Localization (first wrong symbol)

Both decoders' partition walks agree for the first 36 symbols (byte-identical (mi, bsize, value) prefix, sha256-equal). The divergence at symbol 37 (32x32 partition at mi(40,16): ours HORZ vs oracle NONE) is downstream — the decoder tell had already drifted +963 bits. Rung-by-rung (skill ec-av1-first-symbol-divergence):

  • The (32,0) and (32,8) intrabc var-tx trees match the oracle value-for-value (EC_VARTX/EC_VARTXCTX pairing; the earlier apparent ladder fork was instrument asymmetry — the oracle's EC_VARTX rung prints bitpos, not rng, so those reads were invisible to the rng ladder. Every printed symbol still matched → the desync lives in the coefficient phase.)
  • EC_TRACE_COEFF ladders (deduped rng, SequenceMatcher): the last long equal block ends at ours[40646]/aom[40596] — inside the mi(32,16) intrabc block's own var-tx tree. Read 1 (root, txfm_split=1 ctx=8) matches; read 2 (sub-unit 16x16 at (32,16) row0col0) is the first wrong symbol: ours ctx=10, oracle ctx=9, both reading is_split=0 from different CDF rows.

EC_VARTXCTX operand pairing at that read: oracle above=16 left=16; ours above=16 left=8. The left operand is left_txfm[32] — the TXFM_CONTEXT band cell for mi row 32, col band of the tree's sub-unit — written by the PREVIOUS block (the 32x32 intrabc at mi(32,8)).

That block's tree (both sides): split root, 8x8 leaves at (0,0)+(0,4), 16x16 leaves at (4,0)+(4,4). Per-leaf publication leaves left_txfm[32..35] == 16 (the 16x16 leaves' height). Our decode wrote 8: two blanket writes ran AFTER the tree:

  1. decode_block's tail set_txfm_ctxs (decode.rs:24545, the lane-t900 r32 arm): wrote logical_tx = leaves[0].2 = 8 over the whole footprint, resetting left_txfm[32..35] 16→8. libaom's parse_decode_block tx branch (decodeframe.c:1227-1236) is an EITHER/OR: the var-tx branch publishes per leaf via txfm_partition_update and NEVER calls set_txfm_ctxs.
  2. decode_block's tail fill_lf_grid (publishing variant): same overwrite via the deblock-grid publish.

Result: the next tree's sub-read at (32,16) took txfm_partition_ctx 10 where libaom takes 9 — the frame's first divergent read — and the desync surfaced ~30 partition symbols later as the 4x8 subsize refusal at the leaf-8 walk (guard site decode.rs:37719, 8x8 VERT at 4:2:2). The subsize guard itself is honest and was NOT weakened.

Function ownership: the fix site is decode_block's tail publication, NOT decode_intrabc_owned_rect (which this lane never touched).

5. Fix

crates/ec-av1/src/decode.rs, decode_block tail — both blanket publishes gated on the intrabc var-tx tree NOT having run:

  1. set_txfm_ctxs arm: if allow_intrabc && !(intrabc_leaves.is_some() && …len() > 1).
  2. fill_lf_grid arm: when intrabc_leaves.is_some(), call fill_lf_grid_rect_after_vartx (deblock grid only, no TXFM band publish) — the helper lane-av1oddheightfork3 introduced for exactly this class.

allow_intrabc && keeps the intra-only-frame behavior byte-identical (no allow_intrabc ⇒ the set_txfm_ctxs write was already a no-op restatement of what the grid did; now it simply does not run, and record_intrabc_mi follows unchanged). A single-leaf tree (len 1) still publishes — libaom's "unsplit" tree is one leaf covering the block, and the per-leaf publication wrote exactly the block's own size there, so both spellings agree; measured, A4's three trees stay correct with this predicate.

6. Gate + non-vacuity (mutation proofs)

Fixture pinned: crates/ec-av1/fixtures/422_intrabc_vartx_mixedtree_a4.obu (30937 B, sha256 e680b6…036e, FNV-1a64 0x6f0fc77c2217910a — asserted in the gate). Provenance: aomenc profile 2, testsrc2 128x112 tiled 2x2 = 256x224, cq 30, 3 frames (prior report §2 recipe, stream A4).

Gate: the_pinned_422_intrabc_vartx_mixedtree_witnesses_decode_pixel_exact (stream.rs) — asserts size + FNV fingerprint, decodes via the crate's own 4:2:2 pipeline, and asserts every plane byte-equal to ffmpeg (yuv422p).

Red-before, one hunk at a time (each mutation rebuilt, gate re-run, reverted):

  • Mutation 1 (set_txfm_ctxs re-armed): test result: FAILED. 0 passed; 1 failed — panicked at stream.rs:9755 (Y-plane sample mismatch vs ffmpeg).
  • Mutation 2 (fill_lf_grid publish re-armed): test result: FAILED. 0 passed; 1 failed — same site.

Green after restore. Scoped runs (post-fix tree):

  • cargo test -p ec-av1 --lib -- the_pinned_422 → 8 passed, 0 failed.
  • cargo test -p ec-av1 --lib -- intrabc → 29 passed, 0 failed, 1 ignored (pre-existing ignore, untouched).
  • cargo test -p ec-av1 --lib -- vartx → 5 passed, 0 failed.

7. Final byte-exact sweep (fixed binary, all four hunt streams)

stream decode vs ffmpeg yuv422p
A1 4 frames EXACT
A2 4 frames EXACT
A3 4 frames EXACT
A4 3 frames (2 shown + hidden alt-ref) EXACT

A4 also byte-exact against aomdec --rawvideo (verified after the fix: the 344064-byte raw dumps compare equal).

8. Commit

One commit on lane/av1422a2a4: the two decode.rs hunks, the pinned fixture (force-added; fixtures is gitignored, crate pins negated in .gitignore), and this report. No env-gated probe committed (the temporary above/left operand print in read_var_tx_size's EC_ISTEP line was reverted before commit; all tracing used pre-existing EC_* flags). No EC_AV1_ALLOW_422_PROBE anywhere. decode_intrabc_owned_rect untouched.