From 2eb0e50b871a4cd0cc72674b8cd2d9276f3488c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 1 Oct 2026 05:36:17 +0300 Subject: [PATCH] lane-av1422lift: the honesty layer -- six prose sites that named readers which do not exist Refutation pass over `b7a36001` (lane-av1422liftverify, `5ee10c61`) confirmed the lift's behaviour, its assertion, its three coupled inventory deletions, its two new pins and all nine pixel gates, and refuted ONE thing: six prose sites where the lift replaced true "no committed test can read this counter" statements with false "the corpus gate reads this counter" statements. No decoder logic, no assertion, no fixture, no gate body changes here. Every line of the diff is a comment (`git diff -U0 ... | grep -v '^[+-]//'` is empty), and the 4:2:2 gate set is 10 passed / 0 failed, unchanged. Measured on this tip with a throwaway in-`mod tests` probe (added, run, removed; `git status --porcelain` empty and the tree byte-identical to HEAD before this commit) over all 21 committed 4:2:2 cells: 1. `decode.rs` `SB128RECT_REPLAY_SPAN_MISMATCH_HITS`. It claimed the corpus gate asserts it stays zero at 4:2:2. No gate reads it, and it does NOT stay zero: `422_intrabc_sb128_strip.obu` and `422_intrabc_sb128_strip_notxsearch.obu` each read `replay = 72, mismatch = 9`, the other 19 read 0. The first is a pin `the_pinned_422_intrabc_sb128_strip_witnesses_decode_pixel_exact` asserts BYTE-EXACT against ffmpeg, so a non-zero mismatch is the arm counting its own designed case, not a defect. The deleted sentence ("zero on every stream this decoder admits, because 4:2:2 is refused by name") was TRUE and admitting 4:2:2 genuinely made it fire. The doc now carries the two numbers and says plainly that adding the promised zero assert would red a provably correct cell. 2. `decode.rs` `RECT_TILED_CHROMA_NXN_HITS`. Claimed the corpus gate reads it; nothing does, and it reads 0 on all 21 committed 4:2:2 cells and on the 4:2:0 / 4:4:4 cells probed. Now says UNWITNESSED with the number, and names the only two readers (both 4:4:4, where `nxn` is interpolated into a failure message and never asserted). 3. `decode.rs` `INTRABC_RECT4_OWN_CHROMA422_HITS`. Claimed the corpus gate reads its delta per row; the accessor has zero callers in the crate. It does fire -- the six corpus cells step it 1..6 -- so the doc carries that and states the true half: no committed test reads it. 4. `stream.rs` `sb128rect_chroma_replay_counters` (pub API doc): same false attribution, now carries `(72, 9)` and names the two 4:2:0/4:4:4 gates that are the actual readers. 5. `stream.rs`, inside BOTH tripwire gates' own comments (the 4:4:4 one and the 4:2:0 twin): these were the worst two, because those are the gates that DO read the counter, and the text invited a future lane to add the missing 4:2:2 zero assert to one of them and land a red on a correct cell. Both now carry an explicit "DO NOT copy this zero assert onto a 4:2:2 stream", the `mismatch = 9` measurement, and the statement of what actually holds the per-axis span (the 4:2:2 exactness gates). 6. `refusal_inventory.rs`: the retirement note named `a_real_422_stream_decodes_pixel_exact`, which does not exist -- the gate is `a_real_422_key_frame_and_inter_sequence_decode_pixel_exact`; and a sibling-witness comment still pointed at `a_non_420_subsampled_sequence_header_is_refused_by_name`, the test this lift deleted. Both re-pointed at gates that exist. No gate was added. Adding the promised 4:2:2 mismatch assert would red a byte-exact cell, which is a worse outcome than an honest comment. --- crates/ec-av1/src/decode.rs | 56 ++++++++++++++++++-------- crates/ec-av1/src/refusal_inventory.rs | 12 +++--- crates/ec-av1/src/stream.rs | 43 ++++++++++++-------- 3 files changed, 72 insertions(+), 39 deletions(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 7cc3e133..26bf30c6 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -2857,11 +2857,15 @@ thread_local! { /// or 16x64 as two 16x32s). static RECT_TILED_CHROMA_1X2_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; /// Chroma units of the same walk in any other multi-unit grid (2x2 and - /// up). lane-av1422lift: 4:2:2 is DECODED, so this is no longer an arm - /// no admitted stream can reach -- a 4:2:2 block whose chroma plane is - /// wider than tall relative to its luma span lands here. The corpus gate - /// `the_pinned_422_corpus_cells_decode_pixel_exact` reads this counter - /// as a non-vacuity arm; kept so the match above is exhaustive). + /// up). lane-av1422lift: this used to say "only reachable at 4:2:2, which + /// is refused, so this stays 0 on every admitted stream", and that was + /// true. 4:2:2 is decoded now, so the "cannot happen" is gone -- but the + /// arm is still UNWITNESSED: measured on this branch's tip over all 21 + /// committed 4:2:2 cells and over the 4:2:0 / 4:4:4 cells probed, it + /// reads 0 on every one of them. No committed gate reads it either (the + /// only readers of `rect_tiled_chroma_grid_hits()` are two 4:4:4 strip + /// gates, where `nxn` is interpolated into a failure message and never + /// asserted). Kept so the match above is exhaustive. static RECT_TILED_CHROMA_NXN_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; } @@ -6140,9 +6144,16 @@ thread_local! { // lane-av1422luma: the ss (1,0) twin of `INTRABC_RECT4_OWN_CHROMA444_HITS` // -- how many intra-BC 1:4 strips at 4:2:2 took the own-chroma (no pair) // route. Same caveat as the 4:4:4 counter: it proves REACH and nothing else. -// lane-av1422lift: 4:2:2 is DECODED, so committed tests CAN read this -// counter now; `the_pinned_422_corpus_cells_decode_pixel_exact` reads its -// delta on every corpus row. +// lane-av1422lift: 4:2:2 is DECODED, so this counter is no longer pinned +// behind a header refusal -- and it DOES fire: measured on this branch's tip, +// the six committed corpus cells each read 1 more than the cell before +// (`s422_320x246` 1, `s422_322x240` 2, `s422_322x246` 3, `s422_352x242_10b` +// 4, `s422_416x242_10b` 5, `s422_416x250_10b` 6), and every other committed +// 4:2:2 cell leaves it at 6. **No committed gate reads it**: the accessor +// below has no callers in the crate (the 4:4:4 twin is read at two +// `stream.rs` sites, this one nowhere). The honest sentence is therefore +// "no committed test reads this counter", which is what the 4:4:4 twin's +// doc says about itself -- it does NOT become "the corpus gate reads it". thread_local! { static INTRABC_RECT4_OWN_CHROMA422_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; } @@ -23415,14 +23426,27 @@ thread_local! { /// ... and the number of non-skip 128-root rect BLOCKS whose replay /// height differs from the unit's own LUMA-MI height -- the signature of the /// width passed to both axes (`luma_span` where the in-loop stamp used - /// `luma_span_h`). lane-av1422lift: this used to read zero on every - /// admitted stream because 4:2:2 -- the one format whose two spans differ - /// -- was refused by name at the sequence header. It is DECODED now, so - /// this is a REAL detector, not a defensive arm: a hardcoded 4:2:0 span on - /// a 4:2:2 stream lands here and reads non-zero. The two 4:2:0/4:4:4 - /// tripwire gates that assert zero keep asserting zero; the 4:2:2 row of - /// `the_pinned_422_corpus_cells_decode_pixel_exact` asserts it stays zero - /// there too, which is the claim that replaces "it cannot fire". + /// `luma_span_h`). lane-av1422lift: the doc here used to read "Zero on + /// every stream this decoder admits ... 4:2:2 ... is refused by name at + /// the sequence header", and that was TRUE. Admitting 4:2:2 genuinely made + /// this counter able to fire, and it does fire: measured on this branch's + /// tip over all 21 committed 4:2:2 cells, `422_intrabc_sb128_strip.obu` + /// and `422_intrabc_sb128_strip_notxsearch.obu` each read + /// `replay = 72, mismatch = 9`; the other 19 read 0. + /// + /// **Those two pins are byte-exact against ffmpeg** + /// (`the_pinned_422_intrabc_sb128_strip_witnesses_decode_pixel_exact`, all + /// five frames, every plane), so a non-zero mismatch is NOT a defect + /// signature at 4:2:2 -- it is the arm counting its own designed case. + /// Nothing here asserts zero, and nothing should: adding a zero assert + /// would red a gate on a cell that is provably correct. + /// + /// The only readers of the pair are + /// [`sb128rect_chroma_replay_hits`]'s two gates, both on 4:4:4 and 4:2:0 + /// streams, where the unit's luma width and height are equal so the + /// mismatch half is structurally zero. That is the zero this counter is + /// currently a tripwire FOR, and it is a statement about those two + /// streams, not about the format. pub(crate) static SB128RECT_REPLAY_SPAN_MISMATCH_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; } diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index 02c7d2fd..360348db 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -84,9 +84,9 @@ const REFUSALS: &[&str] = &[ // pixel-exact vs ffmpeg). // lane-av1txr: `a sub-8x8 leaf that uses intrabc (…)` is GONE -- the // capability landed in this lane (4x4 / 4x8 / 8x4 intrabc leaves read the - // DV and reconstruct a frame copy + the INTER residual; gates - // `a_non_420_subsampled_sequence_header_is_refused_by_name`'s sibling - // witnesses and the `warped.obu`/`allintra.obu` traces). Its census gate + // DV and reconstruct a frame copy + the INTER residual; the sub-8x8 + // intrabc leaf witnesses in `stream.rs` and the `warped.obu` / + // `allintra.obu` traces). Its census gate // (`a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal`) // still runs: it now reports `reached = 0` with the same non-vacuous // premise (allow_intrabc frames + decoded sub-8 leaves). @@ -512,9 +512,9 @@ const PROVEN: &[(&str, &str, Proof)] = &[ // REFUSAL STRING, so it could not fail on a tree where 4:2:2 decode was // completely broken -- it passed unchanged on the broken tree and would // have kept passing if the port had been reverted. Its replacement - // `a_real_422_stream_decodes_pixel_exact` (and the corpus battery - // `the_pinned_422_corpus_cells_decode_pixel_exact`) assert BYTE-EXACT - // planes against ffmpeg on real 4:2:2 streams, with the + // `a_real_422_key_frame_and_inter_sequence_decode_pixel_exact` (and the + // corpus battery `the_pinned_422_corpus_cells_decode_pixel_exact`) assert + // BYTE-EXACT planes against ffmpeg on real 4:2:2 streams, with the // per-plane coefficient-unit census as the non-vacuity arm. // lane-av1txr-r2 paired, lane-av1-qmatrix RETIRED with its gate: the // refusal's witness is now diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index baeee83f..3432f3f4 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -318,13 +318,16 @@ pub fn intra128_lossless_counters() -> usize { /// lane-av1-128rectspan: chroma transform units re-stamped by /// `decode_block_128rect`'s end-of-block replay, and how many of those -/// replays stamped a height that was not the unit's own. lane-av1422lift: -/// that mismatch was described as "the 4:2:2 signature -- zero on every -/// stream this decoder admits, since 4:2:2 is refused by name at the -/// sequence header". 4:2:2 is decoded now, so the mismatch half is a live -/// detector on 4:2:2 streams and stays zero only because the per-axis span -/// is correct; the 4:2:2 rows of -/// `the_pinned_422_corpus_cells_decode_pixel_exact` assert that. +/// replays stamped a height that was not the unit's own. +/// lane-av1422lift: the second half was described as "the 4:2:2 signature -- +/// zero on every stream this decoder admits, since 4:2:2 is refused by name +/// at the sequence header", and that was TRUE. 4:2:2 is decoded now and the +/// mismatch is NOT zero: measured on this branch's tip, the two +/// `422_intrabc_sb128_strip*` pins each read `(72, 9)` while the other 19 +/// committed 4:2:2 cells read `(0, 0)`. Those two pins are byte-exact +/// against ffmpeg, so the non-zero half counts the arm's own designed case +/// and is not a defect. No 4:2:2 gate reads this pair; the two gates that do +/// are on 4:2:0 and 4:4:4 streams, where the half is structurally zero. pub fn sb128rect_chroma_replay_counters() -> (usize, usize) { crate::decode::sb128rect_chroma_replay_hits() } @@ -9201,13 +9204,16 @@ pub(crate) mod tests { // stopped replaying reads 0), and the mismatch half is the 4:2:2 // signature: this stream is 4:4:4 (ss 0,0), where the unit's luma // width and height are equal, so a replay that stamped one axis with - // the other's span would still read 0 here. lane-av1422lift: 4:2:2 is // decoded now, so this counter no longer "names the day 4:2:2 is - // admitted" -- the 4:2:2 rows of - // `the_pinned_422_corpus_cells_decode_pixel_exact` read the mismatch - // half on streams where the two spans actually differ, which is what - // stops an 8-row spill below the block from corrupting the next - // block's `txb_skip` silently. + // admitted" -- it fires there. **DO NOT copy this zero assert onto a + // 4:2:2 stream**: measured on this branch's tip, the two + // `422_intrabc_sb128_strip*` pins each read `mismatch = 9` while + // being byte-exact against ffmpeg, because the mismatch half counts + // the replay's own designed 4:2:2 case rather than a defect. What + // stops the 8-row spill below the block from corrupting the next + // block's `txb_skip` is the per-axis span itself, and the 4:2:2 + // exactness gates (`the_pinned_422_intrabc_sb128_strip_witnesses_ + // decode_pixel_exact`) are what hold it -- not this counter. let after_replay = crate::decode::sb128rect_chroma_replay_hits(); assert!( after_replay.0 > before_replay.0, @@ -10765,10 +10771,13 @@ pub(crate) mod tests { // them over its own luma-mi rows -- the arm the span fix sits on, on // the OTHER admitted ss (1,1). The mismatch half is the 4:2:2 // signature; lane-av1422lift: 4:2:2 is decoded now, so this is no - // longer "the tripwire for the day it is not" -- it is a zero this - // gate asserts on the stream in front of it, and the 4:2:2 rows of - // `the_pinned_422_corpus_cells_decode_pixel_exact` assert the same - // zero there. + // longer "the tripwire for the day it is not". It is a zero this gate + // asserts about the stream in front of it, and nothing else. + // **DO NOT carry it to a 4:2:2 stream**: the two + // `422_intrabc_sb128_strip*` pins read `mismatch = 9` each and are + // byte-exact against ffmpeg, so a 4:2:2 zero assert would red on a + // provably correct cell. The 4:2:2 rows of the corpus gate read + // neither half of this counter. let after_replay = crate::decode::sb128rect_chroma_replay_hits(); assert!( after_replay.0 > before_replay.0,