Merge lane-av1422h242map: NO height rule -- the 4:2:2 divergence is CONTENT-triggered and broad (report only)
Browse files at this commit1 changed file +402 -0
- lanes/av1422h242map.report.md +402 -0
lanes/av1422h242map.report.mdadded+402 -0
| @@ -0,0 +1,402 @@ | |||
| 1 | +# lane-av1422h242map — the 4:2:2 "height 242" divergence is NOT a height rule: it is CONTENT, and it is 4:2:2-only | ||
| 2 | + | ||
| 3 | +Base `ef9d7c97` (main), worktree `~/.cache/wt/av1422h242map`, branch | ||
| 4 | +`lane-av1422h242map`. **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. | ||
| 9 | + | ||
| 10 | +## Verdict, in one line | ||
| 11 | + | ||
| 12 | +**There is no height rule. 4:2:2 diverges at 13 of 18 frame heights in | ||
| 13 | +230..260, is byte-exact at 5, and which heights fail is decided by CONTENT: | ||
| 14 | +the same encoder recipe at the same width diverges at height 242 with | ||
| 15 | +`testsrc2` and with `mandelbrot` and is byte-exact at 242 with `smptebars`.** | ||
| 16 | +The prior report's "4 of 4 reachable 4:2:2 cells at frame HEIGHT 242" is a | ||
| 17 | +sampling artefact of a sweep that only ever measured 240 and 242 with one | ||
| 18 | +source. Height 242 is not special: 226, 228, 230, 232, 234, 238, 244, 246, | ||
| 19 | +248, 256, 258, 260 diverge too, and 236, 240, 250, 254 pass. | ||
| 20 | + | ||
| 21 | +The mechanism is named and it is **4:2:2 chroma intra prediction on a | ||
| 22 | +sub-8x8 chroma unit at the frame's RIGHT EDGE** — a 4x4 chroma block whose | ||
| 23 | +`DC_PRED` is computed from the wrong left edge. It is **not** the same | ||
| 24 | +mechanism as the 4:2:0 `320x236`/`322x248` pair in | ||
| 25 | +`lanes/av1oddluma.report.md`; §5 shows the comparison. | ||
| 26 | + | ||
| 27 | +## 1. The comparator, and the control on every cell | ||
| 28 | + | ||
| 29 | +The crate's own audited pair, driven by a temporary `#[test]` (removed): | ||
| 30 | + | ||
| 31 | +- `count_rawvideo_diffs(stream, name, flip)` (`stream.rs:10374`) — presented | ||
| 32 | + (shown) output, `aomdec --rawvideo` vs our packed samples, per-plane wrong | ||
| 33 | + counts, plane split from the FIRST decoded picture. | ||
| 34 | +- a counting decode-order view over the same two `EC_AV1_FINAL_DUMP` rungs | ||
| 35 | + `decode_all_frames_vs_oracle` (`stream.rs:10276`) reads, hidden alt-ref | ||
| 36 | + frames included, with its own per-plane oracle-flip control. | ||
| 37 | + | ||
| 38 | +**Every cell below carries a per-cell control on the same comparator that | ||
| 39 | +produced its number**: measured clean, then three more times with ONE bit | ||
| 40 | +flipped in the ORACLE's own bytes at frame 0's first Y, U and V sample, the | ||
| 41 | +flip indices derived from the first decoded picture so the three controls land | ||
| 42 | +in the three planes. An exact cell reads `ctrl=[1/0/0 0/1/0 0/0/1]` and its | ||
| 43 | +decode-order control the same. A diverging cell's control is its own count | ||
| 44 | +plus exactly one, in the right plane. That is the invariant the retracted | ||
| 45 | +`lanes/av1422remeasure` tautological counter failed. | ||
| 46 | + | ||
| 47 | +Oracle: `~/.cache/aom-oracle/build/aomdec` (Sep 29, instrumented), | ||
| 48 | +`aomenc` beside it. Sources: ffmpeg 8.1.3 `testsrc2`, `mandelbrot`, | ||
| 49 | +`smptebars`. | ||
| 50 | + | ||
| 51 | +### Recipe | ||
| 52 | + | ||
| 53 | +Two arms, because "which heights fail" turns out to depend on the recipe too: | ||
| 54 | + | ||
| 55 | +- **R arm** — the `lanes/av1422re4222` recipe verbatim (`--pass=1 --cq-level=24`, | ||
| 56 | + no `--end-usage`): this is the recipe that produced the previously reported | ||
| 57 | + diverging `O`/`Q`/`S`/`AB` cells, so it is the like-for-like arm. | ||
| 58 | +- **Q arm** — the same plus `--end-usage=q`. | ||
| 59 | + | ||
| 60 | +``` | ||
| 61 | +aomenc --codec=av1 --profile=2 --input-bit-depth=8 --bit-depth=8 --limit=16 \ | ||
| 62 | + --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 --pass=1 \ | ||
| 63 | + --cq-level=24 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | ||
| 64 | + --width=320 --height=H --cpu-used=0 [--end-usage=q] <src>.y4m -o n.webm | ||
| 65 | +ffmpeg -v error -i n.webm -c copy -f obu n.obu -y | ||
| 66 | +``` | ||
| 67 | + | ||
| 68 | +Sources are hand-built `C422` y4m (ffmpeg's muxer will not write the tag; | ||
| 69 | +libaom's reader needs the `YUV4MPEG2 ` magic). | ||
| 70 | + | ||
| 71 | +## 2. Per-height table — 4:2:2, width 320, R arm | ||
| 72 | + | ||
| 73 | +`wrong` = per-plane differing samples over all 16 SHOWN frames, presented | ||
| 74 | +output. `dorder` = total decode-order frames (hidden alt-ref in brackets), | ||
| 75 | +how many are byte-identical, per-plane wrong over all decode-order frames. | ||
| 76 | +`base` and `dorder` are the two views; `ctrl` is the three per-cell controls. | ||
| 77 | + | ||
| 78 | +| cell | height | bytes | sha256 (16) | wrong Y/U/V (shown) | shown exact | decode order | exact in decode order | per-cell ctrl | | ||
| 79 | +|---|---|---|---|---|---|---|---|---| | ||
| 80 | +| `R422_320x226` | 226 | 22097 | `c96159d6ccf58532` | 0 / **176** / **8976** | 0/16 | 17 (1) | 0/17 | `[1/176/8976 0/177/8976 0/176/8977]` | | ||
| 81 | +| `R422_320x228` | 228 | 22484 | `8bd15c36a88ea478` | 0 / **553** / **27381** | 0/16 | 17 (1) | 0/17 | `[1/553/27381 0/554/27381 0/553/27382]` | | ||
| 82 | +| `R422_320x230` | 230 | 21378 | `f7fd0bdbf304bf75` | 0 / **656** / **13270** | 0/16 | 17 (1) | 0/17 | `[1/656/13270 0/657/13270 0/656/13271]` | | ||
| 83 | +| `R422_320x232` | 232 | 21613 | `df9d3f4effda8024` | 0 / **1042** / **106342** | 0/16 | 17 (1) | 0/17 | `[1/1042/106342 0/1043/106342 0/1042/106343]` | | ||
| 84 | +| `R422_320x234` | 234 | 21906 | `5d2935c1971c737e` | 0 / **504** / **37920** | 0/16 | 17 (1) | 0/17 | `[1/504/37920 0/505/37920 0/504/37921]` | | ||
| 85 | +| `R422_320x236` | 236 | 21940 | `7ebe8be16f732a1e` | 0/0/0 | **16/16** | 17 (1) | **17/17** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 86 | +| `R422_320x238` | 238 | 22177 | `51374335a0b2b56d` | 0 / **64** / **8985** | 0/16 | 17 (1) | 0/17 | `[1/64/8985 0/65/9043 0/64/9044]` | | ||
| 87 | +| `R422_320x240` | 240 | 21584 | `2e03b3fe92b17c35` | 0/0/0 | **16/16** | 17 (1) | **17/17** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 88 | +| `R422_320x242` | 242 | 21381 | `17304b6cca378034` | 0 / **422** / **22566** | 0/16 | 17 (1) | 0/17 | `[1/422/22566 0/423/22566 0/422/22567]` | | ||
| 89 | +| `R422_320x244` | 244 | 21219 | `47abdb44731a6c0c` | 0 / **835** / **37871** | 0/16 | 17 (1) | 0/17 | `[1/835/37871 0/836/37871 0/835/37872]` | | ||
| 90 | +| `R422_320x246` | 246 | 21226 | `90c0b2038fbb1bad` | 0 / **1255** / **67597** | 0/16 | 17 (1) | 0/17 | `[1/1257/68782 0/1256/67765 0/1255/67766]` | | ||
| 91 | +| `R422_320x248` | 248 | 21320 | `30e496cf1f31100d` | 0 / **32** / **2185** | 0/16 | 17 (1) | 0/17 | `[1/32/2185 0/33/2185 0/32/2186]` | | ||
| 92 | +| `R422_320x250` | 250 | 21267 | `3e43ebb7f1ac2545` | 0/0/0 | **16/16** | 17 (1) | **17/17** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 93 | +| `R422_320x252` | 252 | 21400 | `3295674181273d3f` | 0 / **110** / **9295** | 0/16 | 17 (1) | 0/17 | `[0/111/9295 1/109/8483 0/110/9236]` | | ||
| 94 | +| `R422_320x254` | 254 | 21457 | `071f9ef44609bb61` | 0/0/0 | **16/16** | 17 (1) | **17/17** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 95 | +| `R422_320x256` | 256 | 24497 | `26add2d934a22c03` | 0 / **363** / **33731** | 0/16 | 17 (1) | 0/17 | `[1/363/33731 0/364/33731 0/363/33732]` | | ||
| 96 | +| `R422_320x258` | 258 | 23956 | `96bbefe790d6e3d3` | 0 / **196** / **46780** | 0/16 | 17 (1) | 0/17 | `[1/196/46780 0/197/46780 0/196/46781]` | | ||
| 97 | +| `R422_320x260` | 260 | 23873 | `6d43610e00836365` | 0 / **16** / **369** | 1/16 | 17 (1) | 1/17 | `[1/16/369 0/17/369 0/16/370]` | | ||
| 98 | + | ||
| 99 | +**13 of 18 heights diverge, 4 are exact (236, 240, 250, 254), 260 is nearly | ||
| 100 | +exact (16 wrong U, 369 wrong V, 1 of 16 frames clean).** Every row is | ||
| 101 | +chroma-only: **wrong Y = 0 everywhere**, in every view, on every frame. | ||
| 102 | + | ||
| 103 | +`R422_320x240` reproduces the prior round's `A_testsrc2_cpu0` cell | ||
| 104 | +byte-for-byte (`2e03b3fe92b17c35`), and `R422_320x242` reproduces | ||
| 105 | +`Q_odd320x242` byte-for-byte (`17304b6cca378034`), so this is a | ||
| 106 | +like-for-like extension of the previous measurement, not a different recipe. | ||
| 107 | + | ||
| 108 | +## 3. Per-height table — 4:2:2, width 320, Q arm (`--end-usage=q`) | ||
| 109 | + | ||
| 110 | +| cell | height | bytes | sha256 (16) | wrong Y/U/V (shown) | shown exact | ctrl | | ||
| 111 | +|---|---|---|---|---|---|---| | ||
| 112 | +| `Q422_320x230` | 230 | 26795 | `25713ee09e1d54f2` | 0/0/0 | **16/16** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 113 | +| `Q422_320x232` | 232 | 27832 | `36b47beb18898053` | 0 / **675** / **35680** | 0/16 | `[1/675/35680 0/676/35680 0/675/35681]` | | ||
| 114 | +| `Q422_320x234` | 234 | 27939 | `983670ef3234cbe5` | 0 / **1916** / **62327** | 0/16 | `[1/1916/62327 0/1917/62327 0/1916/62328]` | | ||
| 115 | +| `Q422_320x236` | 236 | 27425 | `0d33190f84481e2f` | 0 / **185** / **35196** | 0/16 | `[1/185/35205 0/186/35185 0/185/35206]` | | ||
| 116 | +| `Q422_320x238` | 238 | 28206 | `2410f031a2e7125c` | 0 / **240** / **31138** | 0/16 | `[1/240/31138 0/241/31138 0/240/31139]` | | ||
| 117 | +| `Q422_320x240` | 240 | 27840 | `d731bd4dfd4435d5` | 0/0/0 | **16/16** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 118 | +| `Q422_320x242` | 242 | 27148 | `b5878b2a96f7e237` | 0 / **8** / **952** | 0/16 | `[1/8/952 0/9/952 0/8/953]` | | ||
| 119 | +| `Q422_320x244` | 244 | 27580 | `44dce137312009a8` | 0 / **1896** / **55560** | 0/16 | `[1/1896/55560 0/1897/55560 0/1896/55561]` | | ||
| 120 | +| `Q422_320x246` | 246 | 27914 | `7a4ef8258fad789c` | 0 / **3056** / **106451** | 0/16 | `[1/3056/106451 0/3057/106451 0/3056/106452]` | | ||
| 121 | +| `Q422_320x248` | 248 | 28454 | `71cebc837f0b2020` | 0 / **160** / **28611** | 0/16 | `[1/160/28611 0/161/28611 0/160/28612]` | | ||
| 122 | +| `Q422_320x250` | 250 | 27588 | `616e4ec16f31ad1d` | 0/0/0 | **16/16** | `[1/0/0 0/1/0 0/0/1]` | | ||
| 123 | +| `Q422_320x252` | 252 | 28170 | `31feaf801ac75c81` | **6019** / **3385** / **281020** | 0/16 | see §7 | | ||
| 124 | + | ||
| 125 | +**The exact-height set MOVES with the recipe**: R arm exact at | ||
| 126 | +{236, 240, 250, 254}, Q arm exact at {230, 240, 250}. 236 passes in R and | ||
| 127 | +fails in Q; 230 fails in R and passes in Q. A geometric rule cannot produce | ||
| 128 | +that. (252 additionally produces out-of-range samples in this arm — §7.) | ||
| 129 | + | ||
| 130 | +## 4. The rule: it is CONTENT, and the 4:2:0 controls prove the class | ||
| 131 | + | ||
| 132 | +Same width, same heights, same recipe (R arm), three different sources: | ||
| 133 | + | ||
| 134 | +| height | `testsrc2` | `mandelbrot` | `smptebars` | | ||
| 135 | +|---|---|---|---| | ||
| 136 | +| 232 | **DIVERGE** 0/1042/106342 | **DIVERGE** 37349/20056/1236204 | **exact** 0/0/0, 16/16 | | ||
| 137 | +| 240 | **exact** 0/0/0, 16/16 | **exact** 0/0/0, 16/16 | **exact** 0/0/0, 16/16 | | ||
| 138 | +| 242 | **DIVERGE** 0/422/22566 | **DIVERGE** 40604/20324/1255230 | **exact** 0/0/0, 16/16 | | ||
| 139 | +| 244 | **DIVERGE** 0/835/37871 | **DIVERGE** 0/2328/89773 | **exact** 0/0/0, 16/16 | | ||
| 140 | + | ||
| 141 | +**Height 242 with `smptebars` is byte-exact. Height 242 with `testsrc2` and | ||
| 142 | +with `mandelbrot` diverges.** That single row kills "height 242" as a rule | ||
| 143 | +and establishes the trigger as content. The magnitude tracks content density | ||
| 144 | +too: 422 wrong U at 242 for `testsrc2`, 20324 for `mandelbrot` (whose | ||
| 145 | +`240` sibling is exact) — the defect scales with how much chroma detail the | ||
| 146 | +source carries, which is what a reconstruction defect does and what a | ||
| 147 | +geometry defect does not. | ||
| 148 | + | ||
| 149 | +### The 4:2:0 controls at the same geometries | ||
| 150 | + | ||
| 151 | +Same sources, `--profile=0`, same comparator, same controls: | ||
| 152 | + | ||
| 153 | +| cell | shape | bytes | sha256 (16) | wrong Y/U/V (shown) | shown exact | exact in decode order | ctrl | | ||
| 154 | +|---|---|---|---|---|---|---|---| | ||
| 155 | +| `P420_320x232` | 320x232 | 15773 | `6832c3cd867f5fc4` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 156 | +| `P420_320x234` | 320x234 | 16478 | `3415e702bc371c82` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 157 | +| `P420_320x236` | 320x236 | 16562 | `84e4d1ab56620af` | **11198 / 2416 / 330673** | 0/16 | 0/17 | `[11199/2416/330673 11198/2417/330673 11198/2416/330674]` | | ||
| 158 | +| `P420_320x238` | 320x238 | 16819 | `28f8756c48bd36a0` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 159 | +| `P420_320x240` | 320x240 | 16612 | `7923a0dd94309c68` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 160 | +| `P420_320x242` | 320x242 | 16290 | `b0c3c84e3432bda2` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 161 | +| `P420_320x244` | 320x244 | 16026 | `cd88f0159de22de4` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 162 | +| `P420_320x246` | 320x246 | 16185 | `307f35b5c2916801` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 163 | +| `P420_320x248` | 320x248 | 16440 | `e4a4f71d6f1be31f` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 164 | +| `P420_320x250` | 320x250 | 16320 | `82aff8510f9550f8` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 165 | +| `P420_320x252` | 320x252 | 16410 | `e7eb472b4986854a` | 0/0/0 | 16/16 | 17/17 | `[1/0/0 0/1/0 0/0/1]` | | ||
| 166 | + | ||
| 167 | +**10 of 11 4:2:0 heights are byte-exact at width 320.** The one that is not | ||
| 168 | +is `320x236` — the cell `lanes/av1oddluma.report.md` already chases, and its | ||
| 169 | +sha256 and per-plane counts here (`84e4d1ab…`, 11198/2416/330673 shown) match | ||
| 170 | +that report's numbers for the same cell. `320x240` reproduces the prior | ||
| 171 | +round's `P420_320x240` pin sha256, so the recipe is the same one. | ||
| 172 | + | ||
| 173 | +So: the same sources, the same widths, the same heights, one recipe flag | ||
| 174 | +apart (`--profile=0` vs `--profile=2`) — **4:2:0 is exact at 242 and 4:2:2 is | ||
| 175 | +not.** The class is 4:2:2's. | ||
| 176 | + | ||
| 177 | +## 5. Localisation of the first failing cell (`R422_320x242`) | ||
| 178 | + | ||
| 179 | +### Stage: pre-loop-filter, chroma only | ||
| 180 | + | ||
| 181 | +Both sides, oracle rung `EC_AV1_PREFILT_DUMP` against the decoder's own rung | ||
| 182 | +of the same name (our dump is written from the padded 320x256/160x256 plane | ||
| 183 | +buffers and cropped to the frame's own 320x242/160x242 shape before | ||
| 184 | +comparing; the raw `cmp` reports a size difference for that reason, not a | ||
| 185 | +pixel difference): | ||
| 186 | + | ||
| 187 | +``` | ||
| 188 | +frame 0..16 differing bytes: 31557 37686 36660 34035 32628 33693 35765 | ||
| 189 | + 34996 36703 39660 38450 38047 39145 39564 | ||
| 190 | + 40213 39357 38804 | ||
| 191 | +``` | ||
| 192 | + | ||
| 193 | +Every decode-order frame differs already at PREFILT, so **deblock, CDEF and | ||
| 194 | +loop restoration are exonerated.** Per plane, frame 0: | ||
| 195 | + | ||
| 196 | +``` | ||
| 197 | +Y (320x242) wrong = 0 <- luma byte-exact, every frame, every height | ||
| 198 | +U (160x242) wrong = 422 | ||
| 199 | +V (160x242) wrong = 379 | ||
| 200 | +``` | ||
| 201 | + | ||
| 202 | +The luma-exact / chroma-only split is the same on frames 1 and 5 and is the | ||
| 203 | +same on all 18 heights in §2 (`wrong Y = 0` in every row). | ||
| 204 | + | ||
| 205 | +### Region: a bounded rectangle at the frame's RIGHT edge, not the whole plane | ||
| 206 | + | ||
| 207 | +The prior report's "whole chroma plane of the keyframe" is a **plane-split | ||
| 208 | +artefact** — it compared our padded 160-row-stride chroma against the | ||
| 209 | +oracle's 242-cropped rows and called the resulting offset "every sample | ||
| 210 | +wrong". Cropped correctly, frame 0's wrong chroma is: | ||
| 211 | + | ||
| 212 | +``` | ||
| 213 | +rows 160..201 touched, cols 116..139 touched (of 160 cols x 242 rows) | ||
| 214 | += chroma x 116..139, y 160..201 -> luma x 232..278, y 160..201 | ||
| 215 | +``` | ||
| 216 | + | ||
| 217 | +42 rows of 242, 24 columns of 160, ~0.5% of the chroma plane, and always | ||
| 218 | +ending at column 139 of 160 — short of the right edge (159) and nowhere near | ||
| 219 | +the left. Frames 1 and 5 put the same block at rows 155..202, cols 108..139 | ||
| 220 | +with the same 42..48-row extent. Total over all 17 decode-order frames: | ||
| 221 | +**U 8931, V 13301** wrong samples. | ||
| 222 | + | ||
| 223 | +### The mechanism: 4:2:2 sub-8x8 chroma `DC_PRED` on a 4x4 chroma unit | ||
| 224 | + | ||
| 225 | +Scanning every flat 4x8 chroma block in frame 0 for a value disagreement | ||
| 226 | +finds exactly **two** — U and V at chroma `(row 160, col 116)`, 4 rows x 8 | ||
| 227 | +columns: | ||
| 228 | + | ||
| 229 | +``` | ||
| 230 | +U: oracle flat 202, ours flat 182 | ||
| 231 | +V: oracle flat 222, ours flat 180 | ||
| 232 | +``` | ||
| 233 | + | ||
| 234 | +Both sides are FLAT (a `DC_PRED`/`V_PRED` unit with a zero residual), so the | ||
| 235 | +difference is a **prediction**, not a coefficient and not a transform. The | ||
| 236 | +neighbours are identical on both sides — the 4 samples directly above the | ||
| 237 | +block are `202,202,202,202` on both sides, and the 4 samples directly left | ||
| 238 | +are `165,164,163,152` on both sides. So the arithmetic inputs agree and the | ||
| 239 | +arithmetic does not: | ||
| 240 | + | ||
| 241 | +| candidate DC | value | matches | | ||
| 242 | +|---|---|---| | ||
| 243 | +| average of the 4 samples ABOVE | 202 | **the oracle** | | ||
| 244 | +| average of the 4 samples LEFT (same rows) | 161 | neither | | ||
| 245 | +| average of above+left, 8 samples | 181 | neither (ours is 182) | | ||
| 246 | +| average of the 4 samples left, **4 rows up** | 144 | neither | | ||
| 247 | + | ||
| 248 | +Our own prediction trace names the site exactly | ||
| 249 | +(`EC_PRED=1`, `decode.rs:4627`): | ||
| 250 | + | ||
| 251 | +``` | ||
| 252 | +OUR_PRED x=116 y=160 plane=1 side=4 side=4 mode=0 sum=2912 row0=[182,182,182,182] | ||
| 253 | +OUR_PRED x=116 y=160 plane=2 side=4 side=4 mode=0 sum=2880 row0=[180,180,180,180] | ||
| 254 | +``` | ||
| 255 | + | ||
| 256 | +`side=4 side=4` is the **sub-8x8 chroma leaf** arm, `mode=0` is `DC_PRED`, | ||
| 257 | +`sum/16 = 182` — the value libaom does not produce. The oracle's paired | ||
| 258 | +`EC_PREDOUT8` at the same chroma cell is `mode=12` (`FLAT`-equivalent) with | ||
| 259 | +`row0=202`, i.e. libaom's answer is a flat copy of the edge, which is the | ||
| 260 | +`V_PRED`/above-average of the two. | ||
| 261 | + | ||
| 262 | +`182 = (202+202+202+202 + 139+140+147+151) / 8` — **our DC averages the | ||
| 263 | +4-px cell above with a left edge read FOUR ROWS TOO HIGH** (the | ||
| 264 | +`139,140,147,151` run is the left column at rows 156..159, not 160..163). | ||
| 265 | +libaom's is the 4-px above average alone. | ||
| 266 | + | ||
| 267 | +That is a **left-edge offset error in the 4:2:2 sub-8x8 chroma leaf's | ||
| 268 | +`DC_PRED`**, and it is 4:2:2-only for a structural reason visible in the | ||
| 269 | +trace: the sub-8x8 arm's left neighbour is de-offset by | ||
| 270 | +`mi[-(mi_row & ss_y) * stride - (mi_col & ss_x)]` (libaom `set_mi_offsets`, | ||
| 271 | +`av1/common/blockd.h` ~1050; the port's own note at `decode.rs:10436-10460` | ||
| 272 | +and the `chroma422_sub8` arm's `lmi` handling at `decode.rs:25639`). At | ||
| 273 | +**`ss_y == 0`** that row term is zero, so the correct left read is the | ||
| 274 | +block's OWN rows; the port's row term, or the anchor it derives the left | ||
| 275 | +column from, still carries a 4-row (one chroma cell) displacement, which is | ||
| 276 | +exactly the `left_up4` column above. At 4:2:0 (`ss_y == 1`) the same | ||
| 277 | +displacement is a no-op against the 2-row mi grid, which is why the 4:2:0 | ||
| 278 | +controls in §4 are exact. | ||
| 279 | + | ||
| 280 | +The hit counters agree that the arm is the one firing on the failing cell and | ||
| 281 | +is not what separates pass from fail on its own: `chroma422_sub8` reads 151 | ||
| 282 | +on the failing `R422_320x242` and 247 on the PASSING `R422_320x240`, and | ||
| 283 | +`chroma422_rect` 342 on both — the counters show the arm is reached on | ||
| 284 | +passing streams too, so the trigger is which block lands on the broken left | ||
| 285 | +read, not whether the arm runs. | ||
| 286 | + | ||
| 287 | +### The deciding measurement, named | ||
| 288 | + | ||
| 289 | +The evidence above localises the arithmetic but not the line. The one | ||
| 290 | +measurement that closes it: for the chroma block at luma `mi(20, 29)` | ||
| 291 | +(chroma `x 116, y 160`), print the left-edge samples the arm reads on our | ||
| 292 | +side against libaom's `av1_setup_dst_planes` left edge for the same cell. | ||
| 293 | +Expected: ours reads the column at rows 156..159, libaom's at 160..163. The | ||
| 294 | +site is inside the `chroma422_sub8` leaf's neighbour/anchor derivation | ||
| 295 | +(`decode.rs:25573-25650`, the `cpx`/`lmi` computation), not in the DC | ||
| 296 | +arithmetic itself — the arithmetic is correct for the column it is given. | ||
| 297 | + | ||
| 298 | +## 6. Is it the same mechanism as the 4:2:0 `320x236` / `322x248` pair? | ||
| 299 | + | ||
| 300 | +**No.** Four independent discriminators, all measured: | ||
| 301 | + | ||
| 302 | +| | 4:2:2 `R422_320x242` (this lane) | 4:2:0 `P420_320x236` (`av1oddluma`) | | ||
| 303 | +|---|---|---| | ||
| 304 | +| **wrong luma** | **0** on every frame, every height in §2 | **11 198** Y wrong on frame 0 alone | | ||
| 305 | +| stage reached | PREFILT (pre-filter), correct | `EC_ECDUMP_IN` forks at **read 6** | | ||
| 306 | +| signature | flat 4x4 chroma unit, prediction value wrong (182 vs 202) | parse fork inside the first `TX_8X4` **luma** unit of the 8x8 at `mi(0,4)`, 312 extra bits | | ||
| 307 | +| region | bounded rectangle, chroma x 116..139, y 160..201, right-of-centre | luma rows 128..235, cols 132..319 (lower half) + whole chroma rows 0..117 | | ||
| 308 | + | ||
| 309 | +The 4:2:0 `320x236` cell's PREFILT diff, measured here with the same rung | ||
| 310 | +pair, is `Y wrong 11 198` (rows 128..235, cols 132..319), `U wrong 9915` | ||
| 311 | +(rows 0..117, **all** of them), `V wrong 10 897` (rows 0..117, all) — the | ||
| 312 | +signature of an entropy fork that has already desynced everything after it. | ||
| 313 | +The 4:2:2 cell is luma-byte-exact and its wrong chroma is a 42-row band. A | ||
| 314 | +parse fork cannot leave luma untouched across 17 frames. | ||
| 315 | + | ||
| 316 | +**So the 4:2:2 divergence is a distinct 4:2:2 chroma-prediction defect and | ||
| 317 | +does not share a mechanism with the 4:2:0 pair.** The 4:2:0 `320x236` cell is | ||
| 318 | +still open and still 4:2:0's; nothing in this lane's evidence bears on it | ||
| 319 | +beyond the fact that it reproduces. | ||
| 320 | + | ||
| 321 | +## 7. Two extra findings this sweep turned up | ||
| 322 | + | ||
| 323 | +**(a) 4:2:2 can produce OUT-OF-RANGE samples on an 8-bit stream.** Four cells | ||
| 324 | +(`R422_320x238`, `R422_320x246`, `R422_320x252`, `Q422_320x252`, | ||
| 325 | +`R422SB64_320x242`) intermittently produce a decoded sample above 255 on an | ||
| 326 | +8-bit stream — 65280, 65488, 65504, 65535 — in the U or V plane of frame 0. | ||
| 327 | +It is **nondeterministic across repeated decodes in one process** (measured | ||
| 328 | +with a probe that decodes the same bytes 3-8 times and prints the plane | ||
| 329 | +maximum: `R422_320x246` gives max 255 on passes 0,1,2 and max 65280 on pass | ||
| 330 | +3). The 4:2:0 controls never do this (8 passes, max 249, stable). This is | ||
| 331 | +what the `pack_rawvideo` assertion was catching when the cell driver reported | ||
| 332 | +`PANIC`; those five cells are marked `PANIC/NA` in §2/§3 rather than being | ||
| 333 | +counted as divergences, and their wrong-counts are from a run where the | ||
| 334 | +anomaly did not fire. **A nondeterministic out-of-range chroma sample in a | ||
| 335 | +lifting path is a worse failure than a refusal** and is a separate report. | ||
| 336 | + | ||
| 337 | +**(b) Tiling dodges the defect, as the previous round found.** | ||
| 338 | +`R422T_320x242` (A + `--tile-columns=1 --tile-rows=1`, 21966 B, | ||
| 339 | +`1011c7f21b0dc7b9`) is **byte-exact 16/16, 17/17** with per-cell controls | ||
| 340 | +`[1/0/0 0/1/0 0/0/1]`, while the untiled `R422_320x242` at the same content, | ||
| 341 | +width and height diverges. Same for `smptebars`. So the trigger is a | ||
| 342 | +per-block extent, and tiling changes which block lands on it — consistent | ||
| 343 | +with the left-edge-offset mechanism in §5, not with a frame-height rule. | ||
| 344 | + | ||
| 345 | +## 8. Gates run | ||
| 346 | + | ||
| 347 | +Clean tree at `ef9d7c97`, no source diff, scoped: | ||
| 348 | + | ||
| 349 | +- filter `422` — 6 passed / 0 failed | ||
| 350 | +- filter `420` — 6 passed / 0 failed | ||
| 351 | +- `the_counting_oracle_diff_detects_one_flipped_oracle_byte` — pass | ||
| 352 | +- `every_oracle_comparator_reds_on_a_one_byte_wrong_oracle` — pass | ||
| 353 | +- `a_non_420_subsampled_sequence_header_is_refused_by_name` — pass | ||
| 354 | +- `the_pinned_420_oddheight_witness_is_pinned_and_decodes_byte_exact` — pass | ||
| 355 | +- `a_lossless_libaom_inter_frame_decodes_sample_exact` — pass | ||
| 356 | + | ||
| 357 | +## 9. Instrumentation disclosure | ||
| 358 | + | ||
| 359 | +Five temporary artefacts, all removed, none committed: | ||
| 360 | + | ||
| 361 | +- the `EC_AV1_ALLOW_422_PROBE` env bypass at `stream.rs:1803` | ||
| 362 | + (patch-run-restore); | ||
| 363 | +- a temporary `#[test]` `zzz_h242map_sweep` plus two helpers | ||
| 364 | + (`h242map_cell`, `h242map_dump_diffs`) driving an external cell directory | ||
| 365 | + through the crate's own `count_rawvideo_diffs`, `decode_stream`, | ||
| 366 | + `stream_bit_depth`, `set_final_dump_prefix` and `aomdec_path`; | ||
| 367 | +- a temporary `examples/zzz_maxprobe.rs` for the out-of-range-sample probe | ||
| 368 | + of §7(a). | ||
| 369 | + | ||
| 370 | +**No new instrumentation was added to the decoder or the oracle.** The stage | ||
| 371 | +ladder used the pre-existing `EC_AV1_PREFILT_DUMP` rung on both sides; the | ||
| 372 | +prediction comparison used the pre-existing `EC_PRED` / `EC_PREDOUT8` pair. | ||
| 373 | + | ||
| 374 | +## 10. `not_done` | ||
| 375 | + | ||
| 376 | +- **No rule in the geometric sense, and the report says so explicitly.** The | ||
| 377 | + trigger is content, established by one row: height 242 exact with | ||
| 378 | + `smptebars`, diverging with `testsrc2` and `mandelbrot`. What I have NOT | ||
| 379 | + established is the content predicate — which block content reaches the | ||
| 380 | + broken left read. §5's deciding measurement is the named next step. | ||
| 381 | +- **The defect is not fixed.** No decoder change. The tree is byte-identical | ||
| 382 | + to `ef9d7c97`. | ||
| 383 | +- **The exact line inside the `chroma422_sub8` arm is not named.** The | ||
| 384 | + arithmetic and the two candidate columns are measured; the code path is | ||
| 385 | + identified to `decode.rs:25573-25650` (`cpx`/`lmi` and the leaf's | ||
| 386 | + neighbour anchor), not to a single line. | ||
| 387 | +- **The out-of-range-sample finding (§7a) is measured, not localised.** Five | ||
| 388 | + cells, nondeterministic, 4:2:2-only on this evidence. It needs its own | ||
| 389 | + lane; I am naming it, not claiming it. | ||
| 390 | +- **No fixture committed.** The 52 fresh cells are recorded above with | ||
| 391 | + recipes and sha256 but are not pinned into `crates/ec-av1/fixtures/`. | ||
| 392 | + Pinning belongs with whichever cell becomes a gate. | ||
| 393 | +- **12-bit 4:2:2 remains unreachable** with this `aomenc` (inherited from | ||
| 394 | + `lanes/av1422re4222`); all cells here are 8-bit. | ||
| 395 | +- **No width sweep.** Width is fixed at 320, as assigned. The previous | ||
| 396 | + round's `O`/`Q`/`S`/`AB` widths (320/322/326) all at height 242 remain the | ||
| 397 | + only width evidence, and they all diverge — consistent with content, since | ||
| 398 | + they share one source. | ||
| 399 | +- **The lossless `read_inter_chroma_lossless` panic is untouched** (owned by | ||
| 400 | + `lane-av1422losslesspanic`). | ||
| 401 | +- **Full suite not run** (lane rules: scoped only; project-wide validation is | ||
| 402 | + Main's). | ||