av1422ctrigger (report only): the encoder setting is FOUND, the reproducer is one command, and the availability hypothesis is REFUTED
Browse files at this commit604fa6cc7d8af8e9ad4e2fe94762fb4a1f77e0d1Parent: eb9de961 changed file +515 -0
- lanes/av1422ctrigger.report.md +515 -0
lanes/av1422ctrigger.report.mdadded+515 -0
| @@ -0,0 +1,515 @@ | ||
| 1 | +# lane-av1422ctrigger — the 4:2:2 intra-chroma trigger is REPRODUCED; the availability decision is NOT the writer (measured refutation) | |
| 2 | + | |
| 3 | +**Outcome in one line: the encoder setting is found and a one-command reproducer | |
| 4 | +exists, but the "availability decision" hypothesis is REFUTED by two independent | |
| 5 | +mutation probes — so this lane delivers the reproducer and a refutation, not a | |
| 6 | +fix.** The tree is clean; no source change is proposed. | |
| 7 | + | |
| 8 | +Tip: `main` = `a30aca9e`. Worktree `/home/user/.cache/wt/av1422ctrigger`, | |
| 9 | +branch `lane-av1422ctrigger`, **zero commits, zero source changes**. Every edit | |
| 10 | +ever applied to this tree (the 4:2:2 sequence-header bypass probe, an | |
| 11 | +`EC_AV1_FHDUMP` frame-header dump, an `EC_SEEDTRACE` call-site print, a | |
| 12 | +`EC_422_DENY_LEFT` availability probe and an `EC_422_ANCHOR` anchor probe) is | |
| 13 | +reverted. `stream.rs:1803` reads `if seq.subsampling_x != seq.subsampling_y {` | |
| 14 | +again and the primary checkout's `git status --porcelain` is empty. | |
| 15 | + | |
| 16 | +--- | |
| 17 | + | |
| 18 | +## 0. What the brief assumed, and what measurement says | |
| 19 | + | |
| 20 | +The brief's step 1 says "the trigger is a header FIELD". **That is refuted.** | |
| 21 | +The trigger is not any header field; it is the *block structure the encoder's | |
| 22 | +partition/mode search lands on*, and the reason the previous lane's 42 fresh | |
| 23 | +encodes all dodged it is that they were not built with the same encoder recipe. | |
| 24 | + | |
| 25 | +| brief's premise | measured verdict | | |
| 26 | +|---|---| | |
| 27 | +| a sequence-header field differs | **REFUTED** — §1, all 7 cells share a bit-identical shape | | |
| 28 | +| a frame-0 header field differs | **REFUTED** — §1, identical except the content-driven `base_q_idx` | | |
| 29 | +| the trigger is reproducible | **CONFIRMED** — §2, one `aomenc` command reproduces it at the *same byte* | | |
| 30 | +| the availability / `dc_top` decision is the writer | **REFUTED** — §5, two probes each break the byte-exact cells | | |
| 31 | + | |
| 32 | +--- | |
| 33 | + | |
| 34 | +## 1. The header diff: no header field discriminates | |
| 35 | + | |
| 36 | +`EC_AV1_SEQDUMP` (the crate's own sequence-header dump, | |
| 37 | +`crates/ec-av1-syntax/src/sequence.rs:375`) over all six corpus cells plus my | |
| 38 | +fresh reproducer, and an `EC_AV1_FHDUMP` frame-header dump I added temporarily | |
| 39 | +in the worktree (reverted): | |
| 40 | + | |
| 41 | +| cell | geometry | `seq_profile` | `reduced_still_picture` | `use_128x128_sb` | `filter_intra` | `order_hint` | `cdef` | `tiles` | `qindex` | | |
| 42 | +|---|---|---|---|---|---|---|---|---|---| | |
| 43 | +| `Q_odd320x242` | 320x242 8 | 2 | false | true | true | true | **bits 0** | 1x1 | 25 | | |
| 44 | +| `O_odd322x242` | 322x242 8 | 2 | false | true | true | true | **bits 0** | 1x1 | 27 | | |
| 45 | +| `AB_inter_warp_odd` | 322x242 8 | 2 | false | true | true | true | **bits 0** | 1x1 | 16 | | |
| 46 | +| `S_odd326x242_10b` | 326x242 10 | 2 | false | true | true | true | **bits 0** | 1x1 | 34 | | |
| 47 | +| **`V_tile2x2_odd`** (EXACT) | 322x242 8 | 2 | false | true | true | true | **bits 2** | **2x2** | 27 | | |
| 48 | +| **`R_odd322x240`** (EXACT) | 322x240 8 | 2 | false | true | true | true | **bits 0** | 1x1 | 31 | | |
| 49 | +| **`MYREPRO`** (mine, DIVERGES) | 320x242 8 | 2 | false | true | true | true | **bits 0** | 1x1 | 26 | | |
| 50 | + | |
| 51 | +Every sequence header is the same shape: `profile=2 still=false reduced=false | |
| 52 | +timing_present=false op_cnt=1 idc0=0 level0=0 frame_width_bits=9 | |
| 53 | +frame_height_bits=8 frame_id_present=false use_128=true filter_intra=true | |
| 54 | +edge_filter=true interintra=true masked=true warped=true dual_filter=true | |
| 55 | +order_hint=true jnt_comp=true ref_frame_mvs=true`, differing only in | |
| 56 | +`max_w`/`max_h`. | |
| 57 | + | |
| 58 | +**The control that kills the header theory is `R_odd322x240`.** It is EXACT | |
| 59 | +(17/17) and its frame-0 header field set is *identical* to the failing cells': | |
| 60 | +same profile, same flags, same `cdef_bits=0`, same `allow_intrabc=true`, same | |
| 61 | +`tx_mode=Select`, same `hdr_bits=39`, same 1x1 tiles, same | |
| 62 | +`lr_type=[None,None,None]`. The only differences are `max_h` (240 vs 242) and | |
| 63 | +`qindex` (31 vs 25) — and `base_q_idx` is the encoder's rate-control output | |
| 64 | +for *this content*, not a mode or tool flag. | |
| 65 | + | |
| 66 | +So **no header field is the trigger.** The brief's hypothesis is refuted, and | |
| 67 | +this is the same conclusion `lanes/av1422h242map` reached from the other side | |
| 68 | +("it is CONTENT, and it is 4:2:2-only"), now confirmed at header granularity. | |
| 69 | + | |
| 70 | +--- | |
| 71 | + | |
| 72 | +## 2. THE REPRODUCER — the encoder setting, named | |
| 73 | + | |
| 74 | +The previous lane (`lanes/av1422llodd` §3) could not rebuild the four cells and | |
| 75 | +recorded the encoder setting as "the open factor". It is not open. The recipe is | |
| 76 | +in `lanes/av1422h242map` §1 ("R arm"), which reports reproducing `Q_odd320x242` | |
| 77 | +byte-for-byte (`17304b6cca378034`). Its failure to run for the prior lane was a | |
| 78 | +**y4m framing bug, not an aomenc limitation**: libaom's `y4m_input_fetch_frame` | |
| 79 | +(`av1/common/y4minput.c:1163-1171`) requires each frame to begin with the six | |
| 80 | +bytes `FRAME\n`. A y4m written with the full `YUV4MPEG2 ...` header on every | |
| 81 | +frame fails with `Loss of framing in Y4M input data` and encodes zero frames. | |
| 82 | + | |
| 83 | +### 2a. Source (hand-built 4:2:2 y4m; ffmpeg's muxer will not write the `C422` tag) | |
| 84 | + | |
| 85 | +``` | |
| 86 | +ffmpeg -v error -f lavfi -i testsrc2=size=320x242:rate=25 \ | |
| 87 | + -frames:v 16 -pix_fmt yuv422p -f rawvideo src.raw -y | |
| 88 | +# then: one "YUV4MPEG2 W320 H242 F25:1 Ip A1:1 C422\n" header line, | |
| 89 | +# then per frame "FRAME\n" + 320*242 + 2*(160*242) bytes | |
| 90 | +``` | |
| 91 | + | |
| 92 | +### 2b. The encode — this is the named trigger setting | |
| 93 | + | |
| 94 | +``` | |
| 95 | +aomenc --codec=av1 --profile=2 --input-bit-depth=8 --bit-depth=8 --limit=16 \ | |
| 96 | + --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 --pass=1 \ | |
| 97 | + --cq-level=24 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | |
| 98 | + --width=320 --height=242 --cpu-used=0 src/testsrc2_320x242.y4m -o n.webm | |
| 99 | +ffmpeg -v error -i n.webm -c copy -f obu n.obu -y | |
| 100 | +``` | |
| 101 | + | |
| 102 | +`aomenc` = `/home/user/.cache/aom-oracle/build/aomenc` (the instrumented | |
| 103 | +oracle tree's encoder, libaom as of 2026-09-30). | |
| 104 | + | |
| 105 | +### 2c. It reproduces, at the same byte | |
| 106 | + | |
| 107 | +`MYREPRO.obu`, 20 733 B, `sha256 909e58db18fd4b759…` (mine; the corpus cell | |
| 108 | +`Q_odd320x242.obu` is 21 381 B, `sha256 17304b6cca378034…` — the two differ from | |
| 109 | +byte 16 on, i.e. my `testsrc2` source bytes differ from the corpus's, so this is | |
| 110 | +a *behavioural* reproduction, not a byte-identical one): | |
| 111 | + | |
| 112 | +| cell | decode frames | first bad decode frame | first bad byte | | |
| 113 | +|---|---|---|---| | |
| 114 | +| `Q_odd320x242` (corpus) | 17 | **0** | **103156** | | |
| 115 | +| **`MYREPRO` (this lane, fresh)** | 17 | **0** | **103156** | | |
| 116 | +| `O_odd322x242` | 17 | 0 | 106388 | | |
| 117 | +| `AB_inter_warp_odd` | 43 | 0 | 110876 | | |
| 118 | +| `S_odd326x242_10b` | 17 | 0 | 214112 | | |
| 119 | +| `R_odd322x240` (control, EXACT) | 17 | — | — | | |
| 120 | +| `V_tile2x2_odd` (control, EXACT) | 17 | — | — | | |
| 121 | + | |
| 122 | +### 2d. Why the previous lane's 42 fresh encodes all dodged it | |
| 123 | + | |
| 124 | +`lanes/av1422llodd` §3 built its sweep with | |
| 125 | +`ffmpeg + libaom-av1 -crf 30 -b:v 0 -cpu-used 6 -usage good -lag-in-frames 0`. | |
| 126 | +That is **ffmpeg's libaom wrapper with a different rate-control mode and | |
| 127 | +`--cpu-used 6`**, not the `aomenc` R arm. The defect needs | |
| 128 | +`--cpu-used 0 --lag-in-frames 25 --auto-alt-ref=1 --enable-global-motion=1` | |
| 129 | +with a constant `--cq-level`; at `-cpu-used 6` the partition search settles on | |
| 130 | +different block structures and the shape never arises. **The sweep was a | |
| 131 | +control against the wrong recipe, which is why it read as "42/42 exact, no | |
| 132 | +trigger".** | |
| 133 | + | |
| 134 | +### 2e. Flag sweep on the fixed geometry (320x242, same source) | |
| 135 | + | |
| 136 | +Every variant below was encoded with the recipe above (same source, same | |
| 137 | +geometry) and measured with the §3 comparator. `sha256` is the first 32 hex: | |
| 138 | + | |
| 139 | +| variant | flag change | bytes | `sha256` | verdict (decode-order frames) | Y / U / V wrong | | |
| 140 | +|---|---|---|---|---|---| | |
| 141 | +| `sw_base` | (the recipe, §2b) | 20 733 | `909e58db18fd4b759…` | **0/17 exact**, first bad frame 0 | 0 / 6337 / 8398 | | |
| 142 | +| `sw_cdef1` | `--enable-cdef=1` | 20 733 | `909e58db18fd4b759…` | **0/17 exact** | 0 / 6337 / 8398 | | |
| 143 | +| `sw_cdef0` | `--enable-cdef=0` | 20 753 | `ceac79b220313b7a…` | **0/17 exact** | 0 / 6196 / 8462 | | |
| 144 | +| `sw_endq` | `--end-usage=q` | 27 377 | `aa16455036aaf142…` | **0/17 exact** | 0 / 7964 / 11614 | | |
| 145 | +| `sw_cq18` | `--cq-level=18` | 20 733 | `909e58db18fd4b759…` | **void** — see below | — | | |
| 146 | +| `sw_cq30` | `--cq-level=30` | 20 733 | `909e58db18fd4b759…` | **void** — see below | — | | |
| 147 | + | |
| 148 | +**CDEF is not the discriminator.** `--enable-cdef=1` is byte-identical to the | |
| 149 | +base (it is the default), `--enable-cdef=0` produces a *different* stream that | |
| 150 | +still diverges, and the failing cells' own frame headers already carry | |
| 151 | +`cdef_bits=0` — CDEF is inert in every stream measured here, so it cannot carry | |
| 152 | +the defect. | |
| 153 | + | |
| 154 | +**`--end-usage=q` is not the discriminator either**: it diverges too, at a | |
| 155 | +different magnitude (U 7964 / V 11614 vs 6337 / 8398). Both rate-control modes | |
| 156 | +produce the shape. | |
| 157 | + | |
| 158 | +**The `--cq-level` rows are void, and the reason is measured, not assumed.** | |
| 159 | +`mkenc.sh` hard-codes `--cq-level=24` in its base flag list and appends the | |
| 160 | +variant flag after it; `sw_cq18` and `sw_cq30` came out **byte-identical to | |
| 161 | +`sw_base`** (same 20 733 B, same `sha256`), which proves `aomenc` takes the | |
| 162 | +**first** occurrence of a repeated flag and the appended one never took effect. | |
| 163 | +I did not re-run that axis with the flag actually removed, so the rate-control | |
| 164 | +axis is **not** swept and I am not claiming anything about it. | |
| 165 | + | |
| 166 | +**Conclusion: no single aomenc tool flag turns the defect on or off.** It is the | |
| 167 | +partition/mode search's *outcome* for this content at this geometry, which is | |
| 168 | +why it is content-sensitive within one recipe (§2e, and | |
| 169 | +`lanes/av1422h242map` §4's `smptebars` control) and recipe-sensitive across | |
| 170 | +recipes (§2d). | |
| 171 | + | |
| 172 | +--- | |
| 173 | + | |
| 174 | +## 3. Per-cell, per-plane, per-decode-frame measurement (with flip control) | |
| 175 | + | |
| 176 | +`FINAL` (post-filter) decode-order dumps from both sides, compared per plane. | |
| 177 | +Both sides' `FINAL` dumps are already cropped to the display shape and have | |
| 178 | +equal byte length, so this is a straight per-plane wrong-SAMPLE count (16-bit LE | |
| 179 | +for the 10-bit cell). `Y / U / V`: | |
| 180 | + | |
| 181 | +| cell | frames | Y | U | V | total | frame-0 Y/U/V | | |
| 182 | +|---|---|---|---|---|---|---| | |
| 183 | +| `Q_odd320x242` | 17 | **0** | 9603 | 14456 | 24059 | 0/422/379 | | |
| 184 | +| `O_odd322x242` | 17 | **0** | 985 | 722 | 1707 | 0/32/16 | | |
| 185 | +| `S_odd326x242_10b` | 17 | **0** | 301 | 751 | 1052 | 0/17/32 | | |
| 186 | +| `AB_inter_warp_odd` | 43 | **0** | 3705 | 4366 | 8071 | 0/32/32 | | |
| 187 | +| `V_tile2x2_odd` | 17 | 0 | 0 | 0 | **0 (EXACT)** | — | | |
| 188 | +| `R_odd322x240` | 17 | 0 | 0 | 0 | **0 (EXACT)** | — | | |
| 189 | + | |
| 190 | +**Oracle-flip control, same comparator, one bit flipped in the oracle's own | |
| 191 | +frame-0 mid-frame byte:** | |
| 192 | + | |
| 193 | +| cell | measured | flipped | delta | landed in | | |
| 194 | +|---|---|---|---|---| | |
| 195 | +| `Q_odd320x242` | U 9603 | U 9604 | **+1** | U, frame 0 | | |
| 196 | +| `O_odd322x242` | U 985 | U 986 | **+1** | U, frame 0 | | |
| 197 | +| `S_odd326x242_10b` | U 301 | U 302 | **+1** | U, frame 0 | | |
| 198 | +| `AB_inter_warp_odd` | U 3705 | U 3706 | **+1** | U, frame 0 | | |
| 199 | +| `V_tile2x2_odd` | 0 | 1 | **+1** | U, frame 0 | | |
| 200 | +| `R_odd322x240` | 0 | 1 | **+1** | Y, frame 0 | | |
| 201 | + | |
| 202 | +The comparator bites: exactly one flipped bit produces exactly one extra wrong | |
| 203 | +sample, in the plane the flip landed in. The counts above are real. | |
| 204 | +**Luma is byte-exact on all four failing cells, every decode frame.** | |
| 205 | + | |
| 206 | +**There is no "after" column: this lane changed no source, so every number above | |
| 207 | +is a before measurement and the after state is identical by construction.** | |
| 208 | + | |
| 209 | +--- | |
| 210 | + | |
| 211 | +## 4. The seed, pinned in pixels | |
| 212 | + | |
| 213 | +`Q_odd320x242`, decode frame 0, `EC_AV1_PREFILT_DUMP` from both sides | |
| 214 | +(ours de-padded from its stride-256 plane buffers, the oracle already cropped). | |
| 215 | +Wrong region: **chroma cols 116–139, rows 160–201, in both U and V** — 24 of 160 | |
| 216 | +columns, 42 of 242 rows, ~0.5 % of each chroma plane. Luma: 0 wrong. | |
| 217 | + | |
| 218 | +First wrong unit, U, chroma (116,160) — a 4x4 unit, wrong in **all 16** pixels: | |
| 219 | + | |
| 220 | +| | value | arithmetic | | |
| 221 | +|---|---|---| | |
| 222 | +| above row (chroma y=159, x=116..119) | `202 202 202 202` — **byte-identical both sides** | sum 808 | | |
| 223 | +| left column (chroma x=115, y=160..163) | `165 164 163 152` — **byte-identical both sides** | sum 644 | | |
| 224 | +| **ours** | **182** | `(808 + 644 + 4) / 8` = `dc` (above **and** left) | | |
| 225 | +| **oracle** | **202** | `(808 + 2) / 4` = above-only | | |
| 226 | + | |
| 227 | +So the samples on both edges are identical on the two sides and only the | |
| 228 | +*DC variant* differs. Our own trace names the unit | |
| 229 | +(`EC_PRED=1`, `decode.rs:4641`, the **square** `reconstruct` path, not the | |
| 230 | +4x8 `sub8_leaf_chroma422` rect path at `decode.rs:4625`): | |
| 231 | + | |
| 232 | +``` | |
| 233 | +OUR_PRED x=116 y=160 plane=1 side=4 side=4 mode=0 ad=0 ft=0 sum=2912 row0=[182,182,182,182] | |
| 234 | +``` | |
| 235 | + | |
| 236 | +and an `EC_SEEDTRACE` call-site print I added temporarily (reverted) resolved the | |
| 237 | +exact producer: **`decode.rs:26026`, the `skip` arm of `sub8_leaf_chroma422`**. | |
| 238 | +Our own block structure at the seed (`EC_AV1_TRACE`, our quarter-mi grid, `MI=4`): | |
| 239 | + | |
| 240 | +``` | |
| 241 | +TRACE partition_w8 mi=(40,58) ctx=0 value=1 <- 8x8 luma group at luma x=232 | |
| 242 | +TRACE sub8 skip mi=(40,58) ctx=1 value=1 <- leaf 1, SKIP, luma 232-239 y160-163 | |
| 243 | +TRACE sub8 skip mi=(41,58) ctx=1 value=0 <- leaf 2, luma 232-239 y164-167 | |
| 244 | +TRACE partition_w8 mi=(40,60) ctx=2 value=1 <- 8x8 luma group at luma x=240 | |
| 245 | +TRACE sub8 skip mi=(40,60) ctx=1 value=0 | |
| 246 | +TRACE sub8 y_mode mi=(40,60) value=12 | |
| 247 | +TRACE sub8 skip mi=(41,60) ctx=0 value=0 | |
| 248 | +TRACE sub8 y_mode mi=(41,60) value=0 | |
| 249 | +``` | |
| 250 | + | |
| 251 | +i.e. two `BLOCK_8X8` groups each split `HORZ` into two `BLOCK_8X4` leaves, whose | |
| 252 | +4:2:2 chroma is two stacked 4x4 units at chroma x=116 and x=120. Our | |
| 253 | +`sub8_leaf_chroma422` anchor is | |
| 254 | +`((lmi.1 & !1) * MI) >> ss_x` (`decode.rs:25969`) = `(58*4)>>1` = **116**, which | |
| 255 | +matches libaom — see §5b. | |
| 256 | + | |
| 257 | +--- | |
| 258 | + | |
| 259 | +## 5. The availability decision: NAMED OUR LINE, and REFUTED as the writer | |
| 260 | + | |
| 261 | +### 5a. The line, and the libaom expression it must match | |
| 262 | + | |
| 263 | +**Our line is the intra edge-availability gate, not the DC arithmetic:** | |
| 264 | + | |
| 265 | +* `crates/ec-av1/src/decode.rs:21076` — `PlaneBuf::edges`, the square path | |
| 266 | +* `crates/ec-av1/src/decode.rs:21115` — `PlaneBuf::edges_rect`, the rect path | |
| 267 | + | |
| 268 | +```rust | |
| 269 | +let left = (x > self.tile_x0 && down > y).then(|| …); | |
| 270 | +``` | |
| 271 | + | |
| 272 | +The DC arithmetic is **not** at fault and needs no change: `intra::dc` | |
| 273 | +(`crates/ec-av1/src/intra.rs:683-726`) already implements all four AV1 variants | |
| 274 | +correctly — `(None, Some) => average(l, bh)` is `dc_left`, `(Some, None) => | |
| 275 | +average(a, bw)` is `dc_top`, `(Some, Some)` is `dc` / `dc_predictor_rect` with | |
| 276 | +libaom's own `dc_rect_multiplier` derivation (`intra.rs:732-745`), and | |
| 277 | +`(None, None) => 1 << (bit_depth - 1)` is `dc_128`. The seed's 182 is exactly | |
| 278 | +`(Some, Some)`. | |
| 279 | + | |
| 280 | +**The libaom expression our gate does not implement** (`reconintra.c:1744-1747`, | |
| 281 | +consuming `set_mi_row_col`, `av1_common_int.h:1367-1379`): | |
| 282 | + | |
| 283 | +```c | |
| 284 | +const int have_top = row_off || (ss_y ? xd->chroma_up_available : xd->up_available); | |
| 285 | +const int have_left = col_off || (ss_x ? xd->chroma_left_available : xd->left_available); | |
| 286 | +… | |
| 287 | +xd->left_available = (mi_col > tile->mi_col_start); | |
| 288 | +xd->chroma_up_available = xd->up_available; | |
| 289 | +xd->chroma_left_available = xd->left_available; | |
| 290 | +if (ss_x && bw < mi_size_wide[BLOCK_8X8]) xd->chroma_left_available = (mi_col - 1) > tile->mi_col_start; | |
| 291 | +if (ss_y && bh < mi_size_high[BLOCK_8X8]) xd->chroma_up_available = (mi_row - 1) > tile->mi_row_start; | |
| 292 | +``` | |
| 293 | + | |
| 294 | +Our gate is missing **three** terms libaom has: the `col_off` term, the | |
| 295 | +per-plane `ss_x`/`ss_y` selection between `chroma_left_available` and | |
| 296 | +`left_available`, and the `bw < mi_size_wide[BLOCK_8X8]` narrowing clause. | |
| 297 | +(`mi_size_wide[]` is in **4x4 units** — `common_data.h:35` — so | |
| 298 | +`mi_size_wide[BLOCK_8X8] == 2` and the clause fires only for a 4-luma-px-wide | |
| 299 | +block, `bw == 1`.) At 4:2:2 `ss_y == 0`, so libaom's `chroma_up_available` is | |
| 300 | +plain `up_available` and its `ss_y` clause is dead — the prior report's reading | |
| 301 | +of that clause is confirmed, but it is not where the answer is. | |
| 302 | + | |
| 303 | +### 5b. Why the seed's `chroma_left_available` cannot be 0 — and the oracle prints nothing | |
| 304 | + | |
| 305 | +For the seed's `BLOCK_8X4` leaf: `bw = mi_size_wide[BLOCK_8X4] = 2`, so | |
| 306 | +`bw < 2` is **false** and `chroma_left_available = left_available = (mi_col=29 > 0) | |
| 307 | += 1`. `n_left_px = have_left ? AOMMIN(txhpx, yd + txhpx) : 0` = 4. libaom must | |
| 308 | +therefore take `dc`, i.e. **182** — yet the oracle's pixels are 202. So the | |
| 309 | +oracle's chroma at (116,160) was **not** produced by that leaf's DC path. | |
| 310 | + | |
| 311 | +Two independent measurements locate why, and neither is the availability gate: | |
| 312 | + | |
| 313 | +1. **libaom's own rung proves it.** `av1_predict_intra_block`'s only early return | |
| 314 | + before the prediction rungs is the palette write (`reconintra.c:1717-1739`, | |
| 315 | + `if (use_palette) { …; return; }`). The oracle's `EC_PREDOUT8` ladder has | |
| 316 | + **no entry at `mi_col=29` anywhere in the frame**, and **no plane-1 entry | |
| 317 | + between `mi_col=24` and `mi_col=32` at `mi_row=20`** — so chroma cols | |
| 318 | + 116–127 at rows 160+ were written on a path that prints nothing. Note the | |
| 319 | + prior lane's inference "`libaom` used `dc_top`" is an **inference from the | |
| 320 | + value 202**, not a printed flag: `EC_PREDOUT8` (the DC path, | |
| 321 | + `reconintra.c:1798-1807`) prints `mi_row/mi_col/plane/row_off/col_off/ | |
| 322 | + txw/txh/mode/sum/row0/col0` and **not** `have_left`/`n_left`. Only the | |
| 323 | + *directional* `EC_PRED` rung (`reconintra.c:1863-1871`) prints | |
| 324 | + `have_top/have_left/n_top/n_left/n_tr/n_bl/bsize`. So the oracle's DC | |
| 325 | + availability at the seed is **unobservable with the current rungs**, and | |
| 326 | + "`dc_top`" is a hypothesis, not a measurement. | |
| 327 | +2. **Palette is excluded for this block, and chroma-palette is excluded by | |
| 328 | + parity.** Our `read_intra_mode_sub8` (`decode.rs:24955`) reads no palette, and | |
| 329 | + that is correct: `av1_allow_palette` needs both block dims ≥ 8, and a | |
| 330 | + `BLOCK_8X4` leaf has height 4. The oracle's own `EC_PALSYN_AOM` ladder | |
| 331 | + (`decodemv.c:607-610`) has 299 entries, **every one at an even `mi_col`**, | |
| 332 | + and **none at `mi_row=20`** — consistent with palette being legal only on | |
| 333 | + ≥ 8x8 blocks at even `mi_col`, i.e. it cannot be the writer at `mi_col=29`. | |
| 334 | + | |
| 335 | +**The 202 therefore comes from a block whose chroma plane block `mi_col` is | |
| 336 | +0 or 1, or from a unit shape I have not identified — and the current oracle | |
| 337 | +rungs cannot distinguish those.** The oracle's `EC_TRACE` partition ladder | |
| 338 | +(`decodeframe.c:1320-1331`) is also incomplete: it has 346 `EC_PART_VAL` entries | |
| 339 | +and **no root at all covering `mi_row=20, mi_col=24..31`**, which is the seed's | |
| 340 | +luma, so the oracle's block structure cannot be read off it either. This is the | |
| 341 | +documented `av1-trace-label-mismatch-class` / label-space trap, and I am not | |
| 342 | +going to guess past it. | |
| 343 | + | |
| 344 | +### 5c. Two mutation probes — the availability/anchor hypotheses are REFUTED | |
| 345 | + | |
| 346 | +Both probes were env-gated, built, and measured across all six cells, then | |
| 347 | +reverted. | |
| 348 | + | |
| 349 | +**Probe 1 — deny the left edge to every 4:2:2 sub-8 chroma prediction** | |
| 350 | +(`EC_422_DENY_LEFT=1`, a depth counter consulted by both `edges` and | |
| 351 | +`edges_rect` and armed around `sub8_leaf_chroma422`'s three arms): | |
| 352 | + | |
| 353 | +| cell | baseline | with `EC_422_DENY_LEFT=1` | | |
| 354 | +|---|---|---| | |
| 355 | +| `Q_odd320x242` | 0/17 | **0/17 (not fixed)** | | |
| 356 | +| `O_odd322x242` | 0/17 | **0/17 (not fixed)** | | |
| 357 | +| `S_odd326x242_10b` | 0/17 | **0/17 (not fixed)** | | |
| 358 | +| `AB_inter_warp_odd` | 0/43 | **0/43 (not fixed)** | | |
| 359 | +| `V_tile2x2_odd` | **17/17 EXACT** | **0/17 — BROKEN** | | |
| 360 | +| `R_odd322x240` | **17/17 EXACT** | **0/17 — BROKEN** | | |
| 361 | + | |
| 362 | +The seed moves `U(116,160)` 182 → 128 (i.e. `dc_128`, both edges denied) and | |
| 363 | +`U(120,160)` 182 → 202, so the probe does reach the seed — but it fixes nothing | |
| 364 | +and destroys the two byte-exact controls. **A blanket per-arm availability | |
| 365 | +denial is refuted.** (The probe is also confounded by the deferred | |
| 366 | +reconstruction queue: the guard is live only while `sub8_leaf_chroma422` is | |
| 367 | +pushing, so units executed later in the queue are unaffected. That confounder is | |
| 368 | +why this probe is reported as *refuting* rather than as a clean negative.) | |
| 369 | + | |
| 370 | +**Probe 2 — libaom's real chroma anchor floor.** libaom floors the chroma | |
| 371 | +anchor only when `mi_size_wide[bsize] == 1` and `mi_col` is odd | |
| 372 | +(`setup_pred_plane`, `reconinter.h:392-395`): | |
| 373 | + | |
| 374 | +```c | |
| 375 | +if (subsampling_x && (mi_col & 0x01) && (mi_size_wide[bsize] == 1)) mi_col -= 1; | |
| 376 | +const int x = (MI_SIZE * mi_col) >> subsampling_x; | |
| 377 | +``` | |
| 378 | + | |
| 379 | +Our `sub8_leaf_chroma422` writes `((lmi.1 & !1) * MI) >> ss_x` (`decode.rs:25969`), | |
| 380 | +which masks the **quarter-mi** grid. Because our `MI = 4` (`decode.rs:7355`), | |
| 381 | +`lmi.1 = 2 * mi_col` is **always even**, so `lmi.1 & !1` is a **no-op that never | |
| 382 | +fires**. Porting libaom's real condition (`EC_422_ANCHOR=1`: `ss_x == 1 && | |
| 383 | +(lmi.1 / 2) % 2 == 1 && leaf_shape.0 == 4`): | |
| 384 | + | |
| 385 | +| cell | baseline | with `EC_422_ANCHOR=1` | | |
| 386 | +|---|---|---| | |
| 387 | +| the four failing cells | 0/17, 0/17, 0/17, 0/43 | **unchanged (not fixed)** | | |
| 388 | +| `V_tile2x2_odd` | **17/17 EXACT** | **0/17 — BROKEN** | | |
| 389 | +| `R_odd322x240` | **17/17 EXACT** | **0/17 — BROKEN** | | |
| 390 | + | |
| 391 | +So the `& !1` no-op is **load-bearing on today's material**: the blocks it | |
| 392 | +misfloors are ones whose correct anchor is *not* libaom's floor either. **The | |
| 393 | +anchor-floor hypothesis is refuted**, and the dead mask is a latent trap for | |
| 394 | +4-px-wide sub-8 leaves that no committed 4:2:2 fixture exercises. | |
| 395 | + | |
| 396 | +**Net: neither candidate is the writer, and both candidate fixes are actively | |
| 397 | +harmful. I am not landing either.** | |
| 398 | + | |
| 399 | +--- | |
| 400 | + | |
| 401 | +## 6. Class sweep — what the defect does and does not touch | |
| 402 | + | |
| 403 | +Reachable decisions measured at the seed and across the wrong region | |
| 404 | +(`Q_odd320x242` frame 0, wrong 4x4 units): | |
| 405 | + | |
| 406 | +| decision | measured | | |
| 407 | +|---|---| | |
| 408 | +| both stacked 4x4 units of the 8x4 leaf | **the first (row 160) is wrong on both leaves** (`x=116` and `x=120`); the second (row 164) is **byte-identical on both sides** | | |
| 409 | +| both chroma planes | **yes** — U and V both wrong, same region, same counts order | | |
| 410 | +| both DC variants | `Q`'s seed is `dc` (ours) vs above-only (oracle); other wrong units in the region are **not** flat-202 on the oracle (`x=132,y=168`: oracle 158 vs ours 123; `x=128,y=192`: oracle 148 vs ours 137), so the class is **not** confined to the `dc`/`dc_top` choice | | |
| 411 | +| directional chroma modes sharing `have_left`/`have_top` | the neighbouring wrong units include `mode=12` (SMOOTH) and `mode=2` predictions in our trace, so the class is **not** DC-only | | |
| 412 | +| luma | **0 wrong samples, every decode frame, all four cells** — the class is chroma-only | | |
| 413 | +| post-recon filters | **0** — `PREFILT`-vs-oracle counts equal `FINAL`-vs-oracle counts exactly (`Q` 422+379 = 801 both ways), re-confirming `lanes/av1422llodd` §2 | | |
| 414 | +| 4:2:0 / 4:4:4 | **0** — `lanes/av1422h242map` §4's 4:2:0 control at width 320 is exact at every height 232–252 but 236, and `V`/`R` here are exact at the same geometries | | |
| 415 | +| entropy parse | **in sync** — luma byte-exact on every frame of all four cells | | |
| 416 | + | |
| 417 | +--- | |
| 418 | + | |
| 419 | +## 7. Gate-ability: NO. Stated plainly, not substituted. | |
| 420 | + | |
| 421 | +4:2:2 is refused at the **sequence header** — | |
| 422 | +`crates/ec-av1/src/stream.rs:1803`, `if seq.subsampling_x != seq.subsampling_y`. | |
| 423 | +**No committed fixture and no committed test can reach this code.** Every | |
| 424 | +measurement in this report required patching that guard out; the guard is | |
| 425 | +restored on this lane and `git status` is clean. | |
| 426 | + | |
| 427 | +What a future lane that lifts the refusal would need, now measured and | |
| 428 | +reproducible: | |
| 429 | + | |
| 430 | +* `R422_320x242.obu`, 20 733 B, `sha256 909e58db18fd4b7590501e2cecfbc090cde49eb26c9a42e15b1ef1fc265843d8` | |
| 431 | + — **and it now has a recipe** (§2a/§2b), which the previous round lacked. | |
| 432 | + This is the first 4:2:2 artifact in this line of work that is both committed-able | |
| 433 | + and buildable from scratch. | |
| 434 | +* A per-decode-frame, per-plane byte-exactness gate (the comparator is | |
| 435 | + `planecmp.py`, §3) plus a mutation proof. | |
| 436 | +* **An oracle rung that prints `have_left`/`n_left`/`have_top`/`n_top` on the DC | |
| 437 | + path.** `EC_PREDOUT8` does not, which is why this defect survived three lanes | |
| 438 | + of label archaeology. Adding those four fields to | |
| 439 | + `reconintra.c:1798-1807` (and to the high-bitdepth twin at `:1774-1791`) is | |
| 440 | + the single highest-value change for closing this defect, and it is an oracle | |
| 441 | + change, not a decoder change. | |
| 442 | + | |
| 443 | +I am not offering a source-scan substitute, and I am not committing the bypass. | |
| 444 | + | |
| 445 | +--- | |
| 446 | + | |
| 447 | +## 8. Regression | |
| 448 | + | |
| 449 | +`cargo test --release -p ec-av1 --lib -- 420 422 444 lossless warp intra | |
| 450 | +--skip bitrate_target_lands_within_5_percent_over_48_frames` on the **reverted, | |
| 451 | +bypass-free, probe-free** lane tree at `a30aca9e`, with | |
| 452 | +`EC_AV1_AOMDEC=/home/user/.cache/aom-oracle/build/aomdec` and | |
| 453 | +`CARGO_TARGET_DIR=/home/user/.cache/tgt/av1422ctrigger`: | |
| 454 | + | |
| 455 | +**`test result: ok. 181 passed; 0 failed; 2 ignored; 0 measured; 618 filtered out; finished in 232.88s`** | |
| 456 | + | |
| 457 | +That is the **same count as `lanes/av1422llodd` §8's baseline** (181/0/2) on an | |
| 458 | +older tip, so nothing moved. No failure was a `/tmp`-full artefact: `/tmp` was | |
| 459 | +at 13 G of 16 G free with `/tmp/ec-av1-*` cleared before the run, and the run | |
| 460 | +reported **0 failed** on the first attempt — no red-then-green sequence to | |
| 461 | +explain. | |
| 462 | + | |
| 463 | +This lane changed no source, so this is a **baseline confirmation, not | |
| 464 | +fix-verification**. `/tmp` was checked first (13 G of 16 G free, | |
| 465 | +`/tmp/ec-av1-*` cleared) so that no gate can fail with | |
| 466 | +`Os { code: 122, kind: QuotaExceeded }` — the class that reads exactly like a | |
| 467 | +red gate (`local-edquot-rust-build-tests`). | |
| 468 | + | |
| 469 | +--- | |
| 470 | + | |
| 471 | +## 9. Handover for the next lane | |
| 472 | + | |
| 473 | +1. **Add `have_top`/`have_left`/`n_top_px`/`n_left_px` to the oracle's DC-path | |
| 474 | + rung** (`reconintra.c:1798`, 8-bit, and `:1774`, high-bitdepth). Everything | |
| 475 | + else in this defect is currently blocked on that one blind spot: three lanes | |
| 476 | + have now inferred the oracle's DC availability from the predicted *value* | |
| 477 | + instead of reading it. | |
| 478 | +2. **Make the oracle's partition ladder complete.** `EC_TRACE`'s 346 | |
| 479 | + `EC_PART_VAL` entries leave `mi_row=20, mi_col=24..31` — the seed's luma — | |
| 480 | + with no root, so the oracle's own block structure at the seed is unreadable. | |
| 481 | + Find out why `read_partition` is not called for that region. | |
| 482 | +3. **The reproducer is now cheap: re-run the §2b command and diff frame 0.** | |
| 483 | + Any candidate fix must take `MYREPRO.obu` from 0/17 to 17/17 **while keeping | |
| 484 | + `V_tile2x2_odd` and `R_odd322x240` at 17/17** — those two are the control | |
| 485 | + that killed both of my candidate fixes, and they are the only two cells that | |
| 486 | + will catch an over-broad availability or anchor change. | |
| 487 | +4. **Do not re-chase**: the header fields (§1), the post-recon filters (§6), the | |
| 488 | + entropy parse, the palette colour maps, `intra::dc`'s arithmetic (§5a), and | |
| 489 | + odd/even geometry (all 42 of `lanes/av1422h242map`'s sweep). | |
| 490 | +5. **The seed's real writer is still unnamed.** It is a chroma write on the | |
| 491 | + oracle's side that emits no prediction rung, at a luma `mi_col` where our | |
| 492 | + leaf is 8 px wide and libaom's `chroma_left_available` is provably 1. Either | |
| 493 | + the oracle's block structure differs from ours in a way the ladders cannot | |
| 494 | + currently express, or the value is a residual rather than a prediction. The | |
| 495 | + rung in (1) plus the ladder fix in (2) decide between those two. | |
| 496 | + | |
| 497 | +--- | |
| 498 | + | |
| 499 | +## 10. Handover hygiene | |
| 500 | + | |
| 501 | +* Lane tree `/home/user/.cache/wt/av1422ctrigger` on `lane-av1422ctrigger`: | |
| 502 | + **clean** apart from this report. The bypass probe, the `EC_AV1_FHDUMP` | |
| 503 | + frame-header dump, the `EC_SEEDTRACE` call-site print, the `EC_422_DENY_LEFT` | |
| 504 | + availability probe and the `EC_422_ANCHOR` anchor probe are **all reverted** | |
| 505 | + (`git status --porcelain` empty; `stream.rs:1803` reads | |
| 506 | + `if seq.subsampling_x != seq.subsampling_y {`). | |
| 507 | +* Primary checkout `/home/user/Documents/Code/Rust/edith_codecs`: | |
| 508 | + `git status --porcelain` **empty**. No relative-path leak. All edits used | |
| 509 | + absolute paths inside the worktree. | |
| 510 | +* No push, no merge, no rustfmt. The 4:2:2 sequence-header bypass is **not** | |
| 511 | + committed anywhere. No `4:2:2` fixture is committed (the refusal makes it | |
| 512 | + unreachable, §7). | |
| 513 | +* Measurement scripts and the reproducer cell live outside the repo, in | |
| 514 | + `/home/user/.cache/lane-av1422ctrigger/` (`mkenc.sh`, `planecmp.py`, | |
| 515 | + `census.sh`, `src/testsrc2_320x242.y4m`, `sweep/`). |