forge
Explore
Log in

Don't you dare go Hollow

Commits

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

2026-08-30

fix(av1): reword a capability claim my own probe just disprovedAhmet Kaan Gümüş · 0653b15
fix(av1): reword a capability claim my own probe just disproved

"a partition below 16x16 other than a clean split (this encoder never writes
one)" is false. A plain default-settings aomenc run over lavfi mandelbrot
(--cpu-used=4 --end-usage=q --cq-level=32, no --enable-* flags at all) hits
that refusal on frame 0. The string now describes the decoder instead.

Measured while re-taking the distance to a default-settings decode, five
content classes, all at those same default settings:
  testsrc2    -> UV palette reconstruction
  mandelbrot  -> this refusal (sub-16x16 non-split partition)
  smptebars   -> HORZ/VERT intra strip in a screen-content frame
  rgbtestsrc  -> HORZ/VERT intra strip in a screen-content frame
  life        -> a palette block with a split luma transform

Three of the five are palette-shaped. The remaining three "this encoder never
writes one" claims (angle delta x2, sub-8x8 partition, non-DC chroma on an 8x8
inter leaf) are NOT cleared by this probe -- they were simply not reached.

Suite 260 passed / 0 failed.
Merge branch 'main' into lane-lr; LR gate is GREEN after the SGR table fixAhmet Kaan Gümüş · aadcbfd
Merge branch 'main' into lane-lr; LR gate is GREEN after the SGR table fix

r9 resolved every conflict and hit its turn cap before compiling. I finished
it: three of main's newer gate call sites were missing this branch's
LoopRestorationParams argument (git merged the text cleanly and the result did
not compile -- same semantic-conflict shape as the delta_q merge), and main's
"a frame with loop restoration enabled" refusal is retired by this branch, so
refusal_inventory drops it.

The result: a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly
PASSES. The one-pixel SGR gap that survived rounds 5, 6 and 7 was
7ad6d77's mistranscribed SGR_X_BY_XPLUS1 entries, not a sampling or
stripe-boundary defect.

Suite 260 passed / 0 failed.
Merge branch 'lane-palette': palette-Y blocks decode pixel-exactAhmet Kaan Gümüş · 2195bbd
Merge branch 'lane-palette': palette-Y blocks decode pixel-exact

Blocker (3) closed. Root cause was call ORDER, not a table: every symbol was
already bit-exact through read_palette_colors_y, and the range diverged exactly
at decode_color_index_map's entry because libaom reaches decode_color_map_tokens
from parse_decode_block AFTER the whole mode-info decode, including UV palette
mode_info and filter_intra. We called it inline after the Y colours and never
read UV palette mode_info at all. Fix: read UV palette mode_info, defer the
index map past filter_intra. UV palette reconstruction stays refused by name.

enable-palette leaves NEVER_EXERCISED with positive evidence -- the new gate
passes --enable-palette=1 -- so intrabc is now the last entry.

Two conflicts resolved here, both additive-vs-additive:
- Neighbours' delta_lf_grid (lane-realworld) and the palette neighbour cache
  (lane-palette) are independent fields; kept both.
- Three lanes each numbered their new oracle instrumentation rung "6".
  lane-palette's two are renumbered 8 and 8b behind superres's 6 and 7.

Suite 256 passed / 0 failed.
Merge branch 'lane-superres': key-frame superres decodes pixel-exact (3/3 frames, superres_hits=3)Ahmet Kaan Gümüş · eb818a1
Merge branch 'lane-superres': key-frame superres decodes pixel-exact (3/3 frames, superres_hits=3)

Root cause was deblocking the mi-alignment margin: libaom's set_lpf_parameters
early-returns TX_4X4 once x >= dst.width or y >= dst.height -- the CODED frame
dimensions, not the mi-grid-padded extent our true_width/true_height used. That
early return is also why r6's two oracle trace points never fired.

Two guard adjustments the merge forced, both tightening rather than relaxing:
- refusal_inventory gains the lane's new inter-frame superres refusal.
- gate_coverage now closes a coverage hole only on POSITIVE evidence -- some
  gate passing . It used to retire an entry as soon as a
  gate merely left the flag off its command line, which this merge would have
  done to palette and intrabc: aomenc's default for both is content-dependent,
  so 'defaulted' means unknown, not exercised. Negative-checked: flipping one
  gate's --enable-palette to =1 fails the test by name.

Suite 255 passed / 0 failed.
fix(av1): palette-Y decode order -- UV mode_info + defer index map past filter_intraAhmet Kaan Gümüş · 37efa9f
fix(av1): palette-Y decode order -- UV mode_info + defer index map past filter_intra

r6 pinned the root cause by range trace: decode_color_index_map was called
inline right after the Y colours, but libaom's av1_visit_palette runs it
only after the WHOLE mode-info read (UV palette mode_info +
filter_intra), from parse_decode_block. Ports the UV palette mode_info
read (mode symbol + refusal-by-name if it fires, no need to read
size/colours since we bail immediately either way), moves the Y
colour-index-map decode to after filter_intra, and removes the r3/r4
"index map decodes but pixels don't match" refusal now that the real
gate is pixel-exact against ffmpeg.

Gate a_real_aomenc_stream_with_palette_y_decodes_pixel_exact (renamed
from *_refuses_by_name) now asserts a real pixel match instead of the
old named refusal; refusal_inventory.rs drops the retired string.
fix(av1): deblock clips to coded frame_width/height, not the mi-aligned marginAhmet Kaan Gümüş · 81df735
fix(av1): deblock clips to coded frame_width/height, not the mi-aligned margin

Charter hypothesis 1 confirmed: libaom's loop filter never visits the
padding between the coded frame_width/height and the next mi-aligned
true_width/true_height (the margin reconstruction still fills but the
filter loop skips). deblock_plane/apply_deblock now bound their x0/y0
loops by frame_width/frame_height (frame_height.div_ceil(2) for chroma),
closing the superres gate: a_real_aomenc_superres_key_frame_sequence_
decodes_pixel_exact now passes (3/3 frames, superres_hits=3). Full
ec-av1 suite: 238 passed, 0 failed, 17 ignored -- no regression.
Merge branch 'main' into lane-realworld: multi-tile decode meets delta_q/delta_lfAhmet Kaan Gümüş · 772ae7b
Merge branch 'main' into lane-realworld: multi-tile decode meets delta_q/delta_lf

Resolves nine conflicts (eight gate-body hunks in stream.rs, one in
decode.rs's inter tile function): kept both new stream.rs gates
(delta_q/delta_lf and main's two-tile-column-inter-frame test) as
separate functions rather than interleaving them, kept main's bit-depth
refusal alongside this branch's already-landed delta_q/delta_lf reads
(dropping main's now-stale delta_q/delta_lf refusal), and threaded
DeltaParams' frame-level flags (set once) plus CURRENT_Q_IDX/
CURRENT_DELTA_LF (reset per tile, mirroring the key-frame tile function)
into main's new per-tile loop in decode_inter_frame_tile_with_cdfs. Also
fixed a missed decode_key_frame_tile_with_cdfs call site (the
four-tile-columns test) that main added without the DeltaParams arg this
branch's signature already carries.

EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib: 246 passed, 0 failed,
17 ignored.
diag(av1): EC_AV1_TRACE range-ladder inside decode_color_index_map + palette Y mode/size/colors (lane-palette r6)Ahmet Kaan Gümüş · f62adbf
diag(av1): EC_AV1_TRACE range-ladder inside decode_color_index_map + palette Y mode/size/colors (lane-palette r6)

Range-ladder bisect against aomdec's EC_TRACE_PALETTE rung (rungs 6/6b)
on the r3/r4 smptebars gate fixture: every symbol up through
read_palette_colors_y matches the oracle's ranges exactly
(partition_w32 rng, skip/y_mode/uv_mode, palette_y_mode, palette_y_size,
palette colours all bit-identical). The desync starts right after --
libaom's decode_color_map_tokens is NOT called inline from
read_palette_mode_info; it runs later, from parse_decode_block via
av1_visit_palette, after palette UV mode_info (mode/size/colors, which
this decoder does not read at all yet) and filter_intra. Our
decode_color_index_map is called immediately after the Y colours
instead, so it reads the color-index symbols against the wrong point in
the bitstream whenever a block is chroma-referenced with UV_DC_PRED
(this gate's block: bsize_ctx=4, uv_mode=0). Confirmed by patching a
throwaway EC_PRE_PALETTE/EC_PALETTE_Y_MODE/SIZE/COLORS print into the
oracle's decodemv.c (not committed, reverted after use) -- ranges
matched ours field-for-field through EC_PALETTE_Y_COLORS rng=39432, then
the oracle's own decode_color_map_tokens entry read rng=51752, proving
UV palette mode_info consumed real bits in between that this decoder
skips.

Adds an EC_AV1_TRACE-gated EC_PAL/EC_PAL_VAL print inside our own
decode_color_index_map (row/col/ctx/n/rng before, color_idx/rng after,
plus the map[0] uniform read) and TRACE prints around the Y palette
mode/size/colors reads, matching the oracle rung's field names so a
future round's bisect doesn't have to re-instrument. No behaviour
change: the palette_y_mode `&&` short-circuit (only read the symbol
when mode == DC_PRED) is preserved exactly.

Refusal strings: none added or removed -- the palette-Y refusal stays
in place; removing it needs the reorder fix (read/skip UV palette
mode_info in the right position, defer the Y+UV color-index-map reads
to after filter_intra) which is next round's job, not this one's.

Suite: EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j4 -- 244
passed, 0 failed, 17 ignored (unchanged).
diag(av1): superres gate stream dump + deblock horz-edge trace at mi_col 11Ahmet Kaan Gümüş · 397bfd7
diag(av1): superres gate stream dump + deblock horz-edge trace at mi_col 11

lane-superres r6: localized the 2-pixel gate residue to horizontal-edge
deblock filtering at the rightmost mi column (x0=44..47) of the coded
(pre-superres) frame. EC_SUPERRES_STREAM_DUMP (stream.rs) and
EC_AV1_DEBLOCK_TRACE (decode.rs, HEDGE line at x0==44) are new
env-gated diagnostics, off by default, left in place for the next round.
merge main into lane-palette: multi-tile key-frame decode, chroma smooth/paeth, CDEF index readsAhmet Kaan Gümüş · 7b81e30
merge main into lane-palette: multi-tile key-frame decode, chroma smooth/paeth, CDEF index reads

Resolved six decode.rs conflicts (Neighbours' palette fields + main's
tile-origin fields coexist on the struct/constructor; read_intra_mode
gained both the palette ctx/cache param and main's mi_r/mi_c param,
updated at both call sites; PlaneBuf::reconstruct keeps the palette-buf
override + filter_intra branch and now threads real smooth_neighbor
instead of a hardcoded false) and one gate_coverage.rs conflict
(NEVER_EXERCISED = enable-intrabc only: main's cdef/chroma lanes already
retired enable-cdef/paeth-intra/smooth-intra, this lane's own real
palette gate already retired enable-palette). Added the two refusal
strings the merge introduced (palette-Y pixel-mismatch refusal, split-
luma-transform-under-palette refusal) to refusal_inventory.rs's pinned
list -- suite failed once on the missing one, fixed, green after.

EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib: 244 passed, 0
failed, 17 ignored.
Merge branch 'lane-tiles': multi-tile decode, gated on real streamsAhmet Kaan Gümüş · 97ae517
Merge branch 'lane-tiles': multi-tile decode, gated on real streams

Four tile columns with the loop filter ON decode pixel-exact, and so do two
columns across an inter frame -- three new real-aomenc gates, 20/20 each.
decode_inter_frame_tile_with_cdfs has the same per-tile loop the key-frame path
has, and the MV-candidate scan is bounded by giving the shared MiGrid tile
bounds, which clamps all four find_mv_stack* call sites through one choke point
instead of widening their signatures.

Three refusals gone: more than two tile columns, multi-tile with loop filtering
enabled, and inter frames with more than one tile. Only tile ROWS still refuse.

The round before this one had lifted the inter refusal with only a green suite
behind it -- which exercises nothing the refusal guarded -- so the branch was
held out of main until the gate existed. Writing it found that
decode_inter_frame_tile_with_cdfs never incremented TILE_HITS: the gate's own
tile-count assert would have passed while blind. That is twice now that "the
suite is green" stood in for evidence, and twice that the gate found something
the suite could not.

AV1 has no loop_filter_across_tiles bit at all, unlike HEVC -- deblocking
crosses tile boundaries unconditionally -- so the loop-filter refusal was
really the same right-edge reach bound as the column-count one, and both lifted
together once PlaneBuf's tile clamps received real values.

Suite 245 passed / 0 failed.
test(av1): gate r6's inter tile-loop lift -- real >1-tile-column INTER streamAhmet Kaan Gümüş · a4b8abf
test(av1): gate r6's inter tile-loop lift -- real >1-tile-column INTER stream

a_real_aomenc_stream_with_two_tile_columns_and_an_inter_frame_decodes_pixel_exact
proves decode_stream's lifted "inter frame with more than one tile" refusal:
2 tile columns, --limit=2 --kf-max-dist=1000 for a genuine inter frame 1,
gradients_source's default speed=0.01 rotation gives real motion so the MV
stack actually crosses the tile boundary. 20/20 pixel-exact vs ffmpeg, hard
tile_hits > frames assert.

Also fixes decode_inter_frame_tile_with_cdfs never incrementing TILE_HITS
(only the key-frame loop did) -- the gate's own tile-count assert would have
been vacuously blind to the inter path without this.
feat(av1): delta_lf -> deblocker path (maybe_read_delta_lf, delta_lf_grid, lf_level)Ahmet Kaan Gümüş · 46e63c7
feat(av1): delta_lf -> deblocker path (maybe_read_delta_lf, delta_lf_grid, lf_level)

New design piece the r3 plan flagged: DeltaLF is a per-superblock running
state (CURRENT_DELTA_LF: Cell<[i32;4]>, same shape as CURRENT_Q_IDX, spec
DeltaLF[FRAME_LF_COUNT]), read by maybe_read_delta_lf (spec
read_delta_lflevel/read_delta_lf_params, same 4-symbol-CDF-then-Golomb-tail
shape as maybe_read_delta_q, called right after it at all 4 block-decode
sites) and snapshotted per 4x4-mi block into a new Neighbours::delta_lf_grid
field (fill_lf_grid_rect, mirroring ref_grid's snapshot pattern -- !multi
mode broadcasts index 0 into all 4 slots at write time so lf_level's
reader never needs the multi flag). lf_level takes the per-block delta and
applies it to the base level (clamp 0..63) before the existing
ref_deltas/mode_deltas scaling, per spec 7.14.4; edge_params looks it up
at both the current and previous mi position via a new plane/dir ->
FRAME_LF_COUNT index map, same as its existing ref_grid lookup.

Removed the stream.rs delta_lf_present refusal (both halves of Job 2 now
read and apply). Refusal removed from refusal_inventory.rs's REFUSALS
list: "a frame with delta_lf_present set (this decoder never applies
per-superblock loop-filter deltas)" -- no replacement string, the
capability is no longer absent.

Full ec-av1 lib suite still green (242/0/17, EC_AV1_REQUIRE_AOMENC=1);
no existing fixture sets delta_lf_present, so this is code-verified
against the spec/libaom read shape, not yet gate-proven against a real
aomenc stream (charter step 4, unstarted this round -- next lever).
feat(av1): inter frame per-tile decode loop, MV stack bounded per tileAhmet Kaan Gümüş · aaa4b1b
feat(av1): inter frame per-tile decode loop, MV stack bounded per tile

decode_inter_frame_tile_with_cdfs now takes tiles: &[&[u8]] + &TileInfo and
grows the same per-tile loop decode_key_frame_tile_with_cdfs already has:
fresh SymbolDecoder + CDF copy per tile, PlaneBuf::set_tile_origin threaded
with real x1/y1 (right/bottom reach bound), only context_update_tile_id's
own adapted table kept as the frame's own output.

mvstack.rs: MiGrid gets tile_row0/col0/row1/col1 bounds (set_tile_bounds,
called once per tile) so scan_row/scan_col/scan_top_right's grid.get()
cannot see a cell outside the current tile -- bounds all four
find_mv_stack*/find_mv_stack_compound call sites through the one grid they
all read, without touching their own signatures.

Lifts the "an inter frame with more than one tile" refusal (verbatim,
removed from stream.rs and refusal_inventory.rs's pinned list). The
>2-columns and multi-tile-with-loop-filter refusals stay -- not
gate-proven safe to lift this round (deferred, see report).

cargo check clean; scoped tests green: tile/frame/mvstack/stream tile
tests (44), refusal_inventory (2), gate_coverage (2), including the
existing mi_units_outside_the_tile_contribute_nothing tile-bound test and
both real-aomenc two-tile-column gates.
fix(av1): three refusals claimed the encoder never writes what it writesAhmet Kaan Gümüş · 177de6a
fix(av1): three refusals claimed the encoder never writes what it writes

Measured, not reasoned: five default-settings aomenc streams through the
decoder, one command each. testsrc2 192x128 at --cpu-used=0 refuses with "a
partition type this encoder never writes" -- a claim about the world, disproved
by the stream that produced it. The same family sits at the 32x32 level for
both the intra and inter paths.

All three now say what this decoder does not code, which is the true and useful
statement:
  "a superblock-level partition type other than NONE or SPLIT (this decoder's
   intra tile path codes only those two at 64x64)"
  "a 32x32 partition type this decoder does not code (value={part32})"
  "an INTER 32x32 partition type this decoder does not code (value={part32})"

Finding those needed a fix to the inventory itself: its scanner stopped at
`unsupported(` and so never saw `unsupported(format!("..."))`. Two refusals were
invisible to it, one of them the INTER claim above. It steps through format!
now, and both are pinned.

Where a default-settings stream stops today, measured this run: palette (Y);
delta_q/delta_lf, twice; the inter path's non-SPLIT superblock partition; and
the intra path's, at cpu-used=0. Four of the five are owned by live lanes; the
superblock-level partition family is not, and is the next lane to arm.

Suite 243 passed / 0 failed.
fix(av1): palette-Y refuses by name instead of decoding to wrong pixelsAhmet Kaan Gümüş · 71d8f67
fix(av1): palette-Y refuses by name instead of decoding to wrong pixels

r3's gate proved a real palette-Y block reconstructs to pixels that
mismatch libaom despite every symbol read (colours, index-map wavefront,
context, CDF table) checked line-for-line correct -- and left the gate
SKIPping on that mismatch, which hid a real stream decoding to silently
wrong pixels from the whole suite.

decode.rs's palette_y_mode arm now returns a named refusal right after
decoding the colours/map (palette_hits still fires, so the read path
stays proven non-vacuous) instead of handing the wrong reconstruction to
the caller; all the landed reconstruction code stays in place, unreachable
until the pixel desync is found. The gate
(a_real_aomenc_stream_with_palette_y_refuses_by_name, renamed from
..._decodes_pixel_exact) now hard-asserts that refusal fires with
palette_hits > 0, instead of SKIPping on a mismatch.

Also adds an EC_TRACE_PALETTE=1 rung to the aom-oracle instrumentation
(decode_color_map_tokens's per-pixel range + av1_read_uniform's map[0])
for the next round's range-ladder bisect, per charter job 2.

EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib: 235 passed, 0 failed,
17 ignored.
fix(av1): finish r5's set_tile_origin sweep -- key-frame tile loop now greenAhmet Kaan Gümüş · 1a6617f
fix(av1): finish r5's set_tile_origin sweep -- key-frame tile loop now green

The two shorthand struct-init blocks r5 flagged (near decode.rs:11661/11673)
already carried all four PlaneBuf fields; the actual break was the key-frame
per-tile loop's own set_tile_origin(x0, y0) calls at decode.rs:4910-4912,
still 2-arg after the signature grew to 4. Thread mi_col1/mi_row1 (this
tile's own end, clamped to the plane's padded width/height) through as
x1/y1 so the key-frame path's right/bottom reach bound matches the rest of
the tree. cargo check clean.
fix(av1): compile r4's delta_q wiring -- inter-frame path finishAhmet Kaan Gümüş · 457c077
fix(av1): compile r4's delta_q wiring -- inter-frame path finish

decode_inter_frame_tile_with_cdfs was missing the DeltaParams param r4
threaded through the key-frame path only (decode.rs:9579 signature,
tile-entry DELTA_Q_PRESENT/DELTA_Q_RES/CURRENT_Q_IDX reset). Both
stream.rs call sites now pass header.delta. Narrowed the whole-frame
refusal to delta_lf_present only, since delta_q is now genuinely read
(maybe_read_delta_q fires on both key and inter frames); delta_lf still
has no deblocker consumer so it keeps refusing by name under a new
string: "a frame with delta_lf_present set (this decoder never applies
per-superblock loop-filter deltas)" (replaces the old combined
delta_q_present-or-delta_lf_present refusal).
Merge branch 'lane-tiles': key frames with two tile columns decodeAhmet Kaan Gümüş · 5e92401
Merge branch 'lane-tiles': key frames with two tile columns decode

decode_key_frame_tile_with_cdfs takes tiles: &[&[u8]] and walks each tile with
its own msac and its own copy of the frame's CDFs; Neighbours and PlaneBuf carry
a tile origin so a block at a tile's left or top edge sees no neighbour there
even though decoded pixels sit at that address. decode_stream threads the real
tile buffers, and a 2-column key frame now decodes through decode_stream itself,
20/20 pixel-exact with the tile count hard-asserted > 1.

The blanket "more than one tile" refusal is replaced by four scoped ones -- inter
frames, tile rows, more than two columns, and loop filtering on -- so the cases
that are genuinely unimplemented say which one they are. refusal_inventory
records the swap.

Two facts the lane paid for: aomenc's default 128px superblock makes a 128x64
frame a single superblock, so any tile fixture needs --sb-size=64; and AV1 has
no loop_filter_across_tiles bit at all (unlike HEVC) -- deblocking crosses tile
boundaries unconditionally, so the loop-filter refusal is really the same
unimplemented right-edge reach bound as the 3-column one.

The lane also caught a false PASS in its own draft gate: Tile::offset is
relative to the slice parse_obu was handed, and without adding obu_offset back
the decoder read garbage that compared EQUAL as flat DC, rather than erroring.

Suite 242 passed / 0 failed.
Merge branch 'lane-realworld': the inter path stops assuming SPLITAhmet Kaan Gümüş · 0e15bcf
Merge branch 'lane-realworld': the inter path stops assuming SPLIT

decode_inter_frame_tile_with_cdfs read the superblock's part64 symbol and threw
it away (`let _ = part64;`), recursing as SPLIT regardless. A real non-SPLIT
part64 in an inter frame silently miscoded the whole superblock -- the one
failure mode this decoder does not tolerate. It now matches: SPLIT is still
inferred for the three straddle/forced-half cases, and any other real value
refuses by name before the quadrant recursion, with a hand-built PARTITION_HORZ
stream as the test.

refusal_inventory gained that string, as designed. The refusal describes what
this decoder does, not what an encoder emits, so it is a plain refusal and not
a capability claim.

delta_q/delta_lf is scoped but unstarted; lanes/realworld-r3.report.md carries
the verified default CDFs, the four call sites (the same four maybe_read_cdef_idx
uses), and the finding that base_q_idx is read at only 2 of ~90 sites, so a
thread-local running quantizer avoids threading a parameter through every block
signature. The DeltaLF-to-deblocker path still needs per-block MiGrid state.

Suite 240 passed / 0 failed.
Merge branch 'lane-chroma': smooth, paeth and directional chroma decodeAhmet Kaan Gümüş · be7060a
Merge branch 'lane-chroma': smooth, paeth and directional chroma decode

The lane went looking for chroma modes and found a luma bug first:
reconstruct() hardcoded smooth_neighbor = false, so the intra edge filter took
the wrong strength bucket whenever a directional block neighboured a
smooth-predicted one. Its own comment called it a corner-cut. Twenty gates had
never caught it because every one of them passed --enable-smooth-intra=0.

Landed here: the luma fix with smooth_neighbor threaded properly, UV-mode
neighbour tracking, the smooth/paeth chroma refusals gone (blocker 5 of the
default-settings chain), and the directional-chroma sibling in
decode_inter_block's intra-in-inter branch.

Gate-proven for the key-frame path. The inter-frame intra-block path is a
structural mirror of it plus a green suite, NOT proven by firing -- the lane
disclosed this itself, and the owed gate is written down in
lanes/chroma-r4.report.md: force an inter-frame leaf with such a uv_mode,
assert smooth_uv_hits/directional_uv_hits and pixel-exactness.

Both guards fired as designed and are updated: gate_coverage loses
enable-smooth-intra and enable-paeth-intra, refusal_inventory loses the two
round-2 chroma refusals.

Suite 239 passed / 0 failed.
fix(av1): refuse non-SPLIT inter SB part64 by name instead of desyncingAhmet Kaan Gümüş · 6e8fc0b
fix(av1): refuse non-SPLIT inter SB part64 by name instead of desyncing

decode_inter_frame_tile_with_cdfs read part64 then `let _ = part64;`,
blindly recursing every superblock as SPLIT. A real non-SPLIT part64 in
an inter frame would silently desync rather than refuse. Now the value
is kept (SPLIT is still inferred for the forced-half/straddle cases,
matching the intra tile's own three-way write) and any other value
returns a named unsupported() error before the quadrant recursion runs.

New refusal string: "an inter SB-level partition type other than SPLIT
(this decoder's inter tile path only recurses a superblock as SPLIT)".

Test: a_non_split_inter_sb_partition_refuses_by_name_instead_of_desyncing
hand-writes a PARTITION_HORZ part64 symbol and asserts the named error
comes back instead of garbage decode.
feat(av1): palette-Y reconstruction (colour cache, delta colours, wavefront index map, prediction wiring)Ahmet Kaan Gümüş · c2f121e
feat(av1): palette-Y reconstruction (colour cache, delta colours, wavefront index map, prediction wiring)

Types in report sections 3-6: Neighbours above/left_palette_size/colors +
record_palette_y + palette_ctx_and_cache (av1_get_palette_mode_ctx +
av1_get_palette_cache, SB-row-boundary above-null rule); read_palette_colors_y
(cache-accept bits + delta-coded remainder + merge_colors), read_uniform,
palette_color_index_context (weighted neighbour score + selection sort +
hash lookup table), decode_color_index_map (wavefront diagonal scan).
read_intra_mode gains a `palette: Option<(ctx, cache)>` param: Some at
decode_block's key-frame path (real decode), None at decode_leaf8 (old
refuse-unconditionally behaviour preserved bit-for-bit). Palette prediction
reaches PlaneBuf::reconstruct through a PALETTE_PRED thread-local (the
existing ENABLE_EDGE_FILTER idiom). A palette block under a split luma
transform refuses by name (untested against a real stream this round).
palette_uv_mode still refuses (UV reconstruction is stage 2) but its context
is now the block's own real just-decided Y palette use.

Refusal strings changed:
- REMOVED: "a block that actually uses a palette (Y) -- reconstruction is
  out of scope" from decode_block's key-frame path (still present,
  unreachable-changed, at decode_leaf8's excluded call site).
- ADDED: "a palette block with a split luma transform (round 1)".
- UNCHANGED (still present): the UV palette refusal string, verbatim.

cargo check -p ec-av1 --tests: clean. Full suite not run this round (turn
budget) -- next round's first job.
Merge branch 'lane-realworld': cdef_idx decodes, gated on a real aomenc streamAhmet Kaan Gümüş · 51e931c
Merge branch 'lane-realworld': cdef_idx decodes, gated on a real aomenc stream

Blocker 1 of the default-settings chain is closed. The per-64x64 cdef_idx
symbol is read (spec 5.11.56) at all five sites where skip is decoded, kept in
a per-superblock grid, and apply_cdef selects that superblock's strength pair
instead of index 0. Gate a_real_aomenc_stream_with_cdef_decodes_pixel_exact:
40/40 pixel-exact, zero refusals, cdef_idx_hits hard-asserted > 0 (24-40/run).

The lane also established why the obvious gate could never work: cdef_bits
selects among per-SUPERBLOCK strength profiles, so a single-64x64-superblock
fixture gives the encoder nothing to differentiate -- 20 attempts kept the
counter at 0. It needed 128x64.

Both guards on main fired exactly as designed and are updated here:
gate_coverage's NEVER_EXERCISED loses enable-cdef (a gate enables it now), and
refusal_inventory loses "a frame with cdef_bits > 0". The decode.rs conflict was
the counter doc-comment restyle against the lane's new CDEF thread-locals; the
lane's block is kept, restyled to match.

Suite 237 passed / 0 failed.
feat(av1): directional/smooth/paeth chroma in inter-frame intra blocksAhmet Kaan Gümüş · c3a0a18
feat(av1): directional/smooth/paeth chroma in inter-frame intra blocks

decode_inter_block's intra-in-inter branch refused any non-DC/CFL uv_mode
and never computed angle_delta_uv (charter step 4 sibling to the r1/r3
keyframe fix). Mirror read_intra_mode's own already-proven pattern:
uv_predict_mode (CFL predicts as DC), angle_delta_uv read for directional
uv_mode, smooth_neighbor_uv from the chroma neighbour's own uv_mode, and
SMOOTH_UV_HITS/DIRECTIONAL_UV_HITS counted same as the keyframe path.
Full lib suite green (234/0/17 ignored) after the change -- no dedicated
gate proves an inter-frame intra block with this uv_mode actually fires
through a real aomenc stream yet (deferred, see report).
wip(av1): lane-tiles r2 per-tile decode in progress, committed at the 75-turn capAhmet Kaan Gümüş · 6416aca
wip(av1): lane-tiles r2 per-tile decode in progress, committed at the 75-turn cap

Staged by the agent, committed verbatim by the orchestrator so it survives the
cap; state unverified by me.
feat(av1): wire read_lr into both SB loops; narrow the whole-frame LR refusal to 'filters not applied'Ahmet Kaan Gümüş · dc215f7
feat(av1): wire read_lr into both SB loops; narrow the whole-frame LR refusal to 'filters not applied'

decode_key_frame_tile_with_cdfs/decode_inter_frame_tile_with_cdfs now take
&LoopRestorationParams and call crate::restoration::read_lr once per
superblock, before decode_partition, storing per-unit Wiener/SGR filters
into a per-plane RestorationGrid (never yet applied to pixels). Public
one-star wrappers pass &LoopRestorationParams::default() unchanged.
stream.rs threads header.loop_restoration through both call sites; the
refusal string is renamed to name the true remaining gap (pixel filters
not applied) now that the partition walk survives a real LR stream.
235 passed / 0 failed (232 baseline + 3 new subexp/recenter tests),
EC_AV1_REQUIRE_AOMENC=1.
wip(av1): lane-chroma r3 smooth-intra gate green path + chroma work, committed at the 75-turn capAhmet Kaan Gümüş · f4a11cd
wip(av1): lane-chroma r3 smooth-intra gate green path + chroma work, committed at the 75-turn cap

Committed verbatim by the orchestrator so the work survives the cap; state
unverified by me.
wip(av1): superres stage-3 gate flags + chroma crop rounding fixAhmet Kaan Gümüş · e9f1fa8
wip(av1): superres stage-3 gate flags + chroma crop rounding fix

Gate a_real_aomenc_superres_key_frame_sequence_decodes_pixel_exact:
- add the restrictive aomenc flag set (charter's list) to get past the
  pre-existing "AV1 tile: partition type this encoder never writes"
  capability gap, plus --superres-kf-denominator=12 (the missing piece:
  --superres-denominator only controls non-key frames; with
  --kf-max-dist=0 every frame is a key frame and AOM_SUPERRES_FIXED
  reads superres_kf_scale_denominator for those, which defaults to 8/
  no-scale -- header.use_superres was parsing false).
- decode.rs: both decode_key_frame_tile_with_cdfs and
  decode_inter_frame_tile_with_cdfs cropped chroma to fw/2 (floor) when
  fw != the mi-aligned decode width; the real AV1 chroma-plane width
  formula is ROUND_POWER_OF_TWO(fw, ss_x) i.e. div_ceil for 4:2:0. Odd
  downscaled superres widths (43 here) exposed it as a length-mismatch
  panic in superres.rs; fixed both sites (general decoder bug, not
  superres-specific, swept repo-wide -- only these two call it).

Gate still fails: 5/4096 luma pixels off by 1 near the right edge
(columns 59-62 of 64) after the flag+crop fixes. Not bounds/kernel --
superres.rs's pinned upscale_row/upscale_plane already matched libaom
bit-exact via the C harness for symmetric in8->out12/16 cases. Likely
candidate: our edge-replication padding in upscale_row synthesizes the
right border from the already-cropped fw-wide row, while libaom's
av1_extend_plane may extend from real reconstructed pixels still
present in the mi-aligned buffer beyond fw before any crop -- untested
theory, not confirmed this round. Next: thread the pre-crop plane
width/margin into upscale_picture instead of cropping to fw first.
fix(av1): thread smooth_neighbor into intra edge filter strength (luma)Ahmet Kaan Gümüş · f3c639d
fix(av1): thread smooth_neighbor into intra edge filter strength (luma)

reconstruct()/reconstruct_rect()/read_plane() hardcoded smooth_neighbor=false
(spec get_intra_edge_filter_type / libaom get_filt_type), so a directional
block's edge-filter strength bucket was wrong whenever its above/left
neighbour used SMOOTH_PRED..=SMOOTH_H_PRED. Threaded a real per-block check
(is_smooth_mode over Neighbours::above_mode/left_mode) through decode_block,
decode_block_rect and decode_leaf8 (the key-frame intra call sites); the
inter-frame intra-in-inter paths (decode_inter_block/decode_inter_block8)
keep smooth_neighbor=false unchanged for now (out of this lane's scope,
matches r1's own note that path is a separate gap). Chroma stays false
(exact) until the smooth/paeth uv_mode refusal is lifted in a later round.
New SMOOTH_LUMA_HITS thread-local counter for the gate.

232/232 ec-av1 --lib passing (baseline unchanged).
wip(av1): tile-boundary availability groundwork for multi-tile decodeAhmet Kaan Gümüş · 4057dda
wip(av1): tile-boundary availability groundwork for multi-tile decode

Neighbours carries its own tile origin (tile_row0_mi/tile_col0_mi,
default 0) plus start_tile() (spec decode_tile's clear_above_context
over the tile's own column span). Every availability check that used
to compare against literal 0 (skip_txfm_ctx, tx_size_context,
tx_size_context_rect, decode_inter_block/decode_inter_block8's
has_above/has_left) now compares against the tile origin instead --
a no-op today (origin stays 0, single tile per frame), but the actual
per-tile hook the full lane-tiles wiring needs.

Refusal at stream.rs:292 (frame with >1 tile) is UNCHANGED -- this
commit does not yet drive start_tile(), split the superblock walk
per tile, give each tile its own entropy decoder/CDF copy, or clip
PlaneBuf's intra-prediction pixel reach to the tile (edges/edges_rect
still read x>0/y>0). Removing the refusal before those land would
desync silently, which the charter forbids.

cargo test -p ec-av1 --lib: 232 passed, 0 failed (baseline unchanged).
wip(av1): lane-realworld cdef_idx + delta q/lf, uncommitted at the 75-turn capAhmet Kaan Gümüş · 7fc9065
wip(av1): lane-realworld cdef_idx + delta q/lf, uncommitted at the 75-turn cap

Committed verbatim by the orchestrator so the work survives the cap; state
unverified (suite not run on this tree by me).
style(av1): thread-local hit counters take line comments, not doc commentsAhmet Kaan Gümüş · 7895d2a
style(av1): thread-local hit counters take line comments, not doc comments

The atomics->thread_local conversion (3cfbe37) left the 28 counter doc
comments attached to a macro invocation, which rustdoc does not document:
28 unused_doc_comments warnings. Comments kept verbatim, /// -> //, and the
five that still claimed 'across every call in the process' now say 'on the
current thread' -- the counters stopped being process-global in that commit.
Merge branch 'lane-rectwire2': rect coefficient decode lands, pixel-exactAhmet Kaan Gümüş · 94033af
Merge branch 'lane-rectwire2': rect coefficient decode lands, pixel-exact

The desync that held this lane for three rounds was an extra symbol, not a
wrong table. decode_block_rect read the tx-depth symbol unconditionally, where
both square paths gate their read_tx_size on `tx_select`. That symbol exists
only under TX_MODE_SELECT, and several gate recipes pass
--enable-tx-size-search=0, so the encoder wrote none and the decoder consumed
one that was never there -- desyncing the tile from that point, which is why
both 32x16 strips of the pinned quadrant were wrong from their first pixel.

r4's own range ladder had already named it without recognising it: the oracle's
range was unchanged across its whole block, 58692 either side, while ours moved
58692 -> 43570. Equal ranges either side of a symbol mean the symbol was never
consumed -- a cheaper conclusion than a near-certain CDF, and it needed no
further instrumentation. r4 read it as a wrong CDF row and refused to land on
an unconfirmed suspect, which was the right call on the evidence it had.

Free-partition gate: 15 pixel-exact matches of 40 with zero mismatches and
rect_coeff_hits=38, against 11 matches and rect_coeff_hits=0 under the
refuse-by-name posture. The firing count is a hard assert again.

Full lib suite 232 passed / 0 failed.
fix(av1): gate the rect strip's tx-depth read on tx_selectAhmet Kaan Gümüş · 8a896ab
fix(av1): gate the rect strip's tx-depth read on tx_select

The tx-depth symbol exists only under TX_MODE_SELECT. Both square paths gate
their read_tx_size on `tx_select`; decode_block_rect read it unconditionally.
Several gate recipes pass --enable-tx-size-search=0, so the encoder wrote no
such symbol and the decoder consumed one that was never there, desyncing the
tile from that point -- which is why both 32x16 strips of the pinned quadrant
came out wrong from their very first pixel.

r4's own range ladder had already named it without realising: the oracle's
range was UNCHANGED across its whole block (58692 either side) while ours moved
58692 -> 43570. Equal ranges either side of a symbol mean the symbol was never
consumed. r4 read it as a wrong CDF row and refused to land on an unconfirmed
suspect, which was right on the evidence it had.

With the read gated, the real coefficient decode is pixel-exact: the
free-partition gate reports rect_coeff_hits=38 and 15 pixel-exact matches of 40
with zero mismatches, where the refuse-by-name posture gave 11 matches and
rect_coeff_hits=0. The hard assert on the firing count is restored.

Full lib suite 231 passed / 0 failed in this worktree.
fix(av1): make the gate hit-counters thread-local so a delta is the test's ownAhmet Kaan Gümüş · 5c21ffa
fix(av1): make the gate hit-counters thread-local so a delta is the test's own

The firing counters were process-global atomics and cargo runs tests in
parallel threads, so a gate's `hits() > before` delta could be satisfied by a
SIBLING gate's increments -- the gate would pass without its own feature ever
firing, which is the vacuous-gate failure this batch has already fixed twice by
other means. Eleven gates took that delta without holding the counter lock.

Measured before the fix: the free-partition gate reported rect_partition_hits=9
and partab_hits=2 alone, and 18 and 4 inside the full suite. Same stream, same
decode, double the count -- the difference was other tests.

Serializing those eleven on the existing lock fixed the correctness and took
the suite from 67 s to over 600 s, because it serializes every slow aomenc gate
against every other. Thread-local counters give the same isolation with no
serialization at all: the decoder runs single-threaded, so each test thread's
counts are inherently its own, and the added locks come back out.

After: the same gate reports 9 and 2 in both contexts. Full lib suite 232
passed / 0 failed in 67 s.
Merge branch 'lane-rectwire': rect coefficient infrastructure, decode still refusedAhmet Kaan Gümüş · 7e312c0
Merge branch 'lane-rectwire': rect coefficient infrastructure, decode still refused

Three rounds, landing on a refusal rather than a decode, which is the correct
outcome for what was proven.

r1 did the recon and deliberately did not land code with the budget it had left
-- the right call for a coefficient-decode edit, where the failure mode is a
silent desync. Its recon narrowed the job sharply: decode_block_rect is called
from only four sites at fixed size pairs, get_txsize_entropy_ctx reduces to
txsize_sqr_up_map so most TxbSet fields reuse the square ones, and the only
genuinely new pieces are two eob CDF table sets.

r2 landed the wiring: those two CDF sets at all four sites, the four literal
scan tables (verified byte-for-byte, and confirmed NOT reproducible from the
square zigzag formula generalized -- the transcription was necessary, not
lazy), the rect context helpers, and a real non-skip decode path.

r3 triaged the mismatch r2 reported honestly rather than shipped. It is a real
deterministic desync, not an attempt-selection flake: 93.5% of the frame's
luma mismatches concentrate in the one PARTITION_HORZ quadrant, and both 32x16
strips are wrong from their first pixel. All three of r2's own suspects were
cleared against libaom source. So the non-skip branch refuses by name again and
the decode logic stays in the file, unreachable, for the round that isolates
the divergence. The gate's RECT_COEFF_HITS assert is downgraded to a note,
since it is now zero by construction -- a hard assert that cannot fire is the
vacuous-gate trap this batch already fixed once.

Full lib suite 231 passed / 0 failed; the free-partition gate is green with
zero mismatches.
fix(av1): revert rect coeff decode to refuse-by-name -- desync found, not isolatedAhmet Kaan Gümüş · 3bebc9d
fix(av1): revert rect coeff decode to refuse-by-name -- desync found, not isolated

lane-rectwire r3: pinned stream rectwire-flake-1.obu (seed 55) reproduces
deterministically and shows a genuine desync in r2's real (non-skip)
32x16/16x32 coefficient decode (93.5% of frame-0 luma mismatches land
inside the one HORZ-split quadrant, both strips ~100% wrong from their
first pixel). r2's three named suspects (base_ctx_rect offsets, chroma
skip-ctx formula, dc_sign_ctx index) all cross-checked byte-for-byte
against real libaom source and cleared. Range-ladder bisection stalled on
the intra key-frame path having no traced symbol between partition and
first coefficient in the oracle; next round's first move is patching that
into aomdec. Reverted decode_block_rect's non-skip branch to refuse by
name (r1 behavior); RECT_COEFF_HITS gate assert downgraded back to a
SOFT-NOTE. Free-partition gate green (29 refusals incl. 3 new named ones,
11 matches, 0 desyncs), full lib suite 231/0.
feat(av1): thread allow_screen_content_tools palette consumption into inter-frame intra sub-blocksAhmet Kaan Gümüş · ad21245
feat(av1): thread allow_screen_content_tools palette consumption into inter-frame intra sub-blocks

decode_inter_block/decode_inter_block8's intra-sub-block branches (libaom's
read_intra_block_mode_info) now read the same PALETTE_Y_MODE/PALETTE_UV_MODE
symbols read_intra_mode already consumes for key frames, gated by the same
av1_allow_palette bsize check, reusing the palette_bsize_ctx(side)/0-ctx
corner-cut. Confirmed against decodemv.c: read_intra_block_mode_info has NO
use_intrabc call at all (intra-frame-only symbol, av1_read_mode_info
dispatches on frame_is_intra_only) -- narrowed charter's intrabc scope for
this path accordingly. Removed stream.rs:169's remaining
frame_type != Key && allow_screen_content_tools whole-frame refusal now that
both key and non-key intra paths consume the syntax. 231/0 lib suite
unchanged (bit clear on every existing stream -> inert).
Merge branch 'lane-gm': non-IDENTITY global motion decodes through the warp pathAhmet Kaan Gümüş · 384a874
Merge branch 'lane-gm': non-IDENTITY global motion decodes through the warp path

Four rounds. The first three ported the syntax correctly -- gm_get_motion_vector,
the mvstack neighbour substitution, the is_global_mv_block vs
is_nontrans_global_motion split -- and the wedge gate still mismatched, because
every check that compared mv VALUES passed. A range ladder settled it: our msac
range and the instrumented aomdec's were both 38664 at the offending block, so
entropy was in sync and the defect was prediction-side. libaom's allow_warp has
a global_warp_allowed branch that predicts every is_global_mv_block block with
the full per-pixel affine warp, independent of motion_mode; this decoder only
ever warped for local WARPED_CAUSAL and fell back to translational MC on the
block-centre mv -- a centre-point approximation whose error grows with distance
from the centre, which is exactly the error shape that was observed.

r4 implements that path, reusing the existing warp_affine and shear machinery
rather than writing a second one. The seed-43 pin's frame 1 luma, the divergence
r3 root-caused, now matches, as do frames 0-13. The blanket "any non-IDENTITY
global motion" refusal is replaced by two named ones: AFFINE models, and more
than one concurrently active ROTZOOM/AFFINE ref slot -- the latter is a real
residue r4 localized but did not root-cause, and refusing it beats guessing.

Also fixed en route: gm_get_motion_vector was missing the -1 on both block-centre
offsets that libaom's block_center_x/y apply.

Full lib suite 231 passed / 0 failed. The wedge gate's match count is 11-16 of 40
across runs -- it selects a different aomenc attempt each run, so single-run
counts from any one round are not comparable.
feat(av1): global-warp prediction for single-ref GLOBALMV (allow_warp's global_warp_allowed branch)Ahmet Kaan Gümüş · eed6f8c
feat(av1): global-warp prediction for single-ref GLOBALMV (allow_warp's global_warp_allowed branch)

Wires global_motion[ref] into crate::warp::global_warp_params (reuses
find_projection's get_shear_params, no second warp implementation) for
every single-ref is_global_mv_block, gated independent of motion_mode
matching libaom's allow_warp exactly (local WARPED_CAUSAL short-circuits
first, else-if global). Pin gm-seed43.obu: frame 1 luma mismatch (r3's
root cause) now MATCH; frames 0-13 all match. Frame 14+ hits a NEW,
narrower, distinct shape (two ref slots concurrently ROTZOOM) -- refused
by name rather than guess-fixed. stream.rs's whole-frame refusal narrowed
from "any non-IDENTITY global motion" to two named remaining gaps: AFFINE
models, and more-than-one concurrently active ROTZOOM/AFFINE ref slot.
Wedge gate: 27/40->30/40 other-capability refusals (10 matches, wii_hits=4),
full lib suite 227/0 unchanged.