lane-av1422liftverify: land the refutation pass report for the 4:2:2 lift
Browse files at this commite1899993989a5f4060f56e0374d8e499aa9b5ca9Parent: 8d3f38a1 changed file +407 -0
- lanes/av1422liftverify.report.md +407 -0
lanes/av1422liftverify.report.mdadded+407 -0
| @@ -0,0 +1,407 @@ | |||
| 1 | +# lane-av1422liftverify — refute-first pass over the 4:2:2 lift | ||
| 2 | + | ||
| 3 | +**Subject**: `b7a36001` (code) + `dc07ddb3` / `eb808df0` / `2ebb86ba` (report), branch `lane/av1422lift`. | ||
| 4 | +**Base**: `4f206ec3` (`main`). **Tip**: `2ebb86ba`. | ||
| 5 | +**Question answered**: does the lift change any behaviour for the formats it is not about, and are its | ||
| 6 | +new assertions / fixtures / gates / comments honest? | ||
| 7 | + | ||
| 8 | +## Trees and instruments (all absolute, nothing in the primary checkout) | ||
| 9 | + | ||
| 10 | +| role | path | head | | ||
| 11 | +|---|---|---| | ||
| 12 | +| review worktree (read-only on the branch) | `/home/user/.cache/wt/av1422liftverify` | `2ebb86ba` | | ||
| 13 | +| base worktree for the A/B | `/home/user/.cache/wt/mainref_4f206ec3` | `4f206ec3` (detached) | | ||
| 14 | +| mutation worktree (throwaway, restored) | `/home/user/.cache/wt/liftmut` | `2ebb86ba` (detached) | | ||
| 15 | + | ||
| 16 | +Three separate `CARGO_TARGET_DIR`s (`wt-target-liftverify`, `wt-target-mainref`, `wt-target-mut`) so no | ||
| 17 | +binary is ever shared across trees. Oracle: ffmpeg 8.1.3 on this host. Every 4:2:2 gate was run with | ||
| 18 | +`EC_AV1_REQUIRE_FFMPEG=1` so the `have_ffmpeg()` early return cannot turn into a silent green. | ||
| 19 | + | ||
| 20 | +## Verdict per item | ||
| 21 | + | ||
| 22 | +| # | item | verdict | | ||
| 23 | +|---|---|---| | ||
| 24 | +| 1 | 4:2:0 / 4:4:4 decode is byte-identical to `4f206ec3` | **CONFIRMED** — 45/45 cells, byte-for-byte | | ||
| 25 | +| 2 | `!(ss_x == 0 && ss_y == 1)` holds for every shape the parser can produce; right place | **CONFIRMED** | | ||
| 26 | +| 3 | REFUSALS row + PROVEN tuple removed together; inventory gates still bite | **CONFIRMED** — 3/3 mutations red | | ||
| 27 | +| 4 | the two new fixtures: pins, genuineness, not the old header/tile pin, gates assert pixels | **CONFIRMED** | | ||
| 28 | +| 5 | the six renamed `the_pinned_422_*` gates are real pixel claims and they bite | **CONFIRMED** — 6/6 red on a 1-LSB error | | ||
| 29 | +| 6 | corrected comments do not claim more than the code does | **REFUTED** — 6 sites, one of them contradicted by measurement | | ||
| 30 | + | ||
| 31 | +Nothing in items 1–5 is wrong. Item 6 is: the lift replaced four *true* "no committed test can read | ||
| 32 | +this counter" statements with *false* "the corpus gate reads this counter" statements, and one of the | ||
| 33 | +four is contradicted by the branch's own committed fixture. | ||
| 34 | + | ||
| 35 | +--- | ||
| 36 | + | ||
| 37 | +## 1. Format-independence — CONFIRMED | ||
| 38 | + | ||
| 39 | +**Method**: `examples/dump_yuv` on **both** trees (per-frame planar YUV, display order, one byte per | ||
| 40 | +sample at 8-bit and little-endian `u16` at 10/12-bit, sample depth taken from the stream's own parsed | ||
| 41 | +sequence header, never from the file name), then `sha256` over the concatenated frames of each side | ||
| 42 | +and a string compare. 45 committed fixtures, 13.9 GiB-free, two `cargo build`s, no oracle involved — | ||
| 43 | +this is our-decoder-vs-our-decoder, and `dump_yuv` writes `decode_stream`'s returned picture, which | ||
| 44 | +is **post**-film-grain (unlike the pre-grain `EC_AV1_FINAL_DUMP` rung), so the grain row is a | ||
| 45 | +full-strength identity claim and not a weakened one. | ||
| 46 | + | ||
| 47 | +``` | ||
| 48 | +for c in <cell>; do | ||
| 49 | + $BDBIN $BR/$c $OUT/b/$n/p ; $MDBIN $MAIN/$c $OUT/m/$n/p | ||
| 50 | + bh=$(cat $OUT/b/$n/p.f*.yuv | sha256sum) ; mh=$(cat $OUT/m/$n/p.f*.yuv | sha256sum) | ||
| 51 | +done | ||
| 52 | +``` | ||
| 53 | + | ||
| 54 | +### Batch 1 (24 cells) — `identical=24 differing=0` | ||
| 55 | + | ||
| 56 | +| format / depth | cells | result | | ||
| 57 | +|---|---|---| | ||
| 58 | +| 4:2:0 8-bit | `av1_192x128_8bit_intra64_in_inter`, `palette_screen_witness`, `filter_intra_8x16_strip_seed49`, `420_odd65x65_key`, `420_oddheight_320x236` | IDENTICAL | | ||
| 59 | +| 4:2:0 10/12-bit | `intra14_256x192_10bit` (10), `av112bit-key` (12, profile 2), `screen12_palette` (12, profile 2) | IDENTICAL | | ||
| 60 | +| 4:2:0 **lossless** | `420_lossless_arf_1to4_320x240_5f`, `420_mixll_320x240_6f`, `lossless_sb128_rect_kf` | IDENTICAL | | ||
| 61 | +| 4:2:0 superres | `superres_kf_cdef_lr_64x64`, `superres_alltools_sb128_320x180` | IDENTICAL | | ||
| 62 | +| 4:2:0 grain | `grain_cdef_lr_128x128` | IDENTICAL | | ||
| 63 | +| 4:4:4 8-bit | `444_lossy_rect4_wide_256x128`, `444_quad_leaf_tx_type`, `r512_rect1x2_444_palette`, `444_lossy_rect4_odd_130x122` | IDENTICAL | | ||
| 64 | +| 4:4:4 10/12-bit | `444_lossy_palette_chroma_352x242_10b`, `444_palette_chroma_hstrip_640x480_12b`, `444_lossy_superres_256x128_d12_12bit` | IDENTICAL | | ||
| 65 | +| 4:4:4 **lossless** | `ll444-lossless-key`, `ll444_128root_lossless` (10), `ll444_minp8_inter` | IDENTICAL | | ||
| 66 | + | ||
| 67 | +### Batch 2 (21 cells) — `identical=21 differing=0` | ||
| 68 | + | ||
| 69 | +`reelb_ss300_key_frame`, `reelb_ss600_key_frame`, `mix176_offtile_chroma_clip`, `ii-flake-{1,5,9}` (24f | ||
| 70 | +each), `rect-flake-{1,3}` (24f each), `golden3-pin`, `golden6-mismatch`, `reelb_kf900`, `reelc_kf2700`, | ||
| 71 | +`reelb_arf_witness` (37f), `lr-sgr-r7`, `420_intrabc_rect4_witness`, `444_intrabc_rect4_witness`, | ||
| 72 | +`444_intra_in_inter_128root_mu_chroma`, `intra128_in_inter_witness`, | ||
| 73 | +`palette_screen_strip16_witness_10bit`, `r512_rect2x1_1x2_444`. | ||
| 74 | + | ||
| 75 | +**Determinism control.** The largest cell (`reelb_arf_witness.obu`, 37 frames, 18.5 MB/frame) was | ||
| 76 | +re-decoded three times per tree to prove the A/B is not measuring scheduler noise: | ||
| 77 | +`tip run1/2/3` and `base run1/2/3` all hash `0e712dfd822bb50d`, `cmp -l` differing bytes = 0. | ||
| 78 | +(An earlier single-shot reading of that cell looked like a difference; it was a dump read while the | ||
| 79 | +sweep was still writing it. The repeated runs are the number I stand behind.) | ||
| 80 | + | ||
| 81 | +### Why this is not luck, and the one thing to keep in mind | ||
| 82 | + | ||
| 83 | +The production-code delta is provably one statement. Filtering the whole `decode.rs` + `stream.rs` | ||
| 84 | +diff to lines that are not comments, not blank and not inside `mod tests` yields exactly the old | ||
| 85 | +refusal and the new `assert!` — nothing else: | ||
| 86 | + | ||
| 87 | +``` | ||
| 88 | +- if seq.subsampling_x != seq.subsampling_y { | ||
| 89 | +- return Err(Error::unsupported( | ||
| 90 | +- "AV1 decode_stream", | ||
| 91 | +- "a chroma format of 4:2:2 (subsampling_x != subsampling_y): ...", | ||
| 92 | +- )); | ||
| 93 | +- } | ||
| 94 | ++ assert!( | ||
| 95 | ++ !(seq.subsampling_x == 0 && seq.subsampling_y == 1), | ||
| 96 | ++ "AV1 decode_stream: a parsed color_config carried 4:4:0 ..." | ||
| 97 | ++ ); | ||
| 98 | +``` | ||
| 99 | + | ||
| 100 | +The old condition `ss_x != ss_y` is **false** for 4:2:0 (1,1) and 4:4:4 (0,0), so for every stream | ||
| 101 | +outside the lift the two versions execute the same statement list. The 45 cells are the measurement | ||
| 102 | +of that argument, not the argument itself. | ||
| 103 | + | ||
| 104 | +*One caveat for whoever reads the dump numbers later*: none for grain (see above), but these are | ||
| 105 | +identity claims between two builds, not correctness claims against ffmpeg. The ffmpeg comparisons | ||
| 106 | +are items 4 and 5's job, and they are per-frame and post-grain there. | ||
| 107 | + | ||
| 108 | +--- | ||
| 109 | + | ||
| 110 | +## 2. The assertion replacing the refusal — CONFIRMED | ||
| 111 | + | ||
| 112 | +**Read the parser, not the comment.** `crates/ec-av1-syntax/src/sequence.rs:427-504`, | ||
| 113 | +`read_color_config(r, seq_profile)`. Exhaustive over the three profiles: | ||
| 114 | + | ||
| 115 | +| branch | condition | `(subsampling_x, subsampling_y)` produced | | ||
| 116 | +|---|---|---| | ||
| 117 | +| `:454` | `mono_chrome` (any profile except 1, where it is not coded) | `(1, 1)` — assigned, never read | | ||
| 118 | +| `:463` | sRGB identity description (primaries 1, transfer 13, matrix 0) | `(0, 0)` — assigned, never read | | ||
| 119 | +| `:470` | profile 0 | `(1, 1)` | | ||
| 120 | +| `:474` | profile 1 | `(0, 0)` | | ||
| 121 | +| `:479-485` | profile 2, `bit_depth == 12` | `sx = read_bits(1)`; `sy = read_bits(1)` **only if `sx == 1`**, else `0` | | ||
| 122 | +| `:486-490` | profile 2, below 12 bits | `(1, 0)` | | ||
| 123 | + | ||
| 124 | +So the produced set is exactly `{(1,1), (0,0), (1,0)}` and `(0,1)` is never produced: the only | ||
| 125 | +`sites that can set `subsampling_y` to `1` are the two *assignments* `(1,1)`, and the only site that | ||
| 126 | +reads a coded `subsampling_y` gates that read on `subsampling_x == 1`. `!(sx == 0 && sy == 1)` | ||
| 127 | +therefore holds over the whole reachable domain, and the existing crate-side test | ||
| 128 | +`the_440_cell_is_not_a_codable_chroma_shape` plus `read_color_config`'s own unit tests | ||
| 129 | +(`profile_shapes_the_subsampling`) pin it from both ends. | ||
| 130 | + | ||
| 131 | +**Placement.** `SeqFlags` has exactly one constructor, `SeqFlags::read(parser)` | ||
| 132 | +(`stream.rs:1401-1420`), which reads `parser.sequence_header()` and `map_or(1, …)`s the subsampling | ||
| 133 | +when no header has been seen. So the assert at `stream.rs:1808` is reachable only with a parsed | ||
| 134 | +header, and with no header at all the pair defaults to `(1,1)`, which passes. The only other | ||
| 135 | +`decode::set_subsampling` call site in the tree is `film_grain.rs:2591`, inside a `#[test]` | ||
| 136 | +(`ragged_overlap_tail_matches_spec_reference`); the single production site is `stream.rs:1918`, | ||
| 137 | +inside `decode_frame`, below the assert. Nothing feeds `FrameCtx` a shape the assert did not see. | ||
| 138 | + | ||
| 139 | +`assert!` (not `debug_assert!`) is the right call here and is this repository's stated convention for | ||
| 140 | +a proven-unreachable arm; a hostile 4:4:0 stream cannot exist, so this does not convert an `Err` into | ||
| 141 | +a panic on any reachable input. | ||
| 142 | + | ||
| 143 | +**4:2:0 / 4:4:4 still parse and decode unchanged** — item 1's 45 cells, all of which take this same | ||
| 144 | +`assert!` on every frame. | ||
| 145 | + | ||
| 146 | +--- | ||
| 147 | + | ||
| 148 | +## 3. Inventory consistency — CONFIRMED | ||
| 149 | + | ||
| 150 | +Baseline on the clean tip, all five inventory gates green: | ||
| 151 | + | ||
| 152 | +``` | ||
| 153 | +cargo test -p ec-av1 --lib -- the_decode_path_refuses_exactly_the_listed_cases \ | ||
| 154 | + every_proven_refusal_names_a_test_that_exists every_named_gate_body_is_bounded_in_these_files \ | ||
| 155 | + capability_claims_are_declared_not_scattered gates_that_swallow_a_decode_error_are_declared | ||
| 156 | +=> 5 passed; 0 failed | ||
| 157 | +``` | ||
| 158 | + | ||
| 159 | +`the_decode_path_refuses_exactly_the_listed_cases` is a bidirectional set equality between the | ||
| 160 | +strings harvested from `Error::unsupported(...)` in `decode.rs` + `stream.rs` and | ||
| 161 | +`CAPABILITY_CLAIMS ∪ REFUSALS`, so each of the three deletions below is independently load-bearing. | ||
| 162 | +All three mutations were applied in `/home/user/.cache/wt/liftmut` and reverted with | ||
| 163 | +`git checkout --`; the branch tip was never edited. | ||
| 164 | + | ||
| 165 | +**M5 — restore the guard in the decode path only** (row still deleted), `sed -i '1808i …' stream.rs`: | ||
| 166 | + | ||
| 167 | +``` | ||
| 168 | +test the_decode_path_refuses_exactly_the_listed_cases ... FAILED | ||
| 169 | + new decode-path refusals are not in the inventory: [ | ||
| 170 | +``` | ||
| 171 | + | ||
| 172 | +**M3 — restore the `REFUSALS` row only** (decode path still lifted), `sed -i '137i …' refusal_inventory.rs`: | ||
| 173 | + | ||
| 174 | +``` | ||
| 175 | +test the_decode_path_refuses_exactly_the_listed_cases ... FAILED | ||
| 176 | + these refusals are listed but no longer in the decode path: [ | ||
| 177 | +``` | ||
| 178 | + | ||
| 179 | +**M4 — restore the `PROVEN` tuple only**, `sed -i '519i …' refusal_inventory.rs`: | ||
| 180 | + | ||
| 181 | +``` | ||
| 182 | +test every_proven_refusal_names_a_test_that_exists ... FAILED | ||
| 183 | + "a chroma format of 4:2:2 (...)" is listed as proven but is no longer a decode-path refusal | ||
| 184 | +test every_named_gate_body_is_bounded_in_these_files ... FAILED | ||
| 185 | +``` | ||
| 186 | + | ||
| 187 | +3/3. The row and the tuple could not have been deleted independently without a red, and neither | ||
| 188 | +deletion is currently hiding anything. | ||
| 189 | + | ||
| 190 | +--- | ||
| 191 | + | ||
| 192 | +## 4. The two new fixtures — CONFIRMED | ||
| 193 | + | ||
| 194 | +**Pins reproduced independently** (`sha256sum` + `stat`, not the report's own table): | ||
| 195 | + | ||
| 196 | +| pin | bytes | sha256 measured | matches the pin in the test | fnv1a64 checked in-process by `read_pin` | | ||
| 197 | +|---|---|---|---|---| | ||
| 198 | +| `422_key_64x64.obu` | 755 | `3c9396c9e42701d720419ec2cb5577387e305482df0cb150f7f0b965edeaaffc` | yes | `0x87fc569cf53bcbc6` | | ||
| 199 | +| `422_inter_160x128_3f.obu` | 6522 | `7b54834c18f5fdc0e8606a6dc5bf4ff368402417d87fcfc2ab9758e4e9164902` | yes | `0xf87eba3bf4fc2bb8` | | ||
| 200 | + | ||
| 201 | +(also reproduced: `s422_12bit_160x128.obu` 9214 / `eacc70f7…`, `s422_superres_160x128.obu` 5304 / | ||
| 202 | +`5852ff2c…`, `s422_grain_160x128.obu` 5433 / `a4a6957b…`, and the six corpus cells' sha256 columns | ||
| 203 | +as printed by the gate at run time.) | ||
| 204 | + | ||
| 205 | +**Genuinely 4:2:2.** `dump_yuv` prints each stream's own parsed header: both new pins are | ||
| 206 | +`seq_profile 2, subsampling 1/0, mono_chrome false`, `yuv422p`. And they round-trip: | ||
| 207 | + | ||
| 208 | +``` | ||
| 209 | +$ ffmpeg -v error -f obu -i 422_key_64x64.obu -f rawvideo -pix_fmt yuv422p ff.yuv | ||
| 210 | +$ cat p.f*.yuv > ours.all ; cmp ours.all ff.yuv | ||
| 211 | + 422_key_64x64 ours=8192B ffmpeg=8192B -> BYTE-EXACT over all frames | ||
| 212 | + 422_inter_160x128_3f ours=122880B ffmpeg=122880B -> BYTE-EXACT over all frames | ||
| 213 | +``` | ||
| 214 | + | ||
| 215 | +**Not the old 4:2:0-tile-behind-a-4:2:2-header construction.** The construction the lifted gate used | ||
| 216 | +to be built in memory (`encode_key_frame_with_ctx(test_card(64,64))` + a hand-set profile-2 header); | ||
| 217 | +the one committed pin of that shape is `440_request_is_422.obu`. I decoded it through the same | ||
| 218 | +comparator to make the distinction measured rather than asserted: | ||
| 219 | + | ||
| 220 | +``` | ||
| 221 | +440_request_is_422 ours=8192B ffmpeg=0B -> ffmpeg produced NO output | ||
| 222 | +``` | ||
| 223 | + | ||
| 224 | +Same header shape, and ffmpeg cannot walk the tile at all — there is no oracle for those bytes. So | ||
| 225 | +the branch's decision to keep that pin as a *shape* witness (assert `32x64` chroma geometry, assert | ||
| 226 | +the chroma walk ran, claim no pixels) and to move the pixel claim onto real 4:2:2 bytes is the only | ||
| 227 | +honest option available, and the report says so in the same words. The new pins are not that | ||
| 228 | +construction: they are the first 4:2:2 bytes in the tree that an oracle can read. | ||
| 229 | + | ||
| 230 | +**Each gate asserts byte-exactness, not a header.** See item 5 — all six renamed gates plus the four | ||
| 231 | +new ones red on a single-LSB decode error, so none of them can be a header-only gate that passes on a | ||
| 232 | +broken decoder. The census arm is real too, measured on the tip: `422_key_64x64` walks | ||
| 233 | +`units=[54, 22, 22] coded=[21, 21, 20]`, `422_inter_160x128_3f` `[497, 277, 277] / [123, 256, 202]`, | ||
| 234 | +`s422_12bit_160x128` `[1037, 529, 529] / [281, 371, 384]`, `s422_superres_160x128` | ||
| 235 | +`[797, 325, 325] / [168, 202, 216]`, and the six corpus rows `[2118,1218,1218]` … `[2927,1426,1426]` | ||
| 236 | +with `coded` non-zero on all three planes of every row. Nothing narrows at HBD: the 12-bit row reds | ||
| 237 | +with `3542 vs 3541`, i.e. 16-bit containers on both sides. | ||
| 238 | + | ||
| 239 | +*Disclosed, not a defect*: the six corpus rows print their sha256 with `eprintln!` instead of | ||
| 240 | +asserting it (the in-process pin is size + fnv1a64), and the test says so in a comment. | ||
| 241 | + | ||
| 242 | +--- | ||
| 243 | + | ||
| 244 | +## 5. The six renamed gates — CONFIRMED, 6/6 bite | ||
| 245 | + | ||
| 246 | +Mutation **M1b**, applied in the scratch worktree at `stream.rs:2236` (right where the picture is | ||
| 247 | +handed to the reference store and to the caller) — a one-LSB chroma decode error with the plane | ||
| 248 | +**shape untouched**, so the shape guard cannot be what reds: | ||
| 249 | + | ||
| 250 | +```rust | ||
| 251 | +// MUTATION M1b: a single-LSB chroma decode error; plane SHAPE untouched. | ||
| 252 | +let mut picture = picture; | ||
| 253 | +if let Some(s) = picture.u.first_mut() { *s = s.saturating_add(1); } | ||
| 254 | +``` | ||
| 255 | + | ||
| 256 | +``` | ||
| 257 | +test the_pinned_422_bigblock_witnesses_decode_pixel_exact ... FAILED | ||
| 258 | + U differs from ffmpeg at frame 0 sample 0 (129 vs 128; 1 of 8192 samples differ) | ||
| 259 | +test the_pinned_422_intrabc_sb128_strip_witnesses_decode_pixel_exact ... FAILED | ||
| 260 | + U differs from ffmpeg at frame 0 sample 0 (130 vs 129; 1 of 61440 samples differ) | ||
| 261 | +test the_pinned_422_lossless_inter_witnesses_decode_pixel_exact ... FAILED | ||
| 262 | + U differs from ffmpeg at frame 0 sample 0 (222 vs 221; 1 of 38400 samples differ) | ||
| 263 | +test the_pinned_422_residual_compound_warp_witness_decodes_pixel_exact ... FAILED | ||
| 264 | + U differs from ffmpeg at frame 0 sample 0 (141 vs 140; 1 of 36864 samples differ) | ||
| 265 | +test the_pinned_422_lr_off_witness_decodes_pixel_exact ... FAILED | ||
| 266 | + U differs from ffmpeg at frame 0 sample 0 (141 vs 140; 1 of 36864 samples differ) | ||
| 267 | +test the_pinned_422_corpus_cells_decode_pixel_exact ... FAILED | ||
| 268 | + U differs from ffmpeg at frame 0 sample 0 (223 vs 222; 1 of 39360 samples differ) | ||
| 269 | +=> test result: FAILED. 1 passed; 9 failed | ||
| 270 | +``` | ||
| 271 | + | ||
| 272 | +The seventh 4:2:2 gate that stays green, `the_440_cell_is_not_a_codable_chroma_shape`, is supposed | ||
| 273 | +to: it makes a geometry claim and says in its own comment that its tile has no oracle. A green there | ||
| 274 | +under M1b is the correct outcome, not a hole. | ||
| 275 | + | ||
| 276 | +A second mutation **M1** — `set_subsampling` hardcoding the 4:2:0 chroma *height* on a `(1,0)` stream | ||
| 277 | +— reds all 10 of the 4:2:2 gates on the shape assertion, which is the complementary proof that the | ||
| 278 | +geometry half of the claim is load-bearing too. | ||
| 279 | + | ||
| 280 | +--- | ||
| 281 | + | ||
| 282 | +## 6. Prose — REFUTED at six sites | ||
| 283 | + | ||
| 284 | +Instrument: a throwaway `examples/liftprobe.rs` in the scratch worktree (removed afterwards) that | ||
| 285 | +decodes one fixture and prints `sb128rect_chroma_replay_counters()`, | ||
| 286 | +`rect_tiled_chroma_grid_hits()` and the census, plus `grep` for the readers of each named counter. | ||
| 287 | + | ||
| 288 | +### 6.1 `decode.rs:23415-23425` — the one that measurement contradicts | ||
| 289 | + | ||
| 290 | +The rewritten doc for `SB128RECT_REPLAY_SPAN_MISMATCH_HITS` says the counter is "a REAL detector, not | ||
| 291 | +a defensive arm … the 4:2:2 row of `the_pinned_422_corpus_cells_decode_pixel_exact` asserts it stays | ||
| 292 | +zero there too, which is the claim that replaces *it cannot fire*". Both halves are false: | ||
| 293 | + | ||
| 294 | +* the corpus gate never reads it. Its only counter reads are `census_nonsub_units` / | ||
| 295 | + `census_nonsub_coded` inside the shared `assert_422_stream_pixel_exact` body; the only two gates that | ||
| 296 | + do read `sb128rect_chroma_replay_hits()` are `a_444_sb128_root_rect_stream_with_restoration_decodes_pixel_exact` | ||
| 297 | + (`stream.rs:9188/9211`, 4:4:4) and `a_lossless_sb128_rect_intra_block_decodes_sample_exact` | ||
| 298 | + (`10753/10772`, 4:2:0 lossless) — neither is a 4:2:2 stream. | ||
| 299 | +* it does not stay zero. On the branch tip, over all 21 committed 4:2:2 cells: | ||
| 300 | + | ||
| 301 | +``` | ||
| 302 | +422_intrabc_sb128_strip.obu sb128rect_replay=72 sb128rect_mismatch=9 frames=5 | ||
| 303 | +422_intrabc_sb128_strip_notxsearch.obu sb128rect_replay=72 sb128rect_mismatch=9 frames=5 | ||
| 304 | +(all 19 other 4:2:2 cells) mismatch=0 | ||
| 305 | +``` | ||
| 306 | + | ||
| 307 | +`422_intrabc_sb128_strip.obu` is one of the pins | ||
| 308 | +`the_pinned_422_intrabc_sb128_strip_witnesses_decode_pixel_exact` asserts **byte-exact against | ||
| 309 | +ffmpeg**, and it is green. So the counter documented as "must be zero, and a gate asserts it" reads | ||
| 310 | +9 on a byte-exact cell, and the gate named as the asserting one never looks. Adding the read the | ||
| 311 | +comment promises would turn a green gate red on a cell that is provably correct. | ||
| 312 | + | ||
| 313 | +This is also the one place where the lift destroyed a *true* statement: pre-lift the doc said "Zero on | ||
| 314 | +every stream this decoder admits … 4:2:2 … is refused by name at the sequence header", and that was | ||
| 315 | +correct. Admission of 4:2:2 genuinely made the counter able to fire — the lift just did not notice, | ||
| 316 | +and wrote down the opposite. | ||
| 317 | + | ||
| 318 | +### 6.2 `decode.rs:2859-2864` — `RECT_TILED_CHROMA_NXN_HITS` | ||
| 319 | + | ||
| 320 | +"The corpus gate … reads this counter as a non-vacuity arm", and "a 4:2:2 block whose chroma plane | ||
| 321 | +is wider than tall relative to its luma span lands here". The corpus gate does not read it. The only | ||
| 322 | +two readers of `rect_tiled_chroma_grid_hits()` are `a_444_rect_strip_chroma_tiled_*` (4:4:4, | ||
| 323 | +`r512_rect1x2_444_palette.obu`), and there `h_nxn` is bound and interpolated into a failure message, | ||
| 324 | +never asserted. Measured `nxn` on all 21 committed 4:2:2 cells and on the 4:2:0 / 4:4:4 cells | ||
| 325 | +probed: **0 everywhere**. The reachability claim is aspirational — no committed 4:2:2 stream lands | ||
| 326 | +in that arm. | ||
| 327 | + | ||
| 328 | +### 6.3 `decode.rs:6139-6145` — `INTRABC_RECT4_OWN_CHROMA422_HITS` | ||
| 329 | + | ||
| 330 | +"committed tests CAN read this counter now; `the_pinned_422_corpus_cells_decode_pixel_exact` reads | ||
| 331 | +its delta on every corpus row". Its accessor `intrabc_rect4_own_chroma422_hits()` | ||
| 332 | +(`decode.rs:6152`) has **zero callers** in the crate — the 4:4:4 twin is read at `stream.rs:10260` | ||
| 333 | +and `10279`, this one nowhere. The corpus gate reads no delta of it. Pre-lift wording ("no committed | ||
| 334 | +test can read it") was true; the replacement is false. | ||
| 335 | + | ||
| 336 | +### 6.4 `stream.rs:319-327` — public API doc, same false claim | ||
| 337 | + | ||
| 338 | +`sb128rect_chroma_replay_counters` is `pub`, and its doc ends "the 4:2:2 rows of | ||
| 339 | +`the_pinned_422_corpus_cells_decode_pixel_exact` assert that [the mismatch stays zero]". Same | ||
| 340 | +misattribution, same 9. Repeated inside the two tripwire gates' own comments at | ||
| 341 | +`stream.rs:9201-9207` and `10764-10771` ("read the mismatch half on streams where the two spans | ||
| 342 | +actually differ", "the 4:2:2 rows … assert the same zero there") — which is worse there, because | ||
| 343 | +those are the gates that *do* read the counter, and a reader would reasonably add the missing 4:2:2 | ||
| 344 | +assert to one of them and get a red on a correct cell. | ||
| 345 | + | ||
| 346 | +### 6.5 `refusal_inventory.rs:515` — names a gate that does not exist | ||
| 347 | + | ||
| 348 | +The replacement note says the old refusal's replacement is `a_real_422_stream_decodes_pixel_exact`. | ||
| 349 | +There is no such test. The gate is `a_real_422_key_frame_and_inter_sequence_decode_pixel_exact` | ||
| 350 | +(`stream.rs:2354`). In the file whose entire job is naming gates, and in the paragraph a future | ||
| 351 | +reader follows to find the evidence for the lift. | ||
| 352 | + | ||
| 353 | +### 6.6 `refusal_inventory.rs:88` — dangling reference to the deleted gate | ||
| 354 | + | ||
| 355 | +`a_non_420_subsampled_sequence_header_is_refused_by_name`'s sibling witnesses — the patch deleted | ||
| 356 | +that test, so the sibling it names no longer exists. Not in the diff's hunks, but the staleness is | ||
| 357 | +introduced by this patch, which is what removed the symbol. | ||
| 358 | + | ||
| 359 | +### 6.7 Checked and sound | ||
| 360 | + | ||
| 361 | +| site | claim | verdict | | ||
| 362 | +|---|---|---| | ||
| 363 | +| `stream.rs:1388-1396` (`SeqFlags` doc) | subsampling is "load-bearing on the DECODE path", published through `decode::set_subsampling` and read per axis | **CONFIRMED** — `set_subsampling` has exactly one production call site (`stream.rs:1918`) | | ||
| 364 | +| `stream.rs:17009-17018` | "the header admits ss (1,1), (1,0) and (0,0), and the (1,0) 4:2:2 arm is dispatched a few lines below (`chroma422_rect32`)" | **CONFIRMED** (dispatch is real, at `decode.rs:17060`; "a few lines" is 42, a nit) | | ||
| 365 | +| `stream.rs:52058-52065` (`cfl_ac_ss`) | "`cfl_ac_ss` DISPATCHES ss (1,0) before the 4:2:0 fallthrough" | **CONFIRMED** — `decode.rs:21007` `else if ss_x == 1 && ss_y == 0`, fallthrough at `21031`/`21034` | | ||
| 366 | +| `lanes/av1422lift.report.md:89-93` | the non-vacuity arm is the census, "not a 4:2:2 arm counter" | **CONFIRMED** — and notably the report does *not* repeat the false claim its own in-code comments make | | ||
| 367 | +| the all-skip row's negative measurement (`coded_delta == (0,0)`) | the cell's identity is that it codes nothing | **CONFIRMED** — measured `units=[4,8,8] coded=[1,0,0]` | | ||
| 368 | + | ||
| 369 | +--- | ||
| 370 | + | ||
| 371 | +## Findings, ranked | ||
| 372 | + | ||
| 373 | +| # | site | what is wrong | fix | | ||
| 374 | +|---|---|---|---| | ||
| 375 | +| 1 | `decode.rs:23415-23425` | claims a 4:2:2 gate asserts `SB128RECT_REPLAY_SPAN_MISMATCH_HITS` stays zero; no gate reads it and it reads **9** on a byte-exact committed 4:2:2 pin | either measure and document the 9, or state the predicate is not a 4:2:2 defect signature; drop the gate attribution | | ||
| 376 | +| 2 | `decode.rs:2859-2864` | claims the corpus gate reads `RECT_TILED_CHROMA_NXN_HITS` as a non-vacuity arm; nothing does, and the arm reads 0 on all 21 committed 4:2:2 cells | say the arm is unwitnessed, not that a gate reads it | | ||
| 377 | +| 3 | `decode.rs:6139-6145` | claims committed tests now read `INTRABC_RECT4_OWN_CHROMA422_HITS` and that the corpus gate reads its delta per row; its accessor has zero callers | restore "no committed test reads it", or add the read | | ||
| 378 | +| 4 | `stream.rs:319-327` (+ `9201-9207`, `10764-10771`) | public API doc and two gate comments repeat finding 1's false attribution, and the two gate comments invite adding a read that would red on a correct cell | same as finding 1 | | ||
| 379 | +| 5 | `refusal_inventory.rs:515` | names `a_real_422_stream_decodes_pixel_exact`; the gate is `a_real_422_key_frame_and_inter_sequence_decode_pixel_exact` | fix the name | | ||
| 380 | +| 6 | `refusal_inventory.rs:88` | still names the deleted `a_non_420_subsampled_sequence_header_is_refused_by_name` as a live sibling gate | drop or re-point the reference | | ||
| 381 | + | ||
| 382 | +Findings 1-4 are one class: the lift changed a true statement about a counter ("no committed test can | ||
| 383 | +read it", "zero on every admitted stream") into a false one about a gate ("the corpus gate reads | ||
| 384 | +it"). Nothing in items 1-5 of this review is wrong because of them — no decode result, no gate | ||
| 385 | +outcome and no pin depends on any of these six sentences — but the sentences are the load-bearing | ||
| 386 | +part of how this tree documents reachability, and a reader who acts on finding 1 or 4 lands a red on | ||
| 387 | +a cell that is byte-exact against ffmpeg. | ||
| 388 | + | ||
| 389 | +## What was not run | ||
| 390 | + | ||
| 391 | +* The three server suites and the branch's own full lib suite were already in flight elsewhere; I ran | ||
| 392 | + scoped named tests only, as assigned. | ||
| 393 | +* The corpus (`63`-cell) re-measurement, `s422_384x240`, and the 51/51 landing condition the corpus | ||
| 394 | + gate's doc states are the owning lane's/main's business; I did not re-measure the corpus. The | ||
| 395 | + branch declares that hold itself, in the gate's doc and in `av1422lift.report.md:226`, and that | ||
| 396 | + declaration is honest. | ||
| 397 | +* I did not re-encode any fixture; "genuine aomenc bytes" is established indirectly but decisively, | ||
| 398 | + by ffmpeg decoding all three frames of each new pin and our output matching byte for byte. | ||
| 399 | +* `a real aomenc 12-bit 4:2:2 stream is unreachable through aomenc on this libaom` (the provenance | ||
| 400 | + note for `s422_12bit_160x128.obu`) is the report's claim; I verified the pin's identity and its | ||
| 401 | + byte-exactness but did not re-run aomenc's `AV1E_SET_CHROMA_SUBSAMPLING_X` experiment. | ||
| 402 | + | ||
| 403 | +## Cleanliness | ||
| 404 | + | ||
| 405 | +`/home/user/.cache/wt/liftmut` restored (`git status --porcelain` empty, `liftprobe.rs` deleted); | ||
| 406 | +`/home/user/.cache/wt/av1422liftverify` carries no decoder change — this report is the only file | ||
| 407 | +added. Nothing pushed, `main` untouched, no `git add`/`git commit` from the primary checkout. | ||