edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-txselect r1 — inter var-tx (TxMode::Select), spec 5.11.17
Branch lane-txselect, commit 138c558 (on top of the orchestrator's WIP
snapshot 16d83e4, itself off main 3808cf8).
What changed
crates/ec-av1/src/decode.rsread_block_tx_size/read_var_tx_size/txfm_partition_ctx/txfm_partition_update/set_txfm_ctxs— the recursivetxfm_splittree, max square transform down toMAX_VARTX_DEPTH = 2, ported againstav1/decoder/decodeframe.c:1029-1090andav1/common/av1_common_int.h(WIP snapshot; verified line by line against the oracle source this round).TXFM_CTX_INIT = 64(decode.rs, next toMAX_VARTX_DEPTH) — root cause of the first gate failure this round. The WIP initialisedNeighbours::above_txfm/left_txfmto 0 with a comment claiming that is "libaom's own tile-start value". It is not:av1_common_int.h:1624memsets the above txfm row totx_size_wide[TX_SIZES_LARGEST]and:1632the left buffer totx_size_high[TX_SIZES_LARGEST]— 64. An unwritten neighbour reads as the widest transform, so every frame-edge block took the wrongtxfm_partitioncontext.read_inter_luma8+split8indecode_inter_block8— the 8x8 inter leaf now reads its owntxfm_splitsymbol (aBLOCK_8X8does signal one) and, when it splits, decodes four 4x4 units, keeping plane-0 neighbour context per unit across the tailrecord_mi. All three of that function's branches (compound, single-ref, intra-in-inter) now callread_block_tx_size; without this an 8x8 inter block underSelectdesynced at its first coefficient.- two narrow refusals at their own site: a var-tx leaf larger than 32x32 (no
64-point inter coefficient tables here) and an intra block in an inter
frame whose
tx_depthsplits (that path predicts the whole block at once).
crates/ec-av1/src/cdf.rs,cdf_state.rs(WIP):TXFM_PARTITION(21 contexts) in the table set, adaptation and the per-frame counter reset;Luma4Inter/Luma4InterSet1coefficient sets.crates/ec-av1/src/stream.rs- the blanket refusal "an inter frame using TxMode::Select …" is deleted,
and
tx_mode == TxMode::Selectis threaded intodecode_inter_frame_tile_with_cdfs(newtx_selectparam → thread-localset_inter_tx_mode). - new gate
a_real_aomenc_inter_sequence_with_tx_select_decodes_pixel_exact.
- the blanket refusal "an inter frame using TxMode::Select …" is deleted,
and
crates/ec-av1/src/refusal_inventory.rs: −1 blanket refusal, +2 narrow ones.gate_coverage.rsneeds no change: it derives only--enable-*tool flags, and--enable-tx-size-searchis present (as=0) in the sibling gates, so the tool was never on itsNEVER_EXERCISEDlist.
How the existing inter gates restricted tx-mode
--enable-tx-size-search=0 — it appears 39 times in stream.rs
(grep -c '"--enable-tx-size-search=0"'), i.e. every inter gate. That flag is
exactly what pins a stream to TxMode::Largest. The new gate is the same
recipe as a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact
with that flag DELIBERATELY ABSENT (plus --min-partition-size=16, because
detailed content otherwise makes aomenc pick sub-16 inter partitions — a
separate, already-named refusal, hit on 30+ of 40 seeds).
Gate result — RED, honestly
CARGO_TARGET_DIR=$HOME/.cache/cargo-target-txselect EC_AV1_REQUIRE_AOMENC=1 \
cargo test -p ec-av1 --lib a_real_aomenc_inter_sequence_with_tx_select
EVIDENCE: cargo test stderr (seed 43) | aomenc default tx-mode, 4-frame 64x64
mandelbrot inter sequence, decode_stream vs ffmpeg per frame |
txfm_split reads=22 splits taken=8; frame 0 (key) and frame 1 (first inter
frame, var-tx active) pixel-exact on Y/U/V; frame 2 Y first differs at (59,14)
got 143 want 144, 1774/4096 samples; frame 3 differs from (0,0).
So: the var-tx read + per-TU residual path is real and correct for a whole key frame and a whole inter frame, and the gate fires (8 splits actually taken). It does not yet pass. No refusal should be considered "proven lifted" on this evidence — the branch is not merge-ready.
Before the TXFM_CTX_INIT fix the same gate failed at frame 2 (32,0) with
3209/4096 samples differing; after it, the first divergence moved to (59,14)
with 1774 — the fix is a real advance, not a reshuffle.
Residue
- fix-now (next round, blocks the merge): frame 2 divergence. Shape: rows 0..13
of frame 2 match everywhere; the first differing samples are on rows 14/15
(x 34..62) with deltas of 1..3, then the error spreads to 43% of the frame.
That is a late-in-block divergence inside the second/third 16x16..32x32
block of the top block row, not a whole-frame desync from symbol 0.
Next step is the ledger's blessed rung, not more reasoning: instrumented
aomdecrange ladder (EC_TRACE=1) vs ourEC_TRACE_MODE_STEPon frame 2 only, comparing msac RANGE element by element (nevertell()), starting at the first block of frame 2. Prime suspects, in order: (1)txfm_partitionCDF adaptation forwarded into frame 2 (frame 1 is clean, frame 2 is the first frame that inherits an adapted copy — the "CDF counter not reset" class, thoughreset_countsdoes list it); (2)tx_size_contextfor an intra block in an inter frame, which still reads the deblocktx_gridinstead of libaom'sabove_txfm_context/left_txfm_contextwith theis_inter_block→ block-size override (pred_common.h:342-371) — a known, unported divergence introduced the moment inter neighbours carry split transforms; (3) the deblock tx grid written per var-tx leaf. - deferred(the frame-2 fix): 10-bit gate — his films are
yuv420p10leand 10-bit is a separate standing refusal (Pictureplanes areVec<u8>), so a 10-bit tx-select gate would prove nothing this round. - deferred(the frame-2 fix): film probe (
decode_probeon 0.4 s of each film) — pointless until the 8-bit gate is green. - accepted (documented corner-cut, in the code): a var-tx block's chroma
deblock edges read
tx_h_grid / 2, i.e. they follow the luma leaves even though the block's uv transform is not split.
Suite totals
CARGO_TARGET_DIR=$HOME/.cache/cargo-target-txselect cargo test -p ec-av1 --lib
test result: FAILED. 267 passed; 1 failed; 23 ignored; 0 measured; 0 filtered out;
finished in 1146.75s
The single failure is this lane's own new gate
(a_real_aomenc_inter_sequence_with_tx_select_decodes_pixel_exact), red for the
frame-2 reason above. No pre-existing test regressed: the same 267 pass with the
blanket TxMode::Select inter refusal removed.
Measured at 138c558. Two commits landed after it:
ecc71ec— this report only, no code.3c174b6—tx_size_context_txfm, reachable from exactly one call site (read_block_tx_size's intra branch, new code this lane);read_tx_size's newctx_overrideisNoneat both pre-existing key-frame call sites (decode.rs:4934,:5346), so it cannot move any of the 267. Re-verified after it: the gate (still red, byte-identical failure), plusrefusal_inventory+gate_coverage(5 passed, 0 failed). The full 1146 s suite was NOT re-run at3c174b6.