forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 50503af092ea77b052d6770536f4108003fdabddFiltered to crates/ec-av1/src/decode.rsClear filter

2026-09-01

test(av1): force_integer_mv motion-mode gate asserts non-vacuity per attemptAhmet Kaan Gümüş · 50503af
test(av1): force_integer_mv motion-mode gate asserts non-vacuity per attempt

The r1 gate asserted `force_integer_mv frames > 0` and `forced-2-symbol
blocks > 0` only in aggregate over its 6 cq/step cells, so one lucky cell
would have carried five silently vacuous ones (class gate-blind-to-feature).
Both counters are now snapshotted per attempt and asserted after that
attempt's pixel compare: all 6/6 cells of each bit-depth arm carry
force_integer_mv=1 frames AND blocks forced onto the 2-symbol obmc
alphabet (114 frames / 342 blocks per arm).

Also documents at the `ref_is_scaled` site why libaom `av1_is_scaled`'s
y_scale_fp half is unreachable in this decoder: a reference whose height
differs from the frame's true size is refused before any tile decodes
(decode.rs ~14681), so the x-only test is exact here and the y term belongs
to whoever lifts that refusal.
fix(av1): motion_mode alphabet ignored force_integer_mv (and scaled refs)Ahmet Kaan Gümüş · a9eda25
fix(av1): motion_mode alphabet ignored force_integer_mv (and scaled refs)

libaom motion_mode_allowed (blockd.h ~1484) only returns WARPED_CAUSAL when
!xd->cur_frame_force_integer_mv && !av1_is_scaled(block_ref_scale_factors[0]);
our warp_eligible had neither clause, so a screen-content frame whose header
set force_integer_mv read the 3-symbol motion_mode_cdf where libaom wrote the
2-symbol obmc_cdf -- a silent tile desync with no refusal naming it (class
wrong-alphabet-same-value). Same clause swept into decode_inter_block8's own
8x8-leaf read.

Gate: a_real_force_integer_mv_warp_{,10bit_}stream_decodes_pixel_exact --
--tune-content=screen, --enable-warped-motion=1 --enable-obmc=1
--enable-global-motion=0 over static screen-content tiles with whole-pixel
motion (what aomenc's av1_is_integer_mv needs). Hard-asserts a decoded frame
header with force_integer_mv=1 and >=1 block forced onto the 2-symbol
alphabet. 6/6 pixel-exact both bit depths; the same gate is 0/6 with 6 named
refusals when the !force_integer_mv clause is removed.
fix(av1): revert r2's nz_map transposition -- it regressed the merged SB HORZ/VERT partition gate; SB split-tx refusal restoredAhmet Kaan Gümüş · 429edc6
fix(av1): revert r2's nz_map transposition -- it regressed the merged SB HORZ/VERT partition gate; SB split-tx refusal restored

r3 ran the gates r2 never reached. r2's claimed root cause (base_ctx reading
the rect av1_nz_map_ctx_offset tables [row][col] instead of [col][row]) turns
the split-transform SB gate green at the cost of turning the MERGED gate
a_real_aomenc_stream_with_a_superblock_level_horz_vert_partition_decodes_pixel_exact
RED at seed 43. All four index/shape combinations measured; two fail both. The
real unknown is the orientation of (row,col) out of the square 32x32-corner
scan vs libaom's column-major coeff_idx, so the SB-level split-transform
refusal is restored and gate (b) is #[ignore]d again with that reason.

Kept from r2: per-attempt gate counters (no vacuous pass from a stream that
later refuses), the SB-interior-TU counter gate (b) asserts, the chroma shape
guard justification, gate (c)'s corrected recipe comment, the nz_map table
packing pin, and the EC_NZOFF_DUMP / decode_probe dump instruments.
fix(av1): the 16x16-level PARTITION_VERT_B arm missed the vert availability tablesAhmet Kaan Gümüş · 1f9bde4
fix(av1): the 16x16-level PARTITION_VERT_B arm missed the vert availability tables

decode.rs:7008 visits its two 8x8 squares TR then BR, out of raster order, so
like the 32/64-level AB arms r5 fixed it must read libaom's has_tr_vert_8x8 /
has_bl_vert_8x8 (get_has_tr_table / get_has_bl_table take the partition type).
has_bl_8x8 is 0 where has_bl_vert_8x8 is 1 at all 16 even-row/odd-col 8x8 slots
-- exactly the TR square -- so its below_left was wrongly false for the
directional modes that read below-left (angle > 180: D203_PRED, D157_PRED with a
positive delta). Class swept: this was the only remaining unguarded VERT_A/_B
site at any level, intra or inter.

Gated by a table pin (encode.rs) rather than a stream: a bounded 112-encode
aomenc sweep produced no decodable 16-level VERT_B -- every stream that
partitions that small first hits the still-refused HORZ_A/HORZ_B/VERT_A-below-16
or coded-rect-strip-below-16 arms. Counts in lanes/part32-r6.report.md.

EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib: 270 passed, 0 failed.
test(av1): gate the square intra path with tx-size search ON and real chroma; the chartered square-path chroma defect does not reproduceAhmet Kaan Gümüş · 213865e
test(av1): gate the square intra path with tx-size search ON and real chroma; the chartered square-path chroma defect does not reproduce

lane-rectsplit r1 recorded, in a comment on two live gates, that a plain
SQUARE-partition intra key frame with real chroma and aomenc's tx-size search
left at its default (ON) mismatches on the U plane, and guarded both gates with
`-vf hue=s=0`. Re-measured at HEAD, that is false: seeds 42..61 at cq 45 and at
cq 20, plus testsrc2/mandelbrot/smptebars/rgbtestsrc at cq 12/32, with and
without CFL and filter intra, all decode pixel-exact against ffmpeg on all three
planes (`--enable-rect-partitions=0`, the charter's own recipe). Seed 42 does
fire the pairing the defect was attributed to -- 6 blocks with `tx_depth != 0`
and uv_modes 0/1/2/5/11 -- and still matches.

So this ships the gate that was missing rather than a fix:
`a_real_aomenc_intra_stream_with_tx_size_search_and_chroma_decodes_pixel_exact`
sweeps 10 8-bit square streams (cq 20/40) plus one 10-bit stream of the same
recipe (his films are yuv420p10le; sequence-header bit_depth asserted before any
pixel compare), and hard-asserts a new `sq_chroma_tx_hits()` counter -- square
blocks whose luma transform split under a non-DC `uv_mode` -- summed only over
attempts that decoded AND pixel-compared, so a refusing stream cannot lend it
firings. 11/11 exact, 23 firing blocks 8-bit + 2 10-bit, 0 refusals.

The stale `hue=s=0` guard is dropped from both live rect gates (and the ignored
SB-strip one); both stay green with real chroma, so they now cover chroma too.
Merge branch 'lane-hbdinter': 10-bit loop restoration (SGR box sums scaled by bd-8, wiener clamp at the bd bound), combine_compound two-step rounding; 10-bit inter+LR gate (verifier PASS, 271/0/23); restoration leaves NEVER_EXERCISED_10BITAhmet Kaan Gümüş · b933555
Merge branch 'lane-hbdinter': 10-bit loop restoration (SGR box sums scaled by bd-8, wiener clamp at the bd bound), combine_compound two-step rounding; 10-bit inter+LR gate (verifier PASS, 271/0/23); restoration leaves NEVER_EXERCISED_10BIT

Also drops enable-dist-wtd-comp and enable-global-motion from
NEVER_EXERCISED_10BIT: lane-cwarp's 10-bit compound global-warp gate passes
=1 for both, so never_exercised_10bit_matches_the_gate_recipes was already
failing at 9c35ecc. gate_coverage is green again after this commit.

Conflict resolutions: warp.rs took main's (cwarp warp_inner/warp_affine_compound
is a superset of hbdinter's const BD -> bit_depth()); mc.rs kept hbdinter's
single (bd-8) diffwtd_mask round plus its combine_compound two-step and
inter_pred_hits counter; stream.rs kept main's encode_10bit_gradients helper
and cwarp gates plus hbdinter's a_real_aomenc_10bit_inter_sequence gate.
fix(av1): a warp-capable frame under a scaled reference read the 3-symbol motion_mode_cdf where libaom reads the 2-symbol obmc_cdfAhmet Kaan Gümüş · cd8ea46
fix(av1): a warp-capable frame under a scaled reference read the 3-symbol motion_mode_cdf where libaom reads the 2-symbol obmc_cdf

libaom motion_mode_allowed (blockd.h:1484) drops WARPED_CAUSAL eligibility when
av1_is_scaled(block_ref_scale_factors[0]), so a superres block reads obmc_cdf.
We read motion_mode_cdf: the decoded value stayed SIMPLE_TRANSLATION, so nothing
errored -- the stream decoded "OK: 24 frames" with quietly wrong pixels from the
diverged coder state (frame 1: 1342 luma pixels off, growing to |d|=18 by frame
23). The existing warp refusal could not see it (warp_params is None there).

Gate: the superres gate now runs --enable-warped-motion=1 by DEFAULT and
hard-asserts scaled_warp_suppressed_hits() > 0 -- 12/12 pixel-exact, 25 blocks
took the obmc_cdf arm only because of this fix. decode_probe gains EC_PROBE_OUT
(raw yuv420p dump), the instrument that located it. Sibling site in
decode_inter_block8 is unreachable (refused earlier) and carries a note.
fix(av1): mi-granular inter neighbour bands + three 8x8-leaf context defects (8-bit 8x8-split gate GREEN)Ahmet Kaan Gümüş · cbf9f54
fix(av1): mi-granular inter neighbour bands + three 8x8-leaf context defects (8-bit 8x8-split gate GREEN)

lane-inter8 r2. `Neighbours`' inter side bands (skip, skip_mode, is_inter,
ref0/ref1, comp_group_idx, compound_idx, interp filter) were SUB(16px)-granular,
so all four 8x8 leaves of a split 16x16 shared one slot. They are now mi(4px)
granular (`record_inter_rect_mi` / `record_compound_ctx_rect_mi`, readers index
by mi), which makes the r1 `prev_leaves` sibling-override hack unnecessary --
each leaf stamps its own 2x2-mi span right after it decodes.

Two further defects that the granularity change exposed, both class
context-read-from-one-cell:

1. `decode_inter_block8`'s COMPOUND arm `return`ed before the end-of-function
   `record_mi`/`fill_lf_grid` the single-ref arm falls through to. Every leaf in
   the gate's stream is compound, so a split 16x16 left `above_side_mi` at 16:
   the 16x16 below it computed partition ctx 0 instead of 1 and read
   PARTITION_NONE where aomdec read PARTITION_SPLIT.
2. `get_comp_group_idx_context`/`get_comp_index_context` took the leaf's
   ENCLOSING 16x16 corner (`outer_at`); they now take mi coordinates and the
   leaf passes its own.

Also threaded the frame's temporal mv field (`tpl_frame`) into the leaf's two mv
stacks, which passed `None` while `decode_inter_block` one level up always
passed it (class parsed-then-discarded). Alignment only: it did not move this
stream's ladder (no `use_ref_frame_mvs` here).

Gate a_real_aomenc_inter_sequence_with_an_8x8_leaf_split_decodes_pixel_exact is
GREEN and un-ignored (4 frames pixel-exact vs ffmpeg, interior-split counter
asserted). aomdec EC_MODE ladder 42/57 -> 57/57. The 10-bit twin stays ignored:
it dies on "an INTER 32x32 partition type ... (value=9)", and `EC_TRACE=1
aomdec` proves that stream contains no value=9 anywhere -- our own desync
(class refusal-from-own-desync), disproving the r1 ledger line that blamed
aomenc for emitting PARTITION_VERT_4.
Merge branch 'lane-part32': SB-level HORZ/VERT/HORZ_A/HORZ_B/VERT_A/VERT_B at 64x64 gated pixel-exact (has_tr_vert/has_bl_vert tables for VERT_A/B visit order); refusal narrowed to HORZ_4/VERT_4 (verifier PASS, 269/0/24)Ahmet Kaan Gümüş · 9235c22
Merge branch 'lane-part32': SB-level HORZ/VERT/HORZ_A/HORZ_B/VERT_A/VERT_B at 64x64 gated pixel-exact (has_tr_vert/has_bl_vert tables for VERT_A/B visit order); refusal narrowed to HORZ_4/VERT_4 (verifier PASS, 269/0/24)

Merge fixup: lane-part32's new decode_block_rect/decode_block_rect64 call sites
(4 AB arms + the strip64! macro) needed HEAD's added `reduced_tx_set` argument.
fix(av1): 10-bit loop restoration, diffwtd mask and warp all ran with 8-bit constantsAhmet Kaan Gümüş · 42752a0
fix(av1): 10-bit loop restoration, diffwtd mask and warp all ran with 8-bit constants

lane-hbdinter r1. The charter's premise (a 10-bit inter frame 2 mismatch)
did NOT reproduce with the tool-restricted inter recipe; widening the
recipe to real loop restoration did, and the defect turned out to be
bit-depth-wide, not inter-specific -- it fires on the KEY frame too, and
lane-hbd's 10-bit gate simply had `--enable-restoration=0`.

Four sites carried hardcoded 8-bit constants, all checked against the
oracle source (~/.cache/aom-oracle/src):

- restoration.rs `compute_ab`: libaom `restoration.c:660-662` scales the
  box sums back to the 8-bit range before forming `p`
  (`a = Round2(A, 2*(bd-8))`, `b = Round2(B, bd-8)`; `B[k]` keeps the raw
  sum). We never did -> wrong `z`, wrong blend factor at 10-bit. This is
  the site the gate attributes the mismatch to (ablation below).
- restoration.rs `apply_wiener_stripe`: the horizontal intermediate was
  clamped to a fixed `[0, 8191]`, i.e. `WIENER_CLAMP_LIMIT(3, bd=8) - 1`
  (`convolve.h:43`), in this crate's *unbiased* domain. Correct bounds are
  the libaom limit shifted down by its `1 << (bd + 3)` bias. At 8-bit
  neither end is reachable (which is why every 8-bit gate passed); at
  10-bit the top of the range is 16368, so most Wiener intermediates were
  truncated.
- mc.rs `diffwtd_mask`: libaom `reconinter.c:307` rounds the CONV_BUF
  difference by `INTER_POST_ROUND + (bd - 8)`; we used the constant 4.
- warp.rs `warp_affine`: `const BD: i32 = 8` fed both offset terms and the
  final `sum - (1<<(bd-1)) - (1<<bd)` (tip from lane-gmaffine, confirmed
  against `av1_warp_affine_c`).

Non-compound sub-pel MC needs no change: libaom only shifts round_0/round_1
when `bd + FILTER_BITS - round_0 + 2 > 16` (`convolve.h:83`), which is
12-bit only -- 10-bit keeps 3/11 and 3/7.

Gate: `a_real_aomenc_10bit_inter_sequence_decodes_pixel_exact` (stream.rs)
-- real aomenc yuv420p10le, 128x64, 16 frames, forward P frames, deblock +
loop restoration on, hard-asserting the new `mc::inter_pred_hits` counter,
`deblock_hits`, and a non-RESTORE_NONE LR filter, comparing all 16 frames
against ffmpeg's own 10-bit decode. Green with the fix; reverting only the
`compute_ab` scaling turns it red at frame 0 (V plane, sample 52: ours 289,
ffmpeg 288).

cargo test -p ec-av1 --lib: 268 passed, 0 failed, 23 ignored (664s).
feat(av1): per-reference GLOBAL warp on compound blocks (was silently translational)Ahmet Kaan Gümüş · e67ae7f
feat(av1): per-reference GLOBAL warp on compound blocks (was silently translational)

decode_inter_block's compound branch predicted both taps through
mc::predict_compound_intermediate; libaom runs av1_init_warp_params per
reference, so each ref of a GLOBAL_GLOBALMV block under a ROTZOOM/AFFINE
model is filtered through av1_warp_plane into the compound intermediate.
No refusal named this -- silently wrong pixels.

warp.rs: warp_affine split into warp_inner + store closure, hardcoded BD=8
replaced by crate::decode::bit_depth(), new warp_affine_compound
(av1_highbd_warp_affine_c's is_compound branch, unbiased to match this
crate's intermediate domain). mc.rs: diffwtd_mask's round was missing
libaom's (bd - 8) term. New gate a_real_compound_global_warp_stream_decodes_pixel_exact:
6/6 pixel-exact, compound_warp_hits=37. 10-bit arm ignored, blocked by a
pre-existing 10-bit compound MC defect (ablation in its doc comment).
feat(av1): inter 16x16 PARTITION_SPLIT into 8x8 leaves, and three real leaf-context defectsAhmet Kaan Gümüş · 1bfb2cb
feat(av1): inter 16x16 PARTITION_SPLIT into 8x8 leaves, and three real leaf-context defects

The inter tile path now reads the real partition alphabet at the 16x16 level
and recurses PARTITION_SPLIT into four 8x8 inter leaves (interior blocks, not
just frame-edge straddles), counted by INTER_SUB16_SPLIT_HITS.

Three defects in decode_inter_block8, each found by diffing our new EC_MODE
range ladder against the instrumented aomdec's rung-4 EC_MODE:

1. comp_mode/compound-ref contexts were built from a FABRICATED neighbour
   (ref0=LAST if inter, ref1=None). av1_get_reference_mode_context asks whether
   the neighbour is COMPOUND, so with real LAST+GOLDEN neighbours the leaf read
   single-ref where aomdec read compound NEAR_NEWMV (mi 4,14).
2. the sibling override was a single prev_leaf; the bottom-left leaf's ABOVE
   neighbour is leaf 0, never leaf 1 (class context-read-from-one-cell). Now a
   prev_leaves slice matched by coordinate, each leaf returning its own refs.
3. both leaf mv stacks used NO_SIGN_BIAS/NO_GM_MV and assign_compound_mv got
   zero gm mvs, while decode_inter_block one level up passed the frame's real
   tables. Threaded through (alignment; inert on this fixture's identity gm).

Gate: a_real_aomenc_[10bit_]inter_sequence_with_an_8x8_leaf_split_decodes_pixel_exact
(aomenc --min-partition-size=8 --max-partition-size=16, hard-asserts
inter_sub16_split_hits moved, pixel-exact vs ffmpeg on every frame). It is RED
and #[ignore]d with its reason: Neighbours' above_*/left_* arrays are still
16x16-granular, so leaf (6,12)'s LEFT neighbour cannot resolve to leaf (6,10)
of the previous 16x16 block. Ladder agreement went 41/57 -> 42/57 blocks and
the stream stopped refusing, but it is NOT pixel-exact. The lane is therefore
not merge-ready; see lanes/inter8-r1.report.md.
fix(av1): inter segment map stamp uses the strip footprint (write_w/write_h), not side x side -- libaom x_mis/y_mis are mi_size_wide/high[bsize]; found by the segr1 verifier, unreachable today behind the rect-residual refusalAhmet Kaan Gümüş · 7555158
fix(av1): inter segment map stamp uses the strip footprint (write_w/write_h), not side x side -- libaom x_mis/y_mis are mi_size_wide/high[bsize]; found by the segr1 verifier, unreachable today behind the rect-residual refusal
fix(av1): PARTITION_VERT_A/_B square sub-blocks must read libaom's _vert_ has_tr/has_bl tablesAhmet Kaan Gümüş · 02e331f
fix(av1): PARTITION_VERT_A/_B square sub-blocks must read libaom's _vert_ has_tr/has_bl tables

lane-part32 r5. A VERT_A/VERT_B partition visits its square sub-blocks
TL, BL, TR, BR -- not raster order -- so the bottom-left square's
top-right neighbour is the partition's own right-hand rectangle, which
is not decoded yet. libaom switches has_top_right/has_bottom_left onto
has_tr_vert_*/has_bl_vert_* for exactly these two partition types
(reconintra.c get_has_tr_table); this crate's `Reach` had only the
raster tables, so the BL 32x32 of an SB-level VERT_A predicted from
never-written samples (has_tr_32x32[0] bit 4 = 1 vs
has_tr_vert_32x32[0] bit 4 = 0).

Symptom on the pinned seed-63 stream: every symbol in sync with the
oracle (aomdec EC_TRACE/EC_TRACE_MODE agree on partition=6 and on every
mode, and the msac range at mi_col=40 matches ours exactly, 53240) yet
the prefilter reconstruction diverges from x=157 of the BL square, and
the 32x64 strip to its right then DC-predicts off that corrupted left
column (107 instead of ~149) and the next superblock row's V_PRED
copies it down -- 4683 luma pixels wrong from one availability bit.

Also lifts the r4 refusal narrowing into a proven capability: the four
SB-level AB arms now decode pixel-exact, hard-asserted arm by arm
(sb_ab_hits_by_arm), and PARTITION_HORZ_4/VERT_4 at 64x64 remain the
only refused 64x64 partition types.
fix(av1): intra tx_depth ctx in an inter frame reads the TXFM_CONTEXT arrays, not the deblock tx gridAhmet Kaan Gümüş · 4fc3a96
fix(av1): intra tx_depth ctx in an inter frame reads the TXFM_CONTEXT arrays, not the deblock tx grid

get_tx_size_context (libaom pred_common.h:342-371) reads above_txfm_context/
left_txfm_context, and an inter neighbour overrides its entry with its own
BLOCK size -- the two differ the moment a neighbour's var-tx tree splits, so
the deblock-grid approximation stops being equivalent under TxMode::Select.
Does not move the frame-2 gate divergence (measured), but is what libaom does.
feat(av1): decode an intrabc block vector -- use_intrabc now reads a real DV instead of refusingAhmet Kaan Gümüş · fbda1c6
feat(av1): decode an intrabc block vector -- use_intrabc now reads a real DV instead of refusing

The DV predictor is the ordinary MV stack queried with INTRA_FRAME
(libaom av1_find_mv_refs/av1_find_ref_dv), the difference reads off a
separate ndvc context at full-pel precision (MV_SUBPEL_NONE), and the
block-copy prediction rides the existing PALETTE_PRED per-block
prediction override with BILINEAR taps off the current frame's own
pre-loop-filter planes (all loop filters are already off when
allow_intrabc). tx_type switches to the inter ext-tx sets, since libaom
counts an intrabc block as is_inter_block.

Two real index bugs fell out: mvstack's sign_bias() and gm_mv() both
indexed table[ref_frame - LAST_FRAME] unguarded, so any INTRA_FRAME
query -- exactly what intrabc does -- panicked at usize::MAX.

The lane's refusal is REPLACED, not lifted: every real aomenc intrabc
block sits under TX_MODE_SELECT, whose inter var-tx transform tree
(read_var_tx_size) this decoder has nowhere, so no stream reconstructs
one end to end yet and enable-intrabc stays in gate_coverage's
NEVER_EXERCISED list. Recipe + evidence in lanes/intrabc-r1.report.md.
Revert the Golomb-tail lift: the refusal is masking a real intra-rect64 defectAhmet Kaan Gümüş · 965c6b6
Revert the Golomb-tail lift: the refusal is masking a real intra-rect64 defect

Reading tails up to 32 leading zeros is bit-identical for every tail an encoder
writes and round-trips cleanly, but it turns
a_real_aomenc_stream_with_a_superblock_level_horz_vert_partition_decodes_pixel_exact
RED: seed 67 refuses at this cap today and, with the cap raised, decodes to a
frame-0 luma mismatch instead. A key frame cannot legitimately carry a level
above 1<<19, so the long tail is the symptom of an earlier desync in that
stream (class refusal-hides-a-defect). Refusal restored, with the finding and
the exact repro recorded at the cap.
feat(av1): inter var-tx (TxMode::Select) read + per-TU residual; blanket inter refusal liftedAhmet Kaan Gümüş · f66f359
feat(av1): inter var-tx (TxMode::Select) read + per-TU residual; blanket inter refusal lifted

spec 5.11.17 read_block_tx_size/read_var_tx_size, libaom decodeframe.c
read_tx_size_vartx: an inter block's transform size is now the recursive
txfm_split tree from its max square transform down to MAX_VARTX_DEPTH=2,
with the above/left TXFM_CONTEXT arrays maintained per transform unit
(txfm_partition_update) and per block (set_txfm_ctxs; a skipped inter block
records its BLOCK size, not its transform size). Coefficients are read and
reconstructed leaf by leaf in the tree's own order, each unit against its own
slice of the motion-compensated predictor and its own txb_skip context;
chroma keeps the block's uv transform and inherits the top-left unit's coded
tx_type.

- decode.rs: read_block_tx_size/read_var_tx_size/txfm_partition_ctx/
  txfm_partition_update/set_txfm_ctxs, TXFM_SPLIT_READS/HITS counters,
  Neighbours::above_txfm/left_txfm, wired into both decode_inter_block
  residual branches and (new this round) all three decode_inter_block8
  branches via read_inter_luma8.
- TXFM_CTX_INIT = 64, not 0: av1_zero_above_context memsets the txfm row to
  tx_size_wide[TX_SIZES_LARGEST] and av1_zero_left_context to
  tx_size_high[TX_SIZES_LARGEST] (av1_common_int.h:1624/1632). The WIP's
  zero-init was a false premise and desynced frame 2 of the gate.
- cdf.rs/cdf_state.rs: TXFM_PARTITION (21 contexts) in the table set,
  adaptation and the per-frame counter reset; Luma4Inter/Luma4InterSet1
  coefficient sets for a var-tx tree that reaches 4x4.
- stream.rs: the blanket "an inter frame using TxMode::Select" refusal is
  gone; what remains refused is named at its own site (a var-tx leaf larger
  than 32x32; an intra block in an inter frame whose tx_depth splits).
  New gate a_real_aomenc_inter_sequence_with_tx_select_decodes_pixel_exact --
  the aomenc recipe WITHOUT --enable-tx-size-search=0, hard-asserting both
  txfm_split counters and panicking (never SKIPping) when nothing fires.
- refusal_inventory.rs: -1 blanket refusal, +2 narrow ones.

Gate is RED at frame 2 (see lanes/txselect-r1.report.md): key frame + first
inter frame decode pixel-exact with 8 splits taken, frame 2 diverges.
feat(av1): scaled-reference MC for compound, OBMC and interintra blocksAhmet Kaan Gümüş · 97a7ed5
feat(av1): scaled-reference MC for compound, OBMC and interintra blocks

Each compound tap now scales off its own stored reference's luma width
(mc::horizontal_scaled_pass shared by predict_scaled and
predict_compound_intermediate), OBMC neighbours are re-predicted through the
scaled walk against their own reference's scale, and interintra blends over the
scaled inter prediction. Warp under a scaled reference stays refused (libaom
allow_warp's translational fallback is implemented but its stream still
mismatches); the 8x8 leaf stays refused (its MC is threaded, but the only
recipe reaching that path desyncs inside the leaf -- lane-sub8's open
below-8x8 defect, not scaling).

Also, found while probing 8x8 leaves and kept: obmc_mask(2) = {45,64} and
one-sided chroma OBMC for an 8x8 luma block (av1_skip_u4x4_pred_in_obmc,
reconinter.c:820) -- the first real 8x8 OBMC block hit unreachable!().

Gate: a_real_aomenc_superres_stream_with_compound_obmc_and_interintra_decodes_pixel_exact,
12/12 seeds pixel-exact vs ffmpeg incl. hidden alt-refs, hard-asserting
predict_scaled/scaled_compound/scaled_obmc/scaled_interintra hit counters
(3198/500/9/1). Refusals 47 -> 44.
fix(av1): have_ffmpeg() SKIPped green under EC_AV1_REQUIRE_AOMENC=1Ahmet Kaan Gümüş · 91c1335
fix(av1): have_ffmpeg() SKIPped green under EC_AV1_REQUIRE_AOMENC=1

Every real-aomenc gate opens `if !have_ffmpeg() || !have_aomenc()`, and
only have_aomenc() asserted under the require flag -- have_ffmpeg() is
evaluated first and short-circuits, so a machine without ffmpeg printed
SKIP and the whole 20-gate batch reported green with the require flag
set (class gate-skips-on-its-own-failure).

have_ffmpeg() now mirrors have_aomenc(): absence panics when
EC_AV1_REQUIRE_FFMPEG=1 or EC_AV1_REQUIRE_AOMENC=1 is set (an aomenc
gate decodes its stream through ffmpeg, so requiring the oracle implies
requiring ffmpeg). Applied to all five copies of the helper
(stream/tile/decode/encode/encoder test modules), which had the same
silent-false shape.
feat(av1): per-block segment_id (spec 5.11.7-5.11.9) with per-segment qindex and loop-filter deltasAhmet Kaan Gümüş · 4950fc3
feat(av1): per-block segment_id (spec 5.11.7-5.11.9) with per-segment qindex and loop-filter deltas

Reads intra_segment_id (pre/post-skip per SegIdPreSkip) and inter_segment_id
at both spec positions, incl. seg_id_predicted against the primary reference's
saved map (load_previous_segment_ids); the decoded map is carried into every
reference slot refresh_frame_flags names. Consumers: get_qindex SEG_LVL_ALT_Q
at all dequant sites, SEG_LVL_ALT_LF_* in lf_level. Both seg CDFs adapt and sit
in the per-frame counter reset. The blanket segmentation refusal is replaced by
a narrow SEG_LVL_REF_FRAME/SKIP/GLOBALMV one. Gates: aomenc --aq-mode=1
--deltaq-mode=0 8-bit 16-frame (10/10 pixel-exact incl. hidden frames, 223
segment_id symbols, 6 distinct ids, 35 seg_id_predicted) and 10-bit key frame
(10/10, 80 symbols, 5 ids).
feat(av1): rect strips predict per transform unit; filter intra on a stripAhmet Kaan Gümüş · aedec07
feat(av1): rect strips predict per transform unit; filter intra on a strip

lane-rectsplit r1 (continuing the WIP snapshot c5de1b6):
- decode_block_rect's split-transform arm decodes per transform unit
  (decode_rect_split), gated by
  a_real_aomenc_stream_with_a_split_transform_horz_vert_strip_decodes_pixel_exact
  (20/20 pixel-exact, rect_split_tx_hits > 0).
- predict_filter_intra takes bw x bh instead of one square side, so a
  use_filter_intra HORZ/VERT strip predicts instead of refusing; gated by
  a_real_aomenc_stream_with_filter_intra_on_a_horz_vert_strip_decodes_pixel_exact
  (--enable-filter-intra=1, cq 25, 40/40 pixel-exact, filter_intra_rect_hits=3).
- decode_leaf_rect (below 16x16) keeps both refusals, its split one renamed
  to name the size, and is listed in refusal_inventory.
- The superblock-level split-transform refusal stays: its gate is measured
  RED (seed 50, luma (171,56) off by one) and #[ignore]d with that number.
fix(av1): read Golomb tails up to 32 leading zeros instead of refusing at 20Ahmet Kaan Gümüş · a369458
fix(av1): read Golomb tails up to 32 leading zeros instead of refusing at 20

libaom's own read_golomb (decodetxb.c:30) calls a 21st prefix bit a corrupt
frame and this decoder mirrored that as a refusal string; dav1d reads up to 32
and stops counting. Reading the longer prefix refuses nothing and leaves every
short tail bit-identical (our own writer tops out at 19 leading zeros,
tile::MAX_LEVEL = MAX_BR_LEVEL + (1<<19)). Gate:
decode::tests::golomb_tails_read_back_past_the_old_twenty_bit_cap round-trips
the smallest and largest value at every prefix length 0..=31 through
tile::write_golomb and back. Refusal 'a Golomb tail longer than this decoder
reads' lifted from refusal_inventory.
feat(av1): inter tile path codes a whole-superblock PARTITION_NONE (64x64 inter block)Ahmet Kaan Gümüş · b7d3bdb
feat(av1): inter tile path codes a whole-superblock PARTITION_NONE (64x64 inter block)

The inter tile path recursed a superblock only as SPLIT, so the case aomenc
picks for static content -- one 64x64 inter block -- was a named refusal. The
arm now decodes through `decode_inter_block` at side 64: size_group 3
(`size_group_lookup[BLOCK_64X64]`), luma through `TxbSet::Luma64` with the
32-point scan (TX_64X64 codes only its top-left 32x32 of frequencies, spec
5.11.40 -- `read_inter_plane` widens the coded corner back to 64x64 before the
inverse transform, mirroring `read_plane`'s own `tx_side != side` branch),
chroma as a plain 32x32 `TxbSet::Chroma32`.

`av1_is_wedge_used` is false at 64x64, so no `compound_type` symbol is written
there; the wedge arm's `unreachable!` becomes a named refusal rather than a
read that would desync.

Gates (both HARD-assert `inter_sb_none_hits` moved and every frame pixel-exact
vs ffmpeg; a decode error fails, never SKIPs):
  a_real_aomenc_inter_sequence_with_a_whole_superblock_block_decodes_pixel_exact
  a_real_aomenc_10bit_inter_sequence_with_a_whole_superblock_block_decodes_pixel_exact

cargo test -p ec-av1 --lib: 269 passed, 0 failed, 23 ignored.
fix(av1): deblocker derived the chroma transform size from luma's tx_depth-split tx, inventing chroma edgesAhmet Kaan Gümüş · 9920fec
fix(av1): deblocker derived the chroma transform size from luma's tx_depth-split tx, inventing chroma edges

A block's chroma transform is av1_get_max_uv_txsize(bsize): the largest
transform covering the SUBSAMPLED BLOCK, capped at 32x32. It does not
follow luma's tx_depth split. `tx_px_at`/`tx_h_px_at` computed it as
`tx_grid / 2`, i.e. half the *resolved luma* transform, so a 16x16 block
whose luma split to 8x8 read a 4-px chroma transform and the deblocker
filtered a chroma edge libaom never has. Reconstruction was already
correct (it derives chroma from the block side), which is why the symptom
was luma-bit-exact, chroma-only, +-1, and only on the seeds where the
phantom edge's filter masks happened to pass.

Chroma tx w/h are now written per-mi from the block's own span in
fill_lf_grid_rect (the single writer every caller routes through) and read
back from their own grids.

Also: probe_tiny_frame_size_boundary promoted to the hard-asserting gate
a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact -- no #[ignore],
wrong pixels or an unnamed failure panics, only a NAMED "unsupported"
refusal is tolerated, and a floor of 70 pixel-exact attempts keeps
refusals from making it vacuous. 32x16 goes 8/10 -> 10/10; every size
except 8x8 (rect-transform refusal) is 10/10.

Instruments: EC_AV1_POSTDEBLOCK_DUMP / EC_AV1_POSTCDEF_DUMP mirroring
aomdec's own post-deblock dump (that pair is what isolated the stage), and
decode_probe takes an optional raw-yuv420p output path.

2026-08-30

wip(part32): pin decode_block_rect64's block2 defect to a scan-table mismatchAhmet Kaan Gümüş · f9547e3
wip(part32): pin decode_block_rect64's block2 defect to a scan-table mismatch

Debug harness (debug_part32_r2_sbpart_pin_mismatch_geometry, #[ignore]d) plus
two env-gated filter bypasses (EC_AV1_DEBUG_SKIP_DEBLOCK/CDEF, off by
default) added to bisect a_real_aomenc_stream_with_a_superblock_level_
horz_vert_partition_decodes_pixel_exact's seed-42 failure.

Findings, all measured on THIS tree (not inherited from round 1 or
lane-rect64q):

- Reproduces: 266 passed, 1 failed, same as the trial merge.
- Pre-filter reconstruction (deblock+CDEF both disabled on our side) matches
  the aom-oracle's own EC_AV1_PREFILT_DUMP pixel-for-pixel through the end
  of SB(1,0)'s first VERT-64 sub-block (px=64..95, all-zero DC, correct).
  First divergence is (96,0): oracle=81, ours=76 -- exactly the first pixel
  of the SECOND VERT-64 sub-block (px=96, mi_c=24), which has real
  coefficients (eob_nonzero=true). Deblock/CDEF are proven NOT the cause
  (mismatch persists identically with both disabled).
- msac RANGE ladder (EC_TRACE_COEFF/EC_AV1_TRACE vs oracle's rung 2/4):
  ranges agree exactly up to and including the `rng=63764` entering this
  block's luma coefficient read. Both sides read eob=6. But the oracle's
  per-step trace assigns nonzero level=1 to scan positions (indices) 0, 1,
  2, 4, 5; ours reads real (row,col) pairs (0,0) (0,1) (1,0) (2,0) (1,1)
  (0,2) via `scan32 = default_scan(TX32)` -- the plain square 32x32 scan.
  The two do not correspond to the same physical layout, and the range
  diverges within this same coefficient read (37896 after, vs the oracle's
  46344) -- an in-block entropy desync, not a post-processing or dequant
  bug.
- Root-cause hypothesis (not yet landed): AV1's real scan-table selection
  for a truncated-corner VERT-64 (TX_32X64/TX_64X32) block is NOT the same
  physical scan as a genuine square TX_32X32 -- spec names a distinct
  Default_Scan_32x64/64x32 table, same shape as this file's own
  `NZ_MAP_CTX_OFFSET_32X64`/`_64X32` split fixed at lane-sbpart r8 for the
  *context* table; the *scan order* itself needs the same treatment and
  hasn't had it. `decode_block_rect64`'s `scan32 = default_scan(TX32)` at
  crates/ec-av1/src/decode.rs:3559 is the call site; needs a real
  SCAN_32X64/SCAN_64X32 table (1024-entry, truncated-corner) ported from
  libaom's `av1_scan_orders[TX_32X64]`/`[TX_64X32]`, selected the same way
  `chroma_scan` already is a few lines below (bw==64 ? ... : ...).

NOT fixed this round -- turn budget spent on entropy-layer localization
(charter's own step 2), out of runway to safely port and verify a new
1024-entry table. HEAD still red on the target gate; committing per this
repo's "landing red on the lane is fine" rule.
Merge branch 'lane-tiny': filter-intra blocks read the wrong tx_type CDF rowAhmet Kaan Gümüş · d21774e
Merge branch 'lane-tiny': filter-intra blocks read the wrong tx_type CDF row

A small AV1 key frame decoded SILENTLY WRONG -- no refusal, no error,
every symbol reading as a valid value, and wrong pixels out. Measured
before the fix, 10 seeds per size: 32x32 3/10 mismatch, 24x24 3/10,
16x32 and 32x16 2/10 each; 16x16, 48x48 and 64x64 clean. Wrong pixels
returned as success is the worst failure this decoder can have, and
nothing exercised it because every one of the 267 tests uses a frame
larger than one superblock.

Root cause: libaom's av1_read_tx_type indexes intra_ext_tx_cdf by
fimode_to_intradir[filter_intra_mode] when use_filter_intra is set, NOT
by the block's ordinary mode -- which under filter intra is always
DC_PRED. Every read_plane call site passed the plain mode, so we read
the DC_PRED row where the stream had used D157_PRED. One wrong CDF row
desynced every coefficient read in the block from the first transform
unit onward.

Found by range ladder, after two rounds of hypotheses that the ladder
then disproved: the mode-info layer matched libaom in value AND range
through skip, mode, uv_mode, use_filter_intra, filter_intra_mode and
tx_depth; all_zero matched; tx_type was the first divergence, both sides
consuming exactly one symbol (37340 vs 42464) -- a wrong row, not a
missing or extra read. Two dead ends are recorded in the lane report so
they are not paid for twice: FILTER_INTRA_TAPS and the prediction
recursion are byte-identical to libaom, and the no-neighbour edge
fallback's shared `base` corner is correct.

Boundary sweep after the fix: 32x32 10/10, 24x24 10/10, 16x32 10/10,
32x16 8/10. The 32x16 residual is chroma-only with luma bit-exact and is
NOT closed -- it has its own round, and the boundary sweep becomes a
hard-asserting gate when it is.

Suite 267 passed / 0 failed.
fix(av1): filter-intra tx_type CDF row was the block's raw DC_PRED mode, not fimode_to_intradir(filter_intra_mode) -- desynced entropy stream at the first coefficient TU of every filter-intra block; 32x32/24x24/16x32 tiny-size gate goes 3/10,3/10,2/10 -> 10/10,10/10,10/10, 32x16 2/10 -> 8/10 (residual chroma-only defect open)Ahmet Kaan Gümüş · 3f037c3
fix(av1): filter-intra tx_type CDF row was the block's raw DC_PRED mode, not fimode_to_intradir(filter_intra_mode) -- desynced entropy stream at the first coefficient TU of every filter-intra block; 32x32/24x24/16x32 tiny-size gate goes 3/10,3/10,2/10 -> 10/10,10/10,10/10, 32x16 2/10 -> 8/10 (residual chroma-only defect open)

Also lands the EC_TRACE_COEFF per-symbol range ladder in read_coeffs (eob/base_eob/after_bases/sign/post_golomb tags) matching the oracle's decodetxb.c instrumentation added this round, and the all_zero/tx_type entry-range traces that isolated the divergence.
wip(tiny): per-symbol mode-info tracing, and the fixture-path probeAhmet Kaan Gümüş · c690c67
wip(tiny): per-symbol mode-info tracing, and the fixture-path probe

EC_TRACE_MODE_STEP-gated EC_ISTEP prints in the square read_intra_mode
and read_tx_size, plus an #[ignore]d probe_tiny_fixture_trace that
decodes a raw .obu from EC_TINY_FIXTURE_PATH so traces line up
byte-for-byte with a saved fixture instead of a regenerated one.

Purely additive; no logic changed. Committed by the orchestrator at the
agent's turn cap.