forge
Explore
Log in

Don't you dare go Hollow

Merge lane-av1422seed r2: the localisation report is amended to point at the landed fix

Browse files at this commit

2b46317b6c7470e2715046b94849bc25952091f1Ahmet Kaan GümüşParent: 2a729cd8a032f3
Report-only. The seed lane's localisation (the intrabc 1:4 strip's pair geometry, the constant list, the
sentinel census) is annotated with the RESOLVED outcome: the fix landed as `459e425d` in lane-av1422luma, and
all six cells of the family are byte-exact. The amendment records what the localisation missed and why -- the
mi-map PUBLICATION half (the origin alone regressed luma 0 -> 5958) and the fact that `has_chroma` was NOT the
missing piece (the caller's predicate already holds for every HORZ strip in the cell: 56 in frame 0, and the U/V
units at mi (51,84) are read, so the oracle reads chroma for an even-row strip too).
lanes/av1422seed.report.mdmodified+90 -10
@@ -4,7 +4,10 @@
4 applied verbatim at ss (1,0) — proved by an unwritten-sample census, not inferred —4 applied verbatim at ss (1,0) — proved by an unwritten-sample census, not inferred —
5 and the write-side half of the fix is not sufficient on its own: moving the chroma5 and the write-side half of the fix is not sufficient on its own: moving the chroma
6 write alone regresses luma, so the entropy-side half of the same arm must move with6 write alone regresses luma, so the entropy-side half of the same arm must move with
7-it. This branch therefore lands NO decoder change.**7+it. The landed fix is `lane/av1422luma` `459e425d` (§3.3): the write, BOTH chroma
8+context gathers, AND the mi-map publication have to move together; with all
9+three, all six cells of this family are byte-exact vs ffmpeg. This branch
10+carries NO decoder change.**
8 11
9 Tip: `main` = `affe70dc`. Worktree `/home/user/.cache/wt/av1422seed`, branch12 Tip: `main` = `affe70dc`. Worktree `/home/user/.cache/wt/av1422seed`, branch
10 `lane/av1422seed`. `crates/ec-av1/src/decode.rs` and `src/stream.rs` are at13 `lane/av1422seed`. `crates/ec-av1/src/decode.rs` and `src/stream.rs` are at
@@ -21,8 +24,11 @@ committed and the sequence-header refusal is intact.
21 and the per-frame counts.24 and the per-frame counts.
22 3. §4 — the localisation: the exact arm, the exact constants, and a census that25 3. §4 — the localisation: the exact arm, the exact constants, and a census that
23 names the unwritten samples.26 names the unwritten samples.
24-4. §5 — the attempted fix, why it is **not** landed, and what the remaining half is.27+4. §3.3 — the RESOLVED outcome: the landed fix `459e425d`, its exact five-edit
25-5. §6 — what is NOT measured (stated, not hidden).28+ shape, and the before/after table for all six cells of this family.
29+5. §4 — what this lane attempted and why the write-side half alone was not enough
30+ (the two missing halves are now in `459e425d`).
31+6. §7 — what is NOT measured (stated, not hidden).
26 32
27 ---33 ---
28 34
@@ -229,7 +235,80 @@ strip family, same two-row-pair displacement, five geometries.
229 235
230 ---236 ---
231 237
232-## 4. The attempted fix, and why it is not landed238+## 3.3 RESOLVED — the landed fix is `lane/av1422luma` commit `459e425d`
239+
240+**Supersedes §4's "not landed" verdict. One owner for this defect:
241+`lanes/av1422luma.report.md`, commit `459e425d`.** Two lanes converged on one
242+function, which is the strongest signal in this report.
243+
244+Measured there, ffmpeg 8.1.3, 16 shown frames per cell:
245+
246+| cell | pre | post |
247+|---|---|---|
248+| `s422_320x246` | 0/7810/5531 | **0/0/0** |
249+| `s422_322x240` | 0/22003/21625 | **0/0/0** |
250+| `s422_322x246` | 0/3437/2222 | **0/0/0** |
251+| `s422_352x242_10b` | 0/4653/3777 | **0/0/0** |
252+| `s422_416x242_10b` | 0/5740/4348 | **0/0/0** |
253+| `s422_416x250_10b` | 99011/61486/60106 | **0/0/0** |
254+
255+25 of 26 swept cells byte-exact; `s422_384x240` unchanged at 0/1780/1871 — a
256+DIFFERENT residual (luma-exact on both sides of the change, first bad frame 1),
257+so it must not be attributed to the 1:4-strip arm. All 4:2:0 and 4:4:4 controls
258+byte-exact before and after.
259+
260+**The landed shape** (`decode.rs`, `decode_rect4_16_intrabc`). One predicate
261+`own422 = ss_x == 1 && ss_y == 0 && horz`, `own_chroma = own444 || own422`
262+(`own444` unchanged), five edits:
263+
264+1. `cw, ch = if own_chroma { (bw >> ss_x(fctx), bh >> ss_y(fctx)) } else { (pw/2, ph/2) }`
265+2. `pair_mi = has_chroma ? (own_chroma ? lmi : horz ? (lmi.0-1, lmi.1) : (lmi.0, lmi.1-1)) : lmi`
266+3. `cpx, cpy = has_chroma ? (own_chroma ? (px >> ss_x(fctx), py >> ss_y(fctx)) : (pair_mi.1*MI/2, pair_mi.0*MI/2)) : (0, 0)`
267+4. **BOTH** chroma gathers (the non-lossless one and the `chroma_stamped_per_unit
268+ = false` one; the lossless `read_inter_chroma_lossless` twin takes `pair_mi` /
269+ `(cpx, cpy)` as arguments and inherits 1-3 for free):
270+
271+ ```rust
272+ let (gmi, gw, gh) = if own_chroma { (lmi, bw, bh) } else { (pair_mi, pw, ph) };
273+ let around = if own422 {
274+ neighbours.around_mi_422_chroma(gmi, gw, gh) // ss (1,0) only
275+ } else {
276+ neighbours.around_mi_rect(gmi, gw, gh) // 4:2:0 pair, 4:4:4 own extent
277+ };
278+ ```
279+
280+ 4:4:4 deliberately keeps `around_mi_rect`: at `ss_x == 0` a chroma column IS a
281+ luma mi column, so the every-second-column sampling would halve its own above
282+ span.
283+5. **the publication the NEXT block's context reads** — the half this lane never
284+ named:
285+
286+ ```rust
287+ let (rmi, rw, rh) = if own_chroma { (lmi, bw, bh) } else { (pair_mi, pw, ph) };
288+ neighbours.record_uv_mode_mi(rmi.0, rmi.1, rw / MI, rh / MI, DC_PRED);
289+ // and the two left/above skip loops over rh/MI and rw/MI at rmi
290+ ```
291+
292+**`has_chroma` is NOT the missing piece** — §4's open candidate 1 is disproved:
293+the caller's existing predicate already holds for every HORZ strip in the cell
294+(56 of them in frame 0; the U and V units at mi (51, 84) are read, so the oracle
295+reads chroma for an even-row strip too).
296+
297+**Why every half was needed — it is one constant read from three places.** The
298+entropy-side half is `around_mi_rect(pair_mi, pw, ph)`: at 4:2:2 the U/V
299+`txb_skip` read of the intra-BC 16x4 strip at mi (51, 84) took its **LEFT** flag
300+one mi row high (ours ctx 2, oracle ctx 8), so `all_zero` decoded 1 instead of 0
301+and the frame desynced, luma included. That is exactly why this lane's
302+write-side-only attempt regressed luma 0 -> 5958: the write had moved to the
303+strip's own origin while the gather and the publication stayed on the 4:2:0 pair,
304+so the three halves disagreed about which block the chroma TU belonged to.
305+
306+This lane's branch carries **no decoder change** (`33cb2d0b` is the report plus
307+the comparator scripts); every hunk is Agent07-4's to carry, agreed by IRC message.
308+§4 is kept as the record of what was tried here and why the write-side half alone
309+was insufficient.
310+
311+## 4. The attempted fix, and why it was not sufficient on its own
233 312
234 The write-side half of the fix, applied and measured (this is the change that is313 The write-side half of the fix, applied and measured (this is the change that is
235 **not** in the tree):314 **not** in the tree):
@@ -311,7 +390,8 @@ Per-frame U counts, `s422_320x246` (display order, 16 frames):
311 **every** frame, growing with the altref's reference use, which is what a390 **every** frame, growing with the altref's reference use, which is what a
312 frame-0 seed that later frames predict from looks like.391 frame-0 seed that later frames predict from looks like.
313 392
314-Post-fix: **none** — the change is not landed.393+Post-fix (`459e425d`, measured by Agent07-4): **0/0/0 on all five**, plus `0/0/0`
394+on `s422_416x250_10b` — see §3.3.
315 395
316 **4:2:0 and 4:4:4 controls after the change attempt:** unchanged, `0/0/0` on all396 **4:2:0 and 4:4:4 controls after the change attempt:** unchanged, `0/0/0` on all
317 five control cells (§1.1 re-run with the change in the tree: 5/5 BYTE-EXACT). The397 five control cells (§1.1 re-run with the change in the tree: 5/5 BYTE-EXACT). The
@@ -335,15 +415,15 @@ Run against `main` instead, the five slice cells read the §2 numbers and
335 `s422_416x250_10b` reads the census's luma-wrong row. The sweep is here so the415 `s422_416x250_10b` reads the census's luma-wrong row. The sweep is here so the
336 next lane does not have to re-derive it: **`s422_384x240` is not this defect**416 next lane does not have to re-derive it: **`s422_384x240` is not this defect**
337 (its first bad frame is 1, and its region is not the 16-columns-from-the-right417 (its first bad frame is 1, and its region is not the 16-columns-from-the-right
338-band), so closing this arm should leave exactly one 4:2:2 cell diverging in the418+band), so with `459e425d` landed that is exactly what happens: 25 of 26 swept cells are
339-sweep.419+byte-exact and `s422_384x240` is the one that remains, on its own residual.
340 420
341 ## 7. What is NOT measured421 ## 7. What is NOT measured
342 422
343 * **The flip control was not run.** §1.1's controls are the five byte-exact cells,423 * **The flip control was not run.** §1.1's controls are the five byte-exact cells,
344 not the sample-flip arms. Nothing here should be read as "the comparator was424 not the sample-flip arms. Nothing here should be read as "the comparator was
345 proven to bite by a flip".425 proven to bite by a flip".
346-* **No permanent gate was added.** The brief asked for a gate in the crate's test426+* **No permanent gate was added by this lane.** The brief asked for a gate in the crate's test
347 binary naming a cell; with the fix unlanded a gate would have to assert a427 binary naming a cell; with the fix unlanded a gate would have to assert a
348 *failure*, and a gate that asserts a known defect is not a gate. The428 *failure*, and a gate that asserts a known defect is not a gate. The
349 `INTRABC_RECT4_OWN_CHROMA422_HITS` counter is the hook such a gate will need;429 `INTRABC_RECT4_OWN_CHROMA422_HITS` counter is the hook such a gate will need;
@@ -354,8 +434,8 @@ sweep.
354 * The 4:2:2 sequence-header refusal is **untouched** — `stream.rs:1803` reads434 * The 4:2:2 sequence-header refusal is **untouched** — `stream.rs:1803` reads
355 `if seq.subsampling_x != seq.subsampling_y` on this branch, verified by435 `if seq.subsampling_x != seq.subsampling_y` on this branch, verified by
356 `git status` clean for that file.436 `git status` clean for that file.
357-* `s422_416x250_10b`'s luma desync is Agent07-4's slice; this report only records437+* `s422_416x250_10b`'s luma desync was Agent07-4's slice and is closed by the same
358- that it is in the same function.438+ commit (§3.3).
359 439
360 ## 8. Reproducing this lane's numbers440 ## 8. Reproducing this lane's numbers
361 441