lane-av1422re4222: re-measure the 4:2:2 surface on a live comparator; 23/30 exact, 4 diverge at height 242, 3 lossless cells panic
Browse files at this commitd5d0289f4a993eda0036e2da3f582dc6cc815d3bParent: 9714b2b1 changed file +383 -0
- lanes/av1422re4222.report.md +383 -0
lanes/av1422re4222.report.mdadded+383 -0
| @@ -0,0 +1,383 @@ | ||
| 1 | +# lane-av1422re4222 — the 4:2:2 decodable surface, re-measured on a LIVE comparator | |
| 2 | + | |
| 3 | +Base `facdcb73` (main), worktree `~/.cache/wt/av1422re4222`, branch | |
| 4 | +`lane-av1422re4222`. **Report-only: no source change is committed.** The | |
| 5 | +`EC_AV1_ALLOW_422_PROBE` bypass and the temporary cell driver were | |
| 6 | +patch-run-restore and are **not** in the commit; `git status` is clean and | |
| 7 | +`stream.rs:1803` reads `if seq.subsampling_x != seq.subsampling_y {` again. | |
| 8 | +The refusal string and header behaviour are untouched, as instructed. | |
| 9 | + | |
| 10 | +The four remaining `EC_AV1_ALLOW_422_PROBE` mentions in `stream.rs` (lines | |
| 11 | +2736, 2786, 2992, 3076) are pre-existing doc comments, not the gate. | |
| 12 | + | |
| 13 | +## Verdict, in one line | |
| 14 | + | |
| 15 | +**23 of 30 reachable 4:2:2 cells are byte-exact, and 7 are not: 4 diverge | |
| 16 | +(chroma-only, at frame HEIGHT 242) and 3 panic (every `--lossless=1` 4:2:2 | |
| 17 | +cell).** The 4:2:0 controls at the same geometries are all exact, so this is | |
| 18 | +not the 4:2:0 odd-height defect — that one is fixed on main. **The refusal is | |
| 19 | +still earning its keep**, for a narrower reason than the old argument gave. | |
| 20 | + | |
| 21 | +## The comparator, and its control | |
| 22 | + | |
| 23 | +The comparator is the crate's own audited pair, not a lane-local counter: | |
| 24 | + | |
| 25 | +- `count_rawvideo_diffs(stream, name, flip)` — `stream.rs:10374`. Presented | |
| 26 | + (shown) output, `aomdec --rawvideo` vs our packed samples, per-plane wrong | |
| 27 | + counts, `None` on a size mismatch. | |
| 28 | +- `decode_all_frames_vs_oracle(stream, name)` — `stream.rs:10276`. Decode | |
| 29 | + order, hidden alt-ref frames included, both sides on `EC_AV1_FINAL_DUMP`. | |
| 30 | + For the table I used a local COUNTING variant of the same two views (it | |
| 31 | + panics on the first differing byte, which cannot classify 30 cells in one | |
| 32 | + process); it is the same file pair, the same rungs, the same plane split. | |
| 33 | + | |
| 34 | +**Control, batch level, both green on this tree before any cell was measured:** | |
| 35 | + | |
| 36 | +- `the_counting_oracle_diff_detects_one_flipped_oracle_byte` — pass. | |
| 37 | + "baseline exact, each flipped oracle byte reported as exactly 1". | |
| 38 | +- `every_oracle_comparator_reds_on_a_one_byte_wrong_oracle` — pass. All five | |
| 39 | + oracle comparators go RED on a one-byte-wrong oracle. This is the permanent | |
| 40 | + control for the exact defect that got `lanes/av1422remeasure.report.md` | |
| 41 | + retracted. | |
| 42 | + | |
| 43 | +**Control, per cell, on the SAME comparator that produced the table.** Every | |
| 44 | +cell was measured four times with the same two helpers: once clean, and three | |
| 45 | +more times with ONE bit flipped in the ORACLE's own bytes — at the first | |
| 46 | +luma byte, the first U byte and the first V byte of frame 0. The flip | |
| 47 | +indices come from the first decoded picture, so the three controls really do | |
| 48 | +land in the three planes. A cell that reads 0 wrong clean and 0 wrong | |
| 49 | +flipped would be a comparator that had stopped reading the oracle; that does | |
| 50 | +not occur once in 30 cells. The per-cell `ctrl@` columns below carry it, and | |
| 51 | +the decode-order view carries its own `dctrl=` (same three flips, re-counted | |
| 52 | +against the `EC_AV1_FINAL_DUMP` frame 0). For an exact cell every control | |
| 53 | +reads `[1,0,0] [0,1,0] [0,0,1]` and `dctrl=[(..,1), (..,1), (..,1)]`; for a | |
| 54 | +diverging cell the control is that cell's own wrong-count plus exactly one, | |
| 55 | +in the right plane. | |
| 56 | + | |
| 57 | +Oracle: `~/.cache/aom-oracle/build/aomdec` (Sep 29 05:44, instrumented), | |
| 58 | +`aomenc` beside it (Aug 30 20:26). Sources: ffmpeg 8.1.2 `testsrc2`, | |
| 59 | +`mandelbrot`, `smptebars`. | |
| 60 | + | |
| 61 | +### Encoder recipe, and the two y4m traps | |
| 62 | + | |
| 63 | +``` | |
| 64 | +aomenc --codec=av1 --profile=2 --input-bit-depth=<bd> --bit-depth=<bd> \ | |
| 65 | + --limit=16 --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 \ | |
| 66 | + --pass=1 --cq-level=24 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | |
| 67 | + --width=W --height=H --cpu-used=0 <src>.y4m -o <n>.webm | |
| 68 | +ffmpeg -v error -i <n>.webm -c copy -f obu <n>.obu -y | |
| 69 | +``` | |
| 70 | + | |
| 71 | +Per-cell deltas are named in the table. Two y4m traps cost real time and are | |
| 72 | +worth writing down: | |
| 73 | + | |
| 74 | +1. libaom's y4m reader **requires the `YUV4MPEG2 ` magic**. A hand-built | |
| 75 | + header without it parses, finds the tags, and then encodes as 4:2:0 — | |
| 76 | + which surfaces as `Profile 2 bit-depth <= 10 requires 4:2:2 color format`, | |
| 77 | + a message that reads like a 4:2:2 problem and is not one. | |
| 78 | +2. The 4:2:2 chroma tag is **lowercase-p** at high bit depth: `C422p10`, | |
| 79 | + `C422p12`. `C422P10` is silently not `422p10`, and with the magic present | |
| 80 | + a wrong-case tag encodes 12-bit 4:2:0 rather than failing. | |
| 81 | + | |
| 82 | +## Per-cell table — 4:2:2 (30 cells) | |
| 83 | + | |
| 84 | +`bytes` = OBU size. `shown` = frames `decode_stream` returns. `wrong` = | |
| 85 | +per-plane differing samples over all shown frames, presented output. | |
| 86 | +`exact` = shown frames byte-identical. `decode order` = total frames | |
| 87 | +(hidden alt-ref in brackets) and how many are byte-identical, plus the | |
| 88 | +per-plane wrong counts over ALL decode-order frames and the first divergent | |
| 89 | +read. Per-cell control columns are in the raw run log. | |
| 90 | + | |
| 91 | +| cell | bytes | shown | wrong Y | wrong U | wrong V | exact shown | decode order (hidden) | exact in decode order | decode-order wrong [Y,U,V] | first divergent read | | |
| 92 | +|---|---|---|---|---|---|---|---|---|---|---| | |
| 93 | +| `422_allskip_2f` (pin) | 62 | 2 | 0 | 0 | 0 | 2/2 | 2 (0) | 2/2 | [0, 0, 0] | none | | |
| 94 | +| `422_intrabc_sb128_strip` (pin) | 1672 | 5 | 0 | 0 | 0 | 5/5 | 5 (0) | 5/5 | [0, 0, 0] | none | | |
| 95 | +| `422_intrabc_sb128_strip_notxsearch` (pin) | 1675 | 5 | 0 | 0 | 0 | 5/5 | 5 (0) | 5/5 | [0, 0, 0] | none | | |
| 96 | +| `422_residual_compound_warp_16f` (pin) | 38845 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 97 | +| `422_residual_compound_warp_nolr_16f` (pin) | 38538 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 98 | +| `422_sb128_3f` (pin) | 12543 | 3 | 0 | 0 | 0 | 3/3 | 3 (0) | 3/3 | [0, 0, 0] | none | | |
| 99 | +| `A_testsrc2_cpu0` 320x240 8-bit | 21584 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 100 | +| `B_testsrc2_cpu6` A + `--cpu-used=6` | 22570 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 101 | +| `C_mandel320` mandelbrot 320x240 | 30327 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 102 | +| `D_bars` smptebars 320x240 | 994 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 103 | +| `E_noglobal` A + `--enable-global-motion=0` | 21545 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 104 | +| `F_allintra` A + `--lag-in-frames=0 --auto-alt-ref=0` | 19937 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 105 | +| `H_10bit_testsrc2` 10-bit | 20628 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 106 | +| `I_10bit_mandel` 10-bit mandelbrot | 28770 | 16 | 0 | 0 | 0 | 16/16 | 16 (0) | 16/16 | [0, 0, 0] | none | | |
| 107 | +| `J_10bit_lr0` H + `--enable-restoration=0` | 20605 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 108 | +| `K_sct` A + `--cq-level=18 --tune=ssim` | 18792 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 109 | +| `L_tiled` A + `--tile-columns=1 --tile-rows=1` | 22553 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 110 | +| `T_tilecols2` A + `--tile-columns=2` | 22374 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 111 | +| `U_tilerows1` A + `--tile-rows=1` | 22009 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 112 | +| `V_tile2x2_odd` 322x242 + `--tile-columns=1 --tile-rows=1` | 22231 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 113 | +| `R_odd322x240` 322x**240**, odd width | 21303 | 16 | 0 | 0 | 0 | 16/16 | 17 (1) | 17/17 | [0, 0, 0] | none | | |
| 114 | +| `AA_inter_compound` 320x240 40f, arnr+gm+warp+chroma-deltaq+masked-comp | 53757 | 40 | 0 | 0 | 0 | 40/40 | 43 (3) | 43/43 | [0, 0, 0] | none | | |
| 115 | +| `AD_inter_nogm` AA + `--enable-global-motion=0` | 53832 | 40 | 0 | 0 | 0 | 40/40 | 43 (3) | 43/43 | [0, 0, 0] | none | | |
| 116 | +| **`O_odd322x242`** 322x**242** | 21490 | 16 | 0 | **32** | **1580** | **0/16** | 17 (1) | **0/17** | [0, **985**, **722**] | frame0/byte106388/plane1 got 203 want 202 | | |
| 117 | +| **`Q_odd320x242`** 320x**242** | 21381 | 16 | 0 | **422** | **22566** | **0/16** | 17 (1) | **0/17** | [0, **9603**, **14456**] | frame0/byte103156/plane1 got 182 want 202 | | |
| 118 | +| **`S_odd326x242_10b`** 326x**242** 10-bit | 20532 | 16 | 0 | **17** | **966** | **0/16** | 17 (1) | **0/17** | [0, **309**, **752**] | frame0/byte214112/plane1 got 38 want 40 | | |
| 119 | +| **`AB_inter_warp_odd`** 322x**242** 40f inter, arnr+gm+warp+comp | 53505 | 40 | 0 | **42** | **13786** | **0/40** | 43 (3) | **0/43** | [0, **3948**, **10984**] | frame0/byte80671/plane1 got 112 want 113 | | |
| 120 | +| **`W_intrabc`** A + `--lossless=1` | 130320 | — | — | — | — | — | — | — | **DECODER PANIC** | `decode.rs:37565` `range end index 20 out of range for slice of length 16` | | |
| 121 | +| **`X_intrabc_tiled`** W + `--tile-columns=1 --tile-rows=1` | 131696 | — | — | — | — | — | — | — | **DECODER PANIC** | same site | | |
| 122 | +| **`Y_intrabc_10b`** W at 10-bit | 202281 | — | — | — | — | — | — | — | **DECODER PANIC** | same site | | |
| 123 | + | |
| 124 | +sha256 (first 16 hex), all from `/tmp/av1422re/cells/`: | |
| 125 | + | |
| 126 | +``` | |
| 127 | +2e03b3fe92b17c35 A 7da006204c9f990c B 945510d22b5da687 C 6d3e3638c2f8cbfe D | |
| 128 | +efee4a80a745ee5f E a96a52339196b4a4 F f983ec21f7040cce H ecf4ffc5ac3ed11b I | |
| 129 | +fcfb47ce74d9c41c J 580bf8d7d459156c K 50c22276a6ad4864 L ad5d34f4c9ab7a24 T | |
| 130 | +ea54403736c3d006 U 59b5939ceb009509 V 1116a3603196db04 R ad9df9523c0a1f41 AA | |
| 131 | +707883a3c5c4bdcc AD 5af747bdb597a7a2 O 17304b6cca378034 Q 1116a3603196db04 R | |
| 132 | +cc3d3dcd34b40504 S 23c3a1769040080b AB 0aad0d6fdd236557 W e7c0c60af1a61531 X | |
| 133 | +ce84d7cb4cfadf3f Y | |
| 134 | +``` | |
| 135 | + | |
| 136 | +**The eleven 320x240 cells `A`–`L` reproduce the previous round's twelve fresh | |
| 137 | +cells byte for byte** (sha256 above matches `lanes/av1422remeasure.report.md` | |
| 138 | +exactly, including `O`), so this round is a like-for-like re-measurement plus | |
| 139 | +nine new cells. The previous round's conclusion for those twelve was produced | |
| 140 | +by the retracted tautological counter; on the live comparator, `A`–`L` are all | |
| 141 | +still exact and **`O_odd322x242` is NOT** — the previous report's "exact on | |
| 142 | +presented output, differing only in the decode-order view" for `O` was the | |
| 143 | +same broken comparator. It differs by 1612 presented samples, which is the | |
| 144 | +`O_odd322x242 1612` number `lanes/av1422anom.report.md` already recovered with | |
| 145 | +a correct comparator. | |
| 146 | + | |
| 147 | +## The six committed pins, re-verified individually | |
| 148 | + | |
| 149 | +Each pin was run through the same comparator, with the same three per-plane | |
| 150 | +oracle-flip controls (`ctrl@` = `[1,0,0]`, `[0,1,0]`, `[0,0,1]` on every one of | |
| 151 | +them, and `dctrl` = one differing byte per flipped byte in decode order). | |
| 152 | + | |
| 153 | +| pin | bytes | sha256 | shown | wrong Y/U/V | exact shown | decode order (hidden) | exact in decode order | | |
| 154 | +|---|---|---|---|---|---|---|---| | |
| 155 | +| `422_allskip_2f.obu` | 62 | `ba4932c14f95971b5f25321b04abce80c9fdd5de4b1fe6fffcdad82aaea87ce1` | 2 | 0/0/0 | 2/2 | 2 (0) | 2/2 | | |
| 156 | +| `422_sb128_3f.obu` | 12543 | `0b851799d99cb4d141a7d042138a3999aad7e0fb24d69c670bca1d38c286dce9` | 3 | 0/0/0 | 3/3 | 3 (0) | 3/3 | | |
| 157 | +| `422_intrabc_sb128_strip.obu` | 1672 | `f92000db86df7acc577d60dd1d0d97454bff4705799ea59d9de34eb5a71dbbcd` | 5 | 0/0/0 | 5/5 | 5 (0) | 5/5 | | |
| 158 | +| `422_intrabc_sb128_strip_notxsearch.obu` | 1675 | `80dd0d4e93fd6c3d4b7188a43e69d9638f2bece38edfab60ff3582628314b5ec` | 5 | 0/0/0 | 5/5 | 5 (0) | 5/5 | | |
| 159 | +| `422_residual_compound_warp_16f.obu` | 38845 | `d78e2afb43ce311d3d82335a945c6f80f62db4537966d881c1349a68b3aecb95` | 16 | 0/0/0 | 16/16 | 16 (0) | 16/16 | | |
| 160 | +| `422_residual_compound_warp_nolr_16f.obu` | 38538 | `8bed368f7ec4bca772137c6a9c2af89e1b2767ed5f937b91bd9e72ec60aeb42f` | 16 | 0/0/0 | 16/16 | 16 (0) | 16/16 | | |
| 161 | + | |
| 162 | +**6/6 exact, 0 wrong samples on any plane of any frame, in both views.** This | |
| 163 | +is the part that survives the retraction, re-established here with controls. | |
| 164 | + | |
| 165 | +## The 4:2:0 controls, and why the divergence is 4:2:2's own | |
| 166 | + | |
| 167 | +Same sources, same recipe at `--profile=0`, same comparator, same controls: | |
| 168 | + | |
| 169 | +| cell | shape | bytes | sha256 | wrong Y/U/V (shown) | exact shown | exact in decode order | | |
| 170 | +|---|---|---|---|---|---|---| | |
| 171 | +| `P420_320x232` | 320x232 | 15773 | `6832c3cd867f5fc4` | 0/0/0 | 16/16 | 17/17 | | |
| 172 | +| `P420_320x240` | 320x240 | 16612 | `7923a0dd94309c68` | 0/0/0 | 16/16 | 17/17 | | |
| 173 | +| `P420_320x242` | 320x**242** | 16290 | `b0c3c84e3432bda2` | 0/0/0 | 16/16 | 17/17 | | |
| 174 | +| `P420_322x242` | 322x**242** | 16100 | `246e458a5ca0ef3a` | 0/0/0 | 16/16 | 17/17 | | |
| 175 | +| `Q45_420_320x242` | 320x242, `--cq-level=45` | 16290 | `b0c3c84e3432bda2` | 0/0/0 | 16/16 | 17/17 | | |
| 176 | +| `Q45_420_320x248` | 320x**248** | 16440 | `e4a4f71d6f1be31f` | 0/0/0 | 16/16 | 17/17 | | |
| 177 | +| `Q45_420_322x242` | 322x242 | 16100 | `246e458a5ca0ef3a` | 0/0/0 | 16/16 | 17/17 | | |
| 178 | + | |
| 179 | +`Q45_420_320x232` is byte-identical to the committed pin | |
| 180 | +`420_oddheight_320x232.obu` (same sha256), and that pin now measures | |
| 181 | +**0/0/0, 16/16, 17/17** on this tree. | |
| 182 | + | |
| 183 | +**This overturns the premise in the retraction.** `lanes/av1422anom.report.md` | |
| 184 | +recorded the 320x232/320x248 failure as an "ordinary 4:2:0 odd-frame-HEIGHT | |
| 185 | +reconstruction defect". `lane-av1422chrtx` has since fixed it (the 32-point | |
| 186 | +INTER chroma `tx_type`; `stream.rs:11328` is now a byte-exactness assertion, | |
| 187 | +and it passes here). So the odd-height 4:2:0 defect no longer exists, and the | |
| 188 | +4:2:2 height-242 divergence is **not** that defect resurfacing: at height 242 | |
| 189 | +4:2:0 is exact and 4:2:2 is not. | |
| 190 | + | |
| 191 | +## Narrowing the four divergences | |
| 192 | + | |
| 193 | +**Stage.** `Q_odd320x242`, both sides, oracle rung `EC_AV1_PREFILT_DUMP` (Y | |
| 194 | +then U then V, crop-sized rows, after tile decode, **before** deblock, CDEF and | |
| 195 | +LR) against the decoder's own rung of the same name: | |
| 196 | + | |
| 197 | +``` | |
| 198 | +frame 0..16: 154880 bytes each side, 31557 / 37686 / 48432 / 48123 / 47905 / | |
| 199 | + 50654 / 49788 / 49822 / 49191 / 52843 / 51434 / 51248 / 52016 / | |
| 200 | + 53004 / 53146 / 52939 / 53133 differing bytes | |
| 201 | +``` | |
| 202 | + | |
| 203 | +Every decode-order frame differs already at PREFILT, so **deblock, CDEF and | |
| 204 | +loop restoration are exonerated**; the defect is in reconstruction. | |
| 205 | + | |
| 206 | +**Plane and region**, same dumps, frame 0 (the keyframe): | |
| 207 | + | |
| 208 | +``` | |
| 209 | +Y (320x242, bytes 0..77440) differing = 0 <- luma byte-exact | |
| 210 | +U (160x242, bytes 77440..116160) differing = 14722 | |
| 211 | + first byte 0 -> chroma (row 0, col 0): ours 81, oracle 224 | |
| 212 | + rows touched 232 of 242 (0..231), cols touched 160 of 160 | |
| 213 | +V (160x242, bytes 116160..154880) differing = 16835 | |
| 214 | + first byte 0 -> chroma (row 0, col 0): ours 90, oracle 166 | |
| 215 | + rows touched 242 of 242, cols touched 160 of 160 | |
| 216 | +``` | |
| 217 | + | |
| 218 | +So on this cell the whole 4:2:2 chroma plane of the **keyframe** is wrong from | |
| 219 | +its top-left sample, with luma byte-exact, before any loop filter. The other | |
| 220 | +three diverging cells carry the same shape with the same first-divergent | |
| 221 | +plane: `O` at U(0,0)-equivalent byte 106388 (plane 1), `S` at byte 214112 | |
| 222 | +(plane 1), `AB` at byte 80671 (plane 1) — all plane 1, all frame 0. | |
| 223 | + | |
| 224 | +**Axis.** Frame height, not width, and not a tiling accident: | |
| 225 | + | |
| 226 | +- `R_odd322x240` (odd **width** 322, height 240): exact. | |
| 227 | +- `Q_odd320x242` / `O_odd322x242` / `S_odd326x242_10b` (height **242**, | |
| 228 | + three widths, two bit depths): all diverge. | |
| 229 | +- `V_tile2x2_odd` is 322x**242** and **exact** — so the trigger is not | |
| 230 | + "height 242" alone; tiling changes the block layout enough to dodge it. | |
| 231 | + That is the same "not a simple alignment rule" the 4:2:0 defect showed, and | |
| 232 | + it means the trigger is a per-superblock or per-row-band extent whose | |
| 233 | + remainder is handled for some remainders and not others. | |
| 234 | + | |
| 235 | +**What this is not.** It is not an entropy desync: luma is byte-exact | |
| 236 | +pre-filter on every frame, and a parse desync would not leave 320x240 luma | |
| 237 | +untouched across 17 frames. It is not a loop-filter effect (PREFILT). It is | |
| 238 | +not the retired 4:2:0 defect (4:2:0 at 242 is exact). It is a 4:2:2 chroma | |
| 239 | +reconstruction defect whose trigger is a frame-height remainder. | |
| 240 | + | |
| 241 | +## Narrowing the three panics | |
| 242 | + | |
| 243 | +All three `--lossless=1` 4:2:2 cells panic at the same line, `decode.rs:37565` | |
| 244 | +inside `read_inter_chroma_lossless` (backtrace: `read_inter_chroma_lossless` → | |
| 245 | +`decode_inter_block` → `decode_inter_frame_tile_with_cdfs`): | |
| 246 | + | |
| 247 | +``` | |
| 248 | +range end index 20 out of range for slice of length 16 | |
| 249 | +``` | |
| 250 | + | |
| 251 | +The copy is | |
| 252 | + | |
| 253 | +```rust | |
| 254 | +let dst = mu_units(<plane>, stride * stride); | |
| 255 | +for row in 0..4 { | |
| 256 | + let start = (oy + row) * stride + ox; | |
| 257 | + dst[start..start + 4].copy_from_slice(&cu_grid[row * 4..][..4]); | |
| 258 | +} | |
| 259 | +``` | |
| 260 | + | |
| 261 | +`stride` is documented at the call site as "the block's **square** chroma | |
| 262 | +side, even for a 2:1 strip, which embeds its narrower plane block in the same | |
| 263 | +square grid". For an 8x8 lossless inter leaf, 4:2:2 gives a chroma plane block | |
| 264 | +of **4 wide x 8 tall** — not square — so the scratch is `4*4 = 16` while the | |
| 265 | +walk covers `4*8 = 32`; the second 4-row band starts at element 20. 4:2:0 and | |
| 266 | +4:4:4 have square chroma plane blocks at that leaf size, so the arm's own | |
| 267 | +`stride` contract is only violated by 4:2:2. That is why all three lossless | |
| 268 | +cells panic and no 4:2:0 or 4:4:4 cell does. | |
| 269 | + | |
| 270 | +**This is a panic, not wrong pixels.** A panic in a decoder reachable through | |
| 271 | +a lifted refusal is a strictly worse failure mode than a refusal, and it is | |
| 272 | +the one finding in this report that a lift would expose to ordinary input. | |
| 273 | + | |
| 274 | +## A 4:2:0 finding that is out of scope here but must be named | |
| 275 | + | |
| 276 | +`P420_lossless` (4:2:0, `--lossless=1`, lag 25, alt-ref on, global motion on) | |
| 277 | +**diverges by 1 254 308 presented samples, 1/16 shown frames exact**, first | |
| 278 | +divergent at frame 1 byte 268, plane 0 (luma!). It is not 4:2:2 and not mine, | |
| 279 | +but the class is narrow and worth the sweep I did run: | |
| 280 | + | |
| 281 | +| 4:2:0 lossless variant | result | | |
| 282 | +|---|---| | |
| 283 | +| `--lag-in-frames=0 --auto-alt-ref=0 --enable-global-motion=0` | **exact**, 16/16, 16/16 | | |
| 284 | +| `--lag-in-frames=0 --auto-alt-ref=1 --enable-global-motion=0` | **exact**, 16/16, 16/16 | | |
| 285 | +| `--lag-in-frames=25 --auto-alt-ref=0 --enable-global-motion=0` | **exact**, 16/16, 16/16 | | |
| 286 | +| `--lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=0` | **REFUSED by name**: `AV1 tile: a Golomb tail longer than this decoder reads` | | |
| 287 | +| `--lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1` (= `P420_lossless`) | **DIVERGES**, 1 254 308 wrong, 1/16 | | |
| 288 | + | |
| 289 | +So 4:2:0 lossless inter is clean without alt-ref, **refuses by name** with | |
| 290 | +alt-ref and no global motion, and is **silently wrong** with alt-ref plus | |
| 291 | +global motion. The committed gate | |
| 292 | +`a_lossless_libaom_inter_frame_decodes_sample_exact` passes, so it does not | |
| 293 | +cover that last combination. This belongs to whichever lane owns lossless | |
| 294 | +inter, not to this one — I am naming it, not claiming it. | |
| 295 | + | |
| 296 | +## Recommendation | |
| 297 | + | |
| 298 | +**Keep the refusal. It is still earning its keep, but for two concrete, | |
| 299 | +narrow, fixable reasons rather than the old coverage argument.** On this | |
| 300 | +evidence: 23 of 30 reachable 4:2:2 cells are byte-exact against the | |
| 301 | +instrumented `aomdec` in both the presented and the decode-order view, with | |
| 302 | +per-cell oracle-flip controls on every one — the 4:2:2 decoder is in good | |
| 303 | +shape. But **every 4:2:2 cell at frame height 242 that I could produce | |
| 304 | +diverges** (4 of 4: `O`, `Q`, `S`, `AB`, up to 22 988 wrong presented samples, | |
| 305 | +whole chroma plane of the keyframe, luma exact, present pre-loop-filter), and | |
| 306 | +**every `--lossless=1` 4:2:2 cell panics** (3 of 3, at one named line, | |
| 307 | +`decode.rs:37565`, for a reason that is arithmetically 4:2:2-only). Lifting | |
| 308 | +would expose users to chroma-only corruption on a whole family of ordinary | |
| 309 | +heights and to a decoder panic on lossless content. The deciding numbers are | |
| 310 | +**4/4 diverging at height 242 and 3/3 panicking on lossless**, against | |
| 311 | +**23/23 exact everywhere else**; the height-242 4:2:0 controls at the same | |
| 312 | +widths are exact, so this is not a defect 4:2:0 shares, and the retraction's | |
| 313 | +premise that it was the shared odd-height 4:2:0 defect no longer holds now | |
| 314 | +that `lane-av1422chrtx` has fixed that one. What I would do next, in order: | |
| 315 | +(1) fix `read_inter_chroma_lossless`'s `stride` for a non-square 4:2:2 plane | |
| 316 | +block — it is a one-line extent and the panic is loud; (2) sweep 4:2:2 frame | |
| 317 | +heights 232/234/…/250 at one width to map the remainder trigger, which also | |
| 318 | +tells us whether `V_tile2x2_odd`'s exactness is a dodge or a different path; | |
| 319 | +(3) re-run this table, and only then decide between a narrowed refusal and a | |
| 320 | +lift. I am not changing the refusal string or the header behaviour: that is a | |
| 321 | +shipped-capability call, and the honest input to it is that 7 of 30 cells are | |
| 322 | +not exact today. | |
| 323 | + | |
| 324 | +## Gates run | |
| 325 | + | |
| 326 | +Clean tree at `facdcb73`, no source diff, scoped: | |
| 327 | + | |
| 328 | +- `the_pinned_422_bigblock_witnesses_are_present_and_refuse_by_name` — pass | |
| 329 | +- `the_pinned_422_intrabc_sb128_strip_witnesses_refuse_by_name` — pass | |
| 330 | +- `the_pinned_422_lr_off_witness_is_present_and_refuses_by_name` — pass | |
| 331 | +- `the_pinned_422_residual_compound_warp_witness_is_present_and_refuses_by_name` — pass | |
| 332 | +- `a_non_420_subsampled_sequence_header_is_refused_by_name` — pass | |
| 333 | +- `the_pinned_420_oddheight_witness_is_pinned_and_decodes_byte_exact` — pass | |
| 334 | +- `a_lossless_libaom_inter_frame_decodes_sample_exact` — pass | |
| 335 | +- `the_counting_oracle_diff_detects_one_flipped_oracle_byte` — pass | |
| 336 | +- `every_oracle_comparator_reds_on_a_one_byte_wrong_oracle` — pass | |
| 337 | +- filter `422` — 6 passed / 0 failed | |
| 338 | +- filter `420` — 6 passed / 0 failed | |
| 339 | + | |
| 340 | +## Instrumentation disclosure | |
| 341 | + | |
| 342 | +Three temporary artefacts, all removed, none committed: | |
| 343 | + | |
| 344 | +- the `EC_AV1_ALLOW_422_PROBE` env bypass at `stream.rs:1803` (patch-run-restore); | |
| 345 | +- a temporary `#[test]` + two helpers driving `EC_AV1_422_CELLS` from an | |
| 346 | + external cell directory, using the crate's own `count_rawvideo_diffs`, | |
| 347 | + `decode_stream`, `stream_bit_depth`, `set_final_dump_prefix` and | |
| 348 | + `aomdec_path`; | |
| 349 | +- a counting variant of the decode-order compare, over the same two | |
| 350 | + `EC_AV1_FINAL_DUMP` views `decode_all_frames_vs_oracle` uses, with its own | |
| 351 | + per-plane oracle-flip control. | |
| 352 | + | |
| 353 | +**No new instrumentation was added to the decoder or the oracle.** The stage | |
| 354 | +ladder used the pre-existing `EC_AV1_PREFILT_DUMP` rung on both sides. | |
| 355 | + | |
| 356 | +## `not_done` | |
| 357 | + | |
| 358 | +- **12-bit 4:2:2 is unreachable with this `aomenc`.** `aomenc --profile=2 | |
| 359 | + --bit-depth=12` on a correct `C422p12` y4m fails with `Failed to set chroma | |
| 360 | + subsampling x: Unspecified internal error`. It is unwitnessed, not untried. | |
| 361 | + (Note: an earlier attempt with a wrong-case `C422P12` tag *appeared* to | |
| 362 | + succeed and produced a 13 961-byte OBU — that stream was not 4:2:2 and was | |
| 363 | + discarded. The lowercase-p tag is the real requirement.) | |
| 364 | +- **Superres 4:2:2 unwitnessed.** `--superres-mode=2` produced no encode with | |
| 365 | + this build; no recipe found. | |
| 366 | +- **No fixture committed.** The 24 fresh cells are recorded above with full | |
| 367 | + recipes and sha256 but are not pinned into `crates/ec-av1/fixtures/`. | |
| 368 | + Pinning belongs with whichever cell becomes a gate, not with this report. | |
| 369 | +- **The height-242 trigger is not root-caused.** It is localised to 4:2:2 | |
| 370 | + chroma reconstruction (PREFILT, keyframe, luma exact, plane 1 first) and to | |
| 371 | + a height remainder, and the full width x height grid is not swept, so the | |
| 372 | + trigger's real extent is unknown. `V_tile2x2_odd` being exact at 322x242 | |
| 373 | + means "height 242" is not the whole rule. | |
| 374 | +- **The `read_inter_chroma_lossless` extent fix is not made.** The panic site | |
| 375 | + and the arithmetic are named; shipping a speculative change to a bit-exact | |
| 376 | + decoder on one cell family is not this lane's call. | |
| 377 | +- **The 4:2:0 lossless alt-ref + global-motion divergence is named, not | |
| 378 | + owned.** It is swept above to the recipe delta that triggers it and left for | |
| 379 | + the lossless-inter owner. | |
| 380 | +- **The top-half engagement census was not re-run** (oracle-side libaom | |
| 381 | + instrumentation I did not rebuild). | |
| 382 | +- **Full suite not run** (lane rules: scoped only; project-wide validation is | |
| 383 | + Main's). |