lane-av1422lift: the honesty layer -- six prose sites that named readers which do not exist
Browse files at this commit2eb0e50b871a4cd0cc72674b8cd2d9276f3488c4Parent: 1a0aad13 changed files +72 -39
- crates/ec-av1/src/decode.rs +40 -16
- crates/ec-av1/src/refusal_inventory.rs +6 -6
- crates/ec-av1/src/stream.rs +26 -17
crates/ec-av1/src/decode.rsmodified+40 -16
| @@ -2857,11 +2857,15 @@ thread_local! { | ||
| 2857 | 2857 | /// or 16x64 as two 16x32s). |
| 2858 | 2858 | static RECT_TILED_CHROMA_1X2_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 2859 | 2859 | /// Chroma units of the same walk in any other multi-unit grid (2x2 and |
| 2860 | - /// up). lane-av1422lift: 4:2:2 is DECODED, so this is no longer an arm | |
| 2861 | - /// no admitted stream can reach -- a 4:2:2 block whose chroma plane is | |
| 2862 | - /// wider than tall relative to its luma span lands here. The corpus gate | |
| 2863 | - /// `the_pinned_422_corpus_cells_decode_pixel_exact` reads this counter | |
| 2864 | - /// as a non-vacuity arm; kept so the match above is exhaustive). | |
| 2860 | + /// up). lane-av1422lift: this used to say "only reachable at 4:2:2, which | |
| 2861 | + /// is refused, so this stays 0 on every admitted stream", and that was | |
| 2862 | + /// true. 4:2:2 is decoded now, so the "cannot happen" is gone -- but the | |
| 2863 | + /// arm is still UNWITNESSED: measured on this branch's tip over all 21 | |
| 2864 | + /// committed 4:2:2 cells and over the 4:2:0 / 4:4:4 cells probed, it | |
| 2865 | + /// reads 0 on every one of them. No committed gate reads it either (the | |
| 2866 | + /// only readers of `rect_tiled_chroma_grid_hits()` are two 4:4:4 strip | |
| 2867 | + /// gates, where `nxn` is interpolated into a failure message and never | |
| 2868 | + /// asserted). Kept so the match above is exhaustive. | |
| 2865 | 2869 | static RECT_TILED_CHROMA_NXN_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 2866 | 2870 | } |
| 2867 | 2871 | |
| @@ -6140,9 +6144,16 @@ thread_local! { | ||
| 6140 | 6144 | // lane-av1422luma: the ss (1,0) twin of `INTRABC_RECT4_OWN_CHROMA444_HITS` |
| 6141 | 6145 | // -- how many intra-BC 1:4 strips at 4:2:2 took the own-chroma (no pair) |
| 6142 | 6146 | // route. Same caveat as the 4:4:4 counter: it proves REACH and nothing else. |
| 6143 | -// lane-av1422lift: 4:2:2 is DECODED, so committed tests CAN read this | |
| 6144 | -// counter now; `the_pinned_422_corpus_cells_decode_pixel_exact` reads its | |
| 6145 | -// delta on every corpus row. | |
| 6147 | +// lane-av1422lift: 4:2:2 is DECODED, so this counter is no longer pinned | |
| 6148 | +// behind a header refusal -- and it DOES fire: measured on this branch's tip, | |
| 6149 | +// the six committed corpus cells each read 1 more than the cell before | |
| 6150 | +// (`s422_320x246` 1, `s422_322x240` 2, `s422_322x246` 3, `s422_352x242_10b` | |
| 6151 | +// 4, `s422_416x242_10b` 5, `s422_416x250_10b` 6), and every other committed | |
| 6152 | +// 4:2:2 cell leaves it at 6. **No committed gate reads it**: the accessor | |
| 6153 | +// below has no callers in the crate (the 4:4:4 twin is read at two | |
| 6154 | +// `stream.rs` sites, this one nowhere). The honest sentence is therefore | |
| 6155 | +// "no committed test reads this counter", which is what the 4:4:4 twin's | |
| 6156 | +// doc says about itself -- it does NOT become "the corpus gate reads it". | |
| 6146 | 6157 | thread_local! { |
| 6147 | 6158 | static INTRABC_RECT4_OWN_CHROMA422_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 6148 | 6159 | } |
| @@ -23415,14 +23426,27 @@ thread_local! { | ||
| 23415 | 23426 | /// ... and the number of non-skip 128-root rect BLOCKS whose replay |
| 23416 | 23427 | /// height differs from the unit's own LUMA-MI height -- the signature of the |
| 23417 | 23428 | /// width passed to both axes (`luma_span` where the in-loop stamp used |
| 23418 | - /// `luma_span_h`). lane-av1422lift: this used to read zero on every | |
| 23419 | - /// admitted stream because 4:2:2 -- the one format whose two spans differ | |
| 23420 | - /// -- was refused by name at the sequence header. It is DECODED now, so | |
| 23421 | - /// this is a REAL detector, not a defensive arm: a hardcoded 4:2:0 span on | |
| 23422 | - /// a 4:2:2 stream lands here and reads non-zero. The two 4:2:0/4:4:4 | |
| 23423 | - /// tripwire gates that assert zero keep asserting zero; the 4:2:2 row of | |
| 23424 | - /// `the_pinned_422_corpus_cells_decode_pixel_exact` asserts it stays zero | |
| 23425 | - /// there too, which is the claim that replaces "it cannot fire". | |
| 23429 | + /// `luma_span_h`). lane-av1422lift: the doc here used to read "Zero on | |
| 23430 | + /// every stream this decoder admits ... 4:2:2 ... is refused by name at | |
| 23431 | + /// the sequence header", and that was TRUE. Admitting 4:2:2 genuinely made | |
| 23432 | + /// this counter able to fire, and it does fire: measured on this branch's | |
| 23433 | + /// tip over all 21 committed 4:2:2 cells, `422_intrabc_sb128_strip.obu` | |
| 23434 | + /// and `422_intrabc_sb128_strip_notxsearch.obu` each read | |
| 23435 | + /// `replay = 72, mismatch = 9`; the other 19 read 0. | |
| 23436 | + /// | |
| 23437 | + /// **Those two pins are byte-exact against ffmpeg** | |
| 23438 | + /// (`the_pinned_422_intrabc_sb128_strip_witnesses_decode_pixel_exact`, all | |
| 23439 | + /// five frames, every plane), so a non-zero mismatch is NOT a defect | |
| 23440 | + /// signature at 4:2:2 -- it is the arm counting its own designed case. | |
| 23441 | + /// Nothing here asserts zero, and nothing should: adding a zero assert | |
| 23442 | + /// would red a gate on a cell that is provably correct. | |
| 23443 | + /// | |
| 23444 | + /// The only readers of the pair are | |
| 23445 | + /// [`sb128rect_chroma_replay_hits`]'s two gates, both on 4:4:4 and 4:2:0 | |
| 23446 | + /// streams, where the unit's luma width and height are equal so the | |
| 23447 | + /// mismatch half is structurally zero. That is the zero this counter is | |
| 23448 | + /// currently a tripwire FOR, and it is a statement about those two | |
| 23449 | + /// streams, not about the format. | |
| 23426 | 23450 | pub(crate) static SB128RECT_REPLAY_SPAN_MISMATCH_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; |
| 23427 | 23451 | } |
| 23428 | 23452 |
crates/ec-av1/src/refusal_inventory.rsmodified+6 -6
| @@ -84,9 +84,9 @@ const REFUSALS: &[&str] = &[ | ||
| 84 | 84 | // pixel-exact vs ffmpeg). |
| 85 | 85 | // lane-av1txr: `a sub-8x8 leaf that uses intrabc (…)` is GONE -- the |
| 86 | 86 | // capability landed in this lane (4x4 / 4x8 / 8x4 intrabc leaves read the |
| 87 | - // DV and reconstruct a frame copy + the INTER residual; gates | |
| 88 | - // `a_non_420_subsampled_sequence_header_is_refused_by_name`'s sibling | |
| 89 | - // witnesses and the `warped.obu`/`allintra.obu` traces). Its census gate | |
| 87 | + // DV and reconstruct a frame copy + the INTER residual; the sub-8x8 | |
| 88 | + // intrabc leaf witnesses in `stream.rs` and the `warped.obu` / | |
| 89 | + // `allintra.obu` traces). Its census gate | |
| 90 | 90 | // (`a_sub8_leaf_census_over_intrabc_screen_streams_measures_the_sub8_refusal`) |
| 91 | 91 | // still runs: it now reports `reached = 0` with the same non-vacuous |
| 92 | 92 | // premise (allow_intrabc frames + decoded sub-8 leaves). |
| @@ -512,9 +512,9 @@ const PROVEN: &[(&str, &str, Proof)] = &[ | ||
| 512 | 512 | // REFUSAL STRING, so it could not fail on a tree where 4:2:2 decode was |
| 513 | 513 | // completely broken -- it passed unchanged on the broken tree and would |
| 514 | 514 | // have kept passing if the port had been reverted. Its replacement |
| 515 | - // `a_real_422_stream_decodes_pixel_exact` (and the corpus battery | |
| 516 | - // `the_pinned_422_corpus_cells_decode_pixel_exact`) assert BYTE-EXACT | |
| 517 | - // planes against ffmpeg on real 4:2:2 streams, with the | |
| 515 | + // `a_real_422_key_frame_and_inter_sequence_decode_pixel_exact` (and the | |
| 516 | + // corpus battery `the_pinned_422_corpus_cells_decode_pixel_exact`) assert | |
| 517 | + // BYTE-EXACT planes against ffmpeg on real 4:2:2 streams, with the | |
| 518 | 518 | // per-plane coefficient-unit census as the non-vacuity arm. |
| 519 | 519 | // lane-av1txr-r2 paired, lane-av1-qmatrix RETIRED with its gate: the |
| 520 | 520 | // refusal's witness is now |
crates/ec-av1/src/stream.rsmodified+26 -17
| @@ -318,13 +318,16 @@ pub fn intra128_lossless_counters() -> usize { | ||
| 318 | 318 | |
| 319 | 319 | /// lane-av1-128rectspan: chroma transform units re-stamped by |
| 320 | 320 | /// `decode_block_128rect`'s end-of-block replay, and how many of those |
| 321 | -/// replays stamped a height that was not the unit's own. lane-av1422lift: | |
| 322 | -/// that mismatch was described as "the 4:2:2 signature -- zero on every | |
| 323 | -/// stream this decoder admits, since 4:2:2 is refused by name at the | |
| 324 | -/// sequence header". 4:2:2 is decoded now, so the mismatch half is a live | |
| 325 | -/// detector on 4:2:2 streams and stays zero only because the per-axis span | |
| 326 | -/// is correct; the 4:2:2 rows of | |
| 327 | -/// `the_pinned_422_corpus_cells_decode_pixel_exact` assert that. | |
| 321 | +/// replays stamped a height that was not the unit's own. | |
| 322 | +/// lane-av1422lift: the second half was described as "the 4:2:2 signature -- | |
| 323 | +/// zero on every stream this decoder admits, since 4:2:2 is refused by name | |
| 324 | +/// at the sequence header", and that was TRUE. 4:2:2 is decoded now and the | |
| 325 | +/// mismatch is NOT zero: measured on this branch's tip, the two | |
| 326 | +/// `422_intrabc_sb128_strip*` pins each read `(72, 9)` while the other 19 | |
| 327 | +/// committed 4:2:2 cells read `(0, 0)`. Those two pins are byte-exact | |
| 328 | +/// against ffmpeg, so the non-zero half counts the arm's own designed case | |
| 329 | +/// and is not a defect. No 4:2:2 gate reads this pair; the two gates that do | |
| 330 | +/// are on 4:2:0 and 4:4:4 streams, where the half is structurally zero. | |
| 328 | 331 | pub fn sb128rect_chroma_replay_counters() -> (usize, usize) { |
| 329 | 332 | crate::decode::sb128rect_chroma_replay_hits() |
| 330 | 333 | } |
| @@ -9201,13 +9204,16 @@ pub(crate) mod tests { | ||
| 9201 | 9204 | // stopped replaying reads 0), and the mismatch half is the 4:2:2 |
| 9202 | 9205 | // signature: this stream is 4:4:4 (ss 0,0), where the unit's luma |
| 9203 | 9206 | // width and height are equal, so a replay that stamped one axis with |
| 9204 | - // the other's span would still read 0 here. lane-av1422lift: 4:2:2 is | |
| 9205 | 9207 | // decoded now, so this counter no longer "names the day 4:2:2 is |
| 9206 | - // admitted" -- the 4:2:2 rows of | |
| 9207 | - // `the_pinned_422_corpus_cells_decode_pixel_exact` read the mismatch | |
| 9208 | - // half on streams where the two spans actually differ, which is what | |
| 9209 | - // stops an 8-row spill below the block from corrupting the next | |
| 9210 | - // block's `txb_skip` silently. | |
| 9208 | + // admitted" -- it fires there. **DO NOT copy this zero assert onto a | |
| 9209 | + // 4:2:2 stream**: measured on this branch's tip, the two | |
| 9210 | + // `422_intrabc_sb128_strip*` pins each read `mismatch = 9` while | |
| 9211 | + // being byte-exact against ffmpeg, because the mismatch half counts | |
| 9212 | + // the replay's own designed 4:2:2 case rather than a defect. What | |
| 9213 | + // stops the 8-row spill below the block from corrupting the next | |
| 9214 | + // block's `txb_skip` is the per-axis span itself, and the 4:2:2 | |
| 9215 | + // exactness gates (`the_pinned_422_intrabc_sb128_strip_witnesses_ | |
| 9216 | + // decode_pixel_exact`) are what hold it -- not this counter. | |
| 9211 | 9217 | let after_replay = crate::decode::sb128rect_chroma_replay_hits(); |
| 9212 | 9218 | assert!( |
| 9213 | 9219 | after_replay.0 > before_replay.0, |
| @@ -10765,10 +10771,13 @@ pub(crate) mod tests { | ||
| 10765 | 10771 | // them over its own luma-mi rows -- the arm the span fix sits on, on |
| 10766 | 10772 | // the OTHER admitted ss (1,1). The mismatch half is the 4:2:2 |
| 10767 | 10773 | // signature; lane-av1422lift: 4:2:2 is decoded now, so this is no |
| 10768 | - // longer "the tripwire for the day it is not" -- it is a zero this | |
| 10769 | - // gate asserts on the stream in front of it, and the 4:2:2 rows of | |
| 10770 | - // `the_pinned_422_corpus_cells_decode_pixel_exact` assert the same | |
| 10771 | - // zero there. | |
| 10774 | + // longer "the tripwire for the day it is not". It is a zero this gate | |
| 10775 | + // asserts about the stream in front of it, and nothing else. | |
| 10776 | + // **DO NOT carry it to a 4:2:2 stream**: the two | |
| 10777 | + // `422_intrabc_sb128_strip*` pins read `mismatch = 9` each and are | |
| 10778 | + // byte-exact against ffmpeg, so a 4:2:2 zero assert would red on a | |
| 10779 | + // provably correct cell. The 4:2:2 rows of the corpus gate read | |
| 10780 | + // neither half of this counter. | |
| 10772 | 10781 | let after_replay = crate::decode::sb128rect_chroma_replay_hits(); |
| 10773 | 10782 | assert!( |
| 10774 | 10783 | after_replay.0 > before_replay.0, |