Merge lane-av1gapremeasure: the odd-height cells are OPEN and reachable via ONE flag; the per-plane attribution of the shared comparator is broken
Browse files at this commit1 changed file +178 -0
- lanes/av1gapremeasure.report.md +178 -0
lanes/av1gapremeasure.report.mdadded+178 -0
| @@ -0,0 +1,178 @@ | ||
| 1 | +# lane-av1gapremeasure — the debt file's remaining ec-av1 gap list, re-measured | |
| 2 | + | |
| 3 | +Base `main` **facdcb73** ("ec-av1: bind the 10-bit film gate's pin names as literals"). | |
| 4 | +Worktree `~/.cache/wt/av1gapremeasure`, branch `lane-av1gapremeasure`. Report only: | |
| 5 | +no source change is committed (the measurement harness was a throwaway test | |
| 6 | +appended to `crates/ec-av1/src/stream.rs` and reverted with `git checkout --` | |
| 7 | +afterwards; `git status --porcelain` is empty and both behaviour gates | |
| 8 | +`a_12bit_screen_content_stream_is_refused_by_name` and | |
| 9 | +`the_counting_oracle_diff_detects_one_flipped_oracle_byte` were re-run green on | |
| 10 | +the restored tree). | |
| 11 | + | |
| 12 | +## 0. Instrument and the control that makes every zero mean something | |
| 13 | + | |
| 14 | +All pixel numbers come from the crate's own | |
| 15 | +`count_rawvideo_diffs(stream, name, flip)` (`crates/ec-av1/src/stream.rs:10374`), | |
| 16 | +which runs the instrumented oracle `~/.cache/aom-oracle/build/aomdec --codec=av1 | |
| 17 | +--rawvideo`, reads its output bytes, packs OUR decoded pictures at the stream's | |
| 18 | +own bit depth, and returns `(wrongY, wrongU, wrongV, frames, frames_exact)`. | |
| 19 | +`flip: Some(i)` XORs one bit of the ORACLE's bytes before comparing. | |
| 20 | + | |
| 21 | +**The control, run live in every measurement below:** flipping oracle byte 0 of | |
| 22 | +`av112bit-key.obu` moves `wrongY` 0 → **1** and `frames_exact` 1 → **0** | |
| 23 | +(flip byte 40000 likewise: `wrongY=1`, `exact=0`; both bytes are luma because the | |
| 24 | +witness is 160x128 at 12-bit, i.e. 40 960 luma bytes per frame). For the | |
| 25 | +odd-height cells the same flip on the very stream being reported moves | |
| 26 | +`wrongY 0 → 1` and `exact 16 → 15`. A zero that cannot move by +1 when the | |
| 27 | +oracle's own bytes change is not a measurement, and none of these are. | |
| 28 | + | |
| 29 | +## 1. The table | |
| 30 | + | |
| 31 | +| item | recorded claim (source) | measured on `facdcb73` | class | evidence | | |
| 32 | +|---|---|---|---|---| | |
| 33 | +| **12-bit AV1 — decode support** | "`12-bit AV1`" left on the unchanged list; the blanket refusal lifted by `lanes/av112bit{,c,g,w}.report.md`, "the witnessed paths (intra stack, dequant/transforms at the 12-bit tables, deblock, CDEF, Wiener+SGR restoration, translational subpel MC …) are lifted" | 7 committed 12-bit pins, **27 frame-dumps, 0 wrong on Y/U/V, every frame exact** | **CLOSED** | `av112bit-key.obu` 923 B 0/0/0 1/1 · `-inter` 4533 B 0/0/0 2/2 · `-compound` 7486 B 0/0/0 6/6 · `-compound-masked` 7470 B 0/0/0 6/6 · `444_lossy_superres_256x128_d12_12bit.obu` 11023 B 0/0/0 4/4 · `…_d9_12bit.obu` 13015 B 0/0/0 4/4 · `…_mode2_256x128_12bit.obu` 14656 B 0/0/0 4/4. Control: flip byte 0 → wrongY 1, exact 0 | | |
| 34 | +| **12-bit screen-content refusal** (the ONE surviving 12-bit refusal) | `refusal_inventory.rs:113` "a 12-bit frame with screen content tools (allow_screen_content_tools=1: neither palette nor intrabc has a 12-bit witness)"; gate `a_12bit_screen_content_stream_is_refused_by_name` | Refusal fires on 3 live aomenc 12-bit encodes whose headers are `[screen=true intrabc=false]`. **With the refusal lifted (local probe, reverted): all 6 12-bit arms decode byte-exact vs aomdec — 0/0/0, 2/2 frames each** (testsrc2 + smptebars × screen-only / palette+intrabc / lossless+palette+intrabc), each with flip control +1 / exact−1. No arm ever set `allow_intrabc`; the 8-bit controls with the same recipes also set `allow_intrabc=false` | **OPEN, but the guard is BROADER than its own string** | see §2.1 | | |
| 35 | +| **12-bit palette / intrabc** | "neither palette nor intrabc has a 12-bit witness" | Not producible here: 6 recipes × 2 sources, `--enable-palette=1 --enable-intrabc=1` and `--lossless=1` included, produce `allow_intrabc=false` at 12-bit AND at 8-bit | **UNREACHABLE with this aomenc** | what is missing: an encoder that selects the tools (the recipe, not the depth, is what failed — the 8-bit control is the proof) | | |
| 36 | +| **SEG_LVL gaps** (`SEG_LVL_REF_FRAME`/`SKIP`/`GLOBALMV`) | `lanes/av1seglvl.report.md:16-19`: "every frame header parsed: aomenc enables `SEG_LVL_ALT_Q` and nothing else. 162 seg-enabled frames … zero instances of any other `SEG_LVL` feature. The refusal **stays, by name, unchanged**" | Census gate `a_segmentation_census_over_real_aq_streams_finds_no_mode_overriding_feature` **green on main, reproducing the recorded numbers digit for digit**: 4 lag/two-pass arms → 162 seg-enabled frames, 134 inherited-map, 38 with ALT_Q, per-feature `[96,0,0,0,0,0,0,0]` / `[32,…]` / `[96,…]` / `[80,…]`. Refusal gate green: 3 features × segments 0/3/7 all refuse, 0 pictures | **UNREACHABLE (guarded) — the record is CORRECT** | control: the same census run on a hand-built header enabling features 5/6/7 reports `per_feature[5]=1`, `[6]=1`, `[7]=1` (and `alt_q=0`) — the instrument reads non-ALT_Q bits, so the corpus zeros are a measurement | | |
| 37 | +| **rect residual tables** ("census film-unreachable, no witness") | `lanes/av1chromarect.report.md:67-68` named `ChromaRect32x64`/`ChromaRect64x32` missing, then **refuted itself** at `:69` ("That conclusion is wrong, and the wrongness is the finding") — libaom never forms a 64-point chroma transform; the missing thing was the WALK. The witness recorded as REFUSING (`fixtures/r512.obu`, 6948 B) is the one the debt calls unwitnessed | **`r512.obu` DECODES 3/3 frames byte-exact vs aomdec, 0 wrong on Y/U/V.** `r512_rect1x2_444_palette.obu` 2250 B 1/1 · `r512_rect2x1_1x2_444.obu` 2697 B 1/1 · `420_intrabc_rect4_witness.obu` 890 B 1/1 · `444_intrabc_rect4_witness.obu` 1016 B 1/1 · `444_lossy_rect4_inter_witness.obu` 6441 B 2/2 — 9 frame-dumps, 0 wrong | **CLOSED** (and the premise was refuted in the record itself) | control: same `flip` mechanism, +1 in Y | | |
| 38 | +| **odd-height 4:2:0 cells** (debt's own "STILL OPEN" row) | "`320x236` (Y 234349, U 56957, V 52981) and `322x248` (Y 36286, U 13359, V 13001)" | **My first "closed" verdict on this row was WRONG and is withdrawn** — see §5. Under the recipe that actually reaches the defect (aomenc's DEFAULT end-usage, no `--end-usage=q`): `320x236` **0/16 frames exact** (16562 B, sha256 `84e4d1ab…`), `322x248` **0/16 frames exact** (16131 B, sha256 `9e8c9c6c…`, f0 Y 2170 — the same number `lanes/av1oddluma.report.md` records), while `320x232` (15773 B, sha256 `6832c3cd…` = the committed pin) and `320x248` and `324x236` are 0/0/0 with 16/16 frames exact | **320x236 and 322x248: OPEN and REACHABLE. 320x232 / 320x248 / 324x236: closed** | control on every cell: flip oracle byte 0 → +1 in Y, `exact` 16 → 15. Per-frame byte diffs on the 320x236 witness: `[16023, 19724, 19422, 20473, 20870, 19647, 21038, 19846, 22231, 21805, 23276, 23013, 24664, 24777, 24727, 22751]` — frame 0 (the keyframe) is already wrong, entropy fork, as `av1oddluma` narrowed | | |
| 39 | +| **4:4:4 SQUARE 64x64 sibling-DC** (debt line 21) | "the SECOND unit reconstructs its SIBLING's flat DC instead of its own … seed: f0 r512.obu mi=(112,80) px=(320,448) side=64 … reconstructs flat 241 (the oracle has 202)" | The seed stream itself measures **0 wrong on all three planes across all 3 frames** vs aomdec — a flat-241-vs-202 signature at one unit would be at least 1 wrong sample | **CLOSED** | same `r512.obu` dump as the row above | | |
| 40 | +| `cfl_ac_q3_at` (debt line 19) | recorded REFUTED and guarded by two gates on main | not re-run this round | closed **by record** (see `not_done`) | — | | |
| 41 | +| 4:2:2 anomaly on 322x242 + the refusal-lift decision (debt line 8) | "ONE NAMED ANOMALY, unattributed … being settled on lane-av1422anom" | not measured (owned by that lane). My fresh 322x242 encode is 0/0/0 vs aomdec on 4 frames, but that is PRESENTED output and does not touch the rung-vs-returned-picture question | **not measured** | see `not_done` | | |
| 42 | +| encoder-suite cost (debt line 15) | ~3h10m of a debug suite | not an ec-av1 correctness row; out of scope | untouched | — | | |
| 43 | + | |
| 44 | +## 2. Charter-ready text for what is still open | |
| 45 | + | |
| 46 | +### 2.1 The 12-bit screen-content refusal is wider than the gap it names — OPEN | |
| 47 | + | |
| 48 | +**Witness:** real `aomenc --bit-depth=12 --profile=2` output over | |
| 49 | +`testsrc2=s=128x128:r=25` and `smptebars=s=128x128:r=25`, recipes | |
| 50 | +`--tune-content=screen` (273 B and 3828 B) and | |
| 51 | +`--tune-content=screen --lossless=1 --enable-palette=1 --enable-intrabc=1` | |
| 52 | +(262 B and 11 500 B) — four to six committed pins, all with parsed | |
| 53 | +`allow_screen_content_tools = true`, `allow_intrabc = false`. | |
| 54 | +**Measurement:** `decode_all_frames_vs_oracle` / `count_rawvideo_diffs` against | |
| 55 | +the instrumented aomdec. On `facdcb73` all six arms are **refused by name**; with | |
| 56 | +the single `if bit_depth == 12 && header.allow_screen_content_tools` arm | |
| 57 | +(`stream.rs:1842`) deleted and nothing else changed, the same six arms are | |
| 58 | +**0 wrong Y / 0 wrong U / 0 wrong V, 2/2 frames exact each**, with the +1 flip | |
| 59 | +control on every arm. The 8-bit control arms prove the recipe is the reason no | |
| 60 | +screen tool is selected: at 8 bits the same recipes also report | |
| 61 | +`allow_intrabc = false`, so the 12-bit absence is an encoder-side selection | |
| 62 | +question, not a depth question. | |
| 63 | +**Unblock / decision:** either (a) narrow the refusal to fire only when a | |
| 64 | +palette or intrabc symbol is actually READ (the flag alone is measurably safe), | |
| 65 | +keeping the string for the genuinely unwitnessed cell, or (b) keep it as is and | |
| 66 | +amend the string, which currently claims a gap ("neither palette nor intrabc has | |
| 67 | +a 12-bit witness") that the flag-only cell does not have. Producing a real 12-bit | |
| 68 | +palette/intrabc stream is a separate unblock and needs an encoder that selects | |
| 69 | +those tools — this `aomenc` does not, at either depth, for the six recipes | |
| 70 | +tried. | |
| 71 | + | |
| 72 | +## 3. Verbatim corrections to the debt text | |
| 73 | + | |
| 74 | +Debt file `~/.omp/agent/debts/DEBTS-home-user-Documents-Code-Rust-edith_codecs.md`. | |
| 75 | + | |
| 76 | +**(a) line 8, the unchanged-list sentence.** Current text: | |
| 77 | + | |
| 78 | +> `Rest of the recorded list unchanged: rect residual tables (census film-unreachable, no witness); 12-bit AV1; SEG_LVL gaps; two pre-existing 10-bit film failures ` | |
| 79 | + | |
| 80 | +Replace the three named items with: | |
| 81 | + | |
| 82 | +> `Re-measured 2026-09-30 on main facdcb73 (lane-av1gapremeasure): 12-bit AV1 is CLOSED for decode -- 7 committed 12-bit pins, 27 frame-dumps, 0 wrong samples on any plane vs the instrumented aomdec (control: one flipped oracle byte moves the count by exactly +1); the only surviving 12-bit refusal (allow_screen_content_tools) is BROADER than its gap -- lifted locally, 6 real aomenc 12-bit arms decode byte-exact 0/0/0 2/2, so the flag-only cell is safe and only a real 12-bit palette/intrabc stream is unwitnessed (this aomenc emits none, at 12 or 8 bits). rect residual tables: CLOSED and the premise refuted in the record itself -- r512.obu (6948 B, the stream the debt calls unwitnessed) decodes 3/3 frames byte-exact vs aomdec 0/0/0 on Y/U/V, plus 5 sibling rect pins 6/6. SEG_LVL gaps: the record is CORRECT -- the census reproduces exactly (162 seg-enabled frames over 4 arms, per-feature [96,0,0,0,0,0,0,0]/[32,..]/[96,..]/[80,..], all non-ALT_Q features 0) and the REF_FRAME/SKIP/GLOBALMV refusal fires on every hand-built header; census control: the same instrument reports per_feature[5]=1/[6]=1/[7]=1 on headers that enable them. ` | |
| 83 | + | |
| 84 | +**(b) line 8, the odd-height row.** Current text: | |
| 85 | + | |
| 86 | +> `STILL OPEN, separate mechanism (LUMA errors, unlocalised): 320x236 (Y 234349, U 56957, V 52981) and 322x248 (Y 36286, U 13359, V 13001). ` | |
| 87 | + | |
| 88 | +This row is **STILL OPEN and now REACHABLE** — do not close it. What is new is | |
| 89 | +the one-flag recipe and the fact that a *plausible-looking* recipe hides it: | |
| 90 | +`aomenc --end-usage=q` makes the defect disappear (the cell measures 0/0/0, | |
| 91 | +16/16 exact), while aomenc's **default** end-usage reproduces it on demand. | |
| 92 | +Append to the row: | |
| 93 | + | |
| 94 | +> `RE-MEASURED 2026-09-30 (lane-av1gapremeasure, main facdcb73, live aomdec comparator, per-cell +1 flip control): still open, and reachable with a one-flag recipe -- aomenc WITHOUT --end-usage=q (its default rate mode) over ffmpeg testsrc2=size=320x236:rate=24:duration=1 gives 16562 B, sha256 84e4d1ab56620af1c5b78e1aa3d2d67496a492f2e127198c82dd1d68b01c6200, 0 of 16 frames exact, per-frame diff bytes [16023, 19724, 19422, 20473, 20870, 19647, 21038, 19846, 22231, 21805, 23276, 23013, 24664, 24777, 24727, 22751] (the KEYFRAME is wrong, so this is an entropy fork, consistent with lanes/av1oddluma.report.md). 322x248 the same way: 16131 B, sha256 9e8c9c6c202a9d6a200e5393a79df5b6b5734ded3d004e3eac65f272c6e4730f, 0/16 frames exact, f0 Y 2170. CLOSED members of the same family: 320x232 (15773 B, sha256 6832c3cd867f5fc491b45fd67f77c38453db0ca6d461e7d225e6276f4d0784c8 = the committed pin, 0/0/0 16/16), 320x248 (16440 B) and 324x236 (16683 B) both 0/0/0 16/16. WARNING for the next lane: adding --end-usage=q (or --threads=1/--row-mt=0) to the recipe makes the defect VANISH without fixing anything -- the threaded default with the default end-usage is the only configuration measured to reach it. ` | |
| 95 | + | |
| 96 | +**(c) line 21, the 4:4:4 SQUARE 64x64 row.** Its opening claim is: | |
| 97 | + | |
| 98 | +> `4:4:4 SQUARE 64x64 block whose 64x64 chroma plane block is walked as a 2x2 grid of Chroma32 units: the SECOND unit reconstructs its SIBLING's flat DC instead of its own.` | |
| 99 | + | |
| 100 | +Its own seed (`f0 r512.obu mi=(112,80)`) measures 0 wrong on all three planes over | |
| 101 | +all 3 frames on current main, so the row's claim and its numbers (flat 241 vs | |
| 102 | +oracle 202) are stale. Prefix the row with: | |
| 103 | + | |
| 104 | +> `STALE 2026-09-30 (lane-av1gapremeasure): the seed stream r512.obu is byte-exact against the instrumented aomdec on current main -- 0 wrong Y/U/V over all 3 frames (control: flipped oracle byte -> +1 in Y). The flat-241-vs-202 signature at mi=(112,80) cannot be present. ` | |
| 105 | + | |
| 106 | +## 4. `not_done` | |
| 107 | + | |
| 108 | +- The 4:2:2 items on debt line 8 (the 322x242 `EC_AV1_FINAL_DUMP`-vs-returned-picture | |
| 109 | + anomaly and the sequence-header refusal lift decision) were NOT measured; they | |
| 110 | + belong to `lane-av1422anom`. My 322x242 encode being 0/0/0 vs aomdec is | |
| 111 | + presented-output only and does not address the rung disagreement. | |
| 112 | +- `cfl_ac_q3_at` (debt line 19) was not re-run; it is recorded refuted with two | |
| 113 | + guards already on main, and the debt's own text says so. | |
| 114 | +- No 12-bit palette/intrabc stream was produced; 6 recipes × 2 sources were | |
| 115 | + tried at 12-bit and the same recipes at 8-bit as a control. No encoder capable | |
| 116 | + of selecting those tools at 12-bit is present on this box. | |
| 117 | +- No 12-bit AFFINE global motion witness (recorded open in | |
| 118 | + `lanes/av112bitw.report.md:123-128` and not named in the debt list) was | |
| 119 | + produced; `av1gwarp12` covers ROTZOOM at 12-bit. | |
| 120 | +- Nothing was left in the tree: the throwaway harness and the temporary refusal | |
| 121 | + lift were reverted; `git status --porcelain` is empty at this commit. | |
| 122 | + | |
| 123 | +## 5. Cross-check against `Agent06-5`'s fixture — my first "closed" verdict on the | |
| 124 | +## odd-height row was an artefact of my own recipe | |
| 125 | + | |
| 126 | +Main measured `/tmp/h232fix/o320x236.obu` (16562 B, sha256 `84e4d1ab…`) as | |
| 127 | +diverging on current main; my 320x236 encode measured 0/0/0 16/16. Both readings | |
| 128 | +are right. Same comparator, same run, per frame, `+1` control on each stream: | |
| 129 | + | |
| 130 | +| stream | bytes | frames exact | per-frame diff bytes | flip-0 control | | |
| 131 | +|---|---|---|---|---| | |
| 132 | +| mine (`testsrc2=size=320x236:rate=25`, 16 frames, aomenc `--end-usage=q --threads=1 --row-mt=0`) | 6615 | **16/16** | all 0 | — | | |
| 133 | +| Agent06-5's (`testsrc2=size=320x236:rate=24:duration=1`, aomenc default end-usage) | 16562 | **0/16** | `[16023, 19724, 19422, 20473, 20870, 19647, 21038, 19846, 22231, 21805, 23276, 23013, 24664, 24777, 24727, 22751]` | wrongY 11198 → **11199** | | |
| 134 | + | |
| 135 | +My f0 number (16023) equals Main's f0 (16023) digit for digit, so the two | |
| 136 | +measurements are the same measurement. | |
| 137 | + | |
| 138 | +**What is NOT the variable** (each ruled out by measurement, all with the +1 | |
| 139 | +control): | |
| 140 | + | |
| 141 | +- **The source content.** Agent06-5's own content, demuxed from his webm and | |
| 142 | + re-encoded with MY flags, is 0/0/0 16/16 exact in six arms (plain, no-lag, | |
| 143 | + cdef0, restoration0, sb128, tx-size-search). | |
| 144 | +- **The container round-trip.** Re-running Agent06-5's exact aomenc line with | |
| 145 | + `--obu -o file.obu` (no webm, no ffmpeg remux) yields 16562 B, | |
| 146 | + `cmp`-IDENTICAL to his file, sha256 `84e4d1ab…`. The remux is byte-preserving. | |
| 147 | +- **Threading.** From his command, adding `--threads=1` → 16459 B, adding | |
| 148 | + `--row-mt=0` → 16459 B (the two are byte-identical to each other), and BOTH | |
| 149 | + measure 0/0/0 16/16 exact. | |
| 150 | + | |
| 151 | +**The single variable: `--end-usage=q`.** From his command on his source, adding | |
| 152 | +only `--end-usage=q` gives 6787 B and 0/0/0 16/16 exact. So aomenc's default | |
| 153 | +rate mode (which ignores `--cq-level=45`, emitting 8281 b/f instead of 3393 b/f) | |
| 154 | +is the only configuration measured to reach the defect; `--end-usage=q`, and | |
| 155 | +independently `--threads=1` or `--row-mt=0`, make it vanish without fixing | |
| 156 | +anything. That is why my sweep found nothing: every recipe I used carried | |
| 157 | +`--end-usage=q`, inherited from the crate's own encode helpers. | |
| 158 | + | |
| 159 | +### 5.1 A defect in the shared comparator, found while doing this | |
| 160 | + | |
| 161 | +`count_rawvideo_diffs` attributes planes with **absolute, non-frame-scaled** | |
| 162 | +thresholds (`stream.rs:10424-10436`: `if i < ys {0} else if i < ys + us {1} else {2}`, | |
| 163 | +where `ys`/`us` come from the FIRST picture). On a multi-frame stream every | |
| 164 | +sample after frame 0's luma therefore lands in plane 2, which is why the | |
| 165 | +diverging stream reports `wrongV = 330 673` when plane V only holds 302 080 | |
| 166 | +bytes across 16 frames. The per-frame byte counts and `frames_exact` are sound | |
| 167 | +(their sum is exactly the reported total, 344 287); the per-plane split is | |
| 168 | +meaningful only on single-frame streams. Read the numbers in §1's rows as | |
| 169 | +"0 wrong on every plane" (they are zeros) and, for any non-zero multi-frame | |
| 170 | +count, use per-frame bytes. | |
| 171 | + | |
| 172 | +### 5.2 Harness note | |
| 173 | + | |
| 174 | +The first `eprintln!` of a `--nocapture` run is intermittently swallowed by the | |
| 175 | +`memguard-runner` wrapper (observed repeatedly: the first `GAP`/`XC`/`XPATH` line | |
| 176 | +of a run is missing, and re-running with the same paths in a different order | |
| 177 | +prints it). Every number quoted here was seen printed in at least one run; none | |
| 178 | +rests on a line that only ever appeared as the swallowed first line. |