forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 00c1b3ff2d80d84fef71bb6208110dedbbd95fc4

2026-08-30

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
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-superres stage-3 gate in progress, committed at the 75-turn capAhmet Kaan Gümüş · 0e6258a
wip(av1): lane-superres stage-3 gate in progress, committed 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).
test(av1): pin the coding tools no real-aomenc gate exercisesAhmet Kaan Gümüş · 21b2356
test(av1): pin the coding tools no real-aomenc gate exercises

lane-chroma r1 found reconstruct()'s `smooth_neighbor` hardcoded false -- wrong
whenever a directional block neighbours a smooth-mode one -- and it had survived
twenty real-aomenc gates because every one of them passes --enable-smooth-intra=0.
The corner-cut was not hidden by a weak assert; it was hidden by the gates'
encoder recipes, which no assert had ever looked at.

gate_coverage derives, from the gate source itself, the set of aomenc tools
switched off in all 20 gates and on in none -- provably never exercised by a
real stream -- and pins it: cdef, intrabc, paeth-intra, palette, smooth-intra.
An unlisted tool joining that set fails the test, and so does an entry the
gates have since started enabling, so a lane closing a hole must delete its
line. Negative-checked: dropping the enable-cdef entry fails with exactly that
name.

Suite 234 passed / 0 failed.
feat(av1): superres upscaler, pinned against real libaom codeAhmet Kaan Gümüş · c262edf
feat(av1): superres upscaler, pinned against real libaom code

crates/ec-av1/src/superres.rs: spec 7.16 horizontal-only linear-filter
upscale (av1_upscale_normative_rows/upscale_normative_rect/
av1_convolve_horiz_rs_c in libaom resize.c/convolve.c), coefficient
table + constants transcribed verbatim.

Corrects the charter's anchor note: libaom's decodeframe.c calls
superres_post_decode() BETWEEN av1_cdef_frame and
av1_loop_restoration_filter_frame, not after LR -- superres runs
before loop restoration, on the frame that will then be LR-filtered
at the upscaled size. Not yet load-bearing here since this decoder
still refuses any loop_restoration.uses_lr stream outright.

Pinned against libaom's own compiled code, not a second transcription:
a standalone C harness links ~/.cache/aom-oracle/build/libaom.a and
calls the real exported av1_get_upscale_convolve_step/
av1_convolve_horiz_rs_c/av1_resize_filter_normative directly (only the
one-line static get_upscale_convolve_x0 formula is copied in both
places) -- guards the class shared-oracle-blindness. Two captured rows
(8->12, 8->16) plus a flat-row unity-gain sanity check, 3/3 green.

Not yet wired into decode_stream (stage 3 next); module currently
unused, hence the dead_code warnings.
wip(av1): loop restoration CDF tables (restore_wiener/sgrproj/switchable)Ahmet Kaan Gümüş · ed590d6
wip(av1): loop restoration CDF tables (restore_wiener/sgrproj/switchable)

libaom entropymode.c default_{wiener,sgrproj,switchable}_restore_cdf,
copied exactly. Wired into Cdfs struct, defaults, and counter reset
(reset1, unindexed like intrabc). Not read from the bitstream yet --
next step wires read_lr/read_lr_unit into the superblock walk.
fix(av1): refuse use_superres by name -- was silent wrongnessAhmet Kaan Gümüş · 08cce92
fix(av1): refuse use_superres by name -- was silent wrongness

Step 0 measurement: use_superres/superres_denom already parse fully in
ec-av1-syntax (unit-tested), and superres adds/removes no per-block
symbol (spec 7.16's upscaler is a pixel-domain post-process run after
loop restoration), so decode_stream stayed bit-exact in sync on a real
--superres-mode=1 stream -- but every decode path stores the Picture at
frame_width (the downscaled coded width) and never runs the upscaler,
so it would silently hand back a picture sized frame_width instead of
upscaled_width. Refuse by name until the upscaler lands (lane-superres
stage 2+).

Gate: a_real_aomenc_stream_with_superres_refuses_by_name, real aomenc
--superres-mode=1 --superres-denominator=12 stream, asserts the refusal
names use_superres rather than desyncing into something else. Suite:
233 passed / 0 failed (232 baseline + 1).
report(av1): lane-chroma r1 -- smooth/paeth chroma refusal root-caused, not landedAhmet Kaan Gümüş · a869d13
report(av1): lane-chroma r1 -- smooth/paeth chroma refusal root-caused, not landed

Removing the two round-2 refusals (decode.rs uv_mode 9..=12) is a real two-line
change, but a real-aomenc gate (--enable-smooth-intra=1 --enable-paeth-intra=1,
never exercised by any other gate in the tree before) fails on LUMA pixels,
not chroma: the documented reconstruct() corner-cut ("smooth_neighbor left
false... a corner-cut for luma") is the root cause -- a directional block's
edge-filter strength picks the wrong bucket when its neighbour predicted
SMOOTH_H, off by 1-2 once smooth becomes RD-reachable. Fix needs threading
Neighbours::above_mode/left_mode through ~9 reconstruct() call sites plus new
chroma-side UV-mode neighbour tracking that does not exist yet -- both pieces,
not just the luma half, or chroma inherits the same silent bug. Reverted to
HEAD; attempt diff saved to scratchpad for the round that lands it. Directional-
chroma sibling refusal lives at a different, unrelated code path (inter-frame
intra-block reader) and was not attempted.
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-fixdet': the gate fixtures were never reproducibleAhmet Kaan Gümüş · 0169a4e
Merge branch 'lane-fixdet': the gate fixtures were never reproducible

ffmpeg's `gradients` lavfi source ignores its `seed` for colour selection.
Hashing one identical command line five times gave five different fixtures, and
twenty gate sites built their input that way -- so those gates have never once
had a reproducible input, and a pin captured from such a run could not be
regenerated.

The encoder was not the variable: six aomenc runs over a fixed y4m produced
identical bytes. That isolation matters, because it corrects an earlier claim
of mine that pinning the encoder's threads had fixed the filter_intra gate. It
had not -- that gate still failed about one run in fifteen in isolation.

Freezing the colours would have made the source reproducible and quietly
destroyed the per-attempt content sampling these gates depend on to fire their
features, which is a class this repo has already been bitten by. Deriving the
colours FROM the seed keeps both: one helper now serves all twenty sites, with
a guard test asserting that one seed reproduces byte-identically and two seeds
differ.

Re-measured after the fix: the filter_intra gate passes 20/20 and 15/15 in two
independent sets of isolated runs, and the free-partition gate gives identical
counts across three runs where it previously moved. No gate failed consistently,
so this nondeterminism was not hiding a decoder defect.

An unknown number of past failures filed against aomenc attempt selection were
really the source changing underneath. That is a real phenomenon, which is what
made it a plausible cover story.

Full lib suite 232 passed / 0 failed.
docs(av1): lane-fixdet r1 reportAhmet Kaan Gümüş · b4bac81
docs(av1): lane-fixdet r1 report

VERDICT FIXED. filter_intra 14/15 -> 20/20; free-partition counts stable
byte-identical across 3 isolated runs; full suite 232/0. Confirmed the
one full-suite-vs-isolated count discrepancy is a shared static
AtomicUsize (RECT_PARTITION_HITS/PARTAB_HITS in decode.rs) racing across
tests in the same process, not residual fixture nondeterminism -- filed
as deferred, out of this lane's scope.
fix(av1): route all 20 gradients gate fixtures through seed-derived coloursAhmet Kaan Gümüş · 5967ddb
fix(av1): route all 20 gradients gate fixtures through seed-derived colours

ffmpeg's `gradients` lavfi source ignores its own seed= for colour
selection -- measured, five identical command lines gave five different
fixtures. Add gradients_source(seed, w, h, tail) which derives c0..c3
from the seed with a plain integer hash (still passes seed= through too),
verified reproducible per-seed while keeping per-attempt variety across
seeds. All 20 stream.rs call sites now build their fixture through it.
Guard test gradients_source_is_reproducible_per_seed pins same-seed
byte-identical / different-seed differs.