forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 98000ad6cccd51d5d823b3773a2d76eba91fb5a0

2026-08-30

fix(av1): superblock HORZ/VERT strip's luma corner nz-map ctx table -- pixel exactAhmet Kaan Gümüş · db23f4b
fix(av1): superblock HORZ/VERT strip's luma corner nz-map ctx table -- pixel exact

r7 range-laddered block2's coefficient read to a single symbol: base_ctx at
(row=1, col=0) diverges (ours 3, libaom level 1) with identical entry range,
eob and base_eob. Root cause per libaom source: get_txsize_entropy_ctx
resolves TX_32X64/TX_64X32's CDF *set* to square TX_64X64 (confirmed correct,
ruling out the charter's first suspect), but av1_nz_map_ctx_offset (the
position term feeding base_ctx) is separately indexed by the raw, un-adjusted
tx_size in decodetxb.c -- TX_32X64 and TX_64X32 each own a genuinely
different offset table from the square one (av1_nz_map_ctx_offset_32x64/
_64x32 in txb_common.c), confirmed against libaom source and used already by
lane-rectwire's base_ctx_rect for the smaller (<=32) rectangular sizes.
decode_block_rect64's luma corner read went through the generic (square-only)
base_ctx via read_coeffs, never picking up the rect table.

Added NZ_MAP_CTX_OFFSET_32X64/_64X32 (verified against the real libaom
tables), threaded an Option<(w, h)> rect_shape hint through read_coeffs/
base_ctx (None at every square call site, Some((bw, bh)) only from
decode_block_rect64), and select the matching offset table.

Gate: a_real_aomenc_stream_with_a_superblock_level_horz_vert_partition_decodes_pixel_exact
now 15/40 pixel-exact matches (0 mismatches, 25 named refusals, sb_rect_hits=36) --
was 0/40 pixel-exact before this round.
Merge branch 'lane-palette2': UV palette blocks decode pixel-exactAhmet Kaan Gümüş · 318c22b
Merge branch 'lane-palette2': UV palette blocks decode pixel-exact

Both chroma planes now reconstruct from their palette and index map
(read_palette_colors_uv written, PaletteUv reconstruction, record_palette_uv).
The gate hard-asserts palette_uv_hits moved before comparing pixels; 2 UV
palette blocks fire and match ffmpeg.

The previous round's uncommitted tree needed exactly one fix -- an 8x8-leaf
read_intra_mode call site still on the pre-UV signature -- so committing that
tree verbatim at the cap was worth doing.

The UV refusal string stays in the inventory: it is still live at two
out-of-scope call sites (rect strip, inter-frame leaf).

Suite 263 passed / 0 failed.
diag(av1): sbpart r7 -- per-symbol coeff range ladder localizes block2's true divergenceAhmet Kaan Gümüş · 36c2f06
diag(av1): sbpart r7 -- per-symbol coeff range ladder localizes block2's true divergence

Rung 3's entry/exit EC_TRACE_COEFF proved block2's luma coefficient read
(TxbSet::Luma64 corner, decode.rs:3214) is where the desync actually starts:
entry rng=63764 matches the oracle exactly (confirming r6's mode-info prefix
finding held all the way through skip/depth), but the luma read's own exit
range (46984 ours vs 46344 oracle) diverges -- overturning r6's suspicion
that around_rect's neighbour gather was the culprit; the gather only feeds
skip_ctx/dc_sign_ctx, and both of those read identically (all_zero=0 both
sides, dc_sign both agree).

Added a new oracle rung (11, scripts/instrument-aom-oracle.sh, same
EC_TRACE_COEFF flag) printing per-symbol rng inside read_coeffs_txb
(eob/base_eob/after_bases/sign/post_golomb), plus matching entry/exit
EC_COEFF/EC_COEFF_VAL markers at all 3 of decode_block_rect64's own
read_coeffs/read_coeffs_rect call sites and rng on read_eob's own TRACE
eob_pt/eob_extra lines. Range-laddered block2's luma block byte-for-byte
against the oracle: eob (6) and base_eob (level=1) both match. First value
divergence is the "base" symbol at scan position row=1,col=0 (pos=32) --
ours decodes value=3 (triggering an extra "br" read, final level 3), the
oracle's equivalent position decodes level=1 with no br read at all. This
is a NEW, sharper suspect than r6's around_rect/context-gather framing: the
coefficient magnitude symbol itself (base_ctx's context computation, or the
CDF row it indexes) for this specific scan position inside the 32x32 corner
scan.

Diagnostics only, no behavior change to the live gate (still red, same as
r6 left it) -- sb_rect_hits()>0 unproven this round, not attempted since the
fix itself wasn't reached within budget.

cargo check -p ec-av1 --tests: clean, only pre-existing missing-doc
warnings. Oracle rung env-gated, applied to the shared ~/.cache/aom-oracle
tree and rebuilt (ninja aomdec clean), also captured in
scripts/instrument-aom-oracle.sh so it reproduces from a fresh clone.
fix(av1): compile the r1 UV-palette WIP + gate it against a real aomenc streamAhmet Kaan Gümüş · 03d0151
fix(av1): compile the r1 UV-palette WIP + gate it against a real aomenc stream

read_intra_mode's 8x8-leaf call site was still on the pre-UV 8-arg tuple/
13-arg signature after r1's mid-edit commit -- fixed by threading the same
None-palette-uv/&[] corner-cut that call site already used for palette_y.
Everything else r1 wrote (read_palette_colors_uv, PaletteUv reconstruction
into both chroma planes, record_palette_uv neighbour tracking) was already
correct once it compiled.

Added a_real_aomenc_stream_with_palette_uv_decodes_pixel_exact: testsrc2
at the same square-only recipe as the palette-Y gate, hard-asserting
palette_uv_hits moved before checking pixel-exactness against ffmpeg
(2 UV palette blocks fire; both frames match luma/U/V exactly).

refusal_inventory.rs needed no edit -- "a block that actually uses a
palette (UV)" is still genuinely present at two other call sites (the
HORZ/VERT rect-strip and inter-frame 8x8-leaf paths), which stay refused
and are out of this round's scope (steps 2/3).
fix(av1): reword a second capability claim my own probe disprovedAhmet Kaan Gümüş · 738a983
fix(av1): reword a second capability claim my own probe disproved

"a partition below 8x8 (this encoder never writes one)" is false. Default
aomenc at --cpu-used=0 --cq-level=20 over lavfi testsrc2, with palette and the
rect/AB/1to4 partitions switched off so the earlier refusals cannot mask it,
reaches that refusal directly. Three sites in decode.rs plus the inventory now
describe the decoder instead.

Method note for whoever probes the remaining two claims (angle delta, non-DC
chroma on an 8x8 inter leaf): a claim can only be tested on a stream that gets
PAST every refusal in front of it, so disable the tools whose refusals fire
first rather than concluding the case is unreachable.

Suite 262 passed / 0 failed.
diag(av1): sbpart r6 -- merge main, build oracle rung 10, range-ladder block2Ahmet Kaan Gümüş · 75f3f89
diag(av1): sbpart r6 -- merge main, build oracle rung 10, range-ladder block2

Merged origin/main (170a5a3) into lane-sbpart; the only real conflict was
stream.rs (adjacent test insertions from lane-realworld's deltaq gate and
lane-tiles' tile-group/non-uniform-spacing gates landing next to this lane's
sbpart tests) -- resolved by keeping both sides' complete functions in
sequence, no interleaving. cargo check -p ec-av1 --tests: clean.

Oracle rung 10 (scripts/instrument-aom-oracle.sh, EC_TRACE_MODE_STEP=1):
per-symbol range ladder inside decodemv.c's
ec_read_intra_frame_mode_info_impl (rung 5's renamed body) -- prints rng
after skip, cdef, dq, mode, angle_y, uv_mode, angle_uv. Rung 9 was already
taken by lane-lr on main by the time this round started; took 10.

Matching istep instrumentation added to our own read_intra_mode_rect
(decode.rs, same EC_TRACE_MODE_STEP gate, same "EC_ISTEP ... name=... rng="
format) so the two sides are directly diffable.

Range-ladder result on the pinned mismatch (seed 42,
EC_SBPART_GATE_ATTEMPTS=1): block2 (mi_row=0 mi_col=24)'s skip/cdef/dq/
mode/angle_y/uv_mode/angle_uv reads are BYTE-EXACT against the oracle --
same decoded values, same rng after every read. This overturns r5's
"desync at block2's first symbol" framing: the desync is not in the mode-
info prefix at all. It narrows the bug to what read_intra_mode_rect's
caller (decode_block_rect64) does AFTER angle_uv returns: tx_select/depth,
then the three coefficient reads (read_coeffs w/ TxbSet::Luma64 for the
32x32 luma corner, read_coeffs_rect w/ TxbSet::ChromaRect32x16 for each
chroma plane), all keyed off Neighbours::around_rect's gathered skip_ctx/
dc_sign_ctx -- around_rect (decode.rs:2094) was NOT part of r5's inspection
audit (which covered record_rect, the write side, and
fill_skip_grid_rect/skip_txfm_ctx) and is the sharpest remaining suspect.

Not fixed this round -- budget spent on the merge + building the range-
ladder proof itself. See lanes/sbpart-r6.report.md.
Merge remote-tracking branch 'origin/main' into lane-sbpartAhmet Kaan Gümüş · a3e5cc5
Merge remote-tracking branch 'origin/main' into lane-sbpart

# Conflicts:
#	crates/ec-av1/src/stream.rs
Merge branch 'lane-tiles': tile-group OBUs and non-uniform tile spacing, both proven liveAhmet Kaan Gümüş · 0bdb5a0
Merge branch 'lane-tiles': tile-group OBUs and non-uniform tile spacing, both proven live

Both closed the same way r8 closed context_update_tile_id: staleness-checked
first, and both turned out to already work. Several tile-group OBUs per frame
decodes 20/20 pixel-exact; uniform_spacing_flag == 0 decodes pixel-exact too,
reachable only through aomenc's --tile-width/--tile-height (present in the
binary, absent from --help; --tile-columns/--tile-rows and --auto-tiles never
set it, and --auto-tiles needs threads >= 2).

Neither needed new decode code. What they needed was a gate, because an
untested capability and an absent one look identical from the outside.

Suite 262 passed / 0 failed.
diag(av1): sbpart r5 -- confirm entropy desync between the two rect64 VERT/HORZ callsAhmet Kaan Gümüş · cc3d46c
diag(av1): sbpart r5 -- confirm entropy desync between the two rect64 VERT/HORZ calls

Pinned-stream diagnostics only: TRACE_RECT32_END trace print, and an
EC_SBPART_DIAG bbox/per-SB-column breakdown on the pinned replay test.
No behavior change to the live gate. See lanes/sbpart-r5.report.md for
the finding.
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.
test(av1): non-uniform tile spacing gate -- decode already generic, staleness-checkedAhmet Kaan Gümüş · 2f03ac7
test(av1): non-uniform tile spacing gate -- decode already generic, staleness-checked

Charter's second item: uniform_spacing_flag == 0 (spec 5.9.15). decode.rs's
tile loop already walks tile_info.mi_col_starts/mi_row_starts generically for
both branches read_tile_info produces -- no refusal exists for this on the
decode side (the only "non-uniform tile spacing is not written" refusal in the
crate is frame.rs's OBU *writer*, an unrelated encode path).

aomenc never emits uniform_spacing=0 from --tile-columns/--tile-rows (always
takes the uniform_spacing=1 branch in libaom's set_tile_info), and
--auto-tiles only reaches the non-uniform path when g_threads>=2, ruled out by
this charter's --threads=1. Found and hand-verified the CLI surface that
actually reaches it: --tile-width=<sb-list>/--tile-height=<sb-list> (present
in the binary, not printed by --help) -- checked live against
av1_cx_iface.c's set_tile_info before writing the gate.

New gate a_real_aomenc_stream_with_non_uniform_tile_spacing_decodes_pixel_exact
(stream.rs): 256x64, --tile-width=1,3 --tile-height=1 --sb-size=64, probes the
parsed header's tile_info.uniform_spacing directly and hard-asserts it false.
20/20 pixel-exact vs ffmpeg, 0 named refusals. Scoped suite
(tile/mvstack/refusal_inventory/gate_coverage, EC_AV1_REQUIRE_AOMENC=1) green,
full stream:: module 52/0 (6 pre-existing ignored fixture tests untouched).

Both charter items now closed: several tile-group OBUs (r9's WIP edit,
verified working this round, no changes needed) and non-uniform tile spacing
(this commit) were both already-correct decode capabilities, gated and proven
live rather than built fresh.
wip(av1): sbpart r4's in-flight rect64 trace edits, committed verbatim at the turn capAhmet Kaan Gümüş · 1677429
wip(av1): sbpart r4's in-flight rect64 trace edits, committed verbatim at the turn cap

The builder stopped while adding "one more targeted trace print to pin down
whether the desync is in symbol reading or purely in reconstruction". Diagnostic
prints are expected in this diff. State unverified by me.
wip(av1): tiles r9's in-flight tile-group gate edit, committed verbatim at the turn capAhmet Kaan Gümüş · 462b1bf
wip(av1): tiles r9's in-flight tile-group gate edit, committed verbatim at the turn cap

The builder stopped mid-edit ("delete lines 7881-7899 and write the replacement
gate"), so stream.rs may not even compile. State unverified by me: r10 checks
before believing anything here.
Merge branch 'lane-lr': loop restoration reads and applies its filters, gate greenAhmet Kaan Gümüş · 53dfc78
Merge branch 'lane-lr': loop restoration reads and applies its filters, gate green

Nine rounds. The last three chased a one-pixel SGR difference through
lr_sample, the box-sum formula, stripe boundaries and the fast arm, all of
which were correct: the cause was two mistranscribed SGR_X_BY_XPLUS1 entries
(av1_x_by_xplus1[101] and [165..=169]).

Two process facts worth keeping. r6's evidence for the divergence was wrong --
its oracle dump matched on a coordinate that recurs across the gate's attempt
sweep, so it captured some other invocation, and r7 spent a full round proving
that. And this lane sat nine rounds without merging, so each late round spent
its whole budget on the merge instead of the work; r9 died at its cap having
resolved every conflict without ever compiling. I finished that merge here:
three of main's newer gate call sites were missing this branch's
LoopRestorationParams argument -- text-clean, compile-broken, the same semantic
conflict shape the delta_q merge produced.

Refusal retired: "a frame with loop restoration enabled (this decoder never
reads the per-unit lr symbols)".

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.
wip(av1): sbpart r3's in-flight rect64 bisect edits, committed verbatim at the turn capAhmet Kaan Gümüş · dac1692
wip(av1): sbpart r3's in-flight rect64 bisect edits, committed verbatim at the turn cap

The builder stopped at its 75-turn limit with "compiles clean, now run the
gate" -- so this tree compiles but its gate result is unknown to me. State
unverified: r4 re-runs the gate before believing anything here.
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.
docs(av1): lane-palette r7 reportAhmet Kaan Gümüş · 745cab9Browse files
Merge branch 'lane-realworld': delta_q/delta_lf decode 40/40 pixel-exact (delta_q_hits=delta_lf_hits=1920, hard-asserted)Ahmet Kaan Gümüş · a74bb66
Merge branch 'lane-realworld': delta_q/delta_lf decode 40/40 pixel-exact (delta_q_hits=delta_lf_hits=1920, hard-asserted)

Blocker (2) of the default-aomenc-settings chain closed. Recipe needs
--deltaq-mode=2 (mode 1 is content-dependent) plus the separate
--delta-lf-mode=1.

The merge was textually clean but semantically broken: lane-tiles' new
tile-row gate calls decode_key_frame_tile_with_cdfs with 16 args while this
branch gave the function a 17th (DeltaParams). Added header.delta at
stream.rs:6396 to match the four sibling call sites.

Suite 249 passed / 0 failed.
fix(av1): SGR_X_BY_XPLUS1 mistranscription (av1_x_by_xplus1[101] and [165..=169])Ahmet Kaan Gümüş · 09e8afa
fix(av1): SGR_X_BY_XPLUS1 mistranscription (av1_x_by_xplus1[101] and [165..=169])

Call-unique debug dump (gated on the pinned stream's own decoded xqd ==
[-16,-32], not a reused coordinate) traced r6's 3110-vs-3109 divergence to
the dense-arm "u" tap's A value: our compute_ab produced (254,303) for
z=101 where libaom's real table gives (253,454). The 9-byte input window
was already correct (r7); the bug was in the const table itself, off by
one at index 101 and short 5 entries in the 254 run at 165..=169.
Regenerated both SGR tables straight from
~/.cache/aom-oracle/src/av1/common/restoration.c to rule out any other
slip (SGR_ONE_BY_X already matched exactly). Pinned stream
fixtures/lr-sgr-r7.obu now decodes pixel-exact on all three planes.
Merge branch 'lane-tiles': tile ROWS decode pixel-exact (bypass + decode_stream gates, edge and interior row boundaries, loop filter ON; rows>1 refusal lifted)Ahmet Kaan Gümüş · e89401f
Merge branch 'lane-tiles': tile ROWS decode pixel-exact (bypass + decode_stream gates, edge and interior row boundaries, loop filter ON; rows>1 refusal lifted)

Also closes context_update_tile_id != 0 with no code change: decode.rs already
read it generically at both tile loops, and stream.rs carried a stale comment
claiming a refusal that never existed anywhere in the crate. Proven live
instead of shipped forward -- aomenc picks 1/2/3 across the four-tile-row
gate's seed sweep, all pixel-exact, hard-asserted.

Suite 248 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.
docs(av1): lane-superres r7 report -- gate closed, deblock clip is the root causeAhmet Kaan Gümüş · 0642e9c
docs(av1): lane-superres r7 report -- gate closed, deblock clip is the root cause

Merge note and stage-4 (inter-frame superres) deferred per charter.
docs(av1): lane-tiles r8 reportAhmet Kaan Gümüş · a8f1aedBrowse files
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.
docs+test(av1): drop the stale context_update_tile_id refusal claim, hard-assert it liveAhmet Kaan Gümüş · 99f3d63
docs+test(av1): drop the stale context_update_tile_id refusal claim, hard-assert it live

stream.rs's multi-tile comment claimed a context_update_tile_id != 0
refusal existed "further down" -- it did not; decode.rs has read
tile_info.context_update_tile_id generically (never hardcoded to 0) at
both tile-loop sites all along. Confirmed live via a probe on the
four-tile-row gate: aomenc's own RD-driven tile-size heuristic picks
1/2/3 as often as 0 across the 20-seed sweep, all pixel-exact. Fixed
the stale comment and added a hard assert
(saw_nonzero_context_update_tile_id) to
a_real_aomenc_stream_with_four_tile_rows_decodes_pixel_exact so this
proof can't silently stop firing.