From d827f72b5803d0554eb4a3b237975592522a1890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 16:17:08 +0300 Subject: [PATCH] av1: gate the var-tx tree on per-segment lossless as a CONJUNCT, not an else-if A 4:2:0 8-bit cell built from a plain aomenc line diverged from the oracle on every inter frame: ffmpeg -f lavfi -i testsrc2=size=256x128:rate=25 -frames:v 5 -pix_fmt yuv420p src5b.y4m aomenc --codec=av1 --obu -o c_mix5.obu --passes=1 --cpu-used=4 \ --limit=5 --end-usage=q --cq-level=0 --aq-mode=1 src5b.y4m 18525 bytes, sha256 3e06b5641e6a0f5a3f4ac8f114d4ee48c88638429e9eaafe6b4483e24f1dbc3a. f0 (key) exact; f1..f5 differ by 33724/34251/44500/36688/37462 bytes of 49152. The first fork is entropy read 30889 of f1: the oracle goes from `ref_mv` (decodemv.c:191) straight to the luma `txb_skip` (decodetxb.c:158) and reads no tx_size symbol at all, while we read one. libaom's reason it reads nothing: parse_decode_block (decodeframe.c:1237) puts !xd->lossless[mbmi->segment_id] in the tree condition itself, and read_tx_size (:1203) answers TX_4X4 on the same flag. Ours tested tx_select && !skip and left lossless(fctx) -- already per-segment, lossless_per_seg[cur_segment_id] -- in the `else if`, one branch too late. Two sites, both fixed by adding the conjunct: decode.rs:27213 intrabc 4x8/8x4 rect leaf decode.rs:48332 sub-8 4x8/8x4 inter leaf After, measured on this base (6bb66a4a): - the pin: 6/6 decode-order byte-exact and the paired EC_SYMR ladder bit-identical over the WHOLE stream, 96997/96997 reads, zero divergence; - the 4:4:4 arm (--profile=1, 8 frames): red on f1..f8 before, 9/9 exact after; - 352x288 of the same recipe: REFUSED before, 7/7 exact after; - 176x144: REFUSED before, decodes 7/7 after (its residual is a separate mi=(32,32) extra-geometry fork, first divergence read 25792 with AND without this change -- measured here, not cited); - 640x480: see below, the one control NOT met; - corpus, all 107 committed fixtures: exactly one status change, 420_mixll_altref_256x128_5f RED -> EXACT. 64/34/9/0 (exact/red/ framecount/refused) at base, 65/33/9/0 after. No fixture regresses. The charter's live question -- make our per-segment lossless answer agree with libaom's xd->lossless[segment_id] -- is answered NO CHANGE IS NEEDED: the derivation is line-for-line libaom's (quant_common.c av1_get_qindex plus the five deltas, evaluated after segmentation resolves), and on the 640x480 cell the parse is bit-identical for 179378 reads, at every one of which a wrong flag would have changed the NUMBER of reads. So no tree gate ever saw a wrong flag. The 640x480 control is not met, and its premise is false: at base the cell decodes 70-92% wrong on EVERY frame (f1..f5 differ by 313795..422078 of 460800 bytes), so it was never a correct decode. The fix moves that cell's first divergence from read 138586 to 179378 and then exposes a SECOND, independent defect: at mi=(80,110), a 4:2:0 8x4 intra leaf with use_filter_intra inside an inter frame, we read tx_size_cat0[2] where libaom reads tx_size_cat0[1] (its own EC_TXCTXB rung: abv=4 lft=8 above=0 left=1 ctx=1; ours: above_txfm=16 left_txfm=8 above=1 left=1). Forcing ctx=1 at that single site makes 640x480 bit-identical to the oracle over all 457907 reads -- so the residual is a missing TXFM_CONTEXT band write above mi column 110, class context-band-not-published, and not a lossless-derivation problem. Loud refusal instead of silent near-garbage is the direction the honesty invariant asks for; the missing band write is handed on. Class sweep: all 74 lossless consults, all 10 `else if lossless` sites and all 9 read_var_tx_size gates re-derived against libaom's own condition. Exactly the 2 fixed sites were in the class (a per-segment flag consulted as a branch alternative instead of a conjunct of the condition it gates); no third site. Gate: a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order, pinning the new fixture by fnv1a64, asserting 6 decode-order dumps with 1 hidden, the SUB8_LOSSLESS_NO_VARTX route counter (incremented on the DECISION, so it is non-zero only when the conjunct actually suppressed a tree; 40 on this pin), and the shown-frame per-plane compare. With the fix surgically reverted the gate fails at frame 1 byte 33 with 33724 differing bytes -- the hand-measured red. Composition: cherry-picking 714fb55b (lane-av1offtile, the chroma-plane-bounded lossless rect walk) on top of this commit was measured and then reverted -- the branch carries no trace of it. With both clips the pin, 176x144, 352x288 and the 4:4:4 arm are ALL byte-exact, and the 640x480 residual is byte-for-byte unchanged (64181 / 98673 / 63442), which is what makes the third defect of the report independent of the chroma walk. lane-av1offtile reports 640x480 "still decodes with both applied"; that does not reproduce on this commit + 714fb55b and was corrected to them over IRC. Scoped run: cargo test -p ec-av1 --lib -- 420 444 422 lossless stream --skip bitrate_target_lands_within_5_percent_over_48_frames -> 375 passed; 0 failed; 7 ignored; 0 measured; 422 filtered out (1770.01s). That scope holds no 640x480-class cell, which is why the cell sweep is the load-bearing evidence for the refusal above. Not claimed: the 10/12-bit arm of the class sweep (this ffmpeg cannot emit a >8-bit y4m), and the residual reds on the 6-frame 256x128 and 320x240 arms. See lanes/av1mixllconj.report.md. --- .../fixtures/420_mixll_altref_256x128_5f.obu | Bin 0 -> 18525 bytes crates/ec-av1/src/decode.rs | 33 +- crates/ec-av1/src/stream.rs | 87 ++++ lanes/av1mixllconj.report.md | 441 ++++++++++++++++++ 4 files changed, 559 insertions(+), 2 deletions(-) create mode 100644 crates/ec-av1/fixtures/420_mixll_altref_256x128_5f.obu create mode 100644 lanes/av1mixllconj.report.md diff --git a/crates/ec-av1/fixtures/420_mixll_altref_256x128_5f.obu b/crates/ec-av1/fixtures/420_mixll_altref_256x128_5f.obu new file mode 100644 index 0000000000000000000000000000000000000000..57b521e5110a7ea4bfd92f771dcdb62ebeee0893 GIT binary patch literal 18525 zcmV(?K-a$#0165K000BG|MP3+0Wy;%6aXLqU;q#R2mk~C0ssL3fPg?iAOHYB002PN zx7?nyDb>MG#mZqIm$qun{$ol)AD@KfWU1OJXg$x%*Q!g+$fX0Gr9Q3f^1nT3~> z>oFv!h?I!3M8@kG${+#v+!50IBhN3nPd8`lb=Y&#V=F__#H>Y>_*TfM$X;nq1*}-)u`h6 z8$1MHxFexvv(yvLgEaPl15NAY&$4)mgaFivYfsWz6~JXtaB2g#VJ867m2ltC^kw_7 zG<}g&e6$!}NIXg?#dPbf_$tw;!U?j?Eq+EqH!&TKZ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*yEvOqbv&1`SsgKC2&`_v5U!Foq zlossless[mbmi->segment_id]` as a + // CONJUNCT of the tx_mode-select condition, not as the `else` arm -- + // `read_tx_size` (`decodeframe.c:1208`) answers TX_4X4 on the same + // flag. A frame whose segments disagree (per-segment mixed + // lossless: `--cq-level=0` with AQ) therefore reads NO tree symbol + // on its lossless blocks. Ordering the test the other way round + // reads a `tx_size_cat1` symbol the oracle never reads and forks + // the very next block's `txb_skip`. + if tx_select && !skip && !lossless(fctx) { // `max_block_wide`/`max_block_high`: the frame's own mi grid, // so a leaf hanging over the right/bottom edge reads no split // symbol for the units outside it (as in `decode_block`). @@ -34662,6 +34671,14 @@ thread_local! { /// is 256 per inter frame (8 unclipped luma rows x 32 columns), and 0 on a /// frame that fits. pub(crate) static LOSSLESS_EDGE_CLIP_UNITS: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// lane-av1mixllfork: sub-8 (4x8 / 8x4) inter leaves whose var-tx tree + /// was SUPPRESSED because their own segment is lossless -- libaom's + /// `parse_decode_block` carries `!xd->lossless[mbmi->segment_id]` as a + /// conjunct of the tree condition (`decodeframe.c:1237`), so a mixed- + /// lossless frame codes no `tx_size_cat1` symbol there. Zero on any frame + /// whose sub-8 leaves all sit in lossy segments, so a gate cannot look + /// armed by merely decoding. + pub(crate) static SUB8_LOSSLESS_NO_VARTX: std::cell::Cell = const { std::cell::Cell::new(0) }; } /// [`MU_CHUNK_WALKS`], for a gate's own before/after delta. @@ -34694,6 +34711,12 @@ pub(crate) fn lossless_edge_clipped() -> usize { pub(crate) fn lossless_edge_clip_units() -> usize { LOSSLESS_EDGE_CLIP_UNITS.with(std::cell::Cell::get) } +/// [`SUB8_LOSSLESS_NO_VARTX`] -- sub-8 inter leaves on a lossless segment that +/// read no var-tx symbol, for a gate's own before/after delta. +#[allow(dead_code)] // read only from the `#[cfg(test)]` gates +pub(crate) fn sub8_lossless_no_vartx() -> usize { + SUB8_LOSSLESS_NO_VARTX.with(std::cell::Cell::get) +} /// [`CHROMA_SPLIT_TX_HITS`], for a gate's own before/after delta. #[allow(dead_code)] // read only from the `#[cfg(test)]` gates @@ -48300,7 +48323,12 @@ fn decode_inter_sub8_rect2( // skipped one codes nothing and records its BLOCK size in both txfm // contexts (`set_txfm_ctxs`' `skip_inter` arm). let mut leaves: Vec<(usize, usize, usize, usize)> = Vec::new(); - if fctx.tx_select_inter.with(std::cell::Cell::get) && !skip { + // lane-av1mixllfork: the same libaom ordering fix as the intrabc rect + // leaf's (`parse_decode_block`, decodeframe.c:1237): the per-segment + // `lossless` flag is a CONJUNCT of the var-tx condition, not its + // `else` arm, so a lossless SEGMENT of a mixed-lossless inter frame + // reads no `tx_size_cat1` symbol here and codes TX_4X4 per plane. + if fctx.tx_select_inter.with(std::cell::Cell::get) && !skip && !lossless(fctx) { let max_w_mi = w_mi.min((mi_cols as usize).saturating_sub(cmi)); let max_h_mi = h_mi.min((mi_rows as usize).saturating_sub(rmi)); read_var_tx_size( @@ -48317,6 +48345,7 @@ fn decode_inter_sub8_rect2( &mut leaves, ); } else if lossless(fctx) && !skip { + hit!(SUB8_LOSSLESS_NO_VARTX); // lane-lossless2: `read_block_tx_size` returns TX_4X4 before it // ever looks at `max_txsize_rect_lookup`, so an 8x4/4x8 leaf is // TWO 4x4 units, not one rect one. diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 87730f62..d50d7865 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -9293,6 +9293,93 @@ pub(crate) mod tests { {shown} shown frame(s) exact per plane, mid-cell chroma publications {mid:?}" ); } + + /// lane-av1mixllfork: per-segment MIXED LOSSLESS + an alt-ref structure. + /// The first fork was entropy read **30889** of f1 (paired `EC_SYMR`: + /// identical `pre[0..1]`, `n`, `s` on both sides, `post_rng` 42076 vs + /// 54010), and the pre-fix `cdf0` at that read was 22401 vs the oracle's + /// 15299 -- **not** the usual `32768 - x` ICDF mirror, i.e. two different + /// reads, not one wrong CDF row. + /// + /// What each side read there: libaom `decodetxb.c:158`, the luma `txb_skip` + /// of a TX_4X4 unit at `mi=(6,1)` `bc=0 br=0`; ours an untagged `n=2` + /// symbol that a `set_symr_cdf` sweep over all six MV-stack copies + /// (`ii16/newmv16/…/refmvB`, `inter8` phase inherited) ruled out as every + /// inter mode-info read, leaving the one read that block makes *between* + /// its `refmv` and its coefficients: the var-tx tree's `tx_size_cat1`. + /// libaom's own reason it reads nothing: `parse_decode_block` + /// (`decodeframe.c:1237`) carries `!xd->lossless[mbmi->segment_id]` as a + /// **conjunct** of the tx-mode-select condition, and `read_tx_size` + /// (`:1208`) answers TX_4X4 on the same flag. This tree tested + /// `tx_select && !skip` and put `lossless(fctx) && !skip` in the `else if` + /// arm instead, so on a lossless SEGMENT of a mixed-lossless frame it read + /// a `tx_size_cat1` symbol libaom never reads, and the very next block's + /// `txb_skip` forked. `SUB8_LOSSLESS_NO_VARTX` counts the leaves that + /// newly take the lossless arm, so this gate cannot pass vacuously on a + /// stream whose sub-8 leaves all sit in lossy segments. + /// + /// The trigger really is the CONJUNCTION: `--cq-level=0` with AQ makes + /// *some* segments lossless and others not (`--cq-level=20`, `--cq-level=32`, + /// `--lossless=1` and `--aq-mode=0` are all byte-exact on this recipe), and + /// `--auto-alt-ref=0` makes it exact at 5, 6, 8 and 12 frames. After the + /// fix the whole-stream `EC_SYMR` ladder is bit-identical: **96997 reads, + /// 96997 paired, zero divergence** -- not just up to the fork. + /// + /// Recipe (ffmpeg 8.1.3 `testsrc2`, shared oracle `aomenc`, 18525 bytes): + /// ```text + /// ffmpeg -f lavfi -i testsrc2=size=256x128:rate=25 -frames:v 5 \ + /// -pix_fmt yuv420p src5b.y4m + /// aomenc --codec=av1 --obu -o c_mix5.obu --passes=1 --cpu-used=4 \ + /// --limit=5 --end-usage=q --cq-level=0 --aq-mode=1 src5b.y4m + /// ``` + /// sha256 `3e06b5641e6a0f5a3f4ac8f114d4ee48c88638429e9eaafe6b4483e24f1dbc3a`. + /// The tree pins fixture identity by fnv1a64; a `const SHA256` compared + /// against itself would be the tautology lane-av1422anom exists to kill. + #[test] + fn a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order() { + const NAME: &str = + "a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order"; + let _gate_lock = lock_gate_counters(); + const FILE: &str = "420_mixll_altref_256x128_5f.obu"; + const BYTES: usize = 18525; + const FNV1A64: u64 = 16348502764482216576; + let path = crate_pin(FILE); + let data = std::fs::read(&path) + .unwrap_or_else(|e| panic!("{NAME}: the committed pin {FILE} is missing ({e})")); + assert_eq!(data.len(), BYTES, "{NAME}: {FILE} size drifted"); + assert_eq!(fnv1a64(&data), FNV1A64, "{NAME}: {FILE} bytes drifted"); + let before = crate::decode::sub8_lossless_no_vartx(); + let (decoded, hidden) = decode_all_frames_vs_oracle(&data, NAME); + let suppressed = crate::decode::sub8_lossless_no_vartx() - before; + assert_eq!( + decoded, 6, + "{NAME}: the oracle decoded {decoded} frames in DECODE order; the 5-frame \ + altref recipe codes 5 source frames plus a hidden alt-ref picture" + ); + assert_eq!( + hidden, 1, + "{NAME}: {decoded} decode-order dumps against {decoded} - {hidden} shown outputs \ + means the gate saw the hidden picture no shown-frame compare can reach" + ); + assert!( + suppressed > 0, + "{NAME}: no sub-8 (4x8/8x4) inter leaf on a LOSSLESS segment read no var-tx \ + symbol ({suppressed} of them did), so this witness does not exercise the \ + ordering at all (class gate-blind-to-feature) -- re-encode per the recipe above" + ); + let (wy, wu, wv, shown, exact) = + count_rawvideo_diffs(&data, NAME, None).expect("the two sides must be byte-comparable"); + assert_eq!( + (wy, wu, wv, exact), + (0, 0, 0, shown), + "{NAME}: shown-frame per-plane diff vs `aomdec --rawvideo`" + ); + eprintln!( + "{NAME}: {decoded} decode-order frame(s) byte-exact ({hidden} hidden), \ + {shown} shown frame(s) exact per plane, {suppressed} sub-8 leaf/leaves on a \ + lossless segment read no var-tx symbol" + ); + } /// lane-av1444rect r2 — the SAME class as the gate above, second /// instance: `decode_rect4_16_intrabc` applied the 4:2:0 pair geometry at /// ss (0,0), where `is_chroma_reference` makes an intra-BC 1:4 strip its diff --git a/lanes/av1mixllconj.report.md b/lanes/av1mixllconj.report.md new file mode 100644 index 00000000..cb248823 --- /dev/null +++ b/lanes/av1mixllconj.report.md @@ -0,0 +1,441 @@ +# lane-av1mixllconj — the per-segment `lossless` answer ALREADY agrees with libaom; the var-tx **conjunct** lands, and the 640x480 "regression" is a SECOND, independent defect on a cell that was never correct + +Base `main` = `6bb66a4a`. Worktree `/home/user/.cache/wt/av1mixllconj`, target dir +`$HOME/.cache/cargo-target-av1mixllconj`, `EC_NOMEMGUARD=1`. Oracle +`~/.cache/aom-oracle/build/{aomdec,aomenc}` (shared, untouched; not rebuilt, not +re-instrumented). ffmpeg 8.1.3. + +**This lane lands the two-line conjunct** (cherry-picked candidate `658d37fa`, +re-derived and re-proved here) **plus its fixture, route counter and gate.** One +regression control from the charter is NOT met as literally written — the +640x480 cell refuses instead of decoding — and §4 shows, with measurements, that +the control's premise is false (the cell is 70–92 % wrong at base) and that the +refusal is caused by a **different defect class**, localised to one read and +reproduced to a one-line override. + +--- + +## 0. Verdict + +| | | +|---|---| +| The charter's live question — "make our per-segment `lossless` answer agree with libaom's `xd->lossless[segment_id]`" | **the answer is: it already agrees.** The derivation is line-for-line libaom's, and 179 378 bit-identical entropy reads on the 640x480 cell prove no var-tx gate ever consulted a wrong flag. There is nothing to fix in the derivation. | +| 256x128 pin (`--limit=5`) | **6/6 decode-order byte-exact**; paired `EC_SYMR` **96 997 / 96 997 bit-identical over the WHOLE stream** (§3.1) | +| 4:4:4 arm (`--profile=1`, 8 frames) | **9/9 exact**, red on f1..f8 before | +| 176x144 / 352x288 (refuse at base) | 352x288 → **7/7 exact**; 176x144 → decodes 7/7 (still red from the already-handed-off `mi=(32,32)` defect, which `lane-av1offtile`'s clip then closes — §7b) | +| 640x480 — **CONTROL NOT MET** | refuses at frame 3 instead of decoding. Base decodes it **70–92 % wrong on every frame** (§4.1). Refusal cause = a second defect, named and one-line-reproduced in §4.3. | +| Corpus sweep, 107 committed fixtures | **exactly one status change: `420_mixll_altref_256x128_5f` RED → EXACT.** Zero EXACT→RED, zero new REFUSED, zero FRAMECOUNT change (§5) | +| Composition with `714fb55b` (`lane-av1offtile`) | cherry-picked for measurement and reverted; the two clips close **every** cell of this recipe at 256x128 / 176x144 / 352x288 / 4:4:4 and leave the 640x480 residual byte-for-byte unchanged (§7b) | +| Class sweep | all 10 `else if lossless(fctx)` sites and all 9 `read_var_tx_size` gates re-derived against libaom's own `if`: **exactly the 2 fixed sites were in the class, no third site** (§6) | +| Fixture / gate / counter | committed; gate mutation-proven red-before (§3.2) | + +## 1. Reproduction + +Every cell below is `testsrc2` at 25 fps, `ffmpeg -f lavfi -i +testsrc2=size=:rate=25 -frames:v -pix_fmt yuv420p`, then + +```text +aomenc --codec=av1 --obu -o .obu --passes=1 --cpu-used=4 --limit= \ + --end-usage=q --cq-level=0 --aq-mode=1 src.y4m # 4:2:0 + ... --profile=1 ... src444.y4m # 4:4:4 +``` + +| cell | bytes | sha256 (prefix) | +|---|---:|---| +| `m5_256x128.obu` (the pin) | 18 525 | `3e06b5641e6a0f5a` | +| `m_256x128.obu` | 22 336 | — | +| `m_176x144.obu` | 20 069 | `02b15d0d5b08aa5a` | +| `m_320x240.obu` / `m5_320x240.obu` | 38 686 / 28 716 | `37fbe7cb…` / `40d613fd…` | +| `m_352x288.obu` | 46 490 | `e43c74b8d847e701` | +| `m5_640x480.obu` | 87 537 | `3d505fd2e0bbb7ca` | +| `m_640x480.obu` | 115 615 | `c82ba4d793d378cc` | +| `m444_8.obu` (4:4:4, 8 frames) | 79 051 | — | + +The three byte counts and shas the inherited reports name all reproduce on the +first try. + +## 2. The charter's premise, tested and answered + +The charter says: *"our per-segment lossless answer disagrees with libaom's +`xd->lossless[segment_id]` on that stream … the table is built from a +qindex/delta predicate that does not account for what segmentation ACTUALLY +resolves to."* + +**It does not disagree. Two independent measurements:** + +**(a) The derivation is libaom's, term for term.** libaom +`decodeframe.c:5210-5217`: + +```c +for (int i = 0; i < MAX_SEGMENTS; ++i) { + const int qindex = av1_get_qindex(&cm->seg, i, quant_params->base_qindex); + xd->lossless[i] = qindex == 0 && quant_params->y_dc_delta_q == 0 && + quant_params->u_dc_delta_q == 0 && quant_params->u_ac_delta_q == 0 && + quant_params->v_dc_delta_q == 0 && quant_params->v_ac_delta_q == 0; + xd->qindex[i] = qindex; +} +``` + +`av1_get_qindex` (`quant_common.c:222`) is +`segfeature_active(SEG_LVL_ALT_Q) ? clamp(base_qindex + data, 0, MAXQ) : +base_qindex`. Ours (`ec-av1-syntax/src/frame.rs:658-666` and `1022-1033`) is the +same predicate, the same clamp, the same five deltas — and it is evaluated +**after** `read_quantization_params` / `read_segmentation_params` / +`read_delta_q_params` / `read_delta_lf_params`, i.e. after segmentation has +resolved, which is the one thing the charter suspected. The suspicion is +**REFUTED**. + +The table this lane prints per frame (env-gated, reverted; the 640x480 cell, all +five frames identical) shows the mixed structure the class needs: + +```text +EC_MIXLL_FRAME base_q=0 deltas=(0,0,0,0,0) qindex=[0,0,0,0,1,1,1,1] + lossless=[true,true,true,true,false,false,false,false] # frames 0-1 +EC_MIXLL_FRAME base_q=0 deltas=(0,0,0,0,0) qindex=[0,0,0,0,0,0,0,0] + lossless=[true,true,true,true,true,true,true,true] # frames 2-4 +``` + +**(b) A wrong flag could not have stayed hidden.** On `m5_640x480` the parse is +**bit-identical to the oracle for 179 378 entropy reads** with the fix in. At +every var-tx gate a wrong `lossless` answer changes the NUMBER of reads (the tree +walk appears or vanishes), so a wrong flag at any gate inside that range would +have forked the ladder. It did not. **No tree-gate on this stream ever +consulted a wrong flag.** + +So the charter's "fix the DERIVATION" lever is empty, and the remaining question +is the one §4 answers. + +## 3. The landed change, and its proof + +```diff +@@ decode.rs:27213 (intrabc 4x8 / 8x4 rect leaf, read_var_tx_size) +- if tx_select && !skip { ++ if tx_select && !skip && !lossless(fctx) { +@@ decode.rs:48332 (sub-8 4x8/8x4 inter leaf, read_var_tx_size) +- if fctx.tx_select_inter.with(std::cell::Cell::get) && !skip { ++ if fctx.tx_select_inter.with(std::cell::Cell::get) && !skip && !lossless(fctx) { +``` + +libaom's own condition (`decodeframe.c:1237`) carries +`!xd->lossless[mbmi->segment_id]` **inside** the tree condition and +`read_tx_size` (`:1203`) answers `TX_4X4` on the same flag before reading +anything. `lossless(fctx)` is already per-segment +(`lossless_per_seg[cur_segment_id]`, `decode.rs:453-456`), so the flag was right +and one branch too late. + +### 3.1 Whole-stream ladder, not just "up to the fork" + +`EC_SYMR=1` on both sides of the pin, comparing the convention-free fields +(`pre[0]`, `pre[1]`, `n`, `s`, `post_rng`; `pre[2]` carries a per-site constant +offset and `cdf0` the ICDF mirror, so neither is the signal): + +```text +ours=96997 (unparsed 0) oracle=96997 (unparsed 0) +bit-identical over all 96997 paired reads +``` + +### 3.2 Gate, counter, mutation proof + +* fixture `crates/ec-av1/fixtures/420_mixll_altref_256x128_5f.obu`, 18 525 B, + pinned by **fnv1a64** `16348502764482216576` (not a `const SHA256` compared + against itself); +* route counter `SUB8_LOSSLESS_NO_VARTX`, incremented on the **decision** — the + `else if lossless(fctx) && !skip` arm, i.e. it can only be non-zero when the + conjunct actually suppressed a tree that the pre-fix tree would have walked + (`decode.rs:48349`). A stream whose sub-8 leaves all sit in lossy segments + leaves it at zero, so the gate cannot look armed by merely decoding; +* gate `a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order` + asserts 6 decode-order dumps with **1 hidden**, the counter delta `> 0`, and the + shown-frame per-plane diff against `aomdec --rawvideo`. + +Mutation proof — the fix surgically reverted from the working tree, the gate +re-run — is in §8. + +## 4. The 640x480 control: what actually breaks, and why it is not this class + +### 4.1 The control's premise is false — the cell is wrong at base + +Decode-order dumps vs the oracle's `EC_AV1_FINAL_DUMP`, 460 800 B per frame: + +| cell | at base `6bb66a4a` | with the fix | +|---|---|---| +| `m5_640x480` (87 537 B) | **6/6 dumps, f1..f5 red by 352 066 / 414 286 / 313 795 / 399 471 / 422 078** | 4/6 dumps, then `REFUSED: unsupported: AV1 tile (a Golomb tail longer than this decoder reads)` | +| `m_640x480` (115 615 B) | 7/7 dumps, f1..f6 red by 162 045 … 439 643 | 5/7 dumps, then the same refusal | + +So the base tree does not "decode 640x480" — it emits between 8 % and 30 % of +each frame's bytes correctly and says nothing. The prior lane recorded the same +gap (`lanes/av1mixllfork.report.md` §7: *"Whether the 640x480 base decode is red +or exact — I measured that it decodes, not that it is correct"*). It is red. +The fix converts a **silent** near-garbage decode into a **loud** refusal, which +is the direction the project's honesty invariant asks for +(`skill://edith-refusal-inventory-gates`). + +### 4.2 The fix moves the fork 40 892 reads forward — it is not the blocker + +Paired `EC_SYMR`, first divergence over the whole stream: + +| tree | first divergence | our read count | oracle | +|---|---:|---:|---:| +| base `6bb66a4a` | **138 586** | 860 431 | 457 696 | +| with the fix | **179 378** | 521 856 | 457 696 | + +The base fork at 138 586 is the *same* signature as the pin's read 30 889 — the +oracle goes `decodemv.c:191` (`ref_mv`) → `decodetxb.c:158` (`txb_skip`) with no +`tx_size` symbol in between, and we read one — i.e. **the 640x480 cell has the +same lossless defect, and the fix fixes 40 892 reads' worth of it.** The +remaining fork is elsewhere. + +### 4.3 The remaining fork is a `tx_size_context` read — a different class + +At read 179 378 both sides are at the **same block, `mi=(80,110)`** (the oracle's +own `EC_TXCTXB` rung names it; its `EC_SYMR` `mi=` label is stale there, and +`site=decodeframe.c:1186` is **not** the var-tx split read — the built binary's +line numbering is 17 lines behind the current `decodeframe.c`, and 1186 there is +`read_selected_tx_size`'s `tx_size_cdf` read, which a paired +`EC_SYMR=1 EC_VARTX=1` run proves: the var-tx rung fires only 15 times in the +whole stream and at none of these bit positions). + +| side | above band | left band | above | left | **ctx** | +|---|---|---|---|---|---:| +| libaom (`EC_TXCTXB mi=80,110 bsize=2 maxw=8 maxh=4 hasup=1 hasleft=1`) | 4 | 8 | 0 | 1 | **1** | +| ours (`EC_TXCTX mi=80,110 own=8x4`) | **16** | 8 | 1 | 1 | **2** | + +The read is `tx_size_cat0[ctx]` at `decode.rs:47264`, a 4:2:0 **8x4 intra leaf +with `use_filter_intra` inside an inter frame** — a *sub-8 intra-rect leaf*, not +an inter leaf, so neither fixed site is involved. + +**One-line reproduction.** Forcing `ctx = 1` at that single site (an env-gated +override, reverted) makes the whole 640x480 cell **bit-identical to the oracle**: + +```text +natural ctx=2 : ours=521856 reads, first divergence 179378 +forced ctx=1 : ours=457907 reads, oracle=457907, bit-identical over all 457907 +forced ctx=0 : 286327 reads forced ctx=2 : 521856 +forced ctx=3 : 179378 reads forced ctx=4 : 179378 +``` + +**The band itself is wrong, not the context formula.** Replaying every +`EC_TXUPD` band write up to read 179 378, the last write to mi column 110 is a +**skipped** 16-px-wide inter block at `mi=(36,108)` (`skip_inter=true`, +`w_mi=4 → bw=16`) at read 157 577; nothing writes column 110 between then and +the read. libaom reads 4 there, so libaom has a band write in rows 37..79 that +this tree does not make — class `context-band-not-published`, the same class +`decode.rs:27595`'s comment already names. **Not this lane's hunks, and not +fixable from a one-line context change: a forced `ctx` is a symptom mask, not a +fix.** + +## 5. Corpus sweep — 107 committed fixtures, before and after + +Every `crates/ec-av1/fixtures/*.obu`, decode-order dumps vs the oracle +(`EC_AV1_DECODE_ORDER_DUMP` / `EC_AV1_FINAL_DUMP`): + +| | base `6bb66a4a` | with the fix | +|---|---:|---:| +| EXACT | 64 | **65** | +| RED (decodes, some frame differs) | 34 | **33** | +| FRAMECOUNT mismatch | 9 | 9 | +| REFUSED | 0 | 0 | + +Per-fixture diff: **one row changes.** + +```text +420_mixll_altref_256x128_5f RED (f1..f5) -> EXACT +``` + +No fixture goes EXACT → RED, none gains a refusal, none changes its frame count. +The change is a strict improvement over the committed corpus. + +## 6. Class sweep — *a per-segment flag consulted as a branch alternative +instead of a conjunct of the condition it gates* + +Every `lossless(fctx)` consult in `decode.rs` re-derived against libaom's own +`if` (74 sites). The class needs a **symbol read** whose guard tests the flag as +a branch *alternative*; chroma unit-grid selection is a different concern. + +| site | shape | verdict | +|---|---|---| +| `12835` | `else if lossless` — chroma unit grid | not this class | +| **`18229`/`18231`** | `if skip \|\| (!lossless && !tx_select) {None} else if lossless {4x4 grid} else {tree}` | **correct** — lossless is the FIRST discriminator, which is what libaom's `!xd->lossless` in the tree condition plus `read_tx_size`'s early return imply | +| `22032`, `23937` | `… && !lossless(fctx)` in the tree condition | conjunct — correct | +| `24642`, `24716`, `25762`, `42459`, `44261`, `48632` | `else if lossless` — chroma unit grid (4:2:2 / 4:4:4 / 4:2:0 rect chroma) | not this class | +| **`27213`/`27236`** | intrabc 4x8/8x4 rect leaf | **WAS this class — fixed** | +| `27572` | `tx_select && !lossless` | conjunct — correct | +| `29267` (`read_tx_size`), `29790` (`read_block_tx_size`), `30315` (`read_block_tx_size_rect`) | `if lossless { return / 4x4 }` before the tree | early return — correct | +| `14087`, `15549`, `16188`, `16754`, `18765`, `19742`, `47264` | `tx_select && !lossless` | conjunct — correct | +| **`48332`/`48348`** | sub-8 4x8/8x4 inter leaf | **WAS this class — fixed** | +| `476`, `485`, `12234`, `14617`, `15098`, `15307`, `15320`, `18342`, `18421`, `18422`, `19108`, `21576`, `21625`, `21664`, `21940`, `23393`, `24147`, `24203`, `24598`, `24850`, `25546`, `25549`, `27374`, `27412`, `29790`, `30315`, `30733`, `30744`, `30815`, `30887`, `37885`, `37894`, `37935`, `42230`, `44043`, `45027`, `45316`, `45769`, `45771`, `47739`, `50236`, `51195`, `51830` | value/units/recon selection, `depth != 0 \|\| lossless`, early returns | not this class | + +**Exactly 2 sites were in the class; both are fixed; there is no third.** The +recursive `read_var_tx_size` calls (29750, 29854, 30381, 30449) sit inside the +three functions that carry the lossless early return, verified by reading each +function's first lines. + +## 7. The rest of the class's stream sweep + +All `testsrc2`, `--passes=1 --cpu-used=4 --end-usage=q --cq-level=0 --aq-mode=1`, +decode-order dumps vs the oracle. "red" = the byte count of each differing frame +(49 152 for 256x128, 115 200 for 176x144/320x240, 230 400 for 352x288, +460 800 for 640x480). + +| cell | at base | with the fix | +|---|---|---| +| `m5_256x128` (pin, 5 f) | 6 dumps, red f1..f5: 33 724 / 34 251 / 44 500 / 36 688 / 37 462 | **6/6 EXACT** | +| `m_256x128` (6 f) | 7 dumps, red f1..f6: 36 045 … 43 147 | 7 dumps, red f1..f6: 6 051 / 4 115 / 2 962 / 26 566 / 41 876 / 14 749 | +| `m_176x144` | **REFUSED** (1 dump) | 7 dumps, red f1..f6: 811 / 949 / 630 / 969 / 811 / 24 105 | +| `m_320x240` | 7 dumps, red f1..f6: 67 194 … 97 946 | 7 dumps, **red f6 only: 19 398** | +| `m5_320x240` | 6 dumps, red f1..f5: 85 821 … 99 314 | 6 dumps, red f1..f5: 15 031 / 16 006 / 21 930 / 65 405 / 90 077 | +| `m_352x288` | **REFUSED** (3 dumps) | **7/7 EXACT** | +| `m5_640x480` | 6 dumps, red f1..f5: 313 795 … 422 078 | 4 dumps then REFUSED (§4) | +| `m_640x480` | 7 dumps, red f1..f6: 162 045 … 439 643 | 5 dumps then REFUSED (§4) | +| `m444_8` (4:4:4, 8 f) | 9 dumps, red f1..f8: 79 886 … 92 108 | **9/9 EXACT** | + +The 6-frame 256x128 and the 320x240 residuals are **not** claimed closed: they +are separate defects this change shrinks but does not remove. + +The 176x144 residual is the `mi=(32,32)` extra-geometry fork already handed to +`lane-av1golomb320`, and this lane re-measured it rather than citing it: paired +`EC_SYMR` on `m_176x144` gives a first divergence at read **25792 both with and +without the conjunct**, and the fix still moves our read count from **41 381 to +105 219** against the oracle's **106 607** — i.e. it closes 63 838 reads of +divergence and leaves 1 388 of that other defect. The two sites are independent, +which is the same conclusion `lanes/av1golomb320.report.md` §4 reached. + +## 7b. Composition with `lane-av1offtile` (`e87a8a27`, was `714fb55b`) — measured, then reverted + +`714fb55b` (later amended to `e87a8a27`) bounds the lossless rect strip's chroma walk by the chroma PLANE and +closes the `mi=(32,32)` 40-extra-reads fork this lane inherited as 176x144's +residual. Cherry-picked onto this tip for the measurement only (reverted; the branch +carries no trace of it). Their tip is now `e87a8a27`, which differs from the +`714fb55b` I measured in `lanes/av1offtile.report.md` ONLY -- `git diff 714fb55b +e87a8a27 -- crates/` is empty -- so these numbers stand without re-taking +them: + +| cell | my clip alone | both clips | +|---|---|---| +| `m5_256x128` (pin) | 6/6 exact | **6/6 exact** | +| `m_176x144` | 7 dumps, red f1..f6 | **7/7 exact** | +| `m_352x288` | 7/7 exact | **7/7 exact** | +| `m444_8` (4:4:4) | 9/9 exact | **9/9 exact** | +| `m5_640x480` | 4/6 dumps then REFUSED, red 64 181 / 98 673 / 63 442 | **identical — the clip changes nothing** | +| `m_640x480` | 5/7 dumps then REFUSED, red 53 685 / 75 891 / 34 386 / 112 145 | identical | + +So the two clips compose without overlap and together close every cell of this +recipe at 256x128, 176x144, 352x288 and 4:4:4. The 640x480 residual is +untouched by the composition — the three red byte counts are the same to the +byte — which is the third defect of §4.3, not a chroma-walk defect. + +**`lane-av1offtile` originally reported that `mix_640x480_5/6` "still decode with +both applied". That does not reproduce on this tip + their clip** (measured +above); it reproduces on base + their clip, i.e. without the var-tx conjunct. +They re-measured, retracted it verbatim with the re-measurement under it, and +amended to `e87a8a27` (2026-09-30). They also independently re-measured the +"red at base" point on their own tree and got my numbers exactly +(f1 352066, f2 414286, f3 313795, f4 399471 of 460800). + +## 8. Mutation proof + +The fix surgically reverted from the working tree (the two +` && !lossless(fctx)` suffixes removed from lines 27213 and 48332), the gate +re-run: + +```text +running 1 test + +thread 'stream::tests::a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order' +panicked at crates/ec-av1/src/stream.rs:10935:17: +a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order: +decode-order frame 1 of 6 (5 shown, 1 hidden) differs from the oracle at byte 33 +(ours 82 vs 81), 33724 bytes differ +test stream::tests::a_420_mixed_lossless_alt_ref_sub8_vartx_witness_... ... FAILED + +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 803 filtered out +``` + +**33 724 -- the same number as the hand-measured red in section 1 / section 7.** +Restored, the same gate is green and prints its non-vacuity evidence: + +```text +a_420_mixed_lossless_alt_ref_sub8_vartx_witness_is_byte_exact_in_decode_order: +6 decode-order frame(s) byte-exact (1 hidden), 5 shown frame(s) exact per plane, +40 sub-8 leaf/leaves on a lossless segment read no var-tx symbol +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 803 filtered out +``` + + +## 9. Scoped test command and output + +```text +CARGO_TARGET_DIR=$HOME/.cache/cargo-target-av1mixllconj EC_NOMEMGUARD=1 \ + cargo test -p ec-av1 --lib -- 420 444 422 lossless stream \ + --skip bitrate_target_lands_within_5_percent_over_48_frames +``` + +```text +test result: ok. 375 passed; 0 failed; 7 ignored; 0 measured; 422 filtered out; + finished in 1770.01s +``` + +**375 / 0 / 7 / 422.** `lanes/av1mixllfork.report.md` §8 records +`373 / 0 / 7 / 422` for the same scope on its (older) base; the two extra +passes are this lane's new gate plus the `4:4:4` chroma palette gate that landed +on `main` after that report, so the numbers are comparable and the run is a +real-delta result, not a no-delta confirmation. + +**The scope limit this run cannot cover, restated because it is load-bearing:** +it contains **no 640x480-class cell**. The corpus sweep in §5 covers the +committed fixtures and the cell sweep in §7 covers the generated ones, so the +§4 refusal is caught by neither the suite nor the corpus -- it needs its own +generated cell, exactly as the prior lane warned. + +## 10. What is NOT measured + +* **The 640x480 cell does not decode with this fix in.** §4 names the blocker + (a missing `TXFM_CONTEXT` band write above `mi=(80,110)`, class + `context-band-not-published`) and reproduces its effect in one line, but the + band write itself is not identified to a call site — the replay only shows + that libaom has a write in rows 37..79 at mi column 110 and this tree has + none. That is the next lane's job, and it is NOT this lane's hunks. +* **10/12-bit arm of the class sweep: not synthesized.** This ffmpeg cannot emit + a >8-bit y4m and a hand-built 16-bit-LE one is rejected by the shared + `aomenc` (`Loss of framing in Y4M input data`). The committed HBD corpus is + covered by the §5 regression; that is a regression, not a sweep of this class + at HBD. +* The class is content-dependent: everything above is `testsrc2` at five sizes. + The 106 committed fixtures that do not come from this recipe are the + regression evidence (§5), not a sweep of the class. +* The forced-`ctx` override in §4.3 is a **symptom mask used as a proof**, not a + candidate fix; it is not in the tree. + +## 11. Fix-now | deferred() | accepted + +* **fix-now** — the two-line conjunct, its fixture, its route counter and its + gate. Landed in this commit. +* **deferred(unblock: identify the `TXFM_CONTEXT` band write libaom makes above + `mi=(80,110)` on a 640x480 mixed-lossless cell, rows 37..79, mi column 110 — + the last write this tree makes is a skipped 16-px inter block at `mi=(36,108)` + publishing 16 where libaom has 4)** — that is the whole 640x480 cell, and the + one regression control this lane does not meet. Owner: whoever holds + `context-band-not-published`; §4.3 hands it a one-line reproduction. +* **deferred(identification of the residual reds on the 6-frame 256x128, + 320x240 and 176x144 arms)** — the 176x144 one is `lane-av1golomb320`'s + `mi=(32,32)` fork; the other two are unnamed and this lane does not claim + them. +* **deferred(a >8-bit y4m source, or a hand-built one the shared `aomenc` + accepts)** — the HBD arm of the class sweep, §10. +* **accepted** — the `EC_MIXLL` per-frame table print, the `EC_SITETAG` / + `EC_TXCTX_SITE` / `EC_TXUPD` diagnostics and the `set_symr_cdf` tags are all + **reverted**; the tree carries no probe bypass and no env-gated trace. The + permanent artefacts are this report and the measurements in it. The shared + oracle was never rebuilt or edited: the one oracle rung this lane needed + (`EC_TXCTXB`) already existed. + +## 12. Hunk scope + +* Authored here: this report, and nothing else. The `decode.rs` lines are the + cherry-picked candidate `658d37fa`'s (`27213`, `48332`, plus the + `SUB8_LOSSLESS_NO_VARTX` counter at `48349`); the fixture and the gate are + that commit's too, re-measured on this base. +* No line outside those hunks was touched; `git status` in the primary checkout + is clean. +* Every diagnostic added during this lane was reverted before the commit + (`git status --porcelain` empty apart from this report).