forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 231663ed27875fd28c44872ee5987f01d935ae8a

2026-08-30

docs(av1): lane-lr r5 charterAhmet Kaan Gümüş · ea29f07Browse files
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.
feat(av1): lift the multi-tile refusal for key frames, scopedAhmet Kaan Gümüş · 4be6f4c
feat(av1): lift the multi-tile refusal for key frames, scoped

decode_stream now threads a real tile_bufs: Vec<&[u8]> (all tiles,
obu_offset-corrected the way r3's gate proved) into
decode_key_frame_tile_with_cdfs instead of hardcoding &[tile_bytes],
and the blanket "more than one tile" refusal is narrowed to four named
cases instead of one: inter frames with cols > 1 (decode_inter_frame_
tile_with_cdfs has no per-tile loop at all), rows > 1 (untested this
round), cols > 2 (non-last-column right-edge reach bound unimplemented
for 3+ columns), and any multi-tile frame with loop filtering on
(deblocking crosses tile boundaries by spec default -- confirmed AV1
has no loop_filter_across_tiles_enabled-style flag at all, unlike
HEVC -- and PlaneBuf's tile origin cannot bound that reach yet).

r3's two-tile-column gate now also runs straight through decode_stream
(new test, --loopfilter-control=0 kept): 20/20 pixel-exact, tile_hits
delta > 1 every time.

EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j4: 234 passed, 0
failed, 17 ignored, 146.97s.
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.
test(av1): two-tile-column key frame decodes pixel-exact, bypassing the multi-tile refusalAhmet Kaan Gümüş · a5441e8
test(av1): two-tile-column key frame decodes pixel-exact, bypassing the multi-tile refusal

Proves r2's per-tile decode loop (fresh SymbolDecoder+CDF copy per tile,
Neighbours::start_tile, PlaneBuf::set_tile_origin) actually decodes both
tiles: a_real_aomenc_stream_with_two_tile_columns_decodes_pixel_exact calls
decode_key_frame_tile_with_cdfs(&[tile0, tile1], ...) directly (decode_stream's
cols>1||rows>1 refusal still fires and is untouched), 20/20 pixel-exact vs
ffmpeg, tile_hits() delta hard-asserted >1 on every match.

--sb-size=64 needed (this decoder hardcodes 64px superblocks; aomenc default
128px SB makes 128x64 a single superblock, nothing to tile-split).
--loopfilter-control=0 needed: deblocking crosses tile boundaries by spec
default and PlaneBuf's tile_x0/tile_y0 only clip left/top reach (the known
r2-flagged gap), so a non-last column's right-edge deblock would misbehave --
sidestepped here since deblocking is not what this gate proves.

Caught and fixed a real bug in the test's own OBU walk while wiring it: tile
byte offsets are relative to the slice parse_obu was handed, not absolute in
the stream (decode_stream already knows this, my first draft didn't) --
without the obu_offset fix every attempt decoded garbage-offset bytes as a
flat all-skip DC block, silently 'matching' nothing real.
feat(av1): lane-lr r3 step 1 -- real aomenc LR gate, proves read_lr firesAhmet Kaan Gümüş · 74cb98d
feat(av1): lane-lr r3 step 1 -- real aomenc LR gate, proves read_lr fires

Adds a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly
(stream.rs): --enable-restoration=1 --sb-size=64 aomenc stream over a
multi-superblock (192x128 = 3x2 SB) gradients fixture, cq-level=15 (r2's
sibling gates' usual cq=45 never landed uses_lr=true for this content --
sampled live). Self-pins WIENER_HITS/SGRPROJ_HITS/SWITCHABLE_HITS
thread-local counters in restoration.rs's read_lr_unit and hard-asserts
their sum > 0.

Building the gate found the real r2 gap: the stream.rs uses_lr refusal
ran BEFORE the tile-decode call, so decode_key_frame_tile_with_cdfs/
decode_inter_frame_tile_with_cdfs (and therefore read_lr) were NEVER
invoked through decode_stream -- 40/40 gate attempts hit the refusal with
zero read_lr_unit hits before this fix. Moved the check to run AFTER the
tile decode succeeds, so it now proves the superblock walk survives
read_lr (no desync) before refusing on the true remaining gap. Refusal
string text unchanged ("a frame with loop restoration enabled (the
per-unit lr symbols are read but the Wiener/self-guided filters are not
yet applied to pixels)"), only its position in decode_stream moved.

Verified: cargo test -p ec-av1 -- 236 passed / 0 failed, 17 ignored,
EC_AV1_REQUIRE_AOMENC=1. New gate alone: 39 LR refusals, 0 other
refusals out of 40 attempts, wiener_hits=19 sgrproj_hits=72
switchable_hits=0 (this fixture's RD never picked frame-level
Switchable, only fixed Wiener/Sgrproj -- both arms proven live).

Next (r3 step 2): apply_loop_restoration pass after apply_cdef, Wiener
first (stripe boundary save/restore trap per charter), then SGR, then
drop this refusal.
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.
docs(av1): lane-chroma r4 reportAhmet Kaan Gümüş · bf25067Browse files
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).
test(av1): pin the decode path's refusals, and the claims they makeAhmet Kaan Gümüş · 093155e
test(av1): pin the decode path's refusals, and the claims they make

Two things this decoder keeps relearning. A refusal string is a claim: 'this
encoder never writes one' asserts something about the world, and one such
string was disproved by the very gate that carried it. And refusals accumulate
silently -- each one is the right call for the lane that adds it (refuse by
name rather than desync), but the total is the distance to decoding a
default-settings stream, and nothing printed the total.

refusal_inventory derives every unsupported(...) reason reachable on the decode
path -- decode.rs and stream.rs, both call shapes -- and pins it: 39 distinct
refusals, of which 7 are phrased as claims about what an encoder emits and are
now declared in their own list rather than scattered. Adding, renaming or
removing a refusal fails until the inventory is updated, so the diff of this
file is the decoder's capability delta in English. A new claim-shaped refusal
fails separately, with the reason it needs evidence.

Negative-checked: dropping one entry fails both tests naming that exact string.
Suite 236 passed / 0 failed.
feat(av1): palette colour-index CDF tables + 4-site wiringAhmet Kaan Gümüş · 28f95f6
feat(av1): palette colour-index CDF tables + 4-site wiring

PALETTE_Y_COLOR_INDEX / PALETTE_UV_COLOR_INDEX (entropymode.c), indexed
[n-2][color_ctx], transcribed from AOM_CDFn macros with zero-padding past
each row's real n+1 entries (call site slices [..=n]). Wired into Cdfs:
struct fields, per-frame counter reset (reset3, generic), defaults array.
Inert until stage 3-4 reads them.
docs(av1): lane-tiles r3 charterAhmet Kaan Gümüş · 565a78bBrowse files
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): CDEF gate -- real aomenc stream, cdef_idx_hits hard-assertedAhmet Kaan Gümüş · 24f08c2
feat(av1): CDEF gate -- real aomenc stream, cdef_idx_hits hard-asserted

lane-realworld r2: verified bd61617's suite green (232/0), then wrote
a_real_aomenc_stream_with_cdef_decodes_pixel_exact. Multi-SB frame
required (single 64x64-SB fixtures the other gates use structurally
can never produce cdef_bits>0 -- nothing to differentiate); 128x64 (2
SBs) at --cpu-used=4 --aq-mode=0 --deltaq-mode=0 avoids two
pre-existing unrelated gaps this lane doesn't own: cpu-used=0 pushes
aomenc's RD into SB-level partition types (HORZ_4/VERT_B) this
decoder's intra part64 match doesn't cover, and cpu-used>=1's default
aq-mode writes delta_q/delta_lf (this lane's own next step).
cdef_idx_hits() hard-asserted > 0 (24-40 hits per run, matched
40/40 pixel-exact).
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.
docs(av1): lane-chroma r4 charterAhmet Kaan Gümüş · 8f6064bBrowse files
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.
feat(av1): msac-flavoured LR subexp/recenter port + Wiener/SGR read_lr_unit primitives (unwired)Ahmet Kaan Gümüş · 4c75e5c
feat(av1): msac-flavoured LR subexp/recenter port + Wiener/SGR read_lr_unit primitives (unwired)

Ports decode_subexp/decode_unsigned_subexp_with_ref/decode_signed_subexp_with_ref
to the msac SymbolDecoder (k is a per-tap parameter here, not global motion's
fixed 3), plus read_wiener_filter/read_sgrproj_filter and the SGR params table,
all from libaom decodeframe.c/restoration.c. Pinned via roundtrip against a
hand-written encode-side mirror (SymbolEncoder has no LR writer of its own).
Not yet called from decode.rs -- stream.rs's whole-frame refusal is unchanged.
wip(av1): smooth-intra gate in progress, committed at the 75-turn capAhmet Kaan Gümüş · 7ba8085
wip(av1): smooth-intra gate in progress, committed at the 75-turn cap

Committed verbatim by the orchestrator so the work survives the cap; the gate
compiles but has never been run.
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).
docs(av1): lane-superres r2 charter; commit the libaom upscaler pin harness out of the reapable scratchpadAhmet Kaan Gümüş · c28ee95
docs(av1): lane-superres r2 charter; commit the libaom upscaler pin harness out of the reapable scratchpad