R2 report -- ReelC's key frame bit-exact, the chroma TU loop, the 128 NONE residual
Browse files at this commite22a8332f8808f99fba81b71db1cd9a4c6dbde8fParent: df156df- docs
- r2 report -- ReelC's key frame bit-exact, the chroma TU loop, the 128 NONE residual
1 changed file +97 -0
- lanes/sb128b-r2.report.md +97 -0
lanes/sb128b-r2.report.mdadded+97 -0
| @@ -0,0 +1,97 @@ | |||
| 1 | +# lane-sb128b r2 — ReelC's key frame is BIT-EXACT; the 128 chroma TU loop; the 128 root's residual | ||
| 2 | + | ||
| 3 | +Branch `lane-sb128b`, worktree `edith_codecs-sb128b`, commits `4e13f60`, `1524838`, `c415a31` | ||
| 4 | +(off r1's `d3bc8da` + `git merge main` b51719f, clean). | ||
| 5 | + | ||
| 6 | +## FIRST: the ReelC KEY-frame pixel check (the charter's first task — first ReelC pixel measurement ever) | ||
| 7 | + | ||
| 8 | +EVIDENCE: `$HOME/.cache/sb128b-work/{reelckf0.obu,ours.f0.yuv,ref.yuv}` | | ||
| 9 | +`ffmpeg -ss 0 -t 2 -c:v copy -frames:v 1 -f obu` off the real film (74 B, 1920x792 yuv420p10le) | ||
| 10 | +→ `dump_yuv` (release, 6G scope) vs `ffmpeg -pix_fmt yuv420p10le -f rawvideo` | | ||
| 11 | +**`cmp` says BYTES EQUAL — ReelC's key frame decodes BIT-EXACT (4 561 920 bytes, 0 differing samples).** | ||
| 12 | + | ||
| 13 | +It was NOT exact before the merge. Pre-merge measurement (same artifacts, r1's tree): | ||
| 14 | +Y 36448 samples off (max |d| 2), U/V 9483 each (max |d| 4), all inside the bottom partial | ||
| 15 | +superblock row — luma rows 765..791 (768 = 6*128, frame is 792 tall) plus 3 deblock rows above, | ||
| 16 | +`+1` per 16-row band, ref uniformly flat (this key frame is black). `git merge main` (lane-oddh's | ||
| 17 | +odd-frame-size work) removes it entirely. Class: [[stale-premise lanes]] — the lane's base | ||
| 18 | +predates the fix. | ||
| 19 | + | ||
| 20 | +ReelC now stops at `an inter frame under a 128x128 superblock` (probe on the 2 s cut, 72 frame | ||
| 21 | +headers parsed) — the sibling lane-sb128 r3's residue, exactly as r1 predicted. | ||
| 22 | + | ||
| 23 | +## Merge seam (had to be fixed before anything could run) | ||
| 24 | + | ||
| 25 | +main b51719f re-introduced lane-oddh's blanket refusal `a sequence using 128x128 superblocks on a | ||
| 26 | +frame larger than 64x64` (stream.rs) — textually a clean merge, semantically a lane-killer (the | ||
| 27 | +ledger's recorded `merge seam` constraint). Deleted, with its inventory line, and its gate | ||
| 28 | +`a_real_aomenc_128x128_superblock_stream_is_refused_by_name` turned into | ||
| 29 | +`..._decodes_pixel_exact`. | ||
| 30 | + | ||
| 31 | +EVIDENCE: `cargo test -p ec-av1 --lib -- a_real_aomenc_128x128_superblock_stream gate_coverage` | | ||
| 32 | +real aomenc 64x72 mandelbrot `--cpu-used=0 --sb-size=128` (`use_128x128_superblock` asserted in | ||
| 33 | +the stream), decoded vs ffmpeg | **ok — 10 passed, 0 failed**; the frame's Y/U/V match ffmpeg | ||
| 34 | +sample for sample. One recipe change was needed and is unrelated to the 128 root: at 64x72 | ||
| 35 | +aomenc also picks `PARTITION_HORZ_4` below 16x16, so the gate now passes | ||
| 36 | +`--enable-1to4-partitions=0 --min-partition-size=16` (gate_coverage green with it). | ||
| 37 | + | ||
| 38 | +## TASK A — the chroma half of a 128x128 `PARTITION_NONE` block (landed, not yet exact) | ||
| 39 | + | ||
| 40 | +`crates/ec-av1/src/decode.rs` | ||
| 41 | +- `decode_block`'s multi-TU arm now codes `cn = chroma_side / chroma_tx` **squared** chroma units | ||
| 42 | + per plane instead of one whole-plane unit. `av1_get_max_uv_txsize(BLOCK_128X128)` = | ||
| 43 | + `av1_get_adjusted_tx_size(max_txsize_rect_lookup[BLOCK_64X64])` = TX_32X32, so a 128 block is | ||
| 44 | + 2x2 TX_32X32 per plane; `cn == 1` (every block at 64 and below) is byte-for-byte the read this | ||
| 45 | + always did. Per unit: `around_mi` gathered over the unit's own 64-luma-pixel span (which is | ||
| 46 | + also its `txb_skip_ctx`, `read_plane`'s chroma branch), `tu_reach` on the matching luma | ||
| 47 | + quadrant, own `set_palette_pred`. | ||
| 48 | +- `Neighbours::record_mi_chroma` (new, next to `record_mi_luma`): per-unit chroma coefficient | ||
| 49 | + context, luma-mi indexed with `record_split_luma_rect_mi`'s own frame-edge clamp. Applied | ||
| 50 | + AFTER `record_split_luma` so the per-unit state is what the next block reads. | ||
| 51 | +- The `skip` arm predicts per transform unit now (libaom predicts inside the transform-block | ||
| 52 | + loop); `n_axis == 1` / `cn == 1` is the unchanged whole-block call. | ||
| 53 | +- counter `chroma_split_tx_hits()`. | ||
| 54 | + | ||
| 55 | +**Result: not pixel-exact, so the refusal is BACK, reworded to what was measured.** | ||
| 56 | +EVIDENCE: `$HOME/.cache/sb128b-work/g42.obu` (the gate's own arm reproduced by hand: gradients | ||
| 57 | +seed 42, 384x384, cq63, `--sb-size=128 --cpu-used=0 --enable-tx-size-search=0`) | `dump_yuv` vs | ||
| 58 | +`ffmpeg -pix_fmt yuv420p` | 139162/147456 luma samples differ, first at row 0 col 60 (ours 114, | ||
| 59 | +ffmpeg 115). **ffmpeg's row 0 is a CONSTANT 115 across the whole first unit where ours ramps | ||
| 60 | +115 → 112**, and the stream is 76 bytes: the mode and the DC agree, our first TX_64X64 luma unit | ||
| 61 | +reads AC coefficients libaom never wrote. So the divergence is inside that unit's coefficient | ||
| 62 | +read, not in chroma and not in prediction. | ||
| 63 | + | ||
| 64 | +Refusal now reads: `a 128x128 PARTITION_NONE block (four TX_64X64 luma and four TX_32X32 chroma | ||
| 65 | +units all decode, but the first unit's coefficients already carry AC where libaom has DC only -- | ||
| 66 | +lane-sb128b r2's open entropy residual)`. Gate | ||
| 67 | +`a_real_aomenc_key_frame_with_a_128x128_none_partition_decodes_pixel_exact` stays `#[ignore]`d as | ||
| 68 | +the reproducer, with its plane asserts rewritten to LOCATE the divergence (count + first | ||
| 69 | +row/col/values) instead of printing 147 456 samples. | ||
| 70 | + | ||
| 71 | +Also corrected in that gate's doc: r1 wrote "ONE TX_64X64 chroma unit per plane / `TxbSet::Chroma64`"; | ||
| 72 | +the truth is four TX_32X32 and no `Chroma64` set exists or is needed. | ||
| 73 | + | ||
| 74 | +## Not done | ||
| 75 | + | ||
| 76 | +- deferred: TASK A's `tx_select` at 128 arm (`--enable-tx-size-search=1`) — not added — unblocked | ||
| 77 | + by the NONE arm being exact at all (an inexact arm cannot gate a tx-depth counter). | ||
| 78 | +- deferred: TASK B (HORZ/VERT + AB at 128) — not started, refused by name | ||
| 79 | + (`a 128x128 superblock HORZ/VERT or AB partition`) — unblocked by the same residual. | ||
| 80 | +- deferred: TASK C (inter 128) — not started, refused by name on both this tree and the sibling's | ||
| 81 | + (`an inter frame under a 128x128 superblock`) — unblocked by lane-sb128 r3 lifting its inter | ||
| 82 | + root refusal; nothing of TASK C was written, so nothing is "ready behind" it. | ||
| 83 | +- `git merge lane-sb128` NOT done: the sibling's tip is `dbf15a4` (gate-recipe fix only, no | ||
| 84 | + inter-128 lift yet), so there was nothing to take. | ||
| 85 | + | ||
| 86 | +## Suite | ||
| 87 | + | ||
| 88 | +r2's first run (`$HOME/.cache/sb128b-suite-r2.log`, unit `sb128b-suite-r2-1788322817.service`) was | ||
| 89 | +armed at the intermediate commit `1524838` and is superseded. Its FAILED list: the 2 rect/AB reds | ||
| 90 | +inherited from 807c110 (`a_real_aomenc_10bit_rect_and_ab_partitions_decode_pixel_exact`, | ||
| 91 | +`a_real_aomenc_10bit_stream_with_a_32_level_ab_partition_decodes_pixel_exact`) — **still red after | ||
| 92 | +`git merge main` b51719f, so main did NOT fix them** — plus the two 128 gates that this round's | ||
| 93 | +final commit resolves (`..._128x128_superblock_stream...` now green, | ||
| 94 | +`..._128x128_none_partition...` now `#[ignore]`d). | ||
| 95 | +The authoritative run for `c415a31` is unit `sb128b-suite-r2b-1788323051.service` → | ||
| 96 | +`$HOME/.cache/sb128b-suite-r2b.log`; it was still running at this round's tool-call ceiling. | ||
| 97 | +NOT a clean-suite claim: read that log for the totals before merging. | ||