forge
Explore
Log in

Don't you dare go Hollow

Merge lane/av1422aomdec51: 51/51 4:2:2 cells byte-exact in decode order

Browse files at this commit

df788de55fa0a115f5a683467d1c71ffb783e93dAhmet Kaan GümüşParent: e40111468799ed
The bookkeep census had 51/51 against ffmpeg in display order and had not
re-run aomdec. Same 51 cells, decode order, depth-correct dumps, 869 frames,
0 diverging. The comparator bites: a one-sample flip moves the count by 1
at both 8-bit and 10-bit, and a first control that did not bite was thrown
out. Report only.
lanes/av1422aomdec51.report.mdadded+127 -0
@@ -0,0 +1,127 @@
1+# lane-av1422aomdec51 — the 51-cell 4:2:2 census, re-measured in decode order against aomdec
2+
3+**Outcome in one line:** the missing half of `lanes/av1bookkeep.report.md` §2.4 is now
4+measured — the same 51 cells, the same bytes, decoded on current main `c38dd788` and
5+compared against the instrumented aomdec in **decode order**: **51/51 byte-exact**
6+(869 decode-order frames), 0 diverging, 0 comparator-error, with the liveness control
7+measured on the same compare path.
8+
9+Branch `lane/av1422aomdec51`, base `c38dd788` (= main when this lane started; re-checked
10+before commit), one commit (this report only), no source change, no push, no merge.
11+No private build was needed beyond the read-only example binary; worktree
12+`/home/user/.cache/wt/av1422aomdec51`, target dir `/home/user/.cache/tgt-av1422aomdec51`.
13+Run executed on `user@host-b` (idle; not on host-a, not on host-e).
14+
15+---
16+
17+## 1. The instrument, and why it is the missing half
18+
19+`av1bookkeep` measured the census with `dump_yuv` + **ffmpeg** in **display** order and
20+stated the limit itself: "the aomdec decode-order census is a different instrument and
21+was not re-run". This lane ran that other instrument:
22+
23+| side | decoder | dump | order |
24+|---|---|---|---|
25+| ours | `dump_yuv` example on main (`decode_stream`) | `EC_AV1_FINAL_DUMP` (env-set), depth-correct u8/u16-LE, one rung per **coded** frame (`<prefix>.f<decode_idx>`) | decode order, hidden frames included |
26+| oracle | instrumented `~/.cache/aom-oracle/build/aomdec` (confirmed present before the run) | rung 12 `EC_AV1_FINAL_DUMP`, same layout | decode order, hidden frames included |
27+
28+* `EC_AV1_FINAL_DUMP` fires inside `decode_frame` for every **coded** frame; a
29+ `show_existing_frame` output re-shows a stored picture and never reaches it, so
30+ neither side writes a rung for it — the accounting is identical by construction, and
31+ hidden alt-refs ARE compared (the frames ffmpeg never emits).
32+* Depth: both sides pack 8-bit as u8 and 10/12-bit as u16 LE (rung 12 is the
33+ depth-correct one; the u8-narrowing `EC_AV1_DECODE_ORDER_DUMP` was deliberately NOT
34+ used — 10 of the 51 cells are 10-bit, and that pairing is the all-HBD-red class).
35+* Per-frame compare asserts `len(ours) == len(oracle)` BEFORE any sample is examined;
36+ a truncating compare is a prefix compare.
37+* Compare pairing is decode index to decode index throughout.
38+
39+## 2. The 51 cells
40+
41+The census's own selection, not a re-derivation: `~/.cache/census422b/cells_ff.json`
42+(95 cells) filtered by `formats.json`'s per-stream 4:2:2 sequence-header probe = **51
43+cells**. This is the list `av1bookkeep` §2.4 quotes.
44+
45+* 51/51 paths resolved; every byte re-hashed locally and again on the remote against
46+ the census's recorded `sha256` before decoding. 9 cells' recorded paths pointed at the
47+ pruned `av1422ffmpegbase` worktree; they re-resolved to `crates/ec-av1/fixtures/` in
48+ the primary checkout **byte-identically** (same sha256).
49+* Composition: 18 fresh-sweep `s422_*` (12 × 8-bit, 6 × 10-bit), 9 COMMITTED-PIN
50+ fixtures, 23 probe-cache cells, 1 fresh-reproducer (`R422_320x242`); 40 × 8-bit +
51+ 11 × 10-bit in total.
52+
53+## 3. Result
54+
55+| verdict | cells |
56+|---|---|
57+| EXACT | **51** |
58+| DIVERGING | 0 |
59+| COMPARATOR-ERROR | 0 |
60+
61+869 decode-order frames compared in total (1–43 per cell; the 43-frame cells are the
62+altref structure AA/AB/AD). Every frame length-asserted; every frame byte-compared.
63+Per-cell frame counts and sha256 prefixes are in `results.json`
64+(remote `~/census422run/results.json`, mirrored in the commit).
65+
66+**Is this the bookkeep 51?** Yes — same `cells_ff.json` × same `formats.json` 4:2:2
67+filter, same recorded shas, no cell invented, none dropped.
68+
69+## 4. Liveness control (the zero is a measurement)
70+
71+`census.compare_only(name)` compares the dumps on disk **without re-decoding** — the
72+control's path and the census's compare are the same code (`compare_dumps`). Two flips,
73+both in the ORACLE's dump, both re-compared and then restored and re-compared:
74+
75+| control | flip | verdict | wrong bytes | plane y/uv | offset | restored |
76+|---|---|---|---|---|---|---|
77+| `s422_384x240` f0 (8-bit) | 1 sample, Y plane middle, low bit | DIVERGING | **1** | 1 / 0 | 61440 | EXACT |
78+| `Y_intrabc_10b` f0 (10-bit) | 1 low bit of one u16 LE sample | DIVERGING | **1** | 1 / 0 | 102400 | EXACT |
79+
80+Each flip moves the count by exactly 1, lands on the exact offset injected, restores to
81+EXACT. The 10-bit control also proves the compare is not an 8-bit narrowing hiding a
82+1-LSB fork (u16 LE bytes are compared, not narrowed).
83+
84+Two defects this control caught in the harness itself, before any verdict was quoted:
85+
86+1. **The first "control" was false.** `run_cell` re-decodes, so it OVERWROTE the
87+ injected flip before comparing and reported EXACT — a control that cannot bite.
88+ Fixed by extracting `compare_only`/`compare_dumps`; the census verdicts and the
89+ control now share one compare loop.
90+2. **The plane split was wrong.** First control reported the Y-plane flip (offset
91+ 61440 < 92160 = ⅔ of a 4:2:2 8-bit frame) as `wrong_uv=1`: the code assumed
92+ Y = ⅓ of bytes (the 4:2:0/4:4:4 habit). For 4:2:2, Y = W·H of 1.5·W·H samples =
93+ **⅔ of the bytes**. Fixed and re-proven by the same flip: `wrong_y=1, wrong_uv=0`
94+ at the injected offset.
95+
96+After both fixes the full 51-cell census was re-run end to end through the corrected
97+path (`census2.log`; the quoted numbers are from that run), and the controls were
98+re-run against it.
99+
100+## 5. What this does and does not establish
101+
102+* Established: every one of the 51 4:2:2 cells decodes **byte-exact against the
103+ instrumented aomdec, in decode order, including hidden frames and all 10-bit cells**,
104+ on main `c38dd788`, with a comparator proven live.
105+* Not the same instrument as `av1bookkeep`'s 51/51 (ffmpeg, display order): the two
106+ agree, which is exactly what §2.4's "different instrument" caveat left unmeasured.
107+* Not established: cells outside the 4:2:2 51 (the census's 44 4:2:0/4:4:4 controls were
108+ out of scope); film-grain synthesis output (grain is applied by both decoders'
109+ normal path but this census does not isolate it); 12-bit (no cell in the census).
110+* No decoder edit: the only tree artifact is this report; `dump_yuv` was built from the
111+ branch as a read-only example binary.
112+
113+## 6. Verification run on this tree
114+
115+| check | result |
116+|---|---|
117+| worktree base | `c38dd788` = main at start (re-checked at commit time) |
118+| `CARGO_TARGET_DIR=… cargo build --release -p ec-av1 --example dump_yuv` | ok (one pre-existing `ec-av1` lib warning, untouched) |
119+| 51-cell sha verification, local + remote, before decode | 51/51 match census records |
120+| census (decode order vs aomdec rung 12) | 51/51 EXACT, 869 frames, 0 errors |
121+| liveness: 1-sample flip, 8-bit cell | count moves by exactly 1, offset lands, restore EXACT |
122+| liveness: 1-LSB u16 flip, 10-bit cell | count moves by exactly 1, offset lands, restore EXACT |
123+| `git status` at commit | only this report |
124+
125+Remote artifacts (host `host-b`, `~/census422run/`): `census.py` (driver),
126+`census.log`/`census2.log` (run logs), `results.json` (per-cell rows), `out/<cell>/`
127+(both sides' per-frame dumps, kept for reproduction).