Merge lane/av1422open2: the two census2 cells are already exact
Browse files at this commit1 changed file +141 -0
- lanes/av1422open2.report.md +141 -0
lanes/av1422open2.report.mdadded+141 -0
| @@ -0,0 +1,141 @@ | ||
| 1 | +# lane-av1422open2 — the two cells `av1422census2` left open are CLOSED at current main | |
| 2 | + | |
| 3 | +**Result in one line: `s422_320x246` and `s422_322x246` are both BYTE-EXACT against | |
| 4 | +ffmpeg at `main` = `2be65e1b` — 0/0/0 wrong Y/U/V samples on all 16 displayed frames of | |
| 5 | +each, first divergence `none` — so there is no site to name and nothing to fix.** | |
| 6 | + | |
| 7 | +Tip: `main` = `2be65e1b`. Worktree `/home/user/.cache/wt/av1422open2`, branch | |
| 8 | +`lane/av1422open2`, `CARGO_TARGET_DIR=/home/user/.cache/tgt/av1422open2`. | |
| 9 | +No source edit is carried by this lane: the tree is a clean worktree of `2be65e1b` | |
| 10 | +plus this report. No push, no merge, no rustfmt. | |
| 11 | + | |
| 12 | +--- | |
| 13 | + | |
| 14 | +## 1. The fixtures | |
| 15 | + | |
| 16 | +Both are **committed**, and both are byte-identical to the census sweep artifact the | |
| 17 | +old report measured. No re-encode was needed. | |
| 18 | + | |
| 19 | +| cell | committed path | bytes | sha256 | | |
| 20 | +|---|---|---|---| | |
| 21 | +| `s422_320x246` | `crates/ec-av1/fixtures/s422_320x246.obu` | 20692 | `aebd3a10d46e617b803579819f2502798076384be52e032b11b46f09eeb09a79` | | |
| 22 | +| `s422_322x246` | `crates/ec-av1/fixtures/s422_322x246.obu` | 20528 | `ee96617fe45ba963d3628f37086077a94806ef0465a74cb538a8e57d2ed900b3` | | |
| 23 | + | |
| 24 | +Both hashes reproduce `sha256sum` of the census's own | |
| 25 | +`~/.cache/census422b/sweep/<name>.obu` exactly, so the old report and this one are | |
| 26 | +measuring the same bitstreams. They were committed by the 4:2:2 lift | |
| 27 | +(`8d6998d7`, "lane-av1422lift"), which copied the first six census sweep cells in and | |
| 28 | +pinned them by size + fnv1a64 + sha256. | |
| 29 | + | |
| 30 | +Geometry, from the sequence header via `ffprobe` (`cmpff.probe_geometry`, never a file | |
| 31 | +size): both `ss=10` (4:2:2), 8-bit, `-pix_fmt yuv422p`, 17 decode frames / 16 displayed, | |
| 32 | +one hidden alt-ref picture (decode frame 1) in each. | |
| 33 | + | |
| 34 | +## 2. The measurement at current main | |
| 35 | + | |
| 36 | +Instrument: the committed `scripts/cmpff.py` + `scripts/run422-ffmpeg.py` module, | |
| 37 | +unmodified, driven by a local `/tmp` wrapper that only sets `PROBE` to this lane's | |
| 38 | +build. Probe: `cargo build -p ec-av1 --release --example decode_probe` at `2be65e1b`, | |
| 39 | +**no bypass patch** — the 4:2:2 sequence-header refusal is lifted on current main, so | |
| 40 | +both cells decode through the shipped path. Oracle: ffmpeg 8.1.3, per plane per | |
| 41 | +display frame, wrong SAMPLE = one byte at 8-bit. | |
| 42 | + | |
| 43 | +| cell | verdict | Y | U | V | decode/display | hidden | first divergence | | |
| 44 | +|---|---|---|---|---|---|---|---| | |
| 45 | +| `s422_320x246` | **BYTE-EXACT** | 0 | 0 | 0 | 17 / 16 | `[1]` | none | | |
| 46 | +| `s422_322x246` | **BYTE-EXACT** | 0 | 0 | 0 | 17 / 16 | `[1]` | none | | |
| 47 | + | |
| 48 | +Control in the same run: `s420_320x246` (4:2:0, same encoder recipe, same geometry | |
| 49 | +family) BYTE-EXACT 0/0/0, 17 decode / 16 displayed, hidden `[16]`. The control proves | |
| 50 | +the comparator is reading real planes and not returning a vacuous zero. | |
| 51 | + | |
| 52 | +Non-vacuity census read off the same run (`census_units` from the probe): | |
| 53 | +`s422_320x246` luma=2118 u=1218 v=1218 units, coded 923/819/874; | |
| 54 | +`s422_322x246` luma=2381 u=1315 v=1315, coded 986/851/920. Both cells really do walk | |
| 55 | +chroma coefficient units; the zero is not a zero-work frame. | |
| 56 | + | |
| 57 | +### 2.1 Flip control — 30 arms, 30 PASS, 0 FAIL | |
| 58 | + | |
| 59 | +A 0/0/0 is only a claim once the comparator has been shown to move. One oracle sample's | |
| 60 | +low byte flipped per plane, per cell, at five display frames (0, 3, 7, 11, 15) — the | |
| 61 | +count must move by **exactly +1 in that plane** with the other two planes unchanged. | |
| 62 | +2 cells x 5 frames x 3 planes = **30 arms, 30 PASS**. | |
| 63 | + | |
| 64 | +The mapping is **pinned from the unflipped run** before any flip (`map_decode_to_display`, | |
| 65 | +1 solution per cell, then held fixed). This matters: re-deriving the mapping after a flip | |
| 66 | +cannot work for a luma-plane flip, because the flipped luma matches nothing and | |
| 67 | +`cmpff` correctly raises `luma identity never covers the display side`. That error is the | |
| 68 | +comparator being honest about a broken identity, not a defect in the flip method — so | |
| 69 | +the pinning is a method requirement, and it is stated here rather than papered over. | |
| 70 | + | |
| 71 | +## 3. Which commit closed them — measured, not inferred | |
| 72 | + | |
| 73 | +The old report is not wrong; it is superseded. Bisected by building a probe per commit | |
| 74 | +and running the same comparator, every row on its own tree, with the local | |
| 75 | +patch-run-restore 4:2:2 bypass wherever the tree still refuses: | |
| 76 | + | |
| 77 | +| commit | `s422_320x246` | `s422_322x246` | note | | |
| 78 | +|---|---|---|---| | |
| 79 | +| `1bc6f543` (parent of the fix) | DIVERGES 0/**7810**/**5531** | DIVERGES 0/**3437**/**2222** | bypass applied | | |
| 80 | +| **`459e425d`** | **0/0/0** | **0/0/0** | `lane-av1422luma` | | |
| 81 | +| `7d3bdfe9` (tailskip, other branch) | DIVERGES 0/7810/5531 | DIVERGES 0/3437/2222 | bypass applied | | |
| 82 | +| `5dbca30d`, `b873bf2b`, `d16af6c3`, `41037463` | 0/0/0 | 0/0/0 | after the fix | | |
| 83 | +| `8d6998d7` (the lift) | 0/0/0 | 0/0/0 | | | |
| 84 | +| `820eeb68`, `2be65e1b` (current main) | 0/0/0 | 0/0/0 | | | |
| 85 | + | |
| 86 | +The closing commit is **`459e425d` "lane-av1422luma: 4:2:2 IntraBC 1:4 strips code their | |
| 87 | +OWN chroma"**. Its own published pre/post table names these two cells at exactly the | |
| 88 | +numbers reproduced above (`0/7810/5531`, `0/3437/2222` -> `0/0/0`), so the census's | |
| 89 | +residue and this lane's red-before are the same defect, and the fix is the one that | |
| 90 | +closes it. | |
| 91 | + | |
| 92 | +Mechanism, in one sentence: an intra-BC 16x4 HORZ 1:4 strip's chroma plane block is its | |
| 93 | +OWN 8x4 at 4:2:2 (which subsamples x only), not 4:2:0's pair, and | |
| 94 | +`decode_rect4_16_intrabc` had gated that pair geometry on ss `(0,0)`, so at `(1,0)` the | |
| 95 | +chroma unit was read one mi row high and the frame desynced from there — which is why | |
| 96 | +both cells were chroma-only and why the first divergence sat at the same U(62,144) in | |
| 97 | +both. | |
| 98 | + | |
| 99 | +Note the census's "shrink-only" reading (§3.1 of `av1422census2`) is the right | |
| 100 | +observation of the wrong tree and the wrong attribution of the future: it saw a region | |
| 101 | +shrink without closing and inferred a second writer in the same rectangle. There was no | |
| 102 | +second writer; the same writer had a second half. | |
| 103 | + | |
| 104 | +## 4. The gate that already holds these bytes | |
| 105 | + | |
| 106 | +`the_pinned_422_corpus_cells_decode_pixel_exact` (`crates/ec-av1/src/stream.rs:4308`), | |
| 107 | +added by the lift, pins both cells by size + fnv1a64 + sha256 and asserts byte-exact | |
| 108 | +planes against ffmpeg with a per-plane coefficient-unit census as its non-vacuity arm. | |
| 109 | +Run here at `2be65e1b`: | |
| 110 | + | |
| 111 | +``` | |
| 112 | +the_pinned_422_corpus_cells_decode_pixel_exact[s422_320x246.obu]: byte-exact vs ffmpeg (yuv422p, 16 frames); census delta units=[2118, 1218, 1218] coded=[923, 819, 874] | |
| 113 | +the_pinned_422_corpus_cells_decode_pixel_exact[s422_322x246.obu]: byte-exact vs ffmpeg (yuv422p, 16 frames); census delta units=[2381, 1315, 1315] coded=[986, 851, 920] | |
| 114 | +test result: ok. 1 passed; 0 failed; 0 ignored; 842 filtered out | |
| 115 | +``` | |
| 116 | + | |
| 117 | +Both cells are inside a **green** gate, so nothing here can drift back silently. No new | |
| 118 | +gate is warranted: the charter's condition ("fix only if the site is one function and a | |
| 119 | +one-fixture gate can prove it") does not arise, because there is no defect. | |
| 120 | + | |
| 121 | +## 5. Housekeeping | |
| 122 | + | |
| 123 | +The 4:2:2 probe bypass was applied in scratch worktrees only, and every one was | |
| 124 | +restored: `grep -rn 'TEMP-PROBE-BYPASS\|if false && seq.subsampling_x'` over the primary | |
| 125 | +checkout, this lane's worktree and all scratch trees = **0 hits**; `git status --porcelain` | |
| 126 | +in each patched tree after `git checkout --` = empty; the primary checkout's | |
| 127 | +`crates/`+`scripts/` = clean. Ten scratch worktrees removed; the two remaining `wt-*` | |
| 128 | +entries (`wt-knobshold`, `wt-av1paletteuv`) belong to other lanes and were not touched. | |
| 129 | + | |
| 130 | +## 6. What is NOT measured | |
| 131 | + | |
| 132 | +1. **12-bit and superres 4:2:2** are not re-measured here — out of the two named cells' | |
| 133 | + scope, and separately gated by the lift. | |
| 134 | +2. **No whole-suite run.** Only the one named gate plus the two probe measurements. | |
| 135 | +3. **No grain claim.** `EC_AV1_FINAL_DUMP` is pre-grain and these two cells are | |
| 136 | + un-grained sweep encodes; the lift gates grained 4:2:2 separately, through its | |
| 137 | + post-grain in-memory comparison. | |
| 138 | +4. **The decode-order basis was not compared against instrumented aomdec**; the basis | |
| 139 | + here is ffmpeg display order with a content-derived decode->display mapping, which | |
| 140 | + leaves exactly one hidden picture in each cell as expected. | |
| 141 | +5. **Nothing was fixed.** The fix is `459e425d`, landed before this lane started. |