forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on bede77e8a52fc53be7e4434c5ffb100b0c7dd9cfFiltered to scripts/instrument-aom-oracle.shClear filter

2026-09-29

rungs 16/17: script EC_PREDOUT8 (with mode=) and EC_PREDND onto current mainAhmet Kaan Gümüş · 079a7cd
rungs 16/17: script EC_PREDOUT8 (with mode=) and EC_PREDND onto current main

Reconstruction, not replay. lane-av1cmpaudit's commit 3d0001bc predates the HBD
repair block that has since landed on main, so re-applying it as a patch would
clobber that block; the rung bodies were re-applied to the CURRENT script instead.
The script diff is one insert-only hunk (@@ -1076,0 +1077,153 @@), zero deletions,
so the repair block provably survives.

What was actually absent from main is bigger than it looked: NOT just the script
half. `grep -c 'OUR_PRED x={x} y={y} plane=' crates/ec-av1/src/decode.rs` is 0 on
main, so the Rust twin field (RECON_PLANE / recon_plane() / PlaneGuard, `plane=` on
both OUR_PRED sites) is absent as well, and 3d0001bc is not an ancestor of main.

1. rung 16, EC_PREDOUT8 at BOTH 8-bit prediction sites in reconintra.c (the
   non-directional early return and the directional / filter-intra tail), with
   `mode=` on both. Install on a pristine file, and upgrade of the no-mode form the
   oracle tree's git HEAD carries, so a rebuild reproduces the live tree.

2. rung 17, EC_PREDND, the 10/12-bit non-directional site. This is the one that
   matters: rung 16 and the pre-existing EC_PREDOUT both sit after the is_hbd early
   return, so without rung 17 a rebuilt oracle prints NOTHING on a high-bitdepth
   stream -- the failure the rung exists to remove.

3. decode.rs gains `plane=` on both OUR_PRED sites so an EC_PREDOUT8/EC_PREDND vs
   OUR_PRED diff can tell a luma/chroma disagreement from a same-plane one. Behind
   the existing EC_PRED flag; RECON_PLANE is read only by that rung.

4. check-aom-oracle-rungs.sh now also restores reconintra.c to pristine before
   deriving (it previously only restored decodeframe.c, so a rung living in
   reconintra.c was never exercised at all), and asserts: rung 16 installed at both
   sites, mode= on both, rung 17 installed once, mode= present, plus a round-trip of
   the no-mode upgrade form. All ten pre-existing checks still print ok, exit 0.
   Mutation-proved: deleting rung 17, dropping rung 16's directional site, and
   dropping its mode= each red the corresponding assertion.

Evidence (one configure, two aomdec builds differing only in reconintra.c):
12-bit av112bit-key.obu -> 118 EC_PREDND lines with the rungs, 0 lines and empty
stderr without them. 8-bit ii-flake-1.obu -> 15 EC_PREDOUT8 lines, 15/15 with
mode=, 0 without. Decoded output byte-identical either way (md5 6b29cc50... /
482b5e04...). On ours, decode_probe prints 177 OUR_PRED lines, all 177 carrying
plane=, pairing field-for-field with the oracle's first three EC_PREDND lines.

cargo check -p ec-av1 --lib: clean, no warnings.
lanes: make a narrowing-rung regression loud, and check the derivationAhmet Kaan Gümüş · c755a39
lanes: make a narrowing-rung regression loud, and check the derivation

The depth fix made the four u8-narrowing rungs correct; the harm that caused
was their SILENCE -- a segfaulting rung leaves a 0-byte file, which downstream
reads as "the oracle has no data for this stage" and becomes a phantom stage
diff, or as evidence about the decoder. Two additions:

1. ec_dump_finish(): all four narrowing rungs now close through a byte-count
   check against the shape they claim (Y+U+V at one byte per sample, crop for
   PREFILT, mi-aligned for the other three) and abort() with one self-naming
   line on a mismatch. Non-vacuous: dropping PREFILT's last luma row makes
   aomdec exit 134 with
   EC_DUMP_ABORT rung=EC_AV1_PREFILT_DUMP bit_depth=12 hbd=1 expect=30720
   wrote=30560; restoring it gives exit 0 / 30720 B. Rung 12 keeps its own
   fclose (charter: do not change rung 12) and the rewriter cannot reach it --
   it keys on a rewritten ec_dump_narrow_row call in the block. Monochrome
   expects luma only; a failed fopen skips the block, so no config writes 0.

2. scripts/check-aom-oracle-rungs.sh: derives decodeframe.c from PRISTINE
   upstream (scratch copy, real tree never written) and asserts 0 legacy row
   loops, 12 narrow_row call sites, 4 finish call sites (one per rung), rung 12
   still converting and not narrowed, and that a second run is a no-op. Exit 0
   today; deleting the depth block from a copy of the script makes it print 7
   FAILs and exit 1 in under a second, with no build.

Emitted bytes unchanged: re-paired av112bit-key.obu (12-bit) and
palette_screen_witness_10bit.obu (10-bit), all four rungs oracle vs decoder,
all IDENTICAL.
lanes: oracle u8-narrowing rungs were reading a HALVED plane pointerAhmet Kaan Gümüş · 0f2d966
lanes: oracle u8-narrowing rungs were reading a HALVED plane pointer

The four u8-narrowing aomdec rungs (PREFILT, POSTDEBLOCK, PREFILT_WIDE,
POSTCDEF) SIGSEGV on every 10/12-bit stream: exit 139, 0-byte file, so a lane
loses HBD debugging through them and cannot tell the crash from a decoder
defect. Rung 12 (FINAL) works, and the difference is the whole bug.

YV12_BUFFER_CONFIG stores plane pointers HALVED at high bit depth
(aom_ports/mem.h: CONVERT_TO_BYTEPTR(x) = x >> 1; yv12config.c:161-180), so the
real address is CONVERT_TO_SHORTPTR(p) (p << 1). The rungs did
fwrite(y_buffer + r*y_stride, 1, w, f): pointer arithmetic on the halved value
addresses an unrelated, unmapped address, and y_stride/uv_stride count SAMPLES
so the row is wrong too. At 8 bit no halving happens, which is why the same
line is correct there.

Fix: one ec_dump_narrow_row helper (CONVERT_TO_SHORTPTR + low byte per sample,
the C spelling of the decoder's `s as u8`) and every legacy row loop rewritten
to call it. The 8-bit branch is the original expression verbatim. Rung 12 and
every rung the decoder does not pair with are untouched. The new trailing block
is a repair pass, so re-running instrument-aom-oracle.sh fixes an
already-instrumented tree in place; verified byte-identical against a hand
application, idempotent, and equal to a fresh derivation from pristine upstream.

Measured: 12-bit av112bit-key.obu 139/0B -> 0/30720B; 10-bit
palette_screen_witness_10bit and palette_screen_strip16_witness_10bit all four
rungs byte-identical to the decoder's as u8 dumps (73728B); 2- and 6-frame 12-bit
streams identical frame by frame; 8-bit output byte-identical to the shared
oracle on 422_allskip_2f and golden4-pin.

2026-09-25

2026-09-02

2026-09-01

test(av1): every alt-ref gate now compares hidden frames -- decode-order compare at 13 sites + an --arnr-maxframes=0 second arm; finding: the gates' own recipes emit ~0 hidden frames (5 across 281 attempt-streams), the arm emits 1-3 each and all are pixel-exact; oracle rung 13 (EC_MODE_MV + EC_MODE_VAL stack=) lifted out of the hand-patched build tree into instrument-aom-oracle.shAhmet Kaan Gümüş · 33130e2
test(av1): every alt-ref gate now compares hidden frames -- decode-order compare at 13 sites + an --arnr-maxframes=0 second arm; finding: the gates' own recipes emit ~0 hidden frames (5 across 281 attempt-streams), the arm emits 1-3 each and all are pixel-exact; oracle rung 13 (EC_MODE_MV + EC_MODE_VAL stack=) lifted out of the hand-patched build tree into instrument-aom-oracle.sh
feat(av1): hidden-frame pixel oracle -- EC_AV1_FINAL_DUMP on both sides + the repo's first alt-ref gateAhmet Kaan Gümüş · 3f461cf
feat(av1): hidden-frame pixel oracle -- EC_AV1_FINAL_DUMP on both sides + the repo's first alt-ref gate

Every pixel gate here compared decode_stream's output against ffmpeg/aomdec
y4m, and both emit SHOWN frames only, so a hidden (show_frame=0) alt-ref
frame -- which his films are full of, aomenc's default --lag-in-frames --
was decoded, stored into a reference slot and never compared to anything
(class gate-blind-to-hidden-frames).

- scripts/instrument-aom-oracle.sh rung 12: EC_AV1_FINAL_DUMP=<prefix> in the
  instrumented aomdec -> <prefix>.f<N> per DECODED frame (decode order, hidden
  included), after CDEF+superres+loop restoration, i.e. the frame as stored
  into the reference buffer; Y/U/V crop-sized rows, 8-bit u8 / high bitdepth
  u16 LE (bit-depth correct, unlike the u16->u8 narrowing debug dumps).
- ec-av1 stream.rs: matching EC_AV1_FINAL_DUMP at the ref-slot store site,
  same layout; prefix from a thread-local (set_final_dump_prefix) falling back
  to the env var so a gate cannot race a sibling test's decode.
- test helper decode_all_frames_vs_oracle() + gate
  a_real_aomenc_altref_sequence_hidden_frames_decode_pixel_exact: aomenc
  --auto-alt-ref=1 --lag-in-frames=25 --arnr-maxframes=0 on moving content,
  8-bit and 10-bit, hard assert hidden >= 2, byte-exact per decode-order
  frame. Result: 43 frames / 3 hidden each depth, all pixel-exact.
  --arnr-maxframes=0 is load-bearing and measured: with libaom's temporal
  alt-ref filter on, the same recipe emits 0 hidden frames (vacuous gate).

2026-08-30

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.
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 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.
instrument(av1): SGR real per-tap A/B ground truth + LR gate stream pinAhmet Kaan Gümüş · fb35afc
instrument(av1): SGR real per-tap A/B ground truth + LR gate stream pin

Adds rung 6 to instrument-aom-oracle.sh: drops `static` from libaom's
calculate_intermediate_result (restoration.c) so an external harness can
call it directly. Extends lr-sgr-pin-harness.c to call it with the same
uint8->int32 border-extend copy av1_selfguided_restoration_c does, and
print the real per-tap A/B for all 9 dense-arm neighbours of the r6
failing pixel (row=61,col=6, V plane, seed 46, ep=6/xqd=[-16,-32]).

Result: real libaom's "u" tap (physical row 60) is (253,454), not the
(254,303) r6 recorded -- but this round's live EC_LR_SAMPLE_DUMP trace
(temporary, reverted) shows our own lr_sample already returns the
correct raw bytes (111/154/194 at that column across the 3 box rows,
matching the harness's own /tmp/lr_full.bin buffer bit for bit), and an
independent Python replica of compute_ab's box-sum/z/A/B formula fed
those exact 9 bytes reproduces libaom's (253,454) exactly. So neither
the samples nor the formula, evaluated in isolation, are wrong -- r6's
(254,303) could not be reproduced this round and needs re-derivation
from a uniquely-identified call, not a coordinate-matched one (multiple
frames/seeds share v_start=60).

Also wires EC_AV1_GATE_DUMP into
a_real_aomenc_stream_with_restoration_reads_lr_symbols_correctly
(mirroring the masked-compound gate's existing pattern) so a mismatching
seed writes its stream for direct, unambiguous re-decode -- ran once
this round, pinned seed 46's stream to fixtures/lr-sgr-r7.obu (gitignored,
not in this commit).
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.
feat(av1): pre-deblock full-buffer oracle rung -- EC_AV1_PREFILT_WIDE_DUMPAhmet Kaan Gümüş · e0104c4
feat(av1): pre-deblock full-buffer oracle rung -- EC_AV1_PREFILT_WIDE_DUMP

Rung 7: same anchor as the existing EC_AV1_PREFILT_DUMP (before loop
filter/CDEF/superres), but dumps y_width/y_height (full aligned buffer)
instead of y_crop_width/y_crop_height, so the margin region [FrameWidth,
true mi-aligned width) is visible pre-deblock too -- separates a
reconstruction bug in the margin from a deblock bug in the margin.
Additive/new env var; the existing EC_AV1_PREFILT_DUMP rung other lanes
already use is untouched. Rebuilt and verified clean.
feat(av1): postdeblock oracle rung -- EC_AV1_POSTDEBLOCK_DUMPAhmet Kaan Gümüş · 894d3a5
feat(av1): postdeblock oracle rung -- EC_AV1_POSTDEBLOCK_DUMP

Add rung 6 to instrument-aom-oracle.sh: dumps cm->cur_frame->buf right
after av1_loop_filter_frame_mt returns and before CDEF/superres run,
same shape as EC_AV1_PREFILT_DUMP (full coded-width rows, Y/U/V, one
file per frame). Rebuilt and verified with ninja -C
~/.cache/aom-oracle/build aomdec -- clean.

This is the ground truth r4 identified as missing: post-deblock,
pre-superres row content over frame_width..true_width, to compare
against decode.rs's stashed superres margin at the failing row
(frame 2, rows 17/18, output col 62 -- 2/4096 luma pixels off by 1).
feat(av1): trace the oracle's intra key-frame mode info tooAhmet Kaan Gümüş · c8e7f7e
feat(av1): trace the oracle's intra key-frame mode info too

The rect-strip desync could not be bisected because libaom's key-frame path had
no traced symbol at all between the partition read and the first coefficient
block -- EC_TRACE_MODE covered only decodemv.c's inter path. That gap is
exactly where the defect hides.

EC_TRACE_MODE now also wraps read_intra_frame_mode_info and prints the msac
range either side, with the decoded mode, uv_mode, skip and tx size. Same
wrapper-around-impl shape, same idempotence guard, still silent when unset --
verified emitting on a real stream and silent without the flag.
feat(av1): coefficient and mode-info range-ladder rungs for the oracleAhmet Kaan Gümüş · 3e41e62
feat(av1): coefficient and mode-info range-ladder rungs for the oracle

Two lanes stalled on the same missing instrument: the oracle's aomdec traced
only read_partition, so a desync inside a coefficient block or inside the
mv-stack/DRL/mv reads had no ladder to walk. Partition granularity is far too
coarse for either.

EC_TRACE_COEFF=1 wraps av1_read_coeffs_txb and prints the msac range before and
after every coefficient block, keyed by plane/row/col/tx_size. EC_TRACE_MODE=1
wraps read_inter_block_mode_info and prints the range either side of a block's
mode info, with the resulting mode, both refs and mv0.

Same wrapper-around-impl shape as the existing partition rung, same idempotence
guard, and both are env-gated: an uninstrumented run emits nothing, verified.

Building the instrument is the first subtask, not the excuse.
feat(av1): commit the oracle localization instrumentation (was lost with /tmp)Ahmet Kaan Gümüş · 6632737
feat(av1): commit the oracle localization instrumentation (was lost with /tmp)

scripts/instrument-aom-oracle.sh idempotently adds the two ladder rungs to the
oracle's aomdec, both env-gated so an uninstrumented run is unchanged:
  EC_AV1_PREFILT_DUMP -> per-frame Y/U/V recon written after tile decode and
    BEFORE loop filter/CDEF/LR (separates recon from filtering mismatches)
  EC_TRACE=1 -> EC_PART/EC_PART_VAL with ctx, tell and msac RANGE per
    partition symbol (the range ladder; compare ranges, never tell)

These existed only as hand edits in the reaped /tmp tree. Re-derived against
the pinned v3.13.3 source and verified byte-compatible with the pre-loss
instrument: EC_PART emits the identical rng values (frame 0 mi(0,0) bsize=9
rng=51744) and the dump is the same 4096+1024+1024 layout.

EVIDENCE: rect-flake-2.obu, oracle dump vs our EC_AV1_PREFILT_DUMP --
24/24 frames byte-identical.