forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on ddb5bef7b455cd95b15033d675d18fd41d526127

2026-08-28

feat(av1): port the DIFFWTD masked-compound blend (comp_group_idx==1), wedge still refusedAhmet Kaan Gümüş · ddb5bef
feat(av1): port the DIFFWTD masked-compound blend (comp_group_idx==1), wedge still refused

diffwtd_mask/blend_masked_compound in mc.rs, algebraically re-derived onto
this crate's unbiased predict_compound_intermediate domain (libaom's
round_offset bias cancels exactly in both the mask diff and the blend
weight sum, proven in the doc comments -- no offset bookkeeping needed).
Both comp_group_idx==1 decode.rs sites now build+apply the real blend for
COMPOUND_DIFFWTD; COMPOUND_WEDGE still refuses by name (wedge codebook out
of r2 scope per the charter's mergeable-partial fallback). Fixed a real
latent bug while wiring this in: compound_idx was read unconditionally,
missing libaom's comp_group_idx==0 outer gate (dead code before this round
since the masked path always errored earlier).

Gate a_real_aomenc_stream_with_masked_compound_decodes_pixel_exact flipped
to hard assert (masked_compound_hits() > 0) with DIFFWTD refusals now
forbidden; hammered 8/8 green, zero pixel mismatches. Full ec-av1 lib
suite: 220 passed, 0 failed, 17 ignored.
test(av1): masked-compound gate zero-hit run soft-skips instead of failing the default suiteAhmet Kaan Gümüş · 7aa15de
test(av1): masked-compound gate zero-hit run soft-skips instead of failing the default suite

aomenc RD nondeterminism can leave a whole attempt window without a
comp_group_idx==1 block; that run proves nothing and must not flake the
suite. r2 flips this to a hard assert when the blend lands.
wip(av1): consume compound_type/wedge_idx/wedge_sign/mask_type on masked compound (comp_group_idx==1); blend still refusedAhmet Kaan Gümüş · 09ba66a
wip(av1): consume compound_type/wedge_idx/wedge_sign/mask_type on masked compound (comp_group_idx==1); blend still refused

lane-maskcomp r1. Syntax entropy-exact per libaom decodemv.c 1634-1656:
compound_type (COMPOUND_WEDGE/COMPOUND_DIFFWTD), then wedge_index+wedge_sign
or mask_type. New CDF tables (COMPOUND_TYPE, WEDGE_IDX) wired through the
4-site checklist (cdf.rs default, cdf_state.rs field/init/reset_counts).
Prediction (wedge/diffwtd mask blend) is NOT ported -- both refusal sites
still return Err, now after consuming the symbols and naming the blend as
the gap. New gate a_real_aomenc_stream_with_masked_compound_decodes_pixel_exact
+ MASKED_COMPOUND_HITS proves the syntax fires without desyncing surrounding
blocks (pixel-exact matches every non-masked-compound attempt). All 11
existing pins + full ec-av1 --lib suite unaffected.
feat(av1): rect/ab free-partition gate; localize real coverage gapAhmet Kaan Gümüş · a3f46bc
feat(av1): rect/ab free-partition gate; localize real coverage gap

New gate lets aomenc pick a free partition instead of every prior gate's
pinned min=max=32. Finding: charter's "extended partitions landed" premise
was wrong -- decode_frame's inter-tile match only handles NONE/SPLIT/HORZ_B;
HORZ/VERT/HORZ_A/VERT_A/VERT_B/HORZ_4/VERT_4 all correctly refuse (no silent
miscoding). Empirically swept 3 recipes (120 aomenc attempts); no decode
defect found, only a genuine 7-of-10-partition-type coverage gap plus an
aomenc-side --enable-1to4-partitions=0 quirk (doesn't suppress VERT_4).
Diversity counter added but its assertion shipped soft, not a hard panic,
since PARTITION_HORZ_B never fires for this fixture regardless of clamp
(confirmed against the already-green warp gate too). ec-av1 lib 219/0.

Details in lanes/rectgate-r1.report.md.
feat(av1): decode non-wedge interintra prediction; fix warp-sample interintra exclusion; reset switchable_interp CDF counterAhmet Kaan Gümüş · a5a10f4
feat(av1): decode non-wedge interintra prediction; fix warp-sample interintra exclusion; reset switchable_interp CDF counter

- interintra syntax (flag -> 4-ary mode -> wedge flag, wedge==1 stays a
  named refusal) + non-wedge smooth blend (II_DC/V/H/SMOOTH, ii_weights1d,
  all planes) on the 16/32 single-ref path and the 8x8 leaf
- interintra blocks record ref_frame1 = INTRA_FRAME(0) in the mi grid so
  find_samples/num_proj_ref exclude them (libaom av1_findSamples requires
  ref_frame[1] == NONE_FRAME); mvstack ref-diff scan guards rf1 > 0
- ii-flake-9: switchable_interp was the one Cdfs field missing from
  reset_counts -- unreset counter saturated past 15 reads and slowed the
  adaptation rate to >>5 while libaom (per-frame counter reset,
  av1_reset_cdf_symbol_counters) stays >>4; rows drifted a few counts and
  the gate flaked on read-dense streams. Field-list audit: no other gap.
- new gate a_real_aomenc_stream_with_interintra_decodes_pixel_exact
  (interintra refusals forbidden, hits counter asserted); pinned-stream
  test extended to 11 fixtures (ii-flake-1..9)

Evidence: 11/11 pins byte-exact; interintra gate 12/12 hammer clean
(hits 11-22 per run); warp gate 3/3; ec-av1 lib 218 passed / 0 failed.
chore(av1): interintra r1 charterAhmet Kaan Gümüş · 1f0e385Browse files
Merge branch 'lane-warp': WARPED_CAUSAL decode lands; interp-read suppression (warp + skip_mode), mvstack entry clamping, extended inter partitionsAhmet Kaan Gümüş · d45c7f8
Merge branch 'lane-warp': WARPED_CAUSAL decode lands; interp-read suppression (warp + skip_mode), mvstack entry clamping, extended inter partitions

Warp leaves the named-refusal list: av1_findSamples/num_proj_ref, 3-symbol
motion_mode, affine projection + filter, and av1_is_interp_needed's
conditional-read contract are ported. Three pinned aomenc streams decode
24/24 byte-exact; warp gate flipped to must-decode (10/10 sweeps clean);
ec-av1 lib 217/0; workspace gate 148/148. Root-cause chain and verification
in lanes/warp-r5*.report.md + lanes/warp-verify.report.md.
fix(av1): clamp every mvstack entry, not just the derived nearest/near pairAhmet Kaan Gümüş · 569067b
fix(av1): clamp every mvstack entry, not just the derived nearest/near pair

libaom av1_find_mv_refs clamps each stack entry after the build; the NEWMV
predictor is the DRL-selected ENTRY, so a left neighbour coded past the
frame edge (col 520 in pinned warp-flake-5.obu) predicted unclamped where
libaom used 384 -- an mv drift with IDENTICAL entropy (same diff symbols,
range ladder exact at every partition read) surfacing as +-1 warp rounding
crumbs in a hidden altref, inherited by shown frames (V-plane assert).
Both builders (single + compound). All three warp pins green.

class: value-equal narrowing drift (neighbour-votes-all-its-fields family);
localization = part-read range ladder exact -> prediction-side, then
EC_MV pred diff vs patched aomdec.
fix(av1): suppress the interp-filter read for skip_mode compound blocksAhmet Kaan Gümüş · 497de2d
fix(av1): suppress the interp-filter read for skip_mode compound blocks

Same conditional-read contract as the WARPED_CAUSAL fix one commit back:
av1_is_interp_needed==0 for skip_mode, libaom derives Regular. Our compound
path read 1-2 switchable_interp symbols on every skip_mode block; range
ladder on pinned warp-flake-7.obu decode-16 diverged inside its B01
skip_mode block (part-read rng 45276 exact, next part 46380 vs 44416).
Fixes pinned warp-flake-7 (frame 15 luma); original warp pin stays green.
Also: part32_pre range trace under EC_AV1_TRACE (inert).

class: symbol-consumption-gap (conditional-read side).
feat(av1): flip the warp gate to must-decode; r5e reportAhmet Kaan Gümüş · 8d5c79f
feat(av1): flip the warp gate to must-decode; r5e report

refuses-or-matches -> warp refusals forbidden, matched>0 and
warp_selected_hits>0 required (non-warp capability refusals still skip).
KNOWN: cross-run encoder non-determinism observed (warp_selected_hits
156/103 across identical-seed sweeps) and one run caught a seed-66
frame-13 mismatch -- flake hunt with EC_AV1_GATE_DUMP in flight; a caught
stream becomes the next pin.
fix(av1): suppress the interp-filter read for WARPED_CAUSAL blocksAhmet Kaan Gümüş · de81760
fix(av1): suppress the interp-filter read for WARPED_CAUSAL blocks

warp r5e ROOT CAUSE of the pinned mismatch chain (r3-r5e): libaom's
av1_is_interp_needed derives the filter (Regular) instead of reading
switchable_interp symbols when motion_mode == WARPED_CAUSAL -- keyed on the
SYMBOL value, not projection validity. Our single-ref path only suppressed
for GLOBALMV, so a warped block consumed 1-2 extra symbols and every read
after it drifted: the hidden no-show altref (decode-order 13, display 23)
desynced at its last 32x32 (phantom HORZ_B partition value=5 where libaom
reads NONE), corrupting the stored ALTREF; shown frames 13+ then inherited
the garbage through zero-mv skip compound copies -- the pin's 'frame 13
luma' failure (class gate-blind-to-hidden-frames, exactly).

Localized with libaom examples/inspect ground truth (display frame 13 quad
(1,1) = 32x32 NEAREST_NEARESTMV zero-mv skip; hidden altref = four 32x32s
incl. NEWMV WARPED_CAUSAL skip at mi(8,0)) vs our EC_AV1_TRACE: B00/B01/B10
symbol-exact, divergence at B11's partition_w32.

EVIDENCE: pinned_warp_stream_decodes_pixel_exact 24/24 pixel-exact vs
ffmpeg, green twice, warp_selected_hits 0->1; ec-av1 lib suite 217 passed
0 failed.

class: symbol-consumption-gap (conditional-read side: a symbol READ that the
reference DERIVES is the same drift as an unread bit).
chore(av1): warp r5c charterAhmet Kaan Gümüş · 714fd00Browse files
wip(av1): warp r5b UNVERIFIED trial -- HORZ_B bottom-leaf coords to mi convention (r32*2+1)Ahmet Kaan Gümüş · e7c9731
wip(av1): warp r5b UNVERIFIED trial -- HORZ_B bottom-leaf coords to mi convention (r32*2+1)

Behavior-neutral on the pin (frames 1-12 pass before and after; frame-13 fail
is intra-walk, untouched). r5b flash builder capped out before verifying and
misreported the worktree clean; committed by orchestrator, adjudication owed.
wip(av1): warp r5 -- extended inter partitions (HORZ_B/VERT_A/VERT_B) implemented; pin refusal GONE, decodes 24/24, frame-13 luma mismatch remains (intra path, quadrant (1,1), unrelated to warp)Ahmet Kaan Gümüş · d57b460
wip(av1): warp r5 -- extended inter partitions (HORZ_B/VERT_A/VERT_B) implemented; pin refusal GONE, decodes 24/24, frame-13 luma mismatch remains (intra path, quadrant (1,1), unrelated to warp)

flash builder round, HANDOFF at tool cap; determination: refusal was case (b),
the pinned aomenc stream really uses extended partition types. Frames 1-2 (the
only frames with warp blocks) PASS. charter lanes/warp-r5.charter.md.
wip(av1): EC_WARP_DEBUG sample dump -- MAJOR REFRAME, mismatch predates warpAhmet Kaan Gümüş · 3a8a953
wip(av1): EC_WARP_DEBUG sample dump -- MAJOR REFRAME, mismatch predates warp

lane-warp round 4, budget-capped stop.

DECISIVE INSTRUMENT (r3's planned next move): added EC_WARP_DEBUG-gated
printf at libaom's av1_find_projection call site (decodemv.c ~1546/1637,
local /tmp/libaom-src checkout, not this repo) dumping mi_row/mi_col,
findSamples' pts/pts_inref, and the resulting wmmat/alpha/beta/gamma/delta;
matching EC_WARP_DEBUG eprintln added here (decode.rs ~5579, in the leaf16
WARPED_CAUSAL arm) dumping our own find_samples/find_projection output at
the same call site. Rebuilt aomdec (decoder-debug preset), ran both sides
on the pinned warp-mismatch.obu fixture.

RESULT: the warp math itself is NOT provably at fault this round -- the
sample coordinates and even the resulting wmmat matched in shape (x/y
sample values identical: pts=(120,-136) both sides), consistent with r3's
line-audit finding warp.rs's arithmetic faithful.

MAJOR REFRAME: cross-referencing libaom's unconditional EC_TRACE
(decodemv.c:1717, fires every inter block, no env gate) against our own
EC_AV1_TRACE (decode.rs:5655, leaf16 only) for the WHOLE 24-frame stream
shows only two real (non-degenerate-skip) content frames exist in decode
order: frame index 1 (ref=LAST_FRAME) and a much later frame (ref=
GOLDEN_FRAME, where WARP_SELECTED_HITS actually fires). ffprobe confirms
this stream has NO reordering (pict_type P for all 23 inter frames, no
hidden altref) -- decode order IS display order, so "frame 1" in the
pinned test's mismatch report is the LAST_FRAME frame, NOT the GOLDEN/warp
frame several frames later. The warp block (mi_row=8,mi_col=0 in libaom's
real stream, motion_mode=2) fires on a frame that is never even reached
by the time the test's assert_eq fails at i=1.

Concretely, on frame index 1 (LAST_FRAME, all four 32x32 leaves):
  libaom: (0,0) skip=0 NEARESTMV mv=(0,0); (0,8) skip=1 NEARESTMV mv=(0,0)
    motion_mode=0 (SIMPLE_TRANSLATION, overlappable=1); (8,0) skip=1
    NEARESTMV mv=(0,0); (8,8) skip=1 NEWMV mv=(-32,0) motion_mode=1 (OBMC)
  ours:   (0,0) skip=0 mv=(0,0) is_new_mv=false [MATCHES]; (0,8) skip=1
    mv=(0,0) is_new_mv=false motion_mode_eligible=1 obmc_selected=1
    [DIVERGES -- we select OBMC, libaom does not]; (8,0) skip=0 mv=(24,0)
    is_new_mv=true [DIVERGES]; (8,8) skip=1 mv=(2,-2) ref=4 [DIVERGES,
    even ref_frame differs]

(0,0) matches on skip/mv/is_new_mv (mv=(0,0) is a trivial integer-pel
copy, so an interp-filter bug there is structurally inert regardless).
r3's ASCII diff mask ("small-magnitude errors, diagonal band, upper-left
half") is consistent with (0,0)'s own RESIDUAL/coefficient decode being
subtly off (skip=0, so real coefficients are coded) rather than any
motion-mode/OBMC/warp symbol bug -- a wrong coefficient desyncs the tile
exactly where we see it: (0,8)'s OBMC symbol reads a different value
than libaom's not because obmc_cdf/context is wrong, but because the bit
reader is already at the wrong position by the time it gets there.

NEXT ROUND'S FIRST MOVE: stop auditing warp.rs -- the fixture's frame-1
mismatch is provably upstream of any warp code. Verify (0,0)'s residual
path first: dump libaom's coefficient levels for this exact leaf (add an
EC_WARP_DEBUG-style printf in decodetxb.c/reconinter around the (0,0)
32x32 block's dequant+inverse-transform) vs our own dequant_and_inverse_
typed's existing EC_AV1_TRACE dequant printout (decode.rs ~1704,
"TRACE dequant plane=... levels=... residual=..."), same block. If levels
differ, it's a coefficient-context/EOB bug; if levels match but residual
differs, it's the inverse-transform/rounding chain. Once (0,0) round-trips
exactly, re-run the pinned test -- the warp block many frames later may
turn out to already be correct, or a fresh independent bug once the tile
is back in sync that far downstream.

Gate/test changes this round: none (only the env-gated debug eprintln in
leaf16's WARPED_CAUSAL arm, dead code on any non-diagnostic run). cargo
check -p ec-av1 --lib clean.

tmpfs: 65% at session start (not yet re-measured this round).
wip(av1): warp fixture found + decisive pinned mismatch -- COMPILING WIPAhmet Kaan Gümüş · fefaafb
wip(av1): warp fixture found + decisive pinned mismatch -- COMPILING WIP

lane-warp round 3, budget-capped stop.

Resolved r2's puzzle first: leaf8 (decode_inter_block8) STILL refuses
motion_mode==2 unconditionally (decode.rs ~6558) -- confirmed by direct
read, not inferred. The gate's fixture partition is forced to 32x32
(--min/max-partition-size=32), so leaf8 (an 8x8 leaf) is structurally
unreachable on that content; the puzzle's (a) was a red herring. The real
reason the warp gate reported "40 named refusals, 0 matches" is a
never-fired-instrument shape from a DIFFERENT angle: every one of the 40
attempts happens to *also* hit some other real, unrelated named refusal
(allow_screen_content_tools, partition-below-16x16, partition-type-never-
written, interintra, directional-chroma) before or regardless of whether
warp fires -- confirmed by instrumenting the gate to print every refusal
string and WARP_SELECTED_HITS (leaf16's counter): even the charter's own
--auto-alt-ref=1 --lag-in-frames=16 --enable-fwd-kf=0
--enable-ref-frame-mvs=0 recipe (already present in the gate, unlike r2's
guess) still gets swamped by aomenc's `gradients` synthetic content
tripping screen-content-tools detection at cpu-used=0. Widening the sweep
(new EC_WARP_GATE_ATTEMPTS env override, default 40) to 200 seeds found
warp firing 14-75 times per run (leaf16 exercised for real) but never
once producing a clean pixel-exact pass across two separate 200-seed
runs -- same seed set gave DIFFERENT refusal shapes on each rerun
(matches the documented aomenc-RD-nondeterminism class:
parallel-flake-is-attempt-selection), so the fixture itself isn't
reproducible by seed alone.

DECISIVE FIND: seed 49 (this run) decoded WITHOUT hitting any other named
refusal, warp fired exactly once (WARP_SELECTED_HITS 0->1), and frame 1
luma mismatched ffmpeg -- a real, isolated warp_affine/find_projection
bug, not a confound. Stream pinned to
$SP/warp-mismatch.obu (621 bytes, 64x64, 24 frames) and a new
`pinned_warp_stream_decodes_pixel_exact` #[ignore]d test added
(stream.rs) that re-decodes it deterministically (no aomenc/ffmpeg
re-encode) and dumps an ASCII diff mask on mismatch.

Diff shape: small-magnitude ('o', delta<4) errors spread across roughly
the frame's upper-left half in a diagonal band, not a sharply-bounded
single-block region of gross error -- consistent with a subtle
coefficient/rounding bug in the warp path rather than a wrong-block/
desync bug. Spent the rest of the round auditing warp.rs's math line by
line against av1/common/warped_motion.c and mvref_common.c: confirmed
FAITHFUL (no bug found yet) in find_affine_int's LS_MV_MAX inner-loop
gate, LS_SQUARE/LS_PRODUCT1/LS_PRODUCT2 shift constants (LS_MAT_DOWN_BITS
=2, >>4 matches), get_mult_shift_diag/ndiag (confirmed we use the
USE_LIMITED_PREC_MULT=0 -- i.e. simple Px*iDet + ROUND_POWER_OF_TWO_
SIGNED_64 -- branch, matching libaom's actual compiled path, not the
unused resolve_multiplier_64 branch), get_shear_params/av1_get_shear_
params (alpha/beta/gamma/delta derivation, WARP_PARAM_REDUCE_BITS
rounding, is_affine_shear_allowed bound), av1_warp_affine_c's whole
horizontal+vertical two-pass loop (offset_bits, reduce_bits, sx4/sy4
alpha/beta/gamma/delta stepping, tap-offset formula, final clip_pixel
formula) all transcribed correctly, and the DIV_LUT table's first ~20
entries spot-checked byte-identical.

NOT YET CHECKED / next round's first move: record_sample's row_offset/
col_offset sign conventions and find_samples' above/left/TL/TR traversal
order against av1_find_warp_samples in mvref_common.c (only structurally
skimmed, not line-audited) -- since every arithmetic primitive downstream
now checks out clean, a wrong *input sample* (wrong neighbour MV/position
recorded) is the next most likely place for a small-but-real numeric
error to originate. Also worth trying: print our own wmmat/alpha/beta/
gamma/delta for this pinned block and compare against libaom's
find_affine_int by adding a debug printf at the av1_find_projection call
site in decodemv.c (~1624) and rebuilding aomdec -- would immediately
localize the bug to sample-gathering vs. estimation vs. filtering without
more manual line-diffing.

Gate/test changes this round (stream.rs): EC_WARP_GATE_ATTEMPTS env
override on the refuse-or-match gate's seed count; dump-on-mismatch via
EC_AV1_GATE_DUMP added to that gate (previously missing); new pinned
`pinned_warp_stream_decodes_pixel_exact` test with ASCII diff-mask
eprintln on failure. cargo check -p ec-av1 --lib and --tests both clean,
0 errors/warnings-of-note (only pre-existing missing-doc lint noise).
Gate itself NOT flipped to require pixel-exact yet -- still legally
refuses-or-matches, correctly reflecting that warp is not yet proven
correct.

tmpfs at session start: 65% (11G/16G), not a blocker this round.
wip(av1): affine warp estimation + filter ported, wired into leaf16 -- COMPILING WIPAhmet Kaan Gümüş · efe3e65
wip(av1): affine warp estimation + filter ported, wired into leaf16 -- COMPILING WIP

lane-warp round 2, budget-capped stop. Step 0 (verify r1's alphabet-
selection change) ran clean first: warp/obmc(x2)/deblocking gates all
green on e886150 before touching anything -- no desync from r1's
num_proj_ref-gated 3-symbol motion_mode_cdf read.

Ported this round (new module crates/ec-av1/src/warp.rs):
- av1_findSamples in full: decode.rs's num_proj_ref (count-only) replaced
  by find_samples, which now also records each sample's own (pts1, pts2)
  1/8-pel coordinates (record_samples, mvref_common.c) -- num_proj_ref is
  now find_samples(..).len(), a pure refactor kept bit-identical (verified:
  both OBMC gates + the warp refuse-or-match gate still green after it).
- av1_selectSamples: MV-diff threshold filter (thresh = clamp(max(bw,bh),
  16, 112)), run only when num_proj_ref > 1, matching decodemv.c's own
  gate.
- find_affine_int + av1_get_shear_params -> find_projection: the full
  least-squares affine fit (LS_SQUARE/LS_PRODUCT1/LS_PRODUCT2, the 64-bit
  divisor-resolution div_lut, get_mult_shift_diag/ndiag) plus the shear
  decomposition/validity check (alpha/beta/gamma/delta, WARP_PARAM_REDUCE_
  BITS, is_affine_shear_allowed). Returns None on a singular fit or
  non-representable shear -- both spec fallback cases collapse to "use the
  block's own translational MV" at the call site, matching libaom's own
  wm_params.invalid handling (reconinter.c allow_warp: global warp is
  never the fallback here since this decoder's global motion is always
  IDENTITY).
- av1_warp_affine_c: the 8x8-tile, two-pass 8-tap affine filter
  (av1_warped_filter, 193 rows, transcribed verbatim from warped_motion.c),
  8-bit non-compound only (this decoder's warp arm only ever reaches a
  single-ref, non-skip-mode block, so conv_params->is_compound is always
  false on this path -- the compound/highbd branches are dropped).

Wired into decode_inter_block (the 16x16+ leaf) only: motion_mode == 2
no longer refuses by name. It computes samples via find_samples +
select_samples, calls find_projection, and when Some(params) overrides
the block's already-computed translational-MV prediction (pred_y/u/v)
with warp_affine's own output (luma subsampling 0/0, chroma 1/1, 4:2:0)
before the OBMC blend check (mutually exclusive with motion_mode==1).
When find_projection returns None, the existing translational-MV
prediction is left untouched -- exactly the spec's own invalid-warp
fallback.

NOT ported/wired this round (steps 5-6 remaining):
- decode_inter_block8 (the 8x8 leaf): STILL refuses motion_mode == 2 by
  name unconditionally -- warp.rs's functions are leaf16-only so far.
- The a_real_aomenc_stream_with_warped_motion_refuses_or_matches gate
  (stream.rs ~3255, "gradients" lavfi content, default aomenc flags) still
  reads "40 named refusals, 0 pixel-exact matches out of 40" after this
  round's wiring -- unchanged from before. NOT diagnosed within budget
  whether that's because (a) the gate's own content/encoder flags never
  actually reach a WARPED_CAUSAL-coded block on this decoder's supported
  path (matches the documented never-fired-gate class: gradients content +
  default flags is a different recipe from the charter's own
  --auto-alt-ref=1 --lag-in-frames=16 --enable-fwd-kf=0
  --enable-ref-frame-mvs=0), or (b) it does reach one and either
  find_projection legitimately returns None every time (falls back to
  translational, no visible difference), or hits some OTHER named refusal
  first (interintra, screen-content-tools, sub-16 partition -- all seen in
  the OBMC gate's own refusal list on identical content). WARP_SELECTED_HITS
  was not read back this round to disambiguate -- next round's first move.
- Gate itself not flipped to require pixel-exact + no self-pin added
  (step 6) -- premature until the above is diagnosed with real fire
  evidence.

cargo check -p ec-av1 --lib: clean, 0 errors. Verified green this round:
both OBMC gates (a_real_aomenc_stream_with_obmc_decodes_pixel_exact +
_obmc_8x8), a_real_aomenc_stream_with_warped_motion_refuses_or_matches
(still legally refuse-or-match, unchanged pass/fail shape). Deblocking
gate verified green at step 0 before any edit this round (unaffected by
this round's changes -- warp.rs is dead code on that path).

NEXT: read WARP_SELECTED_HITS after a run against the charter's own
aomenc flags (--auto-alt-ref=1 --lag-in-frames=16 --enable-fwd-kf=0
--enable-ref-frame-mvs=0, dims mult of 64) to get a real fire count
before touching leaf8 or the gate; wire decode_inter_block8 the same way
find_samples/select_samples/find_projection/warp_affine already support
(the bw4/bw/bh plumbing is generic, only the call site inside
decode_inter_block8's own motion_mode match needs the same three-call
sequence copied over).
wip(av1): WARPED_CAUSAL motion_mode alphabet + num_proj_ref -- COMPILING WIPAhmet Kaan Gümüş · bd6939d
wip(av1): WARPED_CAUSAL motion_mode alphabet + num_proj_ref -- COMPILING WIP

lane-warp round 1, budget-capped stop. Ported:
- cdf.rs/cdf_state.rs: MOTION_MODE 3-symbol CDF (default_motion_mode_cdf's
  square rows, spec 9.4), threaded into CdfState with reset/default wiring.
- decode.rs has_top_right + num_proj_ref: av1_findSamples reduced to its
  COUNT only (no pts/pts_inref) -- exactly what motion_mode_allowed needs
  to pick the 3-symbol motion_mode_cdf over the 2-symbol obmc_cdf
  (num_proj_ref >= 1 under allow_warped_motion). record_samples' actual
  sample coordinates are NOT ported (not needed for the alphabet choice).
- Wired into both decode_inter_block (16x16+) and decode_inter_block8: the
  old "any allow_warped_motion=1 eligible block refuses" is gone. Now: read
  the correct alphabet, OBMC arm unchanged, WARPED_CAUSAL arm (motion_mode
  == 2) still refuses by name (WARP_SELECTED_HITS counts it) since
  av1_find_projection (least-squares warp param estimation), the shear
  validity check, and the affine warp filter (warped_motion.c, spec
  7.11.3.3-.8) are NOT ported this round -- steps 2-4 of the r1 charter.

DYING WORDS -- exactly what's done/remaining against the charter's 6 steps:
1. DONE: 3-symbol motion_mode_cdf read + num_proj_ref-based eligibility
   (count only, both leaves).
2. PARTIAL: av1_findSamples' sample COUNT ported (has_top_right +
   num_proj_ref); record_samples (actual pts/pts_inref coordinates) and
   av1_selectSamples are NOT ported -- needed for step 3.
3. NOT STARTED: av1_find_projection/find_affine_int (warp parameter LS
   estimation) + av1_get_shear_params (shear validity).
4. NOT STARTED: av1_warp_affine_c (the 8x8-tile affine filter itself,
   warped_filter table, two-stage rounding chain).
5. NOT STARTED: wiring the warp filter into prediction (luma+chroma) at
   either leaf -- WARPED_CAUSAL still returns Err(unsupported(..)) instead.
6. NOT STARTED: flipping the a_real_aomenc_stream_with_warped_motion_
   refuses_or_matches gate to pixel-exact-required, or adding self-pin.
   NOT RUN this round either (budget) -- existing gate (refuse-or-match)
   should still pass unmodified since named refusals are still legal
   outcomes, but this was not verified live before the budget cap hit.

cargo check -p ec-av1 --lib --tests: clean, 0 errors (only pre-existing
missing-doc warnings). No test run this round -- budget spent on the port
itself, not verification. NEXT: verify the gate still green, then port
av1_findSamples' sample coordinates (needed for step 3 regardless of
whether find_projection lands the same round).
Merge branch 'lane-comppin': un-swap enable_interintra_compound/enable_jnt_comp at decode_stream call siteAhmet Kaan Gümüş · a370dc2
Merge branch 'lane-comppin': un-swap enable_interintra_compound/enable_jnt_comp at decode_stream call site

10-round compound-drift hunt closed: adjacent same-typed bools swapped at
one call site gated interintra reads on the jnt_comp bit and vice versa.
Pin sb128-compound-refs-flake.obu 24/24 byte-exact; full workspace gate
148 blocks green; compound_references/reference_select/deblocking gates
15x each, 0 flakes. class: adjacent-same-typed-args.
fix(av1): un-swap enable_interintra_compound/enable_jnt_comp at the decode_stream call siteAhmet Kaan Gümüş · 6e4ad30
fix(av1): un-swap enable_interintra_compound/enable_jnt_comp at the decode_stream call site

lane-comppin r10 (session-killed right after the fix compiled; orchestrator
ran the pin and commits). ROOT CAUSE of the 10-round compound-drift hunt:
decode_stream passed enable_interintra_compound and enable_jnt_comp to
decode_inter_frame_tile_with_cdfs in each other's parameter slots -- two
adjacent same-typed bools, so the compiler was silent. Every stream whose
sequence header set the two bits DIFFERENTLY gated the interintra read on
the jnt_comp bit (and compound_idx gating on the interintra bit): an extra
or missing symbol read, then silent bit-drift for the rest of the tile.
Streams with both bits equal decoded exactly -- which is why the gates
only flaked on some aomenc content and every earlier localization pointed
at a different downstream symbol.

VERIFIED: pin sb128-compound-refs-flake.obu now decodes 24/24 frames
byte-exact (was: frame 1+ all-plane drift accumulating to delta 60).
Also in this commit: EC_AV1_SEQDUMP + remaining EC_AV1_TELL range
checkpoints (env-gated instrumentation, inert when unset).

class: adjacent-same-typed-args -- a call site passing N same-typed flags
positionally can swap a pair without any compiler or roundtrip-test signal
(our own encoder does not exercise the decode_stream path's flag plumbing);
range-ladder bisection + the r9 compare-range-not-tell rule found it.
wip(av1): range-state ladder FALSIFIES r8's partition-CDF-skew theory; real divergence narrowed to block(0,0)'s own tail (interintra/motion_mode/ interp_filter/coeffs). Round 9, capped at budget.Ahmet Kaan Gümüş · 056185d
wip(av1): range-state ladder FALSIFIES r8's partition-CDF-skew theory; real
divergence narrowed to block(0,0)'s own tail (interintra/motion_mode/
interp_filter/coeffs). Round 9, capped at budget.

STEP 1 (the r8 caveat, resolved): dumped od_ec_dec's tell-offset math from
libaom entdec.c by hand -- od_ec_dec_init's own refill loop leaves
od_ec_dec_tell() at 1 immediately after init for this stream's tile
(3 bytes pulled into the window: cnt goes -15->-7->1->9, bptr advances 3,
tell = 3*8-9+(-14) = 1), while our SymbolDecoder::new's debug_bitpos()
sits at 15 after its own init read (f(15) always advances self.bit by 15).
That is a CONSTANT 14-bit baseline difference between the two tell()
implementations, not a per-symbol cost -- confirmed by measuring it at
FOUR independent checkpoints (post_is_inter, post_ref_frame,
post_assign_mv, each for two different blocks): every one showed exactly
tell_ours - tell_aomdec = 14. r8's "~15 more bits for the same two
partition symbols" was 100% tell-baseline accounting, not a CDF skew.
CLOSES the partition_w64/partition_w32 CDF-forwarding suspect from r8's
handoff -- no further investigation needed there.

STEP 2 (range-state ladder, the real proof): added `range=` to every TELL
checkpoint on both sides (ours: msac debug_state().0, decode.rs
block_entry/post_is_inter/post_ref_frame/post_assign_mv, new tile_init and
block_end checkpoints; aomdec: r->ec.rng on the mirrored decodemv.c TELL
lines, EC_PART, and the existing per-block EC_TOK line in
decodeframe.c's parse_decode_block, rebuilt at
/tmp/libaom-src/build/decoder-debug/aomdec). Range is representation-
independent (unlike tell/value, which differ by each decoder's own window
convention) so an exact range match is a hard sync proof, not a units
coincidence.

Result for the pin's frame-1 tile, block mi(0,0) (decode-order frame 1,
first real leaf, LAST_FRAME single-ref inter):
  tile_init:      ours range=32768  aomdec range=32768  MATCH
  post_is_inter:  ours range=54894  aomdec range=54894  MATCH
  post_ref_frame: ours range=52050  aomdec range=52050  MATCH
  post_assign_mv: ours range=50720  aomdec range=50720  MATCH  <- exact
  block_end:      ours range=33843  aomdec range=37806  MISMATCH

Every read up through and including assign_mv (partition x2, skip_mode,
skip, intra_inter, ref_frame, the whole MV/DRL path) is bit-for-bit,
range-for-range identical to aomdec on this stream. The FIRST real
divergence is strictly between post_assign_mv and block_end of THIS SAME
block -- i.e. inside decode_inter_block's tail: interintra gate/wedge,
motion_mode (OBMC/warped), interp_filter, or the block's own plane
coefficient decode (txb_skip/tx_type/coeffs for luma+chroma). It is NOT
a later block, NOT a CDF-forwarding artifact, and NOT (per r8, already
closed) the interintra eligibility gate's *logic* -- but the interintra
READ itself, motion_mode, interp_filter, and first-txb_skip are all now
back in scope as the concrete next checkpoints since the "same-value
skewed-cost" theory that ruled interintra out is dead.

Class for memory: `instrument-measures-itself` kin -- two independently-
implemented tell()/bit-position counters can disagree by a fixed
accounting constant (od_ec's window-refill bookkeeping vs a straight
consumed-bit counter) with zero relationship to real desync; RANGE is the
comparable quantity across two independent arithmetic-coder
implementations, TELL is not, unless first proven to share a baseline.

NEXT (round 10): checkpoint range after each of interintra-read,
motion_mode-read, interp_filter-read, and first txb_skip-read for block
mi(0,0) specifically (both sides -- aomdec's read_interintra_mode /
read_motion_mode / read_ref_mv_idx... / av1_read_frame_reference_mode
equivalents in decodemv.c, and decodetxb.c's very first coeffs call);
first range mismatch among those four names the element. TELL_AV1
checkpoints already left in place for all of block_entry/post_is_inter/
post_ref_frame/post_assign_mv/block_end (ours) and the mirrored
decodemv.c + decodeframe.c prints (aomdec, both range-augmented, rebuild
with `make -j12 aomdec` in /tmp/libaom-src/build/decoder-debug).

Repro: EC_AV1_TELL=1 EC_AV1_PIN=<pin> EC_AV1_PIN_N=24 cargo test -p ec-av1
--release --lib scratch_isolate_pinned_mismatch -- --ignored --nocapture
aomdec side: EC_AV1_TELL=1 /tmp/libaom-src/build/decoder-debug/aomdec
--codec=av1 -o /tmp/out.yuv <pin>.obu 2>&1 | grep -E "^TELL|^EC_PART|^EC_TOK"
(frame 1's block is the SECOND "bsize=15" cycle in the trace)
wip(av1): TELL-checkpoint ladder falsifies the r7 interintra suspect; real divergence is at the VERY FIRST partition symbol of frame 1's own tile, before any mode-info read. Round 8, capped at budget.Ahmet Kaan Gümüş · 206379a
wip(av1): TELL-checkpoint ladder falsifies the r7 interintra suspect; real divergence is at the VERY FIRST partition symbol of frame 1's own tile, before any mode-info read. Round 8, capped at budget.

Method (per symbol-consumption-gap class rule): added TELL checkpoints
(decode.rs, gated EC_AV1_TELL) at block_entry (decode_inter_block, right
before skip_mode), post_is_inter, post_ref_frame, post_assign_mv, mirrored
in /tmp/libaom-src/av1/decoder/decodemv.c (post_ref_frame, post_assign_mv)
-- av1/decoder/decodeframe.c already had an unconditional EC_PART/EC_PART_VAL
partition-read trace, reused as-is.

Result for the pin block (mi(0,0), decode-order frame 1, bsize=32):
  aomdec: EC_PART tell=1 (128-level, implicit split, 0 bits) -> EC_PART
  bsize=12(64x64) ctx=12 tell=1, EC_PART_VAL value=3(SPLIT) -> EC_PART
  bsize=9(32x32) ctx=8 tell=4, EC_PART_VAL value=0(NONE) -> mode info starts
  at tell=4, post_is_inter tell=5, post_ref_frame tell=7, post_assign_mv
  tell=15.
  ours: block_entry (i.e. after our own 64->32 partition read, same 2
  symbols: partition_w64 SPLIT then partition_w32 NONE, decode.rs:6984/7007)
  tell=19 already -- post_is_inter tell=19, post_ref_frame tell=21,
  post_assign_mv tell=29.

The frame is confirmed exactly 64x64 (EC_PART only ever visits
mi(0,0)/(0,8)/(8,0)/(8,8), one real 64x64 SB), so the 128-level implicit
split costing 0 bits on both sides is correct and NOT the gap (the
sb128 r1/r2 "not causal for 64x64x4" proof still holds for this file).
Both decoders read the SAME TWO real partition symbols with the SAME
decoded values (SPLIT then NONE) and reach the SAME leaf shape (side=32)
-- but ours costs ~15 more bits for those same two symbol VALUES than
aomdec does. A same-value, wildly different bit cost across the very
first two symbols read in the tile is the signature of a CDF-CONTENT
bug, not a missing/extra symbol read: either partition_w64[sb_ctx] or
partition_w32[ctx32]'s actual probability table entering this frame's
tile is badly skewed relative to aomdec's -- most likely explained by
this frame's own CDF *forwarding* from frame 0 (the preceding key
frame) carrying a wrong/stale partition CDF into frame 1, since a
freshly-initialized default CDF would decode the same value at
essentially the same cost aomdec's does.

This FALSIFIES the round 8 charter's primed suspect (the interintra
read at decode.rs:5391-5411): mv/ref/interintra/motion_mode/interp_filter
are all downstream of an interval that has already desynced by the time
`decode_inter_block` is even entered -- there is no still-unverified
syntax element to isolate there. `enable_interintra_compound`'s own gate
logic (BLOCK_8X8..=BLOCK_32X32, single-ref, SINGLE_INTER_MODE range) was
cross-checked against libaom's is_interintra_allowed/_bsize/_mode/_ref
and matches exactly -- CLOSE this suspect.

NEW PRIME SUSPECT for round 9: this frame's own partition_w64/partition_w32
CDF forwarding from the preceding key frame (Cdfs::forward or whatever
this crate's primary_ref_frame path calls) -- read cdf_state.rs's
forwarding code, diff the two partition CDF tables' actual byte values
entering frame 1's tile against libaom's own `cm->fc` right after
`av1_setup_frame_size`/`load_previous_frame_stats`/whatever gates the
CDF copy (decodeframe.c `read_uncompressed_header`'s primary_ref_frame
branch), NOT any single-block syntax read.

TELL checkpoints left in place under EC_AV1_TELL (decode.rs:
block_entry/post_is_inter/post_ref_frame/post_assign_mv) and libaom
decodemv.c (post_ref_frame/post_assign_mv) for round 9 to extend up
through the partition CDF dump itself.

Repro: EC_AV1_TELL=1 EC_AV1_PIN=<pin> EC_AV1_PIN_N=24 cargo test -p ec-av1
--release --lib scratch_isolate_pinned_mismatch -- --ignored --nocapture
wip(av1): msac symbol_fixed hand-verified correct; real desync is a switchable_interp read aomdec never performs for this block. Round 6, capped at budget.Ahmet Kaan Gümüş · 21c8320
wip(av1): msac symbol_fixed hand-verified correct; real desync is a switchable_interp read aomdec never performs for this block. Round 6, capped at budget.

COMPILES. No behaviour change: new EC_AV1_EOBPT_CDF-gated
`debug_state()`/eprintln! diagnostics only (msac.rs's new `pub(crate) fn
debug_state`, decode.rs's three new state prints in `read_coeffs` and
`read_eob`), same pattern as every prior round's instrumentation.

R6'S OWN PLAN'S STEP 1/2 (msac.rs correctness) IS NOW CLOSED, NEGATIVE:
hand-derived `symbol_fixed` (msac.rs:301-329) against libaom's actual
`od_ec_decode_cdf_q15` source (`/tmp/libaom-src/aom_dsp/entdec.c:204`,
read fresh this round, not from memory) term-by-term for nsyms=11
specifically -- `N = nsyms - 1`, loop increments `ret` before indexing
`icdf[++ret]`, `v = ((r>>8)*(icdf[ret]>>EC_PROB_SHIFT))>>(7-EC_PROB_SHIFT)
+ EC_MIN_PROB*(N-ret)`, loop continues `while (c < v)`. This is
algebraically IDENTICAL to our `cur = (((range>>8)*(f>>EC_PROB_SHIFT))
>>(7-EC_PROB_SHIFT)) + EC_MIN_PROB*(nsyms-1-symbol)`, loop `while value
< cur`. nsyms=11 is not special-cased anywhere in either implementation.
r5's suspicion (1) is FALSIFIED -- do not re-open without new evidence.

DECISIVE NEW EVIDENCE (this round's actual find): added a
`debug_state()` accessor to `SymbolDecoder` and printed `(range, value)`
before/after the `all_zero` (txb_skip) read, after the `tx_type` read,
and entering `eob_pt` -- then added the SAME state to aomdec's
`decodetxb.c` (`EC_AV1_EOBPT_STATE_IN`, plus `rng_before` on the
existing `EC_PLANE` trace). Result: **the coder state ALREADY diverges
before the `txb_skip` read even starts** -- ours enters at
`range=46855`, aomdec enters at `rng_before=50720`. So r5's "CDF +
symbol byte-identical at tx_type/eob_pt" was real but downstream of an
earlier, silent divergence; walking back from there:

Between `EC_MV` (motion vector, matches exactly: `mv=(-2,-8)` both
sides) and `EC_TXBCTX`/`EC_PLANE` (first plane's coeff decode), the ONLY
symbol read possible on this path is the switchable interpolation
filter (`resolve_interp_filter`, decode.rs:3726 / libaom's
`read_mb_interp_filter`, decodemv.c:1122). Ours takes the *real-symbol*
branch (`interp_fixed == None`, i.e. the frame header says
`interpolation_filter == Switchable`) and decodes `filter=[3, 3]`
(BILINEAR both directions) -- a real, adapting 3-symbol CDF read.
aomdec's own trace for this exact block (`mi_row=0 mi_col=0`, frame=14,
ref=1, mode=NEWMV=16) shows `interp=(0,0)` (REGULAR both directions)
with **no `IFILTER_DBG` line at all** -- confirmed by instrumenting
`av1_is_interp_needed()`'s own three sub-conditions directly
(`IFILTER_NEEDED ... skip_mode=0 motion_mode=0 mode=16 needed=1`): the
function returns TRUE (the read is not skipped by the gate), yet
`read_mb_interp_filter`'s OWN symbol-read branch never fires for this
block, which by its source (decodemv.c:1134,
`if (interp_filter != SWITCHABLE)`) is only possible if **libaom's own
per-frame `features->interp_filter` is a FIXED value for frame 14, not
`SWITCHABLE`** -- i.e. aomdec's `interpolation_filter` header field for
THIS frame differs from what our decoder computed.

CONCLUSION / R7 HANDOFF, IN ORDER:
1. This is very likely NOT an msac bug at all (closed, see above). The
   live suspect is `read_interpolation_filter()`
   (`ec-av1-syntax/src/frame.rs:1165`) or, more likely given the header
   bit-parsing there matches spec 5.9.10 exactly on inspection, a
   **frame-header/frame-index MISMATCH**: this pin's "decode-order frame
   1" may not be resolving to the same underlying temporal-unit frame
   aomdec calls its own "frame=14" -- ties back to f952bb4's
   already-flagged "hidden frame" suspicion from round 3, never fully
   closed. Confirm by dumping `header.interpolation_filter` (and ideally
   `show_frame`/`frame_type`/`order_hint`) for EVERY frame header our
   decoder parses in this stream, aligned against aomdec's own
   `cm->current_frame.frame_number` sequence (add an
   `EC_AV1_FRAME_NUMBER`-style eprintln! to `av1_read_coeffs_txb` or the
   frame-header decode point on aomdec's side, matching the counters
   already in place) -- find the first frame where the two disagree on
   `interpolation_filter`, and from there whether it's a genuine
   off-by-one in which OBU/frame our pin harness treats as
   "decode-order frame 1", or a real per-frame header field ours reads
   as `Switchable` when it should not.
2. If frame alignment IS correct and headers genuinely disagree on this
   field for the SAME frame: re-derive `read_interpolation_filter`
   against spec 5.9.10 word-for-word once more (looks correct on this
   round's read, but re-check the surrounding `allow_high_precision_mv`
   /`force_integer_mv` order just above it, frame.rs:963-968 -- an
   earlier misread bit could shift every subsequent header field by one
   bit position without desyncing the *tile* data at all, which is
   exactly the shape of "everything downstream of one header field
   looks locally consistent but globally wrong").
3. Once the true cause is found and fixed, re-run the pin
   (`EC_AV1_PIN_N=24`) for exactness, THEN full
   `cargo test -p ec-av1 --release` (not just `--lib`) per existing
   done-criteria -- a header-parsing fix is even more likely than an
   msac fix to touch every stream.
4. If the pin goes exact: run the three flaking gates 15x each
   (`compound_references`, `reference_select`, `deblocking`) and report
   pass counts honestly.

Instrumentation added this round, env-gated (no behaviour change when
unset): `SymbolDecoder::debug_state()` (msac.rs, `pub(crate)`, mirrors
the existing `debug_bitpos()`), three new `EC_AV1_EOBPT_CDF`-gated
state prints in decode.rs (`EC_AV1_STATE_BEFORE_TXBSKIP`,
`EC_AV1_STATE_AFTER_TXBSKIP`, `EC_AV1_STATE_AFTER_TXTYPE`). External,
not committed to this repo: `/tmp/libaom-src`'s
`av1/decoder/decodetxb.c` (`EC_AV1_EOBPT_STATE_IN`, `rng_before` on
`EC_PLANE`) and `av1/decoder/decodemv.c` (`IFILTER_NEEDED`, gated on the
pre-existing `EC_IFILTER_DBG`) -- rebuilt into
`/tmp/libaom-src/build/decoder-debug/aomdec`; this source tree is
outside the repo and NOT reproducible from a fresh checkout, note for
whoever runs r7 without the same `/tmp` state.

class: sibling of [[stale-premise-lanes]] -- r4 and r5 both suspected
mechanisms one level too deep (a table's forwarding, then a coder
primitive) because both were proven correct in isolation without first
walking the state itself backward to its true entry point; the actual
divergence sits one whole syntax element earlier (a per-block symbol
read that should not have fired at all), in territory ([[hidden frame]]
frame-index resolution) an even earlier round (f952bb4) already named
and left open.
wip(av1): FALSIFY r4's tx_type theory; decisive new lead -- raw eob_pt symbol off-by-one with byte-identical CDF and matching prior read. Round 5, capped at budget.Ahmet Kaan Gümüş · ea8acbf
wip(av1): FALSIFY r4's tx_type theory; decisive new lead -- raw eob_pt symbol off-by-one with byte-identical CDF and matching prior read. Round 5, capped at budget.

COMPILES. No behaviour change (two new EC_AV1_EOBPT_CDF-gated eprintln!
diagnostics only, both no-ops when the env var is unset -- same pattern
as EC_AV1_TRACE/EC_AV1_PREFILT_DUMP).

STEP 1 DONE (owed 3 rounds): self-pin-on-mismatch landed in the previous
commit (de8e7a5) for both compound-refs and reference-select gates.

STEP 2, R4'S CORE THEORY FALSIFIED: r4 believed `Luma32Inter`'s tx_type
symbol was spuriously read (spec forcing EXT_TX_SET_DCTONLY for every
tx_size_sqr >= TX_32X32) and that removing it would fix the pin. Re-read
libaom's own `av1_get_ext_tx_set_type` (blockd.h ~1097) closely: that
DCTONLY collapse is INTRA-only. For an INTER 32x32 block it returns
`EXT_TX_SET_DCT_IDTX` (2 symbols: IDTX, DCT_DCT) -- a REAL read, matching
this crate's existing `INTER_TX_TYPE_SET3_32` table exactly (confirmed
`av1_ext_tx_inv[EXT_TX_SET_DCT_IDTX] = {9, 0}`, our `from_symbol`'s
default arm agrees). `TxbSet::Luma32Inter`'s `Some(inter_tx_type_32)` was
right all along; r4's own doc comment at the site is now stale (still
says "REVERTED... pending a real fix" -- superseded by this commit, left
in place for the paper trail rather than rewritten under budget).

DECISIVE NEW EVIDENCE (rebuilt `/tmp/libaom-src`'s debug `aomdec` with a
new `EC_INTERTXTYPE_CDF`/`EC_INTERTXTYPE_RAWSYM` trace in
`decodemv.c`'s inter branch of `av1_read_tx_type` -- previously only the
intra branch printed its CDF/raw symbol; the inter branch's own read was
invisible to every earlier round's trace):

  block mi(0,0), decode-order frame 1 (aomdec's own `frame=14`), the
  32x32 luma tx_type read:
    aomdec CDF (icdf, decreasing) [32020, 0, 0]  ==  ours (increasing)
      [748, 32768, 0]  (32768-32020=748, exact match, confirms this
      crate's CDF-forwarding for `inter_tx_type_32` is byte-correct --
      the table is untouched since the keyframe never runs an inter
      block, so this is genuinely still spec-default 748, both sides)
    aomdec raw sym=1 (tell=15)  ==  ours: `TRACE tx_type value=1 len=3`
      -- EXACT MATCH, both sides decode the identical symbol here.

  Immediately after, the SAME block's `eob_pt` read (`eob_flag_cdf1024`,
  already libaom-traced via its pre-existing `EC_CDF`/`EC_TRACE` gates,
  no new instrumentation needed there):
    aomdec CDF (icdf) [26070, 24434, 20807, 17006, 12582, 8906, 5334,
      3442, 1686, 718, 0, 0]  ==  ours (converted, increasing)
      [6698, 8334, 11961, 15762, 20186, 23862, 27434, 29326, 31082,
      32050, 32768, 0] -- every entry is an EXACT complement
      (32768-aomdec[i] == ours[i]), proving `eob_pt_1024_luma`'s own
      CDF forwarding is ALSO byte-correct at this point.
    aomdec raw sym=4 (`eob_pt-1`, decodetxb.c's own `EC_CDF decoder2`
      trace)  vs  ours: `TRACE eob_pt value=6` (`group = dec.symbol()+1`,
      so our raw `dec.symbol()` returned 5) -- OFF BY EXACTLY ONE.

CONCLUSION: this rules out CDF forwarding, table selection, and the
tx_type read itself as the cause (all three now proven byte-identical
immediately before the divergent read). The remaining candidates are
narrower than r4 left them:
  1. `msac.rs`'s `symbol_fixed` (the shared decode primitive both this
     table AND every passing table in the suite go through) -- unlikely
     to be generically wrong given the suite's breadth, but not yet
     re-derived by hand against spec 8.2.6 for an 11-symbol read
     specifically (`EC_MIN_PROB * (nsyms - 1 - symbol)` term, `nsyms=11`
     here vs the far more common 2/3/5-symbol tables everywhere else --
     worth checking whether EC_MIN_PROB scaling or the loop's `cur`/`prev`
     arithmetic has an off-by-one that only bites at this width).
  2. A single bit's worth of unaccounted range/`rng` state consumed
     somewhere between the tx_type read's renormalisation and the
     eob_pt read's first comparison -- re-derive `self.range` and
     `self.value` by hand at both points (spec 8.2.6's exact
     `decode_symbol`) rather than trusting the CDF-value comparison
     alone; identical CDF does not guarantee identical `range`/`value`
     entering the read if renormalisation after tx_type diverged by even
     one bit.
  3. Cross-check against a THIRD implementation (dav1d, not just aomdec)
     for this exact eob_pt read to rule out an aomdec-side convention
     quirk in how it reports `symbol=eob_pt-1` (shared-oracle-blindness
     class) -- low priority, aomdec's own reported pixels already
     disagree with ours so it is very unlikely to be a reporting-only
     artifact, but worth naming as the fallback if (1)/(2) both clear.

R6 UPGRADE PATH, IN ORDER:
1. Hand-derive `symbol_fixed`'s loop against spec 8.2.6 for nsyms=11
   specifically, on paper, with the exact CDF values above -- confirm or
   rule out (1) before touching any code.
2. If (1) clears, add a temp `range`/`value` eprintln! (same
   EC_AV1_EOBPT_CDF gate) right after the tx_type read's renormalisation
   and diff against a matching `aom_reader`-internal trace (may need a
   THIRD aomdec rebuild exposing `r->ec.rng`/`r->ec.dif` at that exact
   point, decodetxb.c already prints `rng` via `EC_EOBPT`'s own
   `(unsigned)r->ec.rng` field -- reuse that, don't rebuild again if
   already sufficient) to find where the single bit goes missing.
3. Once found, the previous 16-test regression risk (r4's premise) does
   NOT apply here -- this is a decoder-primitive-level bug, not a
   table-selection one, so a correct fix should not regress any
   currently-green stream (they only pass today because a raw-symbol
   off-by-one at width 11 happens not to matter for their content, or
   they never exercise an 11-wide table with this exact adapted CDF
   shape -- re-run full `cargo test -p ec-av1 --release` after landing
   regardless, per the existing done-criteria).
4. Re-run pin (`EC_AV1_PIN_N=24`) only after (1)-(3) converge.

Instrumentation added this round, env-gated (no behaviour change when
unset): `EC_AV1_EOBPT_CDF` (decode.rs, prints `coding.eob_pt` right
before the read for size-12 tables, and `tx_type_cdf` right before the
read for size-3 tables). External, not committed to this repo:
`/tmp/libaom-src/av1/decoder/decodemv.c`'s new
`EC_INTERTXTYPE_CDF`/`EC_INTERTXTYPE_RAWSYM` (gated on `EC_TRACE2`,
mirrors the pre-existing intra-branch print) -- rebuilt into
`/tmp/libaom-src/build/decoder-debug/aomdec`, this source tree is
outside the repo and NOT reproducible from a fresh checkout; note this
for whoever runs r6 without the same /tmp state.

class: [[reference-layout-not-spec]]'s sibling in the opposite
direction -- r4 trusted a HALF-remembered spec rule (DCTONLY at
tx_size>=32) without checking the is_inter branch, and "fixed" a table
that was already correct; the actual defect turned out to be one level
deeper (the raw symbol decode itself) and only became visible once both
surrounding reads were proven byte-identical first. Lesson: prove the
INPUTS identical (CDF + prior symbol) before suspecting the higher-level
table/forwarding logic, not after.
wip(av1): self-pin-on-mismatch for compound-refs and reference-select gates (owed 3 rounds)Ahmet Kaan Gümüş · 69a575c
wip(av1): self-pin-on-mismatch for compound-refs and reference-select gates (owed 3 rounds)

Both gates now write the mismatching stream to a fixed
std::env::temp_dir() path (ec-av1-compound-refs-gate-fail.obu /
ec-av1-reference-select-gate-fail.obu) unconditionally inside the
mismatch branch, panic message includes the pin path -- same pattern
as the deblocking gate. EC_AV1_GATE_DUMP env var kept as an
additional opt-in dump target, unchanged. No behaviour change besides
the pin write + panic message text.
wip(av1): pre-filter dump pinned frame-1 desync to Luma32Inter's tx_type read; flip-to-None regressed 16 tests, reverted. Round 4, capped at budget.Ahmet Kaan Gümüş · a3dcb12
wip(av1): pre-filter dump pinned frame-1 desync to Luma32Inter's tx_type
read; flip-to-None regressed 16 tests, reverted. Round 4, capped at budget.

COMPILES. Does not fix the pin. Full suite back to baseline (instrumentation
only, no behaviour change from r3's HEAD besides the two new dumps below).

STEP 1 DONE, DECISIVE NEW EVIDENCE:

Added `EC_AV1_PREFILT_DUMP` (decode.rs, both apply_deblock call sites,
`PREFILT_PICTURE_IDX` global counter mirroring stream.rs's own
`pictures_decoded`), diffed against aomdec's own `EC_AV1_PREFILT_DUMP`
(decodeframe.c ~5451, already built into /tmp/libaom-src's debug aomdec).
Confirmed r3's own pre/post-filter accounting: decode-order frame 1's
mismatch (4407/6144 bytes) is already present PRE-filter -- reconstruction,
not the loop filter, exactly as r3 inferred from aomdec's own before/after
delta being tiny (333 bytes) by comparison.

STEP 2 DONE: pulled aomdec's unconditional per-block `EC_TRACE`
(decodemv.c ~1681, fires for every block regardless of env var) for
decode-order frame 1 specifically (the FIRST group of `is_inter=1` lines
after the keyframe's intra-only group, not "frame 1" by display/order_hint
-- r2's mistake) and cross-checked block-by-block against our own
`EC_AV1_TRACE`:

  block (mi 0,0):  ours skip=0 mv=(-2,-8) ref=LAST   -- MATCHES aomdec
                    exactly (mode=NEWMV both sides, motion_mode SIMPLE
                    both sides, no OBMC either side)
  block (mi 0,8):  ours skip=0 mv=(-14,8)  vs  aomdec skip=1 mv=(22,-40)
                    -- FIRST DIVERGENCE, immediately after block(0,0)

Since block(0,0)'s own mode-info matches bit-for-bit, the desync happens
inside block(0,0)'s own RESIDUAL decode (it is skip=0, so tokens are read)
-- the last thing before block(0,8)'s mode-info starts. Traced both sides'
coefficient reads for that one 32x32 luma transform (our own inline
`EC_AV1_TRACE` coeff logging in `read_coeffs`, decode.rs ~606, vs aomdec's
`EC_TRACE2`, decodetxb.c):

  ours:   tx_type symbol read, value=1 (from a real 2-symbol CDF, len=3)
  aomdec: EC_TXTYPE_VAL tx_type=0 (from a degenerate 1-symbol CDF -- no
          real bits consumed; spec `av1_get_ext_tx_set_type` resolves
          every tx_size_sqr >= TX_32X32 to `EXT_TX_SET_DCTONLY`, i.e. no
          tx_type is coded at all for a 32x32 inter transform)
  ours:   eob_pt=6 -> eob=18/17 (varies by exact run)
  aomdec: eob_pt=5 -> eob=13

`cdf_state.rs`'s `TxbSet::Luma32` (intra) already has `tx_type: None`
(correctly forced `DctDct`, matching `Luma64`'s `None` too) -- but
`TxbSet::Luma32Inter` (the one this block's `read_inter_plane` actually
uses, decode.rs ~5591) sets `tx_type: Some(self.inter_tx_type_32...)`,
reading a real symbol that spec says should never be read at this size.

TRIED AND REVERTED: flipping `Luma32Inter`'s `tx_type` to `None` (matching
`Luma32`) does NOT fix the pin -- `eob_pt` still reads 6 instead of
aomdec's 5 immediately afterward (same wrong value as before the flip),
proving the primary desync is NOT (only) the tx_type read; `eob_pt`'s own
context/table selection for this size class has a separate, still-unfound
bug. Worse: the flip regressed `cargo test -p ec-av1 --release --lib` from
green to 201 passed / 16 failed -- `inter_tx_type_32`'s CDF is evidently
depended on (adaptively, via `end_cdfs`/`cdf_slots` propagation into a
later frame's `started_from`, most likely) by other streams that DO expect
a real symbol read at this size, so `None` is not simply "more correct" in
isolation. REVERTED to `Some(...)` (baseline, all tests green again).

class: two independent-looking desync leads (tx_type over-read AND a wrong
eob_pt for 32x32) sit back-to-back in the exact same transform block --
this looks less like "one bug" and more like the CDF/context wiring for
`TxbSet::Luma32Inter` overall not matching spec's 32x32 inter path, closer
to [[tx-class-cross-cutting]] than a single point fix.

R5 UPGRADE PATH, IN ORDER:
1. Do NOT re-attempt the bare `tx_type: None` flip without first finding
   and fixing the `eob_pt` bug too -- confirmed above it does not fix
   anything alone and breaks 16 tests, so it is not a safe partial step.
2. Find the `eob_pt` bug first, in isolation: `read_eob`/`eob_pt` selection
   for `TxClass::TwoD` at side=32 (decode.rs ~549-560) against libaom's own
   `get_eob_pos_token`/`eob_multi_ctx` derivation for `TX_32X32`
   (av1/decoder/decodetxb.c, the `EC_EOBPT` trace line's own call site) --
   the aomdec fixture already prints `eob_pt=5 txs_ctx=3 tx_class=0
   eob_multi_ctx=0`, giving every context input needed to hand-derive the
   expected CDF row without more instrumentation.
3. Once eob_pt is confirmed fixed AND matches for this exact block, retry
   the `tx_type: None` flip for `Luma32Inter` and rerun the FULL
   `cargo test -p ec-av1 --release --lib` (not just the pin) before
   declaring it safe -- the 16-test regression must be understood (which
   16, why they wanted `Some`) or reproduced-fixed, not just silently
   re-broken again.
4. Re-run pin (`EC_AV1_PIN_N=24`) only after both land together.

Instrumentation added this round, env-gated (no behaviour change when
unset): `EC_AV1_PREFILT_DUMP` (decode.rs, `PREFILT_PICTURE_IDX` counter).
Reused, unchanged: `EC_AV1_TRACE` (decode.rs, already had inline coeff
tracing in `read_coeffs`/mode-info logging -- did not need new plumbing),
aomdec's own always-on `EC_TRACE`/`EC_TRACE2`/`EC_AV1_PREFILT_DUMP`
(/tmp/libaom-src, prebuilt at build/decoder-debug/aomdec).

STEP 5 (self-pin-on-mismatch for the two gates) -- STILL NOT reached, now
owed 3 rounds. Must be r5's first task per the standing charter note.

class: dpb-propagation-from-an-unverified-hidden-frame (r3's class) is
CONFIRMED as the correct causal chain (hidden frame 1 -> corrupts later
refs via refresh_frame_flags), origin now narrowed from "frame 1's
reconstruction" to "frame 1's very first non-skip 32x32 luma transform's
own token decode", two candidate bugs identified, neither closes it alone.
wip(av1): r2's skip_mode-desync theory FALSIFIED; real defect is decode-order frame 1's own reconstruction, invisible to the existing pin (hidden frame)Ahmet Kaan Gümüş · 8d878fe
wip(av1): r2's skip_mode-desync theory FALSIFIED; real defect is decode-order
frame 1's own reconstruction, invisible to the existing pin (hidden frame)

COMPILES. Does not fix the pin. Round 3 of lane-comppin, capped at budget.

STEP 1/2 OF THE CHARTER, DONE -- DECISIVE, OVERTURNS r2:
Added EC_AV1_SKIPMODE_DUMP (decode.rs ~4623, ctx+tell before/after the
skip_mode symbol read) and a matching hook in libaom's own read_skip_mode
(/tmp/libaom-src/av1/decoder/decodemv.c ~453, EC_SKIPMODE env var, rebuilt
into /tmp/libaom-src/build/decoder-debug/aomdec). Direct comparison for the
frame r2 called "frame 1" (order_hint=1, the pin's 2nd *shown* frame):

  ctx sequence:    ours 0,1,1,2   aomdec 0,1,1,2   -- MATCH
  result sequence: ours T,T,T,T   aomdec T,T,T,T   -- MATCH

r2's claim ("real bitstream's block (0,0) is SINGLE-ref LAST, skip_mode
false") does not hold under this direct comparison -- it was very likely an
artifact of comparing OUR decode-order frame index against aomdec's own
*decode*-order frame_number without accounting for AV1's hierarchical-B
reorder (decode order for this pin's skip_mode-bearing frames is
order_hint 7, then 3, then 1 -- NOT ascending display order; r2's manual
aomdec read likely landed on a different frame_number than intended). The
raw `tell` numeric gap noted in-flight this round (19 vs 5 bits before the
first read) is ALSO not evidence: aom_reader_tell()/od_ec_dec_tell() is a
fractional-bit *estimate*, not a raw bit-offset like our debug_bitpos() --
apples to oranges, not comparable numerically.

Also confirmed from libaom source (decodemv.c ~1541-1578): comp_group_idx
and compound_idx are NEVER read for a skip_mode block -- both stay at their
init values (0, 1 = COMPOUND_AVERAGE) unconditionally. So compound_idx is
not a desync candidate for this pin's all-skip_mode frame either, closing
off the other half of r2's upgrade path 2/3 as inapplicable here (right
answer, wrong question -- there is no compound_idx *read* to desync).

NEW FINDING THIS ROUND (the actual lead for r4): the existing pixel-diff
harness (`scratch_isolate_pinned_mismatch`) only ever compares *shown*
frames (display order) against ffmpeg's own (also display-order) output --
so it never directly checks the hidden altref/bwdref frames a shown frame's
compound prediction is built from. Added EC_AV1_DECODE_ORDER_DUMP
(stream.rs, dumps every decoded frame's post-loop-filter Y+U+V in DECODE
order, `pictures_decoded` counter) and cross-checked against aomdec's own
EC_AV1_POSTFILT_DUMP for the same pin:

  decode-order frame 0 (keyframe):        byte-exact (as already known)
  decode-order frame 1 (first hidden alt, predicts ONLY from the exact
    keyframe -- no other reference exists yet, so DPB/ref_slots corruption
    is RULED OUT as a cause here):        4439 / 6144 bytes differ (72%),
    mostly +-1/+-2 (row0 col0: 126 vs 127 ...), one outlier delta 31 at
    Y offset 4033 (row 63, col 1)
  cross-checked against aomdec's OWN pre- vs post-loop-filter dump for that
    same frame: only 333/6144 bytes change from its own loop filter, so the
    bulk of our 4439-byte gap already exists in *reconstruction*, upstream
    of loop filtering, not a filter-strength mismatch.

This is a much cleaner, earlier, and larger divergence than the "display
frame 1" comparison r1/r2 chased (worst delta 4, growing to 60 by frame 23)
-- that number was symptom, not source: it is contamination flowing forward
from THIS frame (decode-order 1) through refresh_frame_flags into every
later reference, exactly like lane-av1blend's already-documented DPB
propagation class, except here the corruption's true origin is now pinned
to one fully-isolated single-reference-input frame instead of a whole GOP.

R4 UPGRADE PATH, IN ORDER:
1. Add a Rust-side PRE-loop-filter dump (hook before apply_deblock is
   called in decode_inter_frame_tile_with_cdfs, same shape as
   EC_AV1_DECODE_ORDER_DUMP) and diff against aomdec's EC_AV1_PREFILT_DUMP
   for decode-order frame 1 specifically -- confirms whether the ~4100+
   byte gap is present pre-filter (reconstruction/MC bug) as the pre-vs-post
   accounting above already implies, or partly filter-side.
2. If pre-filter also mismatches widely: decode-order frame 1's own blocks
   are skip_mode=true/compound (per the r2/r3 traces), predicting from a
   single known-exact source (the keyframe) with an MV this round did NOT
   yet verify against aomdec's own decoded MV for THIS frame (r2's MV claim
   was for the wrong frame per the falsification above) -- get
   EC_TRACE mode/mv/ref dumps from decodemv.c for decode-order frame 1
   specifically (not "frame 1" by order_hint) and diff mv/ref pair
   block-by-block against our own EC_AV1_TRACE.
3. Given the pattern (widespread +-1/+-2, one 31-outlier) looks like either
   a systematic rounding bug in the compound blend/MC round-off (the
   ALTREF_FRAME single-ref altref-context special case in record_inter,
   decode.rs ~1023-1032, is one plausible site: this frame's ref pair likely
   *is* LAST+ALTREF) or a wrong film-grain/identity-matrix path leaking in
   before the DPB store -- check `film_grain.apply_grain` isn't
   accidentally hitting this "hidden" frame's stored (pre-grain) picture,
   though stream.rs's grain gating already looks correct on inspection.

STEP 5 (self-pin-on-mismatch for the two gates) -- NOT reached this round,
still owed to r4.

Instrumentation left in place, all env-var-gated (no behaviour change when
unset): EC_AV1_SKIPMODE_DUMP (decode.rs), EC_AV1_DECODE_ORDER_DUMP
(stream.rs), EC_SKIPMODE (libaom decodemv.c, rebuild with `make -j12 aomdec`
in /tmp/libaom-src/build/decoder-debug if stale).

class: dpb-propagation-from-an-unverified-hidden-frame -- same shape as
lane-av1blend's already-filed ref_slots/refresh_frame_flags class, but here
the true origin is now isolated to ONE frame with only one possible input.
wip(av1): trace skip_mode/compound_idx on the sb128-compound-refs pin -- NOT the compound blend, it is skip_mode desyncAhmet Kaan Gümüş · 15f253d
wip(av1): trace skip_mode/compound_idx on the sb128-compound-refs pin -- NOT the compound blend, it is skip_mode desync

COMPILES. Does not fix the pin (still mismatches). round 2 of lane-comppin,
capped at budget -- leaving the decisive lead + instrumentation for round 3.

WHAT THIS ROUND RULED OUT (all re-verified against libaom source, all correct):
- mc.rs predict_compound_intermediate/combine_compound: CONV_BUF-domain i32
  intermediates, round2 offsets, INTER_ROUND_1_COMPOUND=7/INTER_POST_ROUND=4/
  DIST_PRECISION_BITS=4 all match av1_dist_wtd_convolve_2d_c bit-for-bit
  (already landed pre-r1, re-audited this round, still correct).
- compound.rs dist_wtd_comp_weight_assign: QUANT_DIST_WEIGHT/LOOKUP_TABLE
  match libaom's reconinter.c/common_data.h row-for-row.
- decode.rs get_comp_index_context / get_comp_group_idx_context: match
  pred_common.c av1_get_comp_index_context/av1_get_pred_context_comp_group_idx
  line for line, including the single-ref ALTREF_FRAME special case
  (Neighbours::record_inter's altref bit at decode.rs ~1028-1032).
- reference_mode_ctx (mvstack.rs ~1876): matches av1_get_reference_mode_context
  exactly, including the has_second_ref asymmetric branches.
- read_skip_mode_params (ec-av1-syntax/src/frame.rs:1644): matches spec 5.9.22's
  skipModeAllowed forward/backward-ref search verbatim.

THE ACTUAL DEFECT (new this round): decode-order frame 1 of the pin
(sb128-compound-refs-flake.obu, EC_AV1_PIN_N=24) is 4x 32x32 leaves, all
identical: ref0=LAST(1) ref1=ALTREF(7 or 5), mv=(0,0)/(0,0), mode
NEAREST_NEARESTMV, compound_idx=1 (plain average) -- EVERY block reads
skip_mode=true (added EC_AV1_COMPIDX_DUMP trace at decode.rs ~5017/~6022,
EC_PRECOMP trace at ~4671 dumps skip_mode/skip/reference_select/tell before
the comp_mode read).

Cross-checked against a real instrumented aomdec (rebuilt
/tmp/libaom-src/build/decoder-debug/aomdec with a `mbmi->compound_idx` field
added to decodemv.c's existing EC_TRACE fprintf ~1671-1685, since the prior
round's patch only traced comp_group_idx not compound_idx): the REAL
bitstream's frame 1 block (0,0) is `ref=(1,-1)` -- SINGLE reference LAST_FRAME,
real coded MV (-2,-8) in 1/8-pel, skip_mode is NEVER forced there. Any true
skip_mode block would be forced compound by spec 5.11.24 -- a single-ref
result at that block proves the real bitstream's skip_mode bit read false
there, not true.

skip_mode_present (the frame-level bit, spec 5.9.22) is very likely read
correctly -- header fields after it (force_integer_mv, primary_ref_frame,
etc, dumped for all 24 frames by the existing scratch_isolate_pinned_mismatch
test) look sane and stay sane for the rest of the stream, which would not
survive a header-level bit-count desync this early. So the bug is specific to
the PER-BLOCK skip_mode symbol read at decode.rs ~4623 (skip_mode_ctx =
above_skip_mode[c] + left_skip_mode[r], SKIP_MODE cdf table cdf.rs:1206):
`SKIP_MODE = [[32621,32768,0], [20708,32768,0], [8127,32768,0]]` (verified
byte-identical to libaom's default_skip_mode_cdfs) means ctx=0 (both
neighbours false, true at any tile's mi_row=0/mi_col=0 corner if Neighbours
resets its skip_mode arrays per frame) has ~99.6% weight on skip_mode=false
-- decoding true there, then AGAIN at (0,8)/(8,0)/(8,8) (all four leaves of
the frame, tell values repeating 8/16/24 across MANY of the 24 frames, not
just frame 1) is not plausible as a correctly-drawn symbol from that CDF. The
leading hypothesis: `Neighbours::above_skip_mode`/`left_skip_mode` are stale
(not reset per frame, or reset at the wrong granularity) so skip_mode_ctx is
NOT actually 0 at (0,0) despite no real neighbour existing yet -- OR the same
DPB/ref_frame_idx bookkeeping the r1-era av1blend investigation already
flagged (ref_slots/refresh_frame_flags) is corrupting `skip_mode_frame`'s
own reference *pair* (LAST vs ALTREF/BWDREF getting mixed up across frames --
note ref1 alternates 7/5/4 across frames in the EC_COMPIDX dump, tracking
DPB slot churn) even when the boolean itself is right.

UPGRADE PATH for round 3, in order:
1. Print skip_mode_ctx (not just skip_mode) at every read (the second Edit
   attempt this round hit "2 matches, use replace_all" on the identical
   leaf16/leaf8 skip_mode block -- disambiguate by including the `skip_ctx`
   line that follows, which differs between the two call sites) and confirm
   ctx is really 0 at (0,0) of frame 1. If ctx != 0, the neighbour-array
   reset is the bug (grep Neighbours::new / wherever it's re-constructed
   per frame in decode_stream, stream.rs).
2. If ctx IS 0 and the symbol still reads 1, instrument SymbolDecoder::symbol
   itself (msac.rs) to dump (cdf_before, symbol_read, rng, value) for this
   ONE call across frames 1-3 and diff against a fresh COMPIDX_BLK-style hook
   in decodemv.c's own skip_mode read (~line before 1656 in
   /tmp/libaom-src/av1/decoder/decodemv.c -- not yet added, do this first).
3. Only after (1)/(2) rule out a local read bug: chase the DPB/ref_frame_idx
   bookkeeping the ref1=7/5/4 churn hints at (stream.rs's ref_slots /
   refresh_frame_flags, same suspect the pre-existing decode.rs ~4832-4845
   comment already named for a different fixture).

Gates a_real_aomenc_stream_with_compound_references_decodes_pixel_exact /
_reference_select_ NOT yet given the self-pin-on-failure treatment (step 4 of
the charter) -- deferred to round 3, no budget left this round.

Instrumented aomdec debug build lives at
/tmp/libaom-src/build/decoder-debug/aomdec (not repo-tracked, rebuild with
`make -j12 aomdec` there if it goes stale); its decodemv.c EC_TRACE fprintf
now also carries mbmi->compound_idx.
wip(av1): skip mv fr symbols under force_integer_mv (spec 5.11.32)Ahmet Kaan Gümüş · e48aa4c
wip(av1): skip mv fr symbols under force_integer_mv (spec 5.11.32)

lane-comppin r1 dying words: COMPILING. Spec-conformance fix, real but
NOT the pinned defect -- pin sb128-compound-refs-flake.obu decodes with
an IDENTICAL mismatch signature before and after (frame 0 exact; frame 1
Y 1640 px worst-delta 4, first at row 0 col 4 ours=128 theirs=129, U
first col 15, V first col 5, all planes accumulating to worst 60 by
frame 23). Frame 1 has force_integer_mv=true, frames 2+ false; signature
unchanged means the fr reads either never fire on frame 1 or the drift
sits elsewhere. Suspects remaining: dist-wtd compound blend rounding
(round0/round1 intermediate precision, quant_dist_lookup), plain-average
vs jnt_comp path selection, subpel MC on the compound path.
Merge branch 'lane-sb128': consume the interintra symbol; the deblocking-gate flake was this bit-driftAhmet Kaan Gümüş · 6a5f24d
Merge branch 'lane-sb128': consume the interintra symbol; the deblocking-gate flake was this bit-drift

The pin's sequence header enables interintra compound: libaom reads an
interintra symbol (spec 5.11.24, after assign_mv, before
read_motion_mode) that this decoder never consumed, silently
mis-aligning every later symbol -- the first visible casualty was a
neighbouring block's skip flag. interintra == 1 is a NAMED refusal
(blended inter+intra prediction unimplemented); == 0 decodes on.
Pinned stream now 4/4 frames all-plane exact; second pin honestly
refuses (it genuinely codes interintra). Deblocking gate 20/20.
Sequence-header enable_* sweep: no other silently-dropped symbols.
fix(av1): consume the interintra symbol behind enable_interintra_compoundAhmet Kaan Gümüş · c06aac0
fix(av1): consume the interintra symbol behind enable_interintra_compound

Root cause closed (lane-sb128 r4): libaom read_inter_block_mode_info reads
`interintra` (spec 5.11.24) right after assign_mv and before read_motion_mode
whenever the sequence header's enable_interintra_compound is set and
is_interintra_allowed(mbmi) holds (single-ref, BLOCK_8X8..=BLOCK_32X32, any
single-ref mode). This decoder never consumed that symbol, so any stream
with the bit set desynced from the first eligible block onward -- the
"BL skip flip" deblocking-gate flake was this bit-consumption drift.

- cdf.rs already had default_interintra_cdf (INTERINTRA); cdf_state.rs now
  resets it every keyframe (reset2) alongside obmc, closing the gap the r3
  dying words flagged.
- decode_inter_block/decode_inter_block8 both read `interintra` at the
  libaom-verified placement (after MV, before motion_mode), gated on
  enable_interintra_compound && !skip_mode && bsize-in-range, indexed by
  size_group_lookup (16x16->2, 32x32->3, 8x8 leaf->1). interintra==1 is a
  named refusal (inter+intra blended prediction unimplemented), not a
  mis-decode.
- enable_interintra_compound threaded from stream.rs's sequence header
  through decode_inter_frame_tile_with_cdfs's 3 call sites (already landed
  r3) down into both leaf functions' new parameter + every caller
  (decode.rs's plain wrapper, stream.rs's real driver, the decode_inter_block
  unit test).

Verified: scratchpad deblkflake-pin-197.obu now 4/4 all-plane MATCH x3
(previously mismatched -- root cause confirmed); deblkflake-pin-214.obu now
gets an honest named refusal x3 instead of a silent mis-decode (that stream
genuinely uses interintra prediction, unimplemented -- capability gap, not a
bug). Real aomenc deblocking gate 20/20; cdf_forwarding 10/10; obmc 2/2;
reference_select 3/3; compound_references 2/3 pass (1 flake matches the
already-documented aomenc-RD-nondeterminism class, re-ran green standalone).
wip(av1): interintra symbol consumption -- CDF landed, threading INCOMPLETE, NOT COMPILINGAhmet Kaan Gümüş · 35abdb5
wip(av1): interintra symbol consumption -- CDF landed, threading INCOMPLETE, NOT COMPILING

Dying words (r3 capped at 75 calls):
- ROOT-CAUSE DIRECTION: pin stream's sequence header has
  enable_interintra_compound set; libaom read_interintra_mode reads an
  interintra symbol for eligible blocks (single-ref, BLOCK_8X8..=32X32,
  mode NEARESTMV..NEWMV, size_group_lookup-indexed CDF) that our
  decoder never consumes -- the bit-consumption drift that flips BL's
  skip read (TR reads it first). Consuming the symbol (refusing on
  interintra==1) restores alignment.
- LANDED: cdf.rs INTERINTRA (default_interintra_cdf, 4 size groups);
  Cdfs.interintra storage + seed (CHECK: reset2 arm may still be
  missing in reset list -- verify); enable_interintra_compound param
  added to decode_inter_frame_tile_with_cdfs + passed at 3 call sites
  (~6880/6953/7017).
- REMAINING: (1) add enable_interintra_compound param to
  decode_inter_block AND decode_inter_block8 signatures; (2) the
  actual read site: AFTER which symbol exactly? verify against libaom
  decodemv.c read order (read_interintra_mode placement relative to
  ref/mode/motion_mode reads) -- get placement from libaom, not
  memory; interintra==1 => named refusal (interintra prediction
  unimplemented); interintra==0 => continue; (3) eligibility
  is_interintra_allowed port (single-ref + bsize group + mode range +
  !skip_mode?) -- verify exact libaom condition; (4) thread from
  stream.rs caller (sequence header bit -- check field name in our
  seq header struct, may need parsing if not stored); (5) pin P1+P2
  proof + gate sweeps per r3 charter; (6) EC_TRACE line gained
  motion_mode_eligible/obmc_selected/tell fields (scratch-ish but
  env-gated -- keep or trim at close).
- TOOLS: libaom EC_TRACE patches in /tmp/libaom-src/av1/decoder/decodemv.c;
  rebuild cd /tmp/libaom-src/build/decoder-debug && make -j12 aomdec
  (fallback /tmp/libaom-src/build). debug_bitpos vs aom_reader_tell
  remains INVALID cross-comparison.
Merge branch 'lane-motionmode': decode OBMC motion mode (SIMPLE vs OBMC_CAUSAL)Ahmet Kaan Gümüş · f77976c
Merge branch 'lane-motionmode': decode OBMC motion mode (SIMPLE vs OBMC_CAUSAL)

read_motion_mode after MV assignment, before the interp filter read
(libaom decodemv.c order); eligibility ports motion_mode_allowed +
overlappable-neighbour walk; OBMC blend ports
av1_build_obmc_inter_prediction (above+left passes, real obmc_mask
tables, luma + 4:2:0 chroma), wired through both 16x16 and 8x8
leaves. allow_warped_motion=1 at an eligible block is a NAMED
refusal, proven 40/40 seeds refuse with zero mis-decodes. New gates:
OBMC sequence pixel-exact vs ffmpeg (real OBMC blocks fire), 8x8
variant records honest never-fired skip (aomenc RD never splits this
content to 8x8).
feat(av1): thread read_motion_mode/OBMC through decode_inter_block8's 8x8 leavesAhmet Kaan Gümüş · 1944bfc
feat(av1): thread read_motion_mode/OBMC through decode_inter_block8's 8x8 leaves

Round 2 left an OBMC correctness hole: bsize 8x8 is motion_mode_allowed-
eligible but decode_inter_block8 never read the symbol, so an OBMC stream
coding motion_mode on an 8x8 leaf would desync silently. Mirrors the
16x16 decode_inter_block read (same 2-symbol obmc_cdf, same
allow_warped_motion=1 refusal, same obmc_blend call after MC prediction)
and threads switchable_motion_mode/allow_warped_motion/interp_fixed into
decode_inter_block8's signature.

Added a_real_aomenc_stream_with_obmc_8x8_decodes_pixel_exact plus an
obmc_hits_8 counter to try to exercise this path. Measured live: 80
attempts, aomenc's cpu-used=0 RD search never once splits a 16x16 down
to a clean 4-way 8x8 leaf for the gate's smooth gradients fixture (large
blocks always win); kept as an honest never-fired record, matching the
file's existing never_fired-skip convention.
feat(av1): decode OBMC_CAUSAL motion mode (SIMPLE vs OBMC, warp refused)Ahmet Kaan Gümüş · c0d4024
feat(av1): decode OBMC_CAUSAL motion mode (SIMPLE vs OBMC, warp refused)

read_motion_mode ported (spec 5.11.24 / decodemv.c ~1520-1600), placed
between MV assignment and the switchable interp filter read, matching
libaom's own order. motion_mode_allowed (reconinter.h) reduces on this
decoder's single-ref path to "an inter neighbour borders the above row
or left column" -- overlappable_above/left port
foreach_overlappable_nb_{above,left} (obmc.h) over the existing MiGrid,
bsize/global-mv/interintra conditions all hold unconditionally here
(global motion is always IDENTITY, no interintra reader, single-ref
only). allow_warped_motion=1 is refused right at an eligible block
(av1_findSamples/num_proj_ref not ported, so this decoder cannot tell
OBMC_CAUSAL from WARPED_CAUSAL once the header allows warp) rather than
guessed at or refused at the header.

OBMC prediction (av1_build_obmc_inter_prediction, reconinter.c): each
bordering above/left inter neighbour is re-predicted over the overlap
strip with its own mv/ref/filter and blended in with the real
obmc_mask_{4,8,16,32} tables, luma then both 4:2:0 chroma planes,
above pass then left -- max_neighbor_obmc's own cap applied, eligibility
scan stays unbounded per libaom.

New gates: a_real_aomenc_stream_with_obmc_decodes_pixel_exact (3x
green, fires 3 real OBMC blocks pixel-exact against ffmpeg) and
a_real_aomenc_stream_with_warped_motion_refuses_or_matches (40/40 named
refusals, 0 desyncs -- confirms the refuse-vs-desync verdict). Existing
cdf_forwarding/deblocking/compound_references/reference_select gates and
the full lib suite (216/0/16) stay green.

Corner-cut: the obmc.h "4-wide block treated as half a chroma pair"
merge is not ported -- no block this decoder codes is narrower than 8px,
so it never fires on any stream this decoder can reach.
wip(av1): OBMC decode round 1 -- CDF + header-bit plumbing, symbol NOT read yetAhmet Kaan Gümüş · 0b6a5ba
wip(av1): OBMC decode round 1 -- CDF + header-bit plumbing, symbol NOT read yet

Dying words (builder capped at 75 calls):
- COMPILES (warnings only). Landed: default_obmc_cdf transcribed
  (cdf.rs OBMC, 4 square bsizes 8/16/32/64 = BLOCK_SIZES_ALL
  3/6/9/12); Cdfs.obmc storage + reset + seed; decode_inter_block +
  decode_inter_frame_tile_with_cdfs take switchable_motion_mode /
  allow_warped_motion, threaded from header at stream.rs:382; the
  16x16 leaf call sites pass them; decode_inter_block8 (8x8 leaves)
  intentionally NOT wired (round 2 per plan).
- REMAINING: (1) read_motion_mode symbol read inside
  decode_inter_block -- placement per libaom decodemv.c:1575 region
  read order, AFTER compound/interp reads; eligibility =
  av1_count_overlappable_neighbors port (whole edge span, not one
  cell) + global-mv/bsize checks per motion_mode_allowed
  (reconinter.h); round-1 scope reads 2-sym obmc_cdf only
  (allow_warped_motion=0 streams). (2) OBMC prediction:
  av1_build_obmc_inter_predictors_sb port (above/left overlap
  predictors, av1_get_obmc_mask blend, luma + 4:2:0 chroma plane
  loop). (3) aomenc OBMC gate (--enable-obmc=1
  --enable-warped-motion=0 on base recipe) 10x + existing 4 gates
  10x + lib suite 3x. (4) warp-stream refusal accuracy check.
- Refuse-vs-desync verdict for pre-fix OBMC streams: NOT yet
  established by this round -- handoff must check before claiming.
test(av1): self-pin the deblocking gate's stream on mismatch; correct the variance commentAhmet Kaan Gümüş · 4d29711
test(av1): self-pin the deblocking gate's stream on mismatch; correct the variance comment

The gate's content is fresh every run (gradients ignores seed for its
colors), so an unpinned failure may never reproduce. On mismatch the
stream is written to a stable temp path and the panic names it.
Merge branch 'lane-deblkflake': EC_AV1_GATE_DUMP pins the deblocking gate's streamAhmet Kaan Gümüş · 87eb5ee
Merge branch 'lane-deblkflake': EC_AV1_GATE_DUMP pins the deblocking gate's stream

1503 filtered attempts on 95e9170 all green -- the ledger's 1-in-10
flake rate was stale-premise. Real variance mechanism: lavfi
gradients ignores its seed option for c0..c7 colors (default
"random"), so the gate encodes different content every run. The
dump hook captures the exact aomenc stream decoded, so any future
organic failure is pinnable immediately.