Commits
Commits on
a5441e893b7600aec0ba2cc81a55cad4b8837f2bFiltered to crates/ec-av1/src/stream.rsClear filter2026-08-30
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.
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.
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): 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.
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.
Merge branch 'lane-gm2': the mv-stack's missing global-motion fallbackAhmet Kaan Gümüş · dd73232
Merge branch 'lane-gm2': the mv-stack's missing global-motion fallback Root cause of the last global-motion refusal, and it was not in the warp path at all. The single-ref mv-stack fell back to (0,0) when the neighbour scan came up short, where libaom falls back to the querying block's own gm_get_motion_vector for its ref frame. That is invisible whenever a live ref's global motion is identity or translation -- the fallback value is (0,0) either way -- and wrong the instant a ref carries real ROTZOOM and a block needs the fallback, such as the first block of a frame, which has no neighbours. r5 spent a round proving the refusal named a correlate: the failing pixel belonged to a plain NEWMV block against GOLDEN that never enters the global-warp branch, so "more than one active ROTZOOM slot" described the configuration the defect showed in, not the defect. r6 then walked the coefficient/mode range ladder the new oracle instrument made possible: the range matched exactly either side of the block's mode info (34391 -> 46688 on both sides), so consumption was bit-exact and the decoded mv still differed -- a construction bug, which is what it turned out to be. The multi-slot refusal is gone. On this merge the interintra-wedge gate decodes 40 of 40 attempts pixel-exact with zero refusals; it was refusing 27 of 40 when this batch started. Full lib suite 231 passed / 0 failed. AFFINE global models stay refused -- unproven, not broken.
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.
fix(av1): mv-stack single-ref predictor falls back to global motion, not zeroAhmet Kaan Gümüş · 43e5d8c
fix(av1): mv-stack single-ref predictor falls back to global motion, not zero Root cause of lane-gm r4/r5's "more than one concurrently active ROTZOOM/AFFINE ref slot" refusal, found by range-laddering the r5 pin against a new aomdec EC_TRACE_MODE instrument: libaom's setup_ref_mv_list fills any mv_ref_list slot the neighbour scan left short with gm_get_motion_vector for that block's own ref, not zero. Our find_mv_stack_with_sign_bias used (0, 0) -- invisible whenever the live ref's global motion is itself identity/translation, wrong the moment it's a real ROTZOOM/AFFINE and a block's own stack (e.g. the very first block of a frame, no neighbours) comes up short. Symbol consumption was already bit-exact (rng matched aomdec before/after mode info); only the predictor value was wrong. Fixed at the fallback (nearest_mv/near_mv now default to gm_mv(gm, ref_frame)); the r5/r6 pin decodes all 24 frames byte-exact through the unmodified decode_stream. The multi-slot refusal that was masking this is lifted (AFFINE-on-single-ref refusal stays). Wedge gate: 10/40 matches -> 33/40 (7 remaining refusals are all an unrelated screen-content-tools capability gap). Full ec-av1 --lib suite: 230/231 green (1 filter_intra gate flake, confirmed non-regression by standalone rerun -- ok).
wip(av1): rect coefficient wiring (in progress, orchestrator-committed at the turn cap)Ahmet Kaan Gümüş · a27a535Browse files
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.
fix(av1): gm_get_motion_vector block-centre -1 offset; root-cause seed-43 wedge mismatch to missing global-warp prediction path (not fixed)Ahmet Kaan Gümüş · 75017f1
fix(av1): gm_get_motion_vector block-centre -1 offset; root-cause seed-43 wedge mismatch to missing global-warp prediction path (not fixed) Root-caused lane-gm r2's interintra-wedge gate mismatch (seed 43, frame 1 luma) via a pinned/self-decoded-twice reproduction and a msac range-ladder comparison against a patched aomdec: entropy is in sync at the divergent block (rng=38664 both sides), and this decoder's gm_get_motion_vector computes the spec-correct mv once block_center_x/y's missing "- 1" is fixed (found by diffing against the real oracle's mv.h). The remaining gap is real but unfixed this round: libaom predicts every is_global_mv_block (ROTZOOM/AFFINE GLOBALMV, >=8x8) with the full per-pixel affine global-motion warp (reconinter.c's allow_warp / global_warp_allowed), independent of motion_mode; this decoder only builds a warp prediction for local WARPED_CAUSAL and falls back to translational MC for every other GLOBALMV block. Whole-frame global_motion != IDENTITY refusal in stream.rs stays in place.
Merge branch 'lane-altref2': the ALTREF2 gate fires and hard-assertsAhmet Kaan Gümüş · c08245b
Merge branch 'lane-altref2': the ALTREF2 gate fires and hard-asserts The gate had passed its whole life without once exercising ALTREF2 -- 86 attempts, zero firings -- because 16 frames is a single mini-GOP, room for BWDREF and never a second pyramid level. The flags were already right; the clip was too short. At 64 frames ALTREF2 fires 3-4 times per run, and the silent skip-on-never-fired is replaced by an assert, so the gate now fails rather than lies when the feature stops appearing. The search table in the report records that the gf-pyramid-height knobs add nothing measurable once the clip is long enough, so nobody repeats it. Full lib suite 224 passed / 0 failed.
Merge branch 'lane-screen': consume palette/intrabc syntax on key framesAhmet Kaan Gümüş · 31f684b
Merge branch 'lane-screen': consume palette/intrabc syntax on key frames Screen-content key frames decode now. The decoder does not reconstruct a palette -- it consumes the syntax so the arithmetic decoder stays in sync, and a block that genuinely uses palette or intrabc refuses by name. The whole-frame refusal is narrowed rather than removed: decode_inter_block's intra-sub-block branches have no palette wiring at all, so inter frames with the bit set keep refusing until a follow-up lane threads the same two flags there. Two integration points this merge had to settle: Rect intra strips (lane-intradisp) do not consume palette syntax -- the square reader's palette_bsize_ctx is keyed on a single side -- so a strip in a screen-content frame would skip symbols the encoder wrote and desync. It refuses by name instead. The filter_intra gate was eaten by the old whole-frame refusal and skipped for its whole life; now that it runs, it turned out not to pin --threads=1 the way every sibling gate does, and a multi-threaded aomenc is not deterministic, so each run encoded a different stream and the gate flaked against whichever features that run happened to pick. Pinned, plus EC_FI_SEED/EC_FI_CQ hooks so the recipe can be searched without a rebuild. It fired in 6 consecutive runs and in 14 of 15 points of a (cq, seed) sweep; the one failure was a real "use_filter_intra never fired" assert at cq=60, not a mismatch. Full lib suite 224 passed / 0 failed, twice.
fix(av1): altref2 gate -- 64-frame clip makes ALTREF2 actually fire (was 16, 86/86 zero-firings), hard-assert the hit count; search table + filter-intra status in reportAhmet Kaan Gümüş · bb31348
fix(av1): altref2 gate -- 64-frame clip makes ALTREF2 actually fire (was 16, 86/86 zero-firings), hard-assert the hit count; search table + filter-intra status in report
docs(av1): gm r2 -- record step-8 narrowing attempt + its pixel-mismatch reversalAhmet Kaan Gümüş · 1e8e3e2
docs(av1): gm r2 -- record step-8 narrowing attempt + its pixel-mismatch reversal Removing the whole-frame IDENTITY-only refusal decoded AB/free-partition gates clean (0 global-motion refusals, both green) but exposed a real mismatch on a_real_aomenc_stream_with_interintra_wedge_decodes_pixel_exact seed 43 frame 1 luma (EC_WEDGE_GATE_ATTEMPTS=20 EC_AV1_REQUIRE_AOMENC=1). Reverted the narrowing rather than ship a wrong decode; refusal stays until that seed is captured/self-pinned and root-caused next round.
feat(av1): thread allow_screen_content_tools/allow_intrabc through decode_key_frame_tile[_with_cdfs]; narrow whole-frame refusal to non-key framesAhmet Kaan Gümüş · 818f85d
feat(av1): thread allow_screen_content_tools/allow_intrabc through decode_key_frame_tile[_with_cdfs]; narrow whole-frame refusal to non-key frames decode_block/decode_leaf8/read_intra_mode already consumed palette/intrabc syntax on key frames (prior builder). This wires the two bools the rest of the way: through decode_key_frame_tile_with_cdfs and the public decode_key_frame_tile wrapper, stream.rs's real production call (header.allow_screen_content_tools/allow_intrabc), and the 7 test call sites (false, false -- none of those fixtures use screen content tools). Narrows stream.rs:169's whole-frame refusal to `frame_type != Key && allow_screen_content_tools`: decode_inter_block/ decode_inter_block8's intra-sub-block branches have no palette/intrabc wiring at all, so removing the refusal for inter frames would desync them silently.
fix(av1): pin streams to the durable fixtures dir, not a reaped scratchpadAhmet Kaan Gümüş · ae78393
fix(av1): pin streams to the durable fixtures dir, not a reaped scratchpad Three sites addressed a session scratchpad that tmpfs has since reclaimed. Two pinned-mismatch tests could only fail on the read, so pinned_golden4 -- whose bytes do still exist under fixtures/ -- had been dead rather than passing, and it decodes pixel-exact now that it can find them. golden3's bytes are genuinely gone; it now skips by name and says how to re-capture. Worse, the cdf-forwarding gate's unconditional mismatch pin wrote to that same dead path with .expect(), so a real mismatch would have aborted on the write instead of reporting itself. It now writes to fixtures/ and warns rather than panicking, leaving the pixel assert to be the thing that fails. Same class as the reaped-oracle failure that silently voided 20 gates: an instrument parked in a session-scoped directory stops being an instrument.
feat(av1): gm r2 -- non-IDENTITY global motion decode compilesAhmet Kaan Gümüş · 9018cff
feat(av1): gm r2 -- non-IDENTITY global motion decode compiles Threads frame_header.global_motion through decode_inter_frame_tile_with_cdfs to every decode_inter_block call site (stream.rs + both decode.rs wrappers + leaf8's compile-only NO_GM_MV/((0,0),(0,0)) stub, gm-inert by design). Single-ref path: is_global_mv_block (blockd.h:421-429, mode > TRANSLATION, IDENTITY excluded) and is_nontrans_global_motion (reconinter.h:420-425, model != TRANSLATION, IDENTITY counts) computed as separate locals, not unified. is_global_mv_block gates motion_mode_eligible (implicit SIMPLE_TRANSLATION under free mv, spec motion_mode_allowed) and MiInfo::is_global_mv0; gm_nontrans gates the interp-filter suppress arg (av1_is_interp_needed).
fix(av1): bound the 8x8-OBMC gate's ffmpeg source with -t; correct a false refusal claimAhmet Kaan Gümüş · 90aeec8
fix(av1): bound the 8x8-OBMC gate's ffmpeg source with -t; correct a false refusal claim The gate's EC_AV1_OBMC8_SOURCE override lets a caller supply a lavfi source that carries no `duration=` of its own; `testsrc2` is endless, so the y4m pipe never closed and the gate hung to its 300 s timeout. `-t` is the bound that holds for every source. Third instance of the class (mandelbrot `end_pts` twice before): bound the trim inside ffmpeg on decode, bound the duration with `-t` on generate. With the bound in place the gate runs 80 attempts in 7 s and shows why it has never fired one 8x8 OBMC block: decode.rs refuses every inter partition below 16x16. Its message claimed "this encoder never writes one", which the run disproves -- reworded to name the real gap.
fix(av1): inter frames' intra blocks inherited a stale enable_intra_edge_filterAhmet Kaan Gümüş · d1585d0
fix(av1): inter frames' intra blocks inherited a stale enable_intra_edge_filter ENABLE_EDGE_FILTER is a thread-local set only by decode_key_frame_tile_with_cdfs; decode_inter_frame_tile never set it, so an inter frame's intra blocks read whatever the last key frame decoded on that thread left behind. Within one stream that is inert (its own key frame sets it first), but it makes decode impure across streams sharing a thread -- a real contamination path, and the shape that produces a suite-only flake. decode_stream now sets it from the sequence header for every stream, covering inter frames. Also teaches build-aom-oracle.sh to reconfigure a build tree that was configured under a different path instead of failing to regenerate.
test(av1): make the 8x8-OBMC gate's recipe searchable (it has never fired)Ahmet Kaan Gümüş · 62aad8f
test(av1): make the 8x8-OBMC gate's recipe searchable (it has never fired) The gate uses smooth gradients, so aomenc's RD never splits below 16x16: 45 attempts, 0 8x8-OBMC blocks, and it 'passes' by printing SKIP -- the owed 8x8-OBMC debt is exactly this. EC_AV1_OBMC8_SOURCE overrides the lavfi source and EC_OBMC8_ATTEMPTS bounds the loop, so a firing recipe can be searched for without a rebuild. No recipe found yet; the search is the next step.
fix(av1): oracle lives in ~/.cache, not reaped /tmp -- 20 gates were silently vacuousAhmet Kaan Gümüş · 1fc2eb0
fix(av1): oracle lives in ~/.cache, not reaped /tmp -- 20 gates were silently vacuous A tmpfs reclaim wiped /tmp/libaom-src between sessions. aomenc_path()'s only default pointed there, so every one of the 20 aomenc gates hit the SKIP branch and the suite stayed green while proving nothing. - scripts/build-aom-oracle.sh provisions source + aomenc/aomdec under ~/.cache/aom-oracle (pinned v3.13.3, AOM_TARGET_CPU=generic since this box has no nasm; measured same 15.3s/gate as the old SIMD build). - aomenc_path() searches the durable location first, /tmp last (legacy). - EC_AV1_REQUIRE_AOMENC=1 turns a missing oracle into a hard failure so a batch run cannot report green off 20 skips. EVIDENCE: free-partition gate with EC_AV1_REQUIRE_AOMENC=1 -- 5 pixel-exact matches, rect_partition_hits=7 partab_hits=2, 15.34s.
2026-08-29
Merge branch 'lane-wii': wedge-interintra blend decodes (opus-verified vs libaom; gate fires wii_hits 2-7 per run, hard-asserted)Ahmet Kaan Gümüş · f03f2a3Browse files
fix(av1): wii gate -- bound mandelbrot with -t (end_pts never ends; 1h hang), drop vacuous refusal asserts, hard-assert wii_hits (verifier finding); reportAhmet Kaan Gümüş · 098e9a7
fix(av1): wii gate -- bound mandelbrot with -t (end_pts never ends; 1h hang), drop vacuous refusal asserts, hard-assert wii_hits (verifier finding); report
feat(av1): wedge-interintra blend (adapting wedge_idx symbol, fixed sign 0, box-averaged chroma mask); dedicated gateAhmet Kaan Gümüş · 841cf14
feat(av1): wedge-interintra blend (adapting wedge_idx symbol, fixed sign 0, box-averaged chroma mask); dedicated gate Flash-builder r2 output, orchestrator-committed: builder hit its cap without committing. Lib 221/0 + 14 pins green re-run by orchestrator; the slow wedge gate runs separately.
style(av1): re-indent the free gate's summary eprintln (verifier nit)Ahmet Kaan Gümüş · e71b2deBrowse files
wip(lane-partab): HORZ_A/VERT_A/VERT_B INTER arms decode; PARTAB_HITS atomic; dedicated AB gate (7 exact, hits=6)Ahmet Kaan Gümüş · edca059Browse files
2026-08-28
fix(av1): overlappable_left steps by the neighbour's heightAhmet Kaan Gümüş · f1a6012
fix(av1): overlappable_left steps by the neighbour's height The OBMC left-column walk stepped by MiInfo.size (width); a 32x16 left strip swallowed the strip below it and its band blended the wrong neighbour prediction (rect-flake-3, +-2 in the second strip's band). Class sweep: all other grid walks step by the matching axis. Pin added; lib 221/0.
fix(av1): mvstack scan weight inc mins by the candidate's cross axisAhmet Kaan Gümüş · d6cb150
fix(av1): mvstack scan weight inc mins by the candidate's cross axis libaom's scan_row_mbmi mins inc by mi_size_high (candidate height), scan_col by width; ours used the scan's own axis at all 4 sites (single + compound). Square candidates hide it; a 32x16 strip above tied weights, reordering DRL entry 1 and suppressing the -5 extended row scan. rect-flake-2 byte-exact, pin added to the default list; lib 220/0.
feat(av1): wire the COMPOUND_WEDGE blend (comp_group_idx==1, compound_type==0); gate fires wedge live (mandelbrot diagonal content, dist-wtd-comp=0), 20/20 pixel-exact, 475 wedge hitsAhmet Kaan Gümüş · 2803580
feat(av1): wire the COMPOUND_WEDGE blend (comp_group_idx==1, compound_type==0); gate fires wedge live (mandelbrot diagonal content, dist-wtd-comp=0), 20/20 pixel-exact, 475 wedge hits
Merge branch 'lane-maskcomp2' into lane-partitions (integration)Ahmet Kaan Gümüş · 9dc3c1eBrowse files
feat(av1): rect write-footprint plumbing; HORZ/VERT strips refuse by name pending rectangular mvstack (r2)Ahmet Kaan Gümüş · ebb03bd
feat(av1): rect write-footprint plumbing; HORZ/VERT strips refuse by name pending rectangular mvstack (r2) Square-context strip decode desyncs (pin rect-flake-1.obu, frame 16 strip 2: NEARMV picked a different DRL entry -- a 32x16 block's stack weights use n4_h=4). Full strip decode kept in history (4782e57) for r2; free gate recipe re-clamped, green 3/3; lib 220/0; 11 pins byte-exact. HORZ_B's top strip carries the same latent corner-cut -- r2 scope.
feat(av1): port the DIFFWTD masked-compound blend (comp_group_idx==1), wedge still refusedAhmet Kaan Gümüş · ddb5bef
feat(av1): port the DIFFWTD masked-compound blend (comp_group_idx==1), wedge still refused diffwtd_mask/blend_masked_compound in mc.rs, algebraically re-derived onto this crate's unbiased predict_compound_intermediate domain (libaom's round_offset bias cancels exactly in both the mask diff and the blend weight sum, proven in the doc comments -- no offset bookkeeping needed). Both comp_group_idx==1 decode.rs sites now build+apply the real blend for COMPOUND_DIFFWTD; COMPOUND_WEDGE still refuses by name (wedge codebook out of r2 scope per the charter's mergeable-partial fallback). Fixed a real latent bug while wiring this in: compound_idx was read unconditionally, missing libaom's comp_group_idx==0 outer gate (dead code before this round since the masked path always errored earlier). Gate a_real_aomenc_stream_with_masked_compound_decodes_pixel_exact flipped to hard assert (masked_compound_hits() > 0) with DIFFWTD refusals now forbidden; hammered 8/8 green, zero pixel mismatches. Full ec-av1 lib suite: 220 passed, 0 failed, 17 ignored.
Merge branch 'lane-rectgate' into lane-maskcomp: both gates kept (integration merge)Ahmet Kaan Gümüş · 18b88dcBrowse files
test(av1): masked-compound gate zero-hit run soft-skips instead of failing the default suiteAhmet Kaan Gümüş · 7aa15de
test(av1): masked-compound gate zero-hit run soft-skips instead of failing the default suite aomenc RD nondeterminism can leave a whole attempt window without a comp_group_idx==1 block; that run proves nothing and must not flake the suite. r2 flips this to a hard assert when the blend lands.
wip(av1): consume compound_type/wedge_idx/wedge_sign/mask_type on masked compound (comp_group_idx==1); blend still refusedAhmet Kaan Gümüş · 09ba66a
wip(av1): consume compound_type/wedge_idx/wedge_sign/mask_type on masked compound (comp_group_idx==1); blend still refused lane-maskcomp r1. Syntax entropy-exact per libaom decodemv.c 1634-1656: compound_type (COMPOUND_WEDGE/COMPOUND_DIFFWTD), then wedge_index+wedge_sign or mask_type. New CDF tables (COMPOUND_TYPE, WEDGE_IDX) wired through the 4-site checklist (cdf.rs default, cdf_state.rs field/init/reset_counts). Prediction (wedge/diffwtd mask blend) is NOT ported -- both refusal sites still return Err, now after consuming the symbols and naming the blend as the gap. New gate a_real_aomenc_stream_with_masked_compound_decodes_pixel_exact + MASKED_COMPOUND_HITS proves the syntax fires without desyncing surrounding blocks (pixel-exact matches every non-masked-compound attempt). All 11 existing pins + full ec-av1 --lib suite unaffected.
feat(av1): rect/ab free-partition gate; localize real coverage gapAhmet Kaan Gümüş · a3f46bc
feat(av1): rect/ab free-partition gate; localize real coverage gap New gate lets aomenc pick a free partition instead of every prior gate's pinned min=max=32. Finding: charter's "extended partitions landed" premise was wrong -- decode_frame's inter-tile match only handles NONE/SPLIT/HORZ_B; HORZ/VERT/HORZ_A/VERT_A/VERT_B/HORZ_4/VERT_4 all correctly refuse (no silent miscoding). Empirically swept 3 recipes (120 aomenc attempts); no decode defect found, only a genuine 7-of-10-partition-type coverage gap plus an aomenc-side --enable-1to4-partitions=0 quirk (doesn't suppress VERT_4). Diversity counter added but its assertion shipped soft, not a hard panic, since PARTITION_HORZ_B never fires for this fixture regardless of clamp (confirmed against the already-green warp gate too). ec-av1 lib 219/0. Details in lanes/rectgate-r1.report.md.
feat(av1): decode non-wedge interintra prediction; fix warp-sample interintra exclusion; reset switchable_interp CDF counterAhmet Kaan Gümüş · a5a10f4
feat(av1): decode non-wedge interintra prediction; fix warp-sample interintra exclusion; reset switchable_interp CDF counter - interintra syntax (flag -> 4-ary mode -> wedge flag, wedge==1 stays a named refusal) + non-wedge smooth blend (II_DC/V/H/SMOOTH, ii_weights1d, all planes) on the 16/32 single-ref path and the 8x8 leaf - interintra blocks record ref_frame1 = INTRA_FRAME(0) in the mi grid so find_samples/num_proj_ref exclude them (libaom av1_findSamples requires ref_frame[1] == NONE_FRAME); mvstack ref-diff scan guards rf1 > 0 - ii-flake-9: switchable_interp was the one Cdfs field missing from reset_counts -- unreset counter saturated past 15 reads and slowed the adaptation rate to >>5 while libaom (per-frame counter reset, av1_reset_cdf_symbol_counters) stays >>4; rows drifted a few counts and the gate flaked on read-dense streams. Field-list audit: no other gap. - new gate a_real_aomenc_stream_with_interintra_decodes_pixel_exact (interintra refusals forbidden, hits counter asserted); pinned-stream test extended to 11 fixtures (ii-flake-1..9) Evidence: 11/11 pins byte-exact; interintra gate 12/12 hammer clean (hits 11-22 per run); warp gate 3/3; ec-av1 lib 218 passed / 0 failed.
test(av1): warp pin test covers all three pinned regression streamsAhmet Kaan Gümüş · e19a868Browse files
feat(av1): flip the warp gate to must-decode; r5e reportAhmet Kaan Gümüş · 8d5c79f
feat(av1): flip the warp gate to must-decode; r5e report refuses-or-matches -> warp refusals forbidden, matched>0 and warp_selected_hits>0 required (non-warp capability refusals still skip). KNOWN: cross-run encoder non-determinism observed (warp_selected_hits 156/103 across identical-seed sweeps) and one run caught a seed-66 frame-13 mismatch -- flake hunt with EC_AV1_GATE_DUMP in flight; a caught stream becomes the next pin.
chore(av1): warp pin fixture moved to fixtures/warp-mismatch.obu (was a session scratchpad path on tmpfs)Ahmet Kaan Gümüş · bcf41d0Browse files
wip(av1): warp fixture found + decisive pinned mismatch -- COMPILING WIPAhmet Kaan Gümüş · fefaafb
wip(av1): warp fixture found + decisive pinned mismatch -- COMPILING WIP
lane-warp round 3, budget-capped stop.
Resolved r2's puzzle first: leaf8 (decode_inter_block8) STILL refuses
motion_mode==2 unconditionally (decode.rs ~6558) -- confirmed by direct
read, not inferred. The gate's fixture partition is forced to 32x32
(--min/max-partition-size=32), so leaf8 (an 8x8 leaf) is structurally
unreachable on that content; the puzzle's (a) was a red herring. The real
reason the warp gate reported "40 named refusals, 0 matches" is a
never-fired-instrument shape from a DIFFERENT angle: every one of the 40
attempts happens to *also* hit some other real, unrelated named refusal
(allow_screen_content_tools, partition-below-16x16, partition-type-never-
written, interintra, directional-chroma) before or regardless of whether
warp fires -- confirmed by instrumenting the gate to print every refusal
string and WARP_SELECTED_HITS (leaf16's counter): even the charter's own
--auto-alt-ref=1 --lag-in-frames=16 --enable-fwd-kf=0
--enable-ref-frame-mvs=0 recipe (already present in the gate, unlike r2's
guess) still gets swamped by aomenc's `gradients` synthetic content
tripping screen-content-tools detection at cpu-used=0. Widening the sweep
(new EC_WARP_GATE_ATTEMPTS env override, default 40) to 200 seeds found
warp firing 14-75 times per run (leaf16 exercised for real) but never
once producing a clean pixel-exact pass across two separate 200-seed
runs -- same seed set gave DIFFERENT refusal shapes on each rerun
(matches the documented aomenc-RD-nondeterminism class:
parallel-flake-is-attempt-selection), so the fixture itself isn't
reproducible by seed alone.
DECISIVE FIND: seed 49 (this run) decoded WITHOUT hitting any other named
refusal, warp fired exactly once (WARP_SELECTED_HITS 0->1), and frame 1
luma mismatched ffmpeg -- a real, isolated warp_affine/find_projection
bug, not a confound. Stream pinned to
$SP/warp-mismatch.obu (621 bytes, 64x64, 24 frames) and a new
`pinned_warp_stream_decodes_pixel_exact` #[ignore]d test added
(stream.rs) that re-decodes it deterministically (no aomenc/ffmpeg
re-encode) and dumps an ASCII diff mask on mismatch.
Diff shape: small-magnitude ('o', delta<4) errors spread across roughly
the frame's upper-left half in a diagonal band, not a sharply-bounded
single-block region of gross error -- consistent with a subtle
coefficient/rounding bug in the warp path rather than a wrong-block/
desync bug. Spent the rest of the round auditing warp.rs's math line by
line against av1/common/warped_motion.c and mvref_common.c: confirmed
FAITHFUL (no bug found yet) in find_affine_int's LS_MV_MAX inner-loop
gate, LS_SQUARE/LS_PRODUCT1/LS_PRODUCT2 shift constants (LS_MAT_DOWN_BITS
=2, >>4 matches), get_mult_shift_diag/ndiag (confirmed we use the
USE_LIMITED_PREC_MULT=0 -- i.e. simple Px*iDet + ROUND_POWER_OF_TWO_
SIGNED_64 -- branch, matching libaom's actual compiled path, not the
unused resolve_multiplier_64 branch), get_shear_params/av1_get_shear_
params (alpha/beta/gamma/delta derivation, WARP_PARAM_REDUCE_BITS
rounding, is_affine_shear_allowed bound), av1_warp_affine_c's whole
horizontal+vertical two-pass loop (offset_bits, reduce_bits, sx4/sy4
alpha/beta/gamma/delta stepping, tap-offset formula, final clip_pixel
formula) all transcribed correctly, and the DIV_LUT table's first ~20
entries spot-checked byte-identical.
NOT YET CHECKED / next round's first move: record_sample's row_offset/
col_offset sign conventions and find_samples' above/left/TL/TR traversal
order against av1_find_warp_samples in mvref_common.c (only structurally
skimmed, not line-audited) -- since every arithmetic primitive downstream
now checks out clean, a wrong *input sample* (wrong neighbour MV/position
recorded) is the next most likely place for a small-but-real numeric
error to originate. Also worth trying: print our own wmmat/alpha/beta/
gamma/delta for this pinned block and compare against libaom's
find_affine_int by adding a debug printf at the av1_find_projection call
site in decodemv.c (~1624) and rebuilding aomdec -- would immediately
localize the bug to sample-gathering vs. estimation vs. filtering without
more manual line-diffing.
Gate/test changes this round (stream.rs): EC_WARP_GATE_ATTEMPTS env
override on the refuse-or-match gate's seed count; dump-on-mismatch via
EC_AV1_GATE_DUMP added to that gate (previously missing); new pinned
`pinned_warp_stream_decodes_pixel_exact` test with ASCII diff-mask
eprintln on failure. cargo check -p ec-av1 --lib and --tests both clean,
0 errors/warnings-of-note (only pre-existing missing-doc lint noise).
Gate itself NOT flipped to require pixel-exact yet -- still legally
refuses-or-matches, correctly reflecting that warp is not yet proven
correct.
tmpfs at session start: 65% (11G/16G), not a blocker this round.fix(av1): un-swap enable_interintra_compound/enable_jnt_comp at the decode_stream call siteAhmet Kaan Gümüş · 6e4ad30
fix(av1): un-swap enable_interintra_compound/enable_jnt_comp at the decode_stream call site lane-comppin r10 (session-killed right after the fix compiled; orchestrator ran the pin and commits). ROOT CAUSE of the 10-round compound-drift hunt: decode_stream passed enable_interintra_compound and enable_jnt_comp to decode_inter_frame_tile_with_cdfs in each other's parameter slots -- two adjacent same-typed bools, so the compiler was silent. Every stream whose sequence header set the two bits DIFFERENTLY gated the interintra read on the jnt_comp bit (and compound_idx gating on the interintra bit): an extra or missing symbol read, then silent bit-drift for the rest of the tile. Streams with both bits equal decoded exactly -- which is why the gates only flaked on some aomenc content and every earlier localization pointed at a different downstream symbol. VERIFIED: pin sb128-compound-refs-flake.obu now decodes 24/24 frames byte-exact (was: frame 1+ all-plane drift accumulating to delta 60). Also in this commit: EC_AV1_SEQDUMP + remaining EC_AV1_TELL range checkpoints (env-gated instrumentation, inert when unset). class: adjacent-same-typed-args -- a call site passing N same-typed flags positionally can swap a pair without any compiler or roundtrip-test signal (our own encoder does not exercise the decode_stream path's flag plumbing); range-ladder bisection + the r9 compare-range-not-tell rule found it.
wip(av1): self-pin-on-mismatch for compound-refs and reference-select gates (owed 3 rounds)Ahmet Kaan Gümüş · 69a575c
wip(av1): self-pin-on-mismatch for compound-refs and reference-select gates (owed 3 rounds) Both gates now write the mismatching stream to a fixed std::env::temp_dir() path (ec-av1-compound-refs-gate-fail.obu / ec-av1-reference-select-gate-fail.obu) unconditionally inside the mismatch branch, panic message includes the pin path -- same pattern as the deblocking gate. EC_AV1_GATE_DUMP env var kept as an additional opt-in dump target, unchanged. No behaviour change besides the pin write + panic message text.
wip(av1): r2's skip_mode-desync theory FALSIFIED; real defect is decode-order frame 1's own reconstruction, invisible to the existing pin (hidden frame)Ahmet Kaan Gümüş · 8d878fe
wip(av1): r2's skip_mode-desync theory FALSIFIED; real defect is decode-order
frame 1's own reconstruction, invisible to the existing pin (hidden frame)
COMPILES. Does not fix the pin. Round 3 of lane-comppin, capped at budget.
STEP 1/2 OF THE CHARTER, DONE -- DECISIVE, OVERTURNS r2:
Added EC_AV1_SKIPMODE_DUMP (decode.rs ~4623, ctx+tell before/after the
skip_mode symbol read) and a matching hook in libaom's own read_skip_mode
(/tmp/libaom-src/av1/decoder/decodemv.c ~453, EC_SKIPMODE env var, rebuilt
into /tmp/libaom-src/build/decoder-debug/aomdec). Direct comparison for the
frame r2 called "frame 1" (order_hint=1, the pin's 2nd *shown* frame):
ctx sequence: ours 0,1,1,2 aomdec 0,1,1,2 -- MATCH
result sequence: ours T,T,T,T aomdec T,T,T,T -- MATCH
r2's claim ("real bitstream's block (0,0) is SINGLE-ref LAST, skip_mode
false") does not hold under this direct comparison -- it was very likely an
artifact of comparing OUR decode-order frame index against aomdec's own
*decode*-order frame_number without accounting for AV1's hierarchical-B
reorder (decode order for this pin's skip_mode-bearing frames is
order_hint 7, then 3, then 1 -- NOT ascending display order; r2's manual
aomdec read likely landed on a different frame_number than intended). The
raw `tell` numeric gap noted in-flight this round (19 vs 5 bits before the
first read) is ALSO not evidence: aom_reader_tell()/od_ec_dec_tell() is a
fractional-bit *estimate*, not a raw bit-offset like our debug_bitpos() --
apples to oranges, not comparable numerically.
Also confirmed from libaom source (decodemv.c ~1541-1578): comp_group_idx
and compound_idx are NEVER read for a skip_mode block -- both stay at their
init values (0, 1 = COMPOUND_AVERAGE) unconditionally. So compound_idx is
not a desync candidate for this pin's all-skip_mode frame either, closing
off the other half of r2's upgrade path 2/3 as inapplicable here (right
answer, wrong question -- there is no compound_idx *read* to desync).
NEW FINDING THIS ROUND (the actual lead for r4): the existing pixel-diff
harness (`scratch_isolate_pinned_mismatch`) only ever compares *shown*
frames (display order) against ffmpeg's own (also display-order) output --
so it never directly checks the hidden altref/bwdref frames a shown frame's
compound prediction is built from. Added EC_AV1_DECODE_ORDER_DUMP
(stream.rs, dumps every decoded frame's post-loop-filter Y+U+V in DECODE
order, `pictures_decoded` counter) and cross-checked against aomdec's own
EC_AV1_POSTFILT_DUMP for the same pin:
decode-order frame 0 (keyframe): byte-exact (as already known)
decode-order frame 1 (first hidden alt, predicts ONLY from the exact
keyframe -- no other reference exists yet, so DPB/ref_slots corruption
is RULED OUT as a cause here): 4439 / 6144 bytes differ (72%),
mostly +-1/+-2 (row0 col0: 126 vs 127 ...), one outlier delta 31 at
Y offset 4033 (row 63, col 1)
cross-checked against aomdec's OWN pre- vs post-loop-filter dump for that
same frame: only 333/6144 bytes change from its own loop filter, so the
bulk of our 4439-byte gap already exists in *reconstruction*, upstream
of loop filtering, not a filter-strength mismatch.
This is a much cleaner, earlier, and larger divergence than the "display
frame 1" comparison r1/r2 chased (worst delta 4, growing to 60 by frame 23)
-- that number was symptom, not source: it is contamination flowing forward
from THIS frame (decode-order 1) through refresh_frame_flags into every
later reference, exactly like lane-av1blend's already-documented DPB
propagation class, except here the corruption's true origin is now pinned
to one fully-isolated single-reference-input frame instead of a whole GOP.
R4 UPGRADE PATH, IN ORDER:
1. Add a Rust-side PRE-loop-filter dump (hook before apply_deblock is
called in decode_inter_frame_tile_with_cdfs, same shape as
EC_AV1_DECODE_ORDER_DUMP) and diff against aomdec's EC_AV1_PREFILT_DUMP
for decode-order frame 1 specifically -- confirms whether the ~4100+
byte gap is present pre-filter (reconstruction/MC bug) as the pre-vs-post
accounting above already implies, or partly filter-side.
2. If pre-filter also mismatches widely: decode-order frame 1's own blocks
are skip_mode=true/compound (per the r2/r3 traces), predicting from a
single known-exact source (the keyframe) with an MV this round did NOT
yet verify against aomdec's own decoded MV for THIS frame (r2's MV claim
was for the wrong frame per the falsification above) -- get
EC_TRACE mode/mv/ref dumps from decodemv.c for decode-order frame 1
specifically (not "frame 1" by order_hint) and diff mv/ref pair
block-by-block against our own EC_AV1_TRACE.
3. Given the pattern (widespread +-1/+-2, one 31-outlier) looks like either
a systematic rounding bug in the compound blend/MC round-off (the
ALTREF_FRAME single-ref altref-context special case in record_inter,
decode.rs ~1023-1032, is one plausible site: this frame's ref pair likely
*is* LAST+ALTREF) or a wrong film-grain/identity-matrix path leaking in
before the DPB store -- check `film_grain.apply_grain` isn't
accidentally hitting this "hidden" frame's stored (pre-grain) picture,
though stream.rs's grain gating already looks correct on inspection.
STEP 5 (self-pin-on-mismatch for the two gates) -- NOT reached this round,
still owed to r4.
Instrumentation left in place, all env-var-gated (no behaviour change when
unset): EC_AV1_SKIPMODE_DUMP (decode.rs), EC_AV1_DECODE_ORDER_DUMP
(stream.rs), EC_SKIPMODE (libaom decodemv.c, rebuild with `make -j12 aomdec`
in /tmp/libaom-src/build/decoder-debug if stale).
class: dpb-propagation-from-an-unverified-hidden-frame -- same shape as
lane-av1blend's already-filed ref_slots/refresh_frame_flags class, but here
the true origin is now isolated to ONE frame with only one possible input.