From 4fe36ff59e6ab6ce2ffaca22acb4666834b29aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 20:52:41 +0300 Subject: [PATCH] lane-av1422444b: the census annotations are folded in (additive, nothing rewritten), and my own comparator's three bugs are written down with their fixes Report-only. No source change; nothing pushed; committed on lane/av1422444b in this lane's own worktree with absolute paths, rebased onto 36c6f731 first so the census edit applies to the merged copy. CENSUS ANNOTATIONS (4 sites, additive). Every original sentence and table row is left standing, so the record still shows what was believed on which tree; each correction is a bracketed [CORRECTED 2026-09-30 by lane-av1422444b: ...] note naming the tree (ed7c99bc was 36 commits behind main), the fix (f3afa5b7, an ancestor of main) and the numbers (0/0/0 vs ffmpeg on 16 shown frames, 0/0/0 vs instrumented aomdec on all 17 decode-order frames): 1. section 3.2's still-diverging table, after the s444_352x242_10b row -- superseded; 2. section 3.4's "4:4:4 controls: 21 of 22, single exception" -- true only of the census's own two trees; at main 22/22, and the control it carried now holds twice over; 3. section 7.1's class D row -- class D is EMPTY; placed AFTER the table so the table is not split (my first attempt cut it in half and was corrected); 4. section 7.2's "A lift would not fix class D" -- the constraint is GONE, so no 4:4:4 exception bounds a lift. The two 4:2:2 bullets there are explicitly untouched. COMPARATOR BUGS, now section 3.2 of my own report, each with its fix and its tell: 1. missing plane offset on the OURS buffer (oracle indexed per frame, ours read at per-plane-zero) -- reported 1362686/1362769 wrong chroma samples on an EXACT cell; fix is one `base` per plane added to BOTH sides' indices. Tell: implausible magnitude and a first divergence at (0,0) of a non-luma plane. 2. geometry parsed from the cell's FILE NAME -- s444_320x240 read as 320x320, and the 4:2:0 cells reported as "ours=16 ref=8", which reads like a decoder dropping frames; fix is ffprobe width/height/pix_fmt on the cell itself, chroma extents as ceil(w/2**ss_x) x ceil(h/2**ss_y). Tell: a frame count that disagrees with -count_frames. 3. bps hardcoded to 2 -- every 8-bit cell's frame size doubled, so the oracle length stopped being a multiple of it, an error that reads like a truncated oracle; fix is bps derived from the cell's own pix_fmt. Tell: the not-a-multiple hard error firing only on the 8-bit cells. The general lesson recorded with them: all three report a NUMBER rather than refusing to, which is why the liveness controls are ordered before the verdicts and why a comparator should hard-error on a geometry it cannot account for. --- lanes/av1422444b.report.md | 88 +++++++++++++++++++++++++---------- lanes/av1422census2.report.md | 56 ++++++++++++++++++++++ 2 files changed, 120 insertions(+), 24 deletions(-) diff --git a/lanes/av1422444b.report.md b/lanes/av1422444b.report.md index df9a6247..72bbc515 100644 --- a/lanes/av1422444b.report.md +++ b/lanes/av1422444b.report.md @@ -123,17 +123,46 @@ disagreeing about what the pixels are. **Control C — the mutated tree reds on this exact comparator** (§4), which rules out the comparator being unable to see a 4:4:4 chroma defect at all. -Two of my own instrument bugs were found and fixed by these controls rather than by -reading a verdict; both are recorded here because each would have produced a confident -wrong number: - -* the first `cmp.py` indexed the ORACLE buffer with the frame offset but read the OURS - buffer at a per-plane-zero offset, reporting 1.36 M wrong chroma samples on a cell that - is in fact exact. It surfaced as an implausible count, not as a plausible one. -* `cmp.py` hardcoded `bps=2` and `cmp.sh` parsed geometry out of the cell's FILE NAME, - which reported the 4:2:0 cells as "ours=16 ref=8" — a name-parsing artefact, since - `ffprobe -count_frames` says 16 and the ref file is 16 frames of 230400 B. Both are - fixed: `bps` is an argument, and geometry comes from the oracle's own `ffprobe`. +### 3.2 Three comparator bugs this lane hit, each with its fix + +All three were caught by the controls above rather than by reading a verdict, and each +would have produced a CONFIDENT wrong number rather than an obvious failure. They are +the class that produced two wrong tables elsewhere this wave, so the next lane that +writes a comparator should read this list before writing one. + +1. **Missing plane offset on the OURS buffer.** The first `cmp.py` indexed the ORACLE + buffer as `fi * fsz + plane_base + i * bps` but read the OURS buffer as + `i * bps` — per-plane-zero — so every plane after Y was compared against the wrong + region. It reported **1362686 / 1362769** wrong chroma samples on a cell that is in + fact byte-exact, with a first divergence of U(0,0) that was obviously absurd. **Fix:** + derive ONE `base` per plane and add it to BOTH buffers' indices + (`a[base + i*bps] != b[fbase + base + i*bps]`); never let the two sides index + differently. **Tell:** an implausible magnitude, and a first divergence at sample + (0,0) of a non-luma plane. Note the same class in the other direction — a plane + offset applied to one side and not the other still moves the count in the right + direction, so a plausible-looking number is not evidence the instrument is right. +2. **Geometry parsed from the cell's FILE NAME.** The sweep driver read + `s444_320x240` as `320x320` (the name carries the height after an `x`, so a naive + split yields width twice) and reported the 4:2:0 cells as `ours=16 ref=8`, which + reads like a decoder dropping half its frames. It is a name-parsing artefact: + `ffprobe -count_frames` says 16, and the ref file is 16 frames of 230400 B. **Fix:** + take `width`, `height` and `pix_fmt` from `ffprobe` on the cell itself + (`-select_streams v:0 -show_entries stream=width,height,pix_fmt -of csv=p=0`), and + derive chroma extents as `ceil(w / 2**ss_x) x ceil(h / 2**ss_y)`. **Tell:** a frame + count that disagrees with `-count_frames`; and a hard error naming both numbers beats + a tolerated difference. +3. **`bps` hardcoded to 2.** With `bps` fixed at 2, every 8-bit cell's frame size was + computed at double the truth, so the oracle length stopped being a multiple of the + frame size ("ref len 3717120 not a multiple of frame size 614400") — an error that + reads like a truncated oracle rather than a constant. **Fix:** `bps` is an argument + derived from the cell's own `pix_fmt` (1 byte for `yuv* p`, 2 for `*10le`/`*12le`); + never infer it from the cell's name or from a "10b" suffix. **Tell:** the + not-a-multiple hard error, and the fact that it fired ONLY on the 8-bit cells. + +The general lesson, which is why the controls are ordered before the verdicts: each of +these three is a comparator that reports a number rather than refusing to. A comparator +that hard-errors on a geometry it cannot account for would have caught all three at the +first cell instead of after a sweep. ## 4. The gate, and proof that it bites (red-before by mutation, on the current tree) @@ -237,19 +266,30 @@ horizontal arm of the same 32-capped walk in `decode_block_rect64`, on 640x480 1 ## 6. Correction to the census of record, stated plainly -`lanes/av1422census2.report.md` needs three edits, and this lane does not make them -because that report is another lane's artifact and its owner may still be amending it: - -1. §3.2's table row `s444_352x242_10b | 0 | 17/17 | 4:4:4, chroma only` — the cell is - byte-exact at `main`; the row is superseded by `f3afa5b7`. -2. §3.4's "4:4:4 controls: 21 of 22 byte-exact, the single exception `s444_352x242_10b` - (0/1166/1413, identical counts on both trees)" — that "identical on both trees" was - true only of the two trees the census had; a third tree closes it. -3. §7's "a lift would NOT fix class D: `s444_352x242_10b` is a 4:4:4 defect" — still - true as a statement about the 4:2:2 lift, but class D is now empty, so it no longer - constrains the lift. - -The census's own numbers were not wrong; they were bound to `ed7c99bc`, and it said so. +`lanes/av1422census2.report.md` is annotated in this lane, additively — every original +sentence and table row left standing, each correction appended as a bracketed +`[CORRECTED 2026-09-30 by lane-av1422444b: ...]` note naming the tree, the fix and the +numbers, so the record still shows what was believed on which tree. Four sites: + +1. **§3.2's still-diverging table**, after the `s444_352x242_10b | 0 | 17/17` row — that + row is superseded; the cell is byte-exact at main, fixed by `f3afa5b7` (an ancestor of + main; `ed7c99bc` was 36 commits behind `affe70dc`). Carries the 0/0/0 measurements on + both bases and the mutation red-proof. +2. **§3.4's "4:4:4 controls: 21 of 22, single exception `s444_352x242_10b` (identical + counts on both trees)"** — that "identical on both trees" was true only of the census's + own two trees; at main all 22 of 22 are byte-exact, and the control this paragraph + carried now holds twice over (the §3.1 delta is 4:2:2-specific AND the 4:4:4 palette + fix left 4:2:0 bit-identical). +3. **§7.1's class D row** in the failure-class table — class D is now EMPTY, with the + 4:4:4-specific mechanism and the note that the sensitive axis is chroma UNIT COUNT, + not frame width or height, so the cell's "geometry-sensitive" framing was misleading. + The note is placed AFTER the table so the table is not split. +4. **§7.2's "A lift would not fix class D"** — the constraint is GONE: no 4:4:4 exception + remains to bound a lift, and every cell outside 4:2:2 is byte-exact. The two 4:2:2 + bullets in that section are explicitly untouched by this correction. + +The census's own numbers were not wrong; they were bound to `ed7c99bc`, and the census +said so itself. Nothing in it was rewritten. ## 7. What is NOT measured here diff --git a/lanes/av1422census2.report.md b/lanes/av1422census2.report.md index 08fac383..edd99607 100644 --- a/lanes/av1422census2.report.md +++ b/lanes/av1422census2.report.md @@ -199,6 +199,23 @@ cells by their **first-divergence decode frame**: | `s422_352x242_10b` | 0 | 17/17 | chroma only | | `s444_352x242_10b` | 0 | 17/17 | 4:4:4, chroma only | | `s422_384x240` | **1** | 11/17 | chroma only | +[CORRECTED 2026-09-30 by lane-av1422444b: the `s444_352x242_10b` row above is +SUPERSEDED and this cell is NOT among the still-diverging cells at current main. The +row is a true reading of `ed7c99bc`, which was 36 commits behind `affe70dc` when this +correction was made; the fix is `f3afa5b7` ("window the 32-capped chroma palette +buffer per unit"), an ancestor of main, and it is 4:4:4-SPECIFIC — `decode_block_rect64` +caps chroma units at 32, so at `ss=00` a 64-axis luma strip's chroma is TILED and each +tiled unit had been handed the WHOLE block's palette prediction buffer, which +`PlaneBuf::reconstruct` reads as its first `side*side` entries. Measured at `affe70dc`: +0/0/0 vs ffmpeg 8.1.3 (`-pix_fmt yuv444p10le`) on all 16 shown frames AND 0/0/0 vs +instrumented aomdec on all 17 decode-order frames (16 shown + 1 hidden altref), with no +first divergence and an empty wrong-sample bbox. The pinned gate +`a_444_lossy_palette_chroma_unit_window_is_byte_exact_at_352x242_10bit` +(`crates/ec-av1/src/stream.rs:51024`) was proven to bite by mutation on the current +tree: with `palette_window` reverted in both tiled arms it fails at decode frame 0 +byte 328192 (ours 209 vs 216), 0/1112/1362 through the ffmpeg comparator. Original +figures left standing above as the record of what was believed on `ed7c99bc`. Full +report: `lanes/av1422444b.report.md`.] `S_odd326x242_10b` and `s422_352x250_10b` were 10-bit cells that closed; `s422_352x242_10b` and `s422_416x242_10b` are 10-bit cells that did not. So **bit depth does not separate @@ -284,6 +301,19 @@ trees. That the supported formats are bit-identical across the fix is the load-bearing control: the delta in §3.1 is 4:2:2-specific. +[CORRECTED 2026-09-30 by lane-av1422444b: the "4:4:4 controls: 21 of 22, with the +single exception `s444_352x242_10b` (0/1166/1413 — identical counts on both trees)" +sentence above is true only of the TWO trees this census had (`cc9f2668` and +`ed7c99bc`). At current main `affe70dc` — 36 commits past `ed7c99bc` — that exception +is GONE: `f3afa5b7` fixed it, so all 22 of 22 4:4:4 cells are byte-exact and the +"identical counts on both trees" reading was a property of the census's own tree pair, +not of the format. Measured at main: `s444_352x242_10b` is 0/0/0 vs ffmpeg 8.1.3 on all +16 shown frames and 0/0/0 vs instrumented aomdec on all 17 decode-order frames. The +control this paragraph was carrying still holds, and now holds twice over: the §3.1 +delta is 4:2:2-specific, AND the 4:4:4 palette fix left 4:2:0 bit-identical (69 of 69 +committed 4:2:0 fixtures and 18 of 18 fresh 4:2:0 sweep cells byte-exact at main, zero +skips) — 4:2:0 is structurally immune, since `nw * nh == 1` on every 4:2:0 block so the +32-cap never tiles. Original sentence left standing above.] --- @@ -420,6 +450,21 @@ and shipped pixels. | **D — not 4:2:2: 10-bit 4:4:4 chroma** | 1: `s444_352x242_10b` | `--cpu-used 0`, 352x242 10-bit 4:4:4 | 2579 samples | | **E — NEW, found here: luma desync at `--cpu-used 2`** | 1: `rc2_s422_320x242` | **`--cpu-used 2`**, 320x242 8-bit | **890107 samples** | +[CORRECTED 2026-09-30 by lane-av1422444b: class D is now EMPTY. `f3afa5b7` fixed +`s444_352x242_10b` and is an ancestor of main; `ed7c99bc`, the tree this table was +measured on, was 36 commits behind `affe70dc` at the time of this correction. Measured +at main: 0/0/0 vs ffmpeg 8.1.3 on all 16 shown frames and 0/0/0 vs instrumented aomdec +on all 17 decode-order frames, and the whole 4:4:4 surface is clean — 18/18 fresh 4:4:4 +sweep cells, 18/18 fresh 4:2:0 controls, 36/36 committed 4:4:4 fixtures, 69/69 +committed 4:2:0 fixtures, zero skips. The defect was 4:4:4-SPECIFIC and had nothing to +do with the 4:2:2 family: `decode_block_rect64` caps chroma units at 32, so at `ss=00` a +64-axis luma strip's chroma is TILED and each tiled unit was handed the whole block's +palette prediction buffer. The sensitive axis is CHROMA UNIT COUNT, not frame width or +height, which is why the sibling geometries at the same depth were already exact and +why this cell's "geometry-sensitive" framing was misleading. The class D row above is +left standing as the record of what was believed on `ed7c99bc`. Full report: +`lanes/av1422444b.report.md`.] + **Worst current 4:2:2 divergence:** `s422_416x250_10b`, 230275 wrong samples. Worst overall including the new class E: `rc2_s422_320x242`, 890107 wrong samples including 436945 luma. Smallest current 4:2:2: `s422_384x240`, 4063. @@ -436,6 +481,17 @@ overall including the new class E: `rc2_s422_320x242`, 890107 wrong samples incl and class E if a `--cpu-used 2` stream ever arrives) fail in the **luma plane**. * A lift would **not** fix class D: `s444_352x242_10b` is a 4:4:4 defect, already reachable, already diverging with the refusal standing, unchanged by the fix. + [CORRECTED 2026-09-30 by lane-av1422444b: this constraint is GONE. Class D is empty + at main — `f3afa5b7` fixed `s444_352x242_10b` and is an ancestor of main, while + `ed7c99bc` (the tree these numbers were measured on) was 36 commits behind `affe70dc` + at the time of this correction. Re-measured at main: 0/0/0 vs ffmpeg 8.1.3 on all 16 + shown frames and 0/0/0 vs instrumented aomdec on all 17 decode-order frames, and the + full 4:4:4 surface is clean (18/18 fresh 4:4:4 sweep cells, 36/36 committed 4:4:4 + fixtures, zero skips). So a lift is no longer constrained by a 4:4:4 exception: every + cell outside 4:2:2 is byte-exact, and 4:2:0 is structurally immune to that fix + (`nw * nh == 1` on every 4:2:0 block, so the 32-cap never tiles) — 69/69 committed + 4:2:0 fixtures and 18/18 fresh 4:2:0 sweep cells byte-exact at main. The two 4:2:2 + bullets above are unaffected by this correction. Sentence left standing above.] * A lift would **not** reach class E, which is invisible at every recipe the census swept. * The lift's blast radius is not bounded by this census: §8.