forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 8dbd683068d7f87f21dcc4ed1dfdca786d82c52bFiltered to crates/ec-av1/src/stream.rsClear filter

2026-08-28

chore(av1): remove bisect scratch instrumentation (SREF/COMPIDX/COMPOUND_DEBUG/r17 dump)Ahmet Kaan Gümüş · d6ab49e
chore(av1): remove bisect scratch instrumentation (SREF/COMPIDX/COMPOUND_DEBUG/r17 dump)

Strips the env-gated dump machinery (EC_AV1_SREF_DUMP, EC_AV1_COMPIDX_DUMP,
EC_AV1_COMPOUND_DEBUG, BITPOS_BLK_START, IFILTER_RS prints) and the r17_dump
frame-counter/PREFILT/POSTFILT scaffolding from decode.rs/stream.rs, plus the
three scratch #[ignore] tests that depended on it in stream.rs
(scratch_decode_pinned_stream, scratch_dump_compound_idx_cdf_state,
scratch_sweep_compound_mismatch). Keeps scratch_isolate_pinned_mismatch and
scratch_decode_pinned_stream_once as generic pin-repro tools, GATE_COUNTER_LOCK,
the hardened cdf gate, pin fixtures, tile.rs's own EC_RNG trace, and the
comp_group_idx==1 wedge/diffwtd refusal untouched.
fix(av1): single-ref mvstack scan votes a compound neighbour's second slotAhmet Kaan Gümüş · 2b9615f
fix(av1): single-ref mvstack scan votes a compound neighbour's second slot

Named read #538 (EC_RNG global trace): L5039, the new_mv symbol in
decode_inter_block16's single-ref path, fed a new_mv_ctx computed from
find_mv_stack_with_sign_bias. Its row/col/corner scans and the
single-ref extension pass (process_single_ref_mv_candidate) matched a
neighbour on info.ref_frame alone, silently dropping the vote whenever
a compound-coded neighbour's match sat in its second slot
(ref_frame1/mv1) -- the third instance of the neighbour-votes-all-its-
fields class. Frame 10 (decode order) has reference_select=true, so a
compound neighbour is live next to the diverging single-ref query.

Added single_ref_match() (mirrors libaom's add_ref_mv_candidate `for
ref in 0..1+is_compound`), used by scan_row/scan_col/scan_corner/
scan_top_right; extended process_single_ref_mv_candidate to donate
both of a compound candidate's slots instead of just the first.

Proof: av1idx-refsel-pin.obu (20 frames) now 60/60 plane-MATCH against
ffmpeg (0 mismatches), 3x. Full ec-av1 --lib suite 214/0/19 green.

Also: added a CURRENT_OP thread-local (msac.rs) plus a per-call-site
tag before every dec.symbol()/symbol_fixed() read in decode.rs (r5
scratch instrumentation, EC_RNG=1 trace now prints op=L<line>), and a
reference_select/primary_ref_frame field on the EC_AV1_SREF_DUMP print
(stream.rs) used to confirm frame 10's header state.
wip(av1): r4 -- EC_RNG global trace finds the real desync read, r3's frame-8 fidx claim falsifiedAhmet Kaan Gümüş · d0ddce6
wip(av1): r4 -- EC_RNG global trace finds the real desync read, r3's frame-8 fidx claim falsified

STREAM_HEADER dump extended with is_motion_mode_switchable/enable_interintra_compound/
allow_warped_motion. Checked against the pin: all three are false on every one of its
20 frames -- the motion_mode/OBMC/interintra/warped-motion read paths (confirmed via
libaom decodemv.c grep to be entirely unimplemented in decode.rs: zero hits for
"motion_mode"/"obmc"/"warped"/"interintra") are a real capability gap but NOT this
pin's defect, since the bits that would gate those reads are off throughout.

Ran the existing EC_RNG global trace (msac.rs symbol_fixed, already instrumented a
prior round) on both sides: ours 658 symbol reads for the whole 20-frame stream vs
aomdec 655 -- a genuine 3-read count mismatch, confirming a structural desync
somewhere, not a pure "same reads, wrong probs" bug.

Diffed the two EC_RNG logs read-by-read (rng_before/rng_after/nsyms/symbol, ignoring
the "n=" index since counts differ): identical for the first 538 reads, then:
  ours: rng_before=44723 rng_after=32887 nsyms=2 symbol=0
  aom:  rng_before=44723 rng_after=38110 nsyms=2 symbol=1
Same range state and same nsyms into the read, different decoded symbol -- a real
context/CDF divergence, not a narrowing coincidence. Counting frame-boundary markers
(rng_before=32768, i.e. every SymbolDecoder::new) up to that point: 10 boundaries
passed, so this read is in decode-order frame index 10, NOT frame index 8. Frame
index 8's segment (log lines 363-486, containing the nsyms=3 reads r3 attributed to
the mi(0,0) dir1 switchable_interp mismatch) diffs byte-for-byte identical between
ours and aomdec -- r3's "mismatch frame 8" identification was built on the
fidx-offset trap the r2 handoff already warned about and does not hold up against
this direct value/range trace. The real first divergence is a *later* frame, a
different symbol (nsyms=2, not switchable_interp's nsyms=3), ~25 reads into that
frame's tile.

Not yet identified which flag nsyms=2 at that position corresponds to (no call-site
tag on the shared EC_RNG print -- it's a global counter over every dec.symbol() call
in the crate). Next step: tag EC_RNG (or add a parallel thread-local "current op"
string set right before each dec.symbol() call near candidate binary reads --
skip_mode, is_inter, single/comp ref bits, comp_group_idx, delta_q/delta_lf presence,
palette presence, filter_intra, tx_depth splits) so the divergent read's call site is
named directly, then cross-check that site's context computation against libaom's
matching function for real-frame-10 pixel content (not frame 8).

Masks untouched (compound_references/reference_select refusals still in stream.rs).
No pixel-level re-verification needed yet -- pin still mismatches, unchanged.
wip(av1): r2 -- interp filter ctx matches neighbour's SECOND ref tooAhmet Kaan Gümüş · 49ec72b
wip(av1): r2 -- interp filter ctx matches neighbour's SECOND ref too

get_ref_filter_type: a neighbour votes with EITHER of its two references
(record_compound_ctx supplies the real second ref); ref0-only matching
dropped real filter matches to the no-neighbour sentinel. Second instance
of the neighbour-votes-all-its-fields class.

Dying words: checking whether the per-OBU loop's local header is
stale/different vs the header used elsewhere for the same frame.
Merge branch 'lane-av1blend': ref-frame ctx counts both compound-neighbour refs; interp_filter read orderAhmet Kaan Gümüş · c806031
Merge branch 'lane-av1blend': ref-frame ctx counts both compound-neighbour refs; interp_filter read order

Seven-round bisect. Real fixes: mvstack ref_ctx family now counts both
refs of a compound neighbour (libaom av1_collect_neighbors_ref_counts);
resolve_interp_filter read moved after the compound reads per spec
5.11.19. Pinned compound fixture now decodes 24/24 frames byte-exact
unmasked; a second compound_idx defect remains, so comp_group_idx==0
blends stay refused-by-name and gates stay green. Trace instrumentation
from the bisect rides along, cleanup queued.
fix(av1): r7 -- fix leftover test call sites for the r6 ref_ctx fix, but re-mask compound_idx blendAhmet Kaan Gümüş · 3f636a9
fix(av1): r7 -- fix leftover test call sites for the r6 ref_ctx fix, but re-mask compound_idx blend

Two stream.rs test call sites (single_ref_p1/p3/p5_ctx) still used the pre-r6
2-arg signature, so the crate did not compile after r6's committed fix -- now
pass all four (above0, above1, left0, left1).

Verification of r6's own claim ("root cause found") does NOT hold up under the
wide gate sweep: the fresh seed-45 pinned fixture (av1blend-r1-mismatch.obu)
now decodes byte-exact for all 24 frames/72 planes, confirming r6/r7's
mvstack.rs ref_ctx fix (single_ref_p*/comp_ref*/comp_bwdref* now count both
sides of a compound neighbour, matching libaom's
av1_collect_neighbors_ref_counts) is a real, independently-correct fix -- kept.

But re-running a_real_aomenc_stream_with_compound_references_decodes_pixel_exact
and a_real_aomenc_stream_with_reference_select_reads_comp_mode_correctly
(cq-level=45, many seeds) with the plain-average (comp_group_idx == 0) blend
unmasked on that fix alone still mismatches roughly half the time, at a
different frame each run for the identical seed (aomenc's own cpu-used=0 RD
search is run-to-run nondeterministic, so "same seed" is not "same
bitstream"). r6's own residual-mismatch note already flagged this: 321/846
mismatched pixels in its analysis did not fit the (9,7)-vs-plain-average
hypothesis its fix addresses either -- more than one compound_idx bug lives
here. Re-masked both leaf16 and leaf8's comp_group_idx == 0 path (dead code
kept beneath, #[allow(unreachable_code)]) rather than ship a blend that is
right only sometimes; widened the reference_select gate's refusal-accept
back to accept COMPOUND_REFERENCE, since that refusal is legal again.

cdfflake pin (frame 2 luma 359/4096, right-edge col 63, seed 45,
w=64 h=64 n=4) reproduces exactly as pinned -- unrelated to this lane's
compound work, still open.

Full `cargo test -p ec-av1 --release --lib` 214/0/19 green x2.
wip(av1): r4 compound_idx CDF-state trace instrumentation, built not yet runAhmet Kaan Gümüş · dc3404f
wip(av1): r4 compound_idx CDF-state trace instrumentation, built not yet run

COMPIDX_PRE dumps per-frame pre-tile compound_idx CDF words; COMPIDX_BLK/VAL
trace every read. scratch_dump_compound_idx_cdf_state pins the fixture run.
fix(av1): r2 bisect -- BWDREF compound divergence is per-block, not DPB slotAhmet Kaan Gümüş · 70c2a11
fix(av1): r2 bisect -- BWDREF compound divergence is per-block, not DPB slot

r1's fixture (av1blend-r1-mismatch.obu) was gitignored and lost; could not
be regenerated byte-exact. Static review of stream.rs's ref_slots/
refresh_frame_flags/cdf_slots bookkeeping and the show_existing_frame
refresh arm (spec 7.21, already correctly gated on frame_type==Key in
ec-av1-syntax's frame.rs) found nothing wrong -- the DPB slot bookkeeping
r1 suspected is spec-correct.

A fresh unmasked sweep (seed 45, same recipe) isolated a narrower shape:
decode-order frame 3 (BWDREF compound, zero MV, simple average) is the
first to diverge from ffmpeg even though both its compound inputs are
independently proven pixel-exact and the blend arithmetic is the same
formula r1 proved algebraically exact. That rules out a stale/wrong
reference picture for this fixture -- the defect is in that frame's own
per-block decode (entropy desync or the compound mode/MV read itself),
not reference-slot bookkeeping. Not isolated further within budget.

Both masks stay (comp_group_idx == 0 and == 1); instrumentation is
env-gated (EC_AV1_COMPOUND_DEBUG frame-state trace in stream.rs,
scratch_sweep_compound_mismatch to find a fresh repro seed). Full
`cargo test --release -p ec-av1 --lib`: 214 passed, 0 failed, 18 ignored.
fix(av1): pin a real cdf-forwarding decode defect, harden the gate's instrumentationAhmet Kaan Gümüş · bc99468
fix(av1): pin a real cdf-forwarding decode defect, harden the gate's instrumentation

The cdf-forwarding gate's rare parallel-run "flake" is not instability: a
standalone 3x-reproduction of the pinned seed-45 stream deterministically
mismatches frame 2 luma (359/4096 bytes, first diff row 43 col 63) every
time -- a real decode defect that only a lucky seed sequence exposes, not
a race. The gate itself never reads a counter-gated compare (no
GATE_COUNTER_LOCK coverage needed here), so hypothesis A's "attempt
selection" shape does not apply to this test.

Hardens the gate for future triage instead of masking the defect:
- hard length assert on the y4m fixture (header + frames*(6 + w*h*3/2))
- FNV-1a fingerprints of the y4m/stream/ffmpeg-raw bytes on every attempt
- unconditional (no env var needed) pin-to-scratchpad of both the aomenc
  stream and ffmpeg's raw reference bytes on any mismatch

Repro pinned at /tmp/.../scratchpad/cdfflake-stream-seed45.bin (gitignored
scratchpad, not committed) for the follow-on lane that fixes the decoder.
fix(av1): r1 bisect -- falsify the compound-blend arithmetic hypothesisAhmet Kaan Gümüş · 793125d
fix(av1): r1 bisect -- falsify the compound-blend arithmetic hypothesis

r16/r17 called the masked COMPOUND_REFERENCE reconstruction a
predict_compound_intermediate/combine_compound rounding bug. Unmasking
both sites and running the real gates falsifies that: combine_compound's
combined round2 shift is proven algebraically identical to libaom's
separate DIST_PRECISION_BITS-then-ROUND_POWER_OF_TWO sequence, and a
whole-pel zero-MV compound block reproduces aomdec's own pre-deblock
dump byte-for-byte for several consecutive frames (decode-order 0, 1,
10-18 of the r1 gate fixture).

The real defect: decode-order frame 2 (first block pair to reference
BWDREF_FRAME instead of ALTREF_FRAME, same zero MV, same math shape as
the matching frame 1) is the first frame to diverge from aomdec, and
the corruption propagates into every later frame via refresh_frame_flags
regardless of which reference a later block names -- a DPB slot/
reference-bookkeeping bug, not an MC/blend arithmetic bug. Re-masked
both sites (comp_group_idx == 0) with the corrected root-cause comment;
kept the r17_dump/EC_AV1_COMPOUND_DEBUG instrumentation used to find
this, per the bisect's own re-mask-and-report contingency.
fix(av1): r17 bisect -- falsify loop-filter hypothesis for the masked compound blendAhmet Kaan Gümüş · 80caed5
fix(av1): r17 bisect -- falsify loop-filter hypothesis for the masked compound blend

r16 called the plain-average COMPOUND_REFERENCE blend defect
"loop-filter-shaped". r17 adds an env-gated pre/post-deblock frame dump
(decode.rs's r17_dump, EC_AV1_PREFILT_DUMP/EC_AV1_POSTFILT_DUMP, matching
aomdec's own hooks of the same name) and a one-shot pinned-stream decode
test (stream.rs's scratch_decode_pinned_stream_once, needed so this
decoder's own frame-index counter lines up with aomdec's numbering).

Result: the 32x32-quadrant mismatch (898/1024 px, rows 32-63 cols 32-63 of
a 64x64 luma plane) is already present *before* this decoder's own loop
filter runs, at parity with aomdec's own pre-deblock buffer for the same
frame -- this falsifies "loop-filter-shaped, not a desync" from r16. It is
a predict_compound_intermediate/combine_compound reconstruction defect.
Root cause still not isolated within that arithmetic (out of this round's
budget); both refusal sites stay masked, with the comment corrected to
this finding and the exact fixture location so the next round can bisect
predict_compound_intermediate itself instead of the loop filter.

Task B (cdf_forwarding-gate flake) not reached this round -- no budget
left after the bisect; the flake did not fire in 3x full-suite runs here
either (214 passed/0 failed/17 ignored each), consistent with its known
low reproduction rate.
wip(av1): compound r11 — comp_group_idx/compound_idx read, MC blend wired in main pathAhmet Kaan Gümüş · fed4a60
wip(av1): compound r11 — comp_group_idx/compound_idx read, MC blend wired in main path

Round capped mid-wiring; committed by orchestrator after fixing the two
test-wrapper call sites (the five new seq/order-hint params threaded, not
neutralised, where the tile fn has them in scope). 211/211 lib tests green.
Remaining: decode_inter_block8 blend path, record_inter threading of
ref_frame1/mv1/compound_idx, remaining COMPOUND_REFERENCE refusals, firing
gate.
feat(av1): wire comp_mode/comp_ref reads into both inter-block decodersAhmet Kaan Gümüş · 14ea0a6
feat(av1): wire comp_mode/comp_ref reads into both inter-block decoders

reference_select now threads from the frame header through
decode_inter_frame_tile(_with_cdfs) into decode_inter_block and
decode_inter_block8: when set, each inter block reads comp_mode (spec
5.11.25) first and, on COMPOUND_REFERENCE, reads comp_ref_type/
comp_ref/comp_bwdref via read_compound_ref_frames before refusing the
block by name -- two-reference motion compensation is not wired yet.
This keeps the arithmetic decoder in sync for reference_select streams
that never actually pick compound, and replaces the old blanket
frame-level reference_select refusal with a comp_mode-count-verified
per-block one. skip_mode_present (a separate header bit) gets its own
frame-level refusal since no block-level reader for it exists yet.

Added COMP_MODE_HITS/comp_mode_hits() and a real-aomenc gate
(a_real_aomenc_stream_with_reference_select_reads_comp_mode_correctly)
proving both outcomes: a fully-decoded reference_select stream that
never fired compound, or a refusal that names COMPOUND_REFERENCE with
comp_mode_hits having advanced. Live run: every aomenc attempt in this
recipe hit skip_mode_present or allow_screen_content_tools first (both
separate unimplemented capabilities), so comp_mode itself has not yet
fired live -- next round needs a recipe/attempt-count that clears both
before reaching a bidirectional-reference block.
feat(av1): pixel-exact single-ref decode for LAST2/LAST3/BWDREF/ALTREF2/ALTREFAhmet Kaan Gümüş · 1719c8e
feat(av1): pixel-exact single-ref decode for LAST2/LAST3/BWDREF/ALTREF2/ALTREF

Adds per-reference hit counters (decode::ref_hits) so a gate can prove the
SPECIFIC reference it targets fired, not just non_last_ref_hits. Adds 5
targeted real-aomenc gates (dropping the golden gate's own
--max-reference-frames=3/--reduced-reference-set=1 narrowing, which
suppresses exactly these references; backward refs additionally need
--auto-alt-ref=1/--lag-in-frames for aomenc to code them at all). All 5
decode pixel-exact against ffmpeg across 3 repeated runs (15/15), proving
the WIP's sign_bias threading for BWDREF/ALTREF2/ALTREF is correct.

Also cherry-picks b650420 (--enable-ref-frame-mvs=0 swept into every
recipe) and a668c49 (film-grain gate pinned below the same fix) from
main, which this branch had forked before -- fixes the 3 real-aomenc
gates that were failing on the WIP alone.
fix(av1): pin the film-grain gate below use_ref_frame_mvs's unimplemented pathAhmet Kaan Gümüş · 25e8a4f
fix(av1): pin the film-grain gate below use_ref_frame_mvs's unimplemented path

real_aomenc_film_grain_streams_decode_pixel_exact's frame-1 mismatch was
never a grain bug: aomenc turns on temporal MV projection
(use_ref_frame_mvs) by default once order hints are enabled, and
mvstack.rs's documented corner-cut always computes zero_mv_ctx and the
mode-context GLOBALMV_OFFSET bit as if it were off, desyncing the symbol
stream from the first NEARESTMV block that inherits a temporal-adjusted
context. Add --enable-ref-frame-mvs=0 alongside this gate's other
disabled features so it isolates grain synthesis as its own comment
already claims, matching every real-aomenc gate's envelope pattern.
Temporal MV projection stays a separate, unimplemented capability.
fix(av1): sweep --enable-ref-frame-mvs=0 into every aomenc test recipeAhmet Kaan Gümüş · 6836b28
fix(av1): sweep --enable-ref-frame-mvs=0 into every aomenc test recipe

use_ref_frame_mvs (temporal MV projection) is unimplemented; mvstack
computes zero_mv_ctx/GLOBALMV_OFFSET as if it were off, so any real
aomenc stream with it enabled desyncs the symbol decoder on inter
frames. The film-grain gate hit this (frame-1 luma mismatch pinned to
this, grain falsified); the remaining 7 aomenc recipes carried the same
latent flake and are now pinned inside the supported envelope. The
ffmpeg single-frame helper is keyframe-only and unaffected.
fix(av1): port libaom's exact single-ref MV stack extensionAhmet Kaan Gümüş · 81de048
fix(av1): port libaom's exact single-ref MV stack extension

Replace the hand-written GOLDEN-fix extension pass (mvref_common.c
reduction guessed by hand: gated on the 8-entry stack cap, flat
unconditional weight=2 adds) with an exact port of
process_single_ref_mv_candidate + setup_ref_mv_list's single-reference
extension: real gate is MAX_MV_REF_CANDIDATES (2, not 8), real reach
is the query block's own bw4/bh4 (not a flat 16), dedup/weight/
sign-bias now match libaom's function precisely.

Fixes the 3 real-clip encoder regressions the hand-written pass
caused (stack contents diverged from what a real decoder derives,
desyncing DRL/MV coding). All 3 pinned/hand-built golden tests still
green; full ec-av1 suite green (179 passed); forwarding gate 20/20
clean, 0 mismatches. Golden gate fires=0/20 live (aomenc's fixed
seeds never select GOLDEN_FRAME in this environment) -- GOLDEN arm
stays unmasked since the pinned fixtures and forwarding gate already
prove it correct; re-masking per the fires=0 contingency would break
those pinned tests, a direct conflict flagged rather than resolved
silently.
test(av1): drive the film-grain sweep with the repo aomenc and the supported-envelope recipeAhmet Kaan Gümüş · 4da5dbf
test(av1): drive the film-grain sweep with the repo aomenc and the supported-envelope recipe

The sweep probed bare `aomenc` on PATH (always absent) and so always
skipped; it now uses aomenc_path() like every other gate. The recipe
adopts the forwarding gate's constraint set so the streams stay inside
the decoder's supported envelope, with --tune-content=film as the one
flag under test. At 64x64 the streams now reach the GOLDEN_FRAME
refusal on this branch; the test goes green once the mvstack
extension-pass fix (lane-av1golden8) merges and unmasks GOLDEN.
feat(av1): implement spec 7.18.3 film grain synthesis, flip the refusalAhmet Kaan Gümüş · 84e41d9
feat(av1): implement spec 7.18.3 film grain synthesis, flip the refusal

Port the AR-filtered grain template generation, piecewise-linear scaling
LUT, and 32x32/16x16 tiled overlap-blend application from libaom's
reference synthesis (crates/ec-av1/src/film_grain.rs), wired into
decode_stream's frame-finalize path so the reference bank keeps the
clean pre-grain decode (spec 7.18.3.1) while only the caller's output
picture carries grain.

Header parsing (ec-av1-syntax FilmGrainParams, load_grain_params
ref-slot forwarding) was already spec-complete -- no changes needed
there.

Replaces the apply_grain refusal with a pixel-exact gate against
ffmpeg's own AV1 decoder on the pinned aomenc fixture (frame 0, the
span the original mismatch was traced to; later frames in that fixture
hit an unrelated pre-existing GOLDEN_FRAME MC gap, out of this lane's
scope), plus an aomenc multi-seed sweep gate that skips gracefully
when aomenc is unavailable.
fix(av1): re-mask GOLDEN_FRAME behind the LAST_FRAME refusal arm, pin round-9 residualAhmet Kaan Gümüş · 2e169ef
fix(av1): re-mask GOLDEN_FRAME behind the LAST_FRAME refusal arm, pin round-9 residual

Round 9's own forwarding gate still shows GOLDEN_FRAME motion compensation
mismatching a real aomenc stream once the film-grain refusal is in place
(1/20, frame 3 luma, apply_grain=false). Collapse the GOLDEN_FRAME arm back
into the single LAST_FRAME/_ refusal match so it refuses by name again, and
add an #[ignore]d pinned_golden7_stream_decodes_pixel_exact test (same shape
as golden4's) against the pinned repro fixture for round 10. Also drops the
debug-only probe_env_stream test.
fix(av1): gate switchable_interp neighbour ctx by ref_frame, keep GOLDEN_FRAME maskedAhmet Kaan Gümüş · 71a371f
fix(av1): gate switchable_interp neighbour ctx by ref_frame, keep GOLDEN_FRAME masked

resolve_interp_filter fed a block's above/left filter context straight
from Neighbours regardless of which reference frame each neighbour
coded -- a different-ref neighbour's filter choice was corrupting the
symbol read for this block's own filter, instead of reading as unset
([3,3], the same sentinel intra neighbours already produce). Gate both
above_filter and left_filter on above_ref/left_ref matching this
block's ref_frame.

Round 8's GOLDEN_FRAME unmask attempt with this ctx fix still produces
a real mismatch: a golden gate run 20x reproduces a frame-0 (intra
keyframe) luma diff against ffmpeg whenever GOLDEN_FRAME actually
fires later in the same stream (seeds 57, 59, both live-reproduced).
The ctx fix itself is not the cause -- decode_inter_block8 never
resolves switchable_interp context at all (it refuses non-LAST_FRAME
before reaching any filter code), so this bug is golden-adjacent
elsewhere, unproven past that. GOLDEN_FRAME stays a named refusal;
added the same EC_AV1_GATE_DUMP pin-on-mismatch pattern the CDF
forwarding gate already has to the golden gate test, and captured the
reproducing stream for the next round.

2026-08-27

fix(av1): re-derive the GOLDEN_FRAME loop-filter residue, re-mask with a pinAhmet Kaan Gümüş · d02f017
fix(av1): re-derive the GOLDEN_FRAME loop-filter residue, re-mask with a pin

Un-masked decode_inter_block's GOLDEN_FRAME arm this round and re-ran the
forwarding + golden-reference gates: two real aomenc streams mismatched
(30-run forwarding gate: 4/30 real failures, all a real aomenc GOLDEN
stream, not the documented flake). Pinned one (seed 43, frame 3 luma) as
stream::tests::pinned_golden4_stream_decodes_pixel_exact (#[ignore]d) and
traced it: 3 of 4096 luma pixels off by exactly +-1, all inside the loop
filter's edge window at a GOLDEN_FRAME/LAST_FRAME block boundary. Hand-
checked lf_level's ref_deltas/mode_deltas arithmetic against spec 7.14.4
at that edge -- it matches the default table exactly, so the residue is
still open: a narrow deblock-kernel rounding defect, or a golden-side
pixel one filter tap upstream. Re-narrowed the mask (decode_inter_block's
GOLDEN_FRAME arm refuses by name again) and reverted
a_hand_built_golden_reference_refuses_by_name to its refusal-asserting
form -- no fix proven this round, but the pinned fixture and the
narrowed-down suspect (deblock edge, not lf_level's own math) carry
forward.
fix(av1): loop filter level must not forward from the primary ref frameAhmet Kaan Gümüş · 3024af4
fix(av1): loop filter level must not forward from the primary ref frame

read_loop_filter_params only re-reads loop_filter_level[2]/[3] (chroma)
when a luma level is nonzero (spec 5.9.11); the whole LoopFilterParams
struct -- including level/sharpness -- was being seeded from the primary
reference frame's saved params before that read, so a frame whose own
luma levels are both 0 kept the PREVIOUS frame's nonzero chroma level
instead of the spec's implicit 0. Spec 7.20's load_previous only
forwards ref_deltas/mode_deltas, never level/sharpness. Isolated with a
pinned mismatching stream (seed 47, frame 1 chroma vs ffmpeg): bisected
pre/post-deblock dumps to prove the loop filter kernel itself untouched
by the bug, then a level sweep on the exact failing pixel's 6-tap window
showed a threshold flip precisely between level<=2 (matches ffmpeg) and
level>=3 (our observed wrong output) -- our decoder computed level=8
(carried from frame 0's key frame header) where the true value is 0.

Adds an env-gated EC_AV1_GATE_DUMP pin to the forwarding gate test plus
an #[ignore]d fast-reproduce test reading that pinned stream.
fix(av1): GLOBALMV loop-filter mode delta; mask GOLDEN behind its stacked defectAhmet Kaan Gümüş · ef03524
fix(av1): GLOBALMV loop-filter mode delta; mask GOLDEN behind its stacked defect

lane-av1golden2 round 5. The round-4 GOLDEN flip's hand-built fixture
proved the symbol path and a whole-pel skip copy -- the first real aomenc
GOLDEN streams through the live arm mismatched. Symbol-trace vs a patched
aomdec isolated one cause on the LAST_FRAME-reachable side: lf_level
applied mode_deltas[1] to every inter block, but spec 7.14.4's mode_lf_lut
maps GLOBALMV to mode_deltas[0]. Fixed by packing the GLOBALMV bit into
ref_grid's sign; that moved the forwarding gate's failure from seed 42
frame 1 to seed 48 frame 3 -- at least one more stacked defect on the
GOLDEN-live path, so the GOLDEN arm narrows back to a named refusal
(threading kept, unread) and the hand-built fixture now asserts the mask
by name instead of pixel exactness. A rare (~1/10..1/30) all-LAST
mismatch on the forwarding gate remains reachable even with the mask --
present with semantics identical to the previously pushed baseline --
pinned as this lane's next round.
feat(av1): flip the GOLDEN_FRAME refusal, proven by a hand-built OBU fixtureAhmet Kaan Gümüş · 5fb6ee3
feat(av1): flip the GOLDEN_FRAME refusal, proven by a hand-built OBU fixture

120+ real aomenc attempts never produced a decodable stream that fired
GOLDEN_FRAME before hitting an unrelated refusal first. A hand-built
3-frame stream (real key frame; a hand-coded intra "different content"
frame refreshing LAST_FRAME's slot; a hand-coded frame whose lone block
codes single_ref out to GOLDEN_FRAME and a skip zero-MV NEARESTMV) drives
decode_stream directly and is cross-checked against ffmpeg's own decode
of the identical wire bytes, 4 consecutive runs. decode_inter_block now
threads GOLDEN_FRAME to the golden_y/u/v planes already passed to it
instead of refusing every non-LAST_FRAME reference; LAST2/LAST3/BWDREF/
ALTREF2/ALTREF still refuse, unproven. intra_inter_ctx made pub(crate)
so the fixture can compute the exact context the decoder does.
guard(av1): GOLDEN decode stays refused until a stream proves it liveAhmet Kaan Gümüş · ed5f4c7
guard(av1): GOLDEN decode stays refused until a stream proves it live

The full single-non-LAST implementation stays (reference tree, MC
threading, mvstack filter, deblock ref deltas), but decode_stream
refuses GOLDEN narrowly again: 120 recipe attempts never produced a
decodable stream that actually fires the path, and an accepted-but-
unproven decode is the silent-miscode shape this repo does not ship.
The gate documents the refusal and the firing hunt continues.
feat(av1): decode a single non-LAST_FRAME reference (GOLDEN_FRAME)Ahmet Kaan Gümüş · 8a443b2
feat(av1): decode a single non-LAST_FRAME reference (GOLDEN_FRAME)

Round 2 continuation: read_single_ref threads the full single_ref_p1..p6
spec tree (context from the block's real above/left reference via
Neighbours::above_ref/left_ref, not a bare is_inter bool), decode_inter_block
threads a GOLDEN_FRAME picture down to motion compensation when the frame
header's ref_frame_idx[3] names a live DPB slot, and the deblock filter's
ref_frame_for_lf now indexes loop_filter_ref_deltas by the block's actual
reference instead of assuming LAST_FRAME for every inter block.

decode_stream widens its global-motion IDENTITY refusal to cover both
LAST_FRAME and GOLDEN_FRAME's own entries, and adds a reference_select
refusal (comp_mode/compound prediction stays out of scope; skip_mode is a
spec-guaranteed consequence of that same refusal, not a separate check).

mvstack's find_mv_stack candidate filtering and decode_inter_block8's
straddling-8x8 leaf path were already ref_frame-generic/LAST-only
respectively and needed no changes.

Gate: a_real_aomenc_inter_sequence_with_a_golden_reference_decodes_pixel_exact
(stream.rs) -- an 8-frame real-aomenc sequence with order-hint left on (the
one flag the sibling CDF-forwarding test disables specifically to suppress
GOLDEN_FRAME), asserting pixel-exact decode against ffmpeg whenever
decode::non_last_ref_hits() actually advances. Across the attempt budgets
tried this round, aomenc's RD never produced a stream that both fully
decoded under this crate's existing round-2 refusals AND picked
GOLDEN_FRAME -- the test SKIPs loudly rather than claim untested coverage,
same pattern as its cdf-forwarding sibling.

cargo test -p ec-av1 --release: 177 passed, 0 failed, 12 ignored.
feat(av1): implement the intra edge filter/upsample (spec 7.11.2.7-2.9)Ahmet Kaan Gümüş · 645882d
feat(av1): implement the intra edge filter/upsample (spec 7.11.2.7-2.9)

r5 left directional()'s edge filter/upsample as an unimplemented corner-cut
and left the two new predict() bool params half-plumbed (encode.rs call
sites done, stream.rs/decode.rs test-module sites missing). This round:

- finished the plumbing: decode.rs threads the sequence header's
  enable_intra_edge_filter through a thread-local (ENABLE_EDGE_FILTER,
  set once per decode_key_frame_tile_with_cdfs call, not per-block --
  documented why a thread-local beats touching two dozen call sites)
  down to PlaneBuf::reconstruct's predict() call; stream.rs sets it from
  the parsed seq header; encode.rs sites already passed false (our
  encoder never turns it on, so round-trips stay bit-green regardless).
- filter_intra_edge (5-tap kernel, 3 strength buckets via
  intra_edge_filter_strength's two smooth/non-smooth threshold tables),
  the filter_corner blend, and upsample_intra_edge (av1_upsample_intra_edge_c)
  were transcribed against libaom's reconintra.c and wired into
  directional()'s z1/z2/z3 walk (base/shift math doubled for the
  upsampled-density case). All present, none stubbed.
- flipped the gate's --enable-intra-edge-filter=0 to =1 so
  a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact
  actually exercises the new path instead of the disabled one.

The gate still fails, but NOT from this filter: patched-aomdec
cross-checks (EC_UDUMP dqcoeff/pred/recon dumps, /tmp/libaom-src's
decodeframe.c, not committed) prove the failing TU (chroma cpx=0/cpy=0,
DC_PRED, tx_type DctDct, skip=1 both sides) reconstructs bit-identically
pre-loop-filter in both decoders -- flat 128 either way, edge filter
inapplicable there (no real neighbours, corner-filter's 2n>=24 gate
doesn't fire at n=8). A PREDEBLOCK/POSTDEBLOCK trace (also not committed)
localizes the actual divergence to apply_deblock: our decoder introduces
a value our own pre-filter data does not justify at the row6-9/col6-9
TU-corner intersection, where both a horizontal and a vertical deblock
edge are filtered back to back. r4/r5's "intra edge filter gap" and
"tx_type path" suspects are both now falsified for this failure; the
next round's target is deblock_plane's edge-intersection order/read-back
(vertical-then-horizontal at a corner where an already-filtered vertical
sample feeds the horizontal filter's taps).

Suite: 174 passed, 1 failed (the known gate above) -- no regression from
r5's own checkpoint of the same numbers; the cdffwd flake did not fire
this run.
wip(av1): chroma tx_type derivation from Intra_Mode_To_Tx_Type, wires default_tx_typeAhmet Kaan Gümüş · 637d48a
wip(av1): chroma tx_type derivation from Intra_Mode_To_Tx_Type, wires default_tx_type

read_coeffs already carried a default_tx_type parameter from a prior round;
both call sites (read_plane's intra path and read_inter_plane's inter path)
didn't pass it yet, so the tree didn't compile. Wires them:

- read_plane (intra): plane_idx==0 or side>=32 -> DctDct (av1_get_tx_type,
  blockd.h: 64-and-up is unconditional, 32x32 chroma survives
  intra_mode_to_tx_type only to be re-forced by EXT_TX_SET_DCTONLY gating
  in av1_get_ext_tx_set_type); otherwise chroma takes
  default_intra_tx_type(predict_mode), a from-libaom transcription of
  intra_mode_to_tx_type's static table (D45_PRED is DCT_DCT, not an ADST
  mode -- transcribed exactly, no set-membership fallback needed since
  every entry the table can produce (DCT_DCT/ADST_DCT/DCT_ADST/ADST_ADST)
  is already inside both TX_SET_INTRA_1 and _2).
- read_inter_plane: always DctDct -- Intra_Mode_To_Tx_Type only applies to
  an intra block's chroma plane per av1_get_tx_type's own is_inter branch.

Cross-checked against a live patched aomdec (EC_CHROMA_TXTYPE trace in
/tmp/libaom-src/av1/decoder/decodetxb.c, not committed here) on the
lane's own seed-42 aomenc fixture: every uv_mode -> tx_type pair libaom
picked for this stream's chroma matches default_intra_tx_type exactly.

Suite: 174 passed, 1 failed (the new
a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact) --
NOT the pre-existing cdffwd flake. Confirmed the failure predates and
survives this fix: reverting default_tx_type to always-DctDct made the
mismatch start at pixel row 0 (whole-plane wrong); with this fix it
starts at row 6 and grows outward in a triangular fan, meaning the
tx_type choice is not itself wrong (matches libaom's own choice
byte-for-byte) but something downstream of it -- reconstruction/
directional-prediction propagation -- still diverges. Left failing,
not silenced or adjusted, for the next round to chase with the two
named suspects (intra edge filter gap, this tx_type path) now narrowed
to one.
Merge branch 'lane-av1tx4': TX4 luma decode and the 1D transform classesAhmet Kaan Gümüş · 843a5a8
Merge branch 'lane-av1tx4': TX4 luma decode and the 1D transform classes

Seven rounds: TX4 coefficient tables (transcription cross-verified),
V_DCT/H_DCT scan orders and the class-split eob_pt CDF, the leaf8
scan-table fix, and a gate that fires the class-1 path on real aomenc
bytes and decodes pixel-exact. The tx-class lesson: a transform class
is a cross-cutting dimension -- scan, eob table, and context each
carry it.
feat(av1): gate the V_DCT/H_DCT class-1 path on real aomenc bytesAhmet Kaan Gümüş · 5147651
feat(av1): gate the V_DCT/H_DCT class-1 path on real aomenc bytes

The sub-8 refusal verdict, the fixture recipe, and a tx_class1_hits
counter: a min/max-partition-8 horizontal-stripe stream fires H_DCT
through the class-split eob path and decodes full-frame pixel-exact
vs ffmpeg, 4/4 runs.
feat(av1): interpolation filters beyond REGULAR, incl. per-block SWITCHABLEAhmet Kaan Gümüş · 10f24e6
feat(av1): interpolation filters beyond REGULAR, incl. per-block SWITCHABLE

The ~13% decodes-but-wrong inter flake was a whole missing filter
family: motion compensation always used the REGULAR subpel tables,
while real encoders pick SMOOTH/SHARP per frame -- or SWITCHABLE,
reading a per-block filter symbol pair this decoder never read (the
silently-unread class again; our own encoder writes one fixed filter).
All four table sets land in mc.rs with an aomdec-pinned unit test, the
switchable_interp CDFs and neighbour context follow libaom's
read_mb_interp_filter, and the filter threads from the frame header
through both inter block paths. The forwarding gate ran 10/10 with
zero pixel mismatches and no vacuous skips.
diag(av1): report worst pixel delta in the pinned-mismatch scratch probeAhmet Kaan Gümüş · ddd8c16
diag(av1): report worst pixel delta in the pinned-mismatch scratch probe

Re-measured the cdf-forwarding gate's flake on HEAD (4/30, ~13%, matches
the prior ~17% sample -- not stale). Pinned a failing stream and used
scratch_isolate_pinned_mismatch to triage it: frame 2 is small (+-1,
MC-rounding shape); frame 3's much larger mismatch is downstream
propagation through frame 3's own inter reference to frame 2's
already-wrong pixels, not a second independent defect. Added worst-delta
to the probe's report so this triage doesn't need a manual pass next
time. Root cause not fixed this round -- see ledger for the numeric
reproduction (a 16x16 chroma block, mv=(7,15) eighth-pel, subpel
xfrac=15/yfrac=7) that lands outside the previously-fixed leaf8 4-tap
case, still open.
feat(av1): the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate firesAhmet Kaan Gümüş · 2411791
feat(av1): the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate fires

A reduced_tx_set=0 frame's 8x8-and-under intra transforms read tx_type
from the seven-symbol TX_SET_INTRA_1, not the five-symbol reduced row
our tables carried (the row-held-constant class, on the tx-set
dimension -- our own encoder always writes reduced_tx_set=1, the same
writer-never-needs-it trap as mv_hp). New set-1 CDF row, the set-1
symbol order from av1_ext_tx_inv, and the V_DCT/H_DCT inverse
transforms (one-axis DCT, identity on the other). The tx-select gate
now actually FIRES: mandelbrot content at min-partition 16 splits
16x16 blocks into TX8 TUs that read the set-1 rows and decode
pixel-exact vs ffmpeg, 4/4 runs, no skips. Resolved 4x4 luma stays a
named refusal (no TX4 coefficient tables yet).
feat(av1): read tx_depth under TxMode::Select on key framesAhmet Kaan Gümüş · ab94637
feat(av1): read tx_depth under TxMode::Select on key frames

Threads a tx_select flag through decode_key_frame_tile's block walk so an
intra frame using TxMode::Select reads the tx_depth symbol (cat0..3 CDFs,
tx_size_context) instead of assuming TxMode::Largest, resolving to a
per-TU split-luma decode path when the block's transform is smaller than
its own side. A resolved 4x4 luma transform still refuses by name (no 4x4
coefficient tables yet). Narrows the old whole-stream TxMode::Select
refusal to inter frames only, since decode_inter_frame's block loop does
not thread tx_select yet.

Adds tx_depth_hits() (before/after counter, same pattern as
filter_intra_hits/deblock_hits) and a real-aomenc gate test proving a
split transform actually decodes pixel-exact against ffmpeg -- currently
SKIPs (no fixture recipe found in this session reliably lands a stream
that both avoids this decoder's other named round-2 gaps and resolves a
tx_depth split without exhausting to 4x4); it never fails, so the suite
stays green while that fixture search continues.

Investigated a reported suite regression on this branch first: it does
not reproduce against this diff -- the cdf-forwarding inter-sequence gate
(a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact)
fails at the same ~17% rate with this diff fully reverted, confirmed over
30 stashed runs on HEAD. Pre-existing flake, not a regression.
fix(av1): predict from the slot ref_frame_idx names, not the last decodeAhmet Kaan Gümüş · 8f9acc8
fix(av1): predict from the slot ref_frame_idx names, not the last decode

The reference picture was a single global overwritten every frame;
LAST_FRAME names a slot via ref_frame_idx[0], and a frame whose
predecessor refreshed a different slot must keep predicting from what
is still stored there. Bit-exact motion vectors into the wrong picture
made a luma-only small-magnitude residue that looked like rounding.
Pictures now live in the same 8-slot array discipline the CDF states
already use, both stored under refresh_frame_flags.

The pinned forwarding stream decodes 4/4 frames pixel-exact on every
plane; the live gate ran 6/6 green with no skips.
feat(av1): read the mv_hp/class0_hp bits real hp streams carryAhmet Kaan Gümüş · e192a62
feat(av1): read the mv_hp/class0_hp bits real hp streams carry

The dropped-as-dead half-pel MV CDFs (our own writer never sets
allow_high_precision_mv) were silently unread on foreign streams whose
headers set the flag -- every later symbol shifted one bit, the same
silently-unread-symbol shape as use_filter_intra. Tables restored,
reads gated on the frame header's flag, plumbed through the inter tile
path. On the pinned forwarding stream frame 3's desync drops from
2618 wrong luma pixels (worst 35) to 541 (all within 1, chroma exact)
-- entropy now aligned, a luma-only reconstruction residue remains.
debug(av1): env-gated dump of frame-2 saved CDF tables, decisive negative resultAhmet Kaan Gümüş · a45ccae
debug(av1): env-gated dump of frame-2 saved CDF tables, decisive negative result

EC_AV1_DUMP_TABLES dumps the reference-slot CDF tables a frame saves
(partition_w64/w32/w16, skip, new_mv, zero_mv, ref_mv, mv_joint) in the
spec's cumulative-probability orientation. Cross-checked against a matching
libaom decodeframe.c dump (converting its inverted icdf storage back to the
same orientation) on the pinned cdffwd stream: frame 2's saved tables are
byte-identical between the two decoders across every table sampled. This
falsifies the CDF-forwarding hypothesis (stale/never-adapted forwarded
table, specifically the gathered-partition-never-adapted theory) for the
frame-3 partition_w32[ctx=8] divergence — the bug is elsewhere (context
computation entering frame 3, an untabled CDF, or an actual bitstream
desync inside frame 3 itself). Also confirmed by libaom source
(bitreader.h aom_read_symbol_ vs aom_read_cdf_) that libaom's own gathered
partition reads never call update_cdf on the full table either, matching
our symbol_fixed's behavior -- the gathered-adaptation theory was wrong on
both sides independently.
test(av1): trace inter-block mv/skip; restructure the cdf-forwarding gate as a seed loopAhmet Kaan Gümüş · 82a96d2
test(av1): trace inter-block mv/skip; restructure the cdf-forwarding gate as a seed loop

decode_inter_block now prints its skip/mv/is_new_mv decision under
EC_AV1_TRACE, matching the key-frame path's existing tracing -- needed to
diff against an instrumented aomdec when chasing the cdf-forwarding
mismatch (still open: pinned streams show frame N+1's second same-context
partition_w32 read choosing a different split than aomdec once frame N's
forwarded, count-reset table has adapted through one prior read at that
context, implying the forwarded state itself already differs going into
the frame -- root cause not yet found).

The cdf-forwarding gate now retries several aomenc seeds (RD is
non-deterministic run to run) and requires the first stream that decodes
to be pixel-exact, rather than depending on one fixed seed's RD choice.
fix(av1): reset every CDF's symbol counter before saving it forwardAhmet Kaan Gümüş · 6404564
fix(av1): reset every CDF's symbol counter before saving it forward

Spec 7.20 save_cdfs (libaom av1_reset_cdf_symbol_counters, entropy.c)
zeroes each table's adaptation-rate counter before storing the tile's
end-of-tile state into a reference slot for cross-frame forwarding --
the probabilities carry forward, the counts do not. This decoder was
forwarding the raw counts, so every table an inter frame resumed from
adapted faster than the real decoder's for the rest of that frame: too
small a drift to flip a symbol after one hop, but compounding across
two into a genuine desync (a pinned aomenc stream showed frame 0/1
pixel-exact, then ~60% of frame 2's luma wrong by +-1 once the drift
caught up).

crates/ec-av1/src/cdf_state.rs adds Cdfs::reset_counts (and the
MvComponentCdfs half it delegates to), zeroing the last entry of every
adapting array without touching its probabilities.
crates/ec-av1/src/stream.rs calls it on the saved (non-
disable_frame_end_update_cdf) branch only, matching libaom's REFRESH_
FRAME_CONTEXT_BACKWARD path; the disable_frame_end_update_cdf branch
already stores the untouched loaded state, which needs no reset.

The forwarding-gate test is still flaky, but no longer on this bug: a
20-run sample after the fix shows zero pixel-mismatch failures (the
class this commit targets); every failure left is a variant of the
same pre-existing, already-documented round-2 refusal (aomenc's RD
search occasionally choosing a reference other than LAST_FRAME or a
partition/tx-type this decoder does not model), unaffected by CDF
state. Full `cargo test -p ec-av1 --release` here: 170 passed, 1
failed (that same refusal), 12 ignored.
feat(av1): GLOBALMV under identity warp; the real inter gap was CDF forwardingAhmet Kaan Gümüş · 74ed1bd
feat(av1): GLOBALMV under identity warp; the real inter gap was CDF forwarding

The 'partition type' refusal on real inter streams was misattributed:
the tile's first partition symbol came back out-of-alphabet because a
real encoder's inter frame loads its initial CDF state from the
previous frame's adapted tables (primary_ref_frame + load_cdfs, spec
7.20) and this decoder starts every frame from the spec defaults. The
deblocked inter-sequence gate now encodes with error-resilient frames
(primary_ref_frame = NONE, a shape real low-latency encodes use) and
decodes pixel-exact. GLOBALMV decodes as the zero vector under the
IDENTITY warp model, with a named refusal for any other model.
feat(av1): implement the spec 7.14 in-loop deblocking filterAhmet Kaan Gümüş · 66b41fc
feat(av1): implement the spec 7.14 in-loop deblocking filter

Fixes the two decode_key_frame_tile/decode_inter_frame_tile call sites in
stream.rs (a prior round added the LoopFilterParams parameter without
threading it through), then ports libaom's edge-level decision
(av1_loopfilter.c) and pixel kernels (aom_dsp/loopfilter.c: filter4/6/8/14)
restricted to this decoder's own invariants -- uniform level only (no
segmentation/delta_lf, already refused upstream), and transform size always
equal to block size, which collapses the PU-edge/TU-edge distinction and the
both-sides-skipped suppression away entirely.

Applied after tile reconstruction and before apply_cdef in both frame
paths. Our own encoder never sets a nonzero loop_filter.level, so every
existing round-trip is unaffected (verified: encode.rs never touches
LoopFilterParams, suite green at 170/0/12).

New gate: a_real_aomenc_intra_stream_with_deblocking_decodes_pixel_exact
(pixel-exact vs ffmpeg, deblocking on, CDEF off, deblock_hits() counter
proves the filter fired) and its inter-sequence counterpart, which SKIPs on
this box -- the same real-aomenc stream hits a pre-existing partition-type
gap this lane's decoder doesn't cover (lane-av1-rect territory per
decode.rs's own module doc), not a deblocking defect.
fix(av1): filter-intra was already correct -- gate against a real aomenc streamAhmet Kaan Gümüş · 2adf290
fix(av1): filter-intra was already correct -- gate against a real aomenc stream

The straddling-boundary mismatch against ffmpeg's decode was never the
filter-intra predictor: it's a real AV1 deblocking-filter artifact, and
this decoder has no in-loop deblocking at all. `--loopfilter-control=0`
on the aomenc fixture makes the two decodes byte-exact with zero source
changes to intra.rs/decode.rs's prediction math.

Adds a permanent gate (crates/ec-av1/src/stream.rs) that shells out to a
real standalone aomenc build (ffmpeg's own libaom-av1 wrapper on this box
doesn't expose enable-tx-size-search/loopfilter-control through
-aom-params), asserts the use_filter_intra symbol actually fired via a new
process-global counter (decode::filter_intra_hits), and checks pixel-exact
luma/U/V against ffmpeg's own decode of the identical bytes. The
encoder's screen-content-tools decision is a real internal PSNR trial,
occasionally flips even with palette/intrabc off; the test skips (not
fails) the still-unsupported-gap runs the same way the existing CDEF gate
test does.
feat(av1): finish CDEF in-loop filter (spec 7.15), close r1's borrow errorAhmet Kaan Gümüş · 8425e46
feat(av1): finish CDEF in-loop filter (spec 7.15), close r1's borrow error

r1 left decode.rs with a full CDEF port (direction search, primary/
secondary taps, damping, chroma) but an E0502 borrow (closures captured
`y.width`/`y.true_*` while `y` was mutably borrowed by the filter call) and
several test call sites at the old decode_key_frame_tile/decode_inter_frame_tile
arity. Fixed the borrow by copying the plane's stride/extent into locals
before the closures, and threaded &CdefParams::default() through every
in-crate test caller.

Verified two real correctness bugs against libaom's cdef_block.c/cdef.c
while porting:
- is_skip_txfm only read one of the four 4x4 mi cells an 8x8 CDEF unit
  covers; libaom's is_8x8_block_skip requires all four skip (a sub-8x8
  partition can straddle the unit with mixed skip flags).
- av1_cdef_filter_fb zeroes the shared `dir` per plane when *that plane's
  own* frame-level primary strength is 0 (`pri_strength ? dir : 0`),
  independent of the per-block adjusted strength and of the other plane;
  the port was passing the same nonzero dir to both.

New hard test (a_real_libaom_gradients_stream_with_cdef_decodes_pixel_exact)
encodes a real libaom-av1 stream with CDEF left on (no -enable-cdef 0) and
asserts pixel-exact against ffmpeg's own decode -- passed first run after
the two fixes above. Full cargo test -p ec-av1 --release: 166 passed, 0
failed, 12 ignored.
fix(av1): read the unread use_filter_intra flag; audit the same blindness classAhmet Kaan Gümüş · beeeec5
fix(av1): read the unread use_filter_intra flag; audit the same blindness class

lane-av1real r10 added the FILTER_INTRA/FILTER_INTRA_MODE CDF tables and
Cdfs fields but stopped mid-wiring; this finishes threading
enable_filter_intra (from the sequence header) through decode_key_frame_tile
-> decode_block/decode_leaf8 -> read_intra_mode, which now reads
use_filter_intra after DC_PRED at <=32x32 (spec 5.11.14,
av1_filter_intra_allowed) and refuses use_filter_intra==1 blocks (this
decoder does not implement the 5.11.14 recursive predictor) rather than
silently miscoding.

The pinned CfL stream's actual bug was exactly this: its block reads
use_filter_intra=0, so the flag's own bits were never consumed before,
desyncing every later symbol read self-consistently -- both the Python
cross-checks and debug aomdec traces shared that blindness. With the flag
read, the pin decodes pixel-exact (luma/U/V) against ffmpeg, and the
previously-#[ignore]d a_real_libaom_cfl_stream_decodes_pixel_exact test now
passes green with no split needed.

Blindness-audit sweep of read_intra_frame_mode_info (libaom decodemv.c)
found three more per-block/per-superblock symbols this crate silently never
reads while accepting the header fields that would gate them:
allow_screen_content_tools (intrabc/palette_mode_info), delta.q_present/
delta.lf_present (per-SB delta_q/delta_lf), and segmentation.enabled
(per-block segment_id) -- named refusals added in decode_stream next to the
existing CDEF/TxMode::Select refusals.

Full ec-av1 suite: 165 passed, 0 failed, 12 ignored.