diff --git a/lanes/sb128c-r6.report.md b/lanes/sb128c-r6.report.md new file mode 100644 index 00000000..05a402e2 --- /dev/null +++ b/lanes/sb128c-r6.report.md @@ -0,0 +1,121 @@ +# lane-sb128c r6 report + +Branch `lane-sb128c`, worktree `edith_codecs-sb128c`. +Tip `cf0bd84` (merges: `363ab1e` main 727f29a, `5230f4c` lane-golomb 173b793). + +## Verdict: GREEN on the merge + the five 128 arms; the partition work is NOT started (see below) + +## (1) Merge (charter step 1) -- done, and it found a real regression + +`git merge --no-commit main` (main tip 727f29a, which does NOT contain lane-golomb), +then `git merge --no-commit 173b793` directly, as chartered. + +Resolutions (all in `crates/ec-av1/src/decode.rs`): +- var-tx leaves are main's general `(row, col, tw, th)`; the lane's 128-root mu-chunk + chroma interleave (`side > 64`, one 32x32 uv unit per 64x64 chunk) is kept, appended + after main's `record_mi_luma_rect` (:17540 and :18670, both leaf loops). +- `default_scan(tx_px.min(32))` kept over main's `default_scan(tx_px)` -- a TX_64X64 + codes only its top-left 32x32 (r5 root cause c). +- the per-vartx-leaf lf grid write is golomb's LUMA-ONLY `fill_lf_grid_leaf_luma` + (:19477), called with `(tw, th)`; this is exactly the r5 arm-3 defect (a 16x16 luma + leaf was publishing a chroma TU extent of 8 and inventing a chroma edge at chroma + x=56), so arm 3 needed no new code of mine. +- the lane's skip-inter `suppress_internal_lf_edges` is kept, narrowed to the 128 root. +- leaf ceiling is per root: main's TX_32X32 refusal below 128, TX_64X64 at the 128 root. +- `cdf.rs` diff vs 173b793 is ONLY the lane's own three rows in `MOTION_MODE`/`OBMC` + (BLOCK_64X128 / 128X64 / 128X128), 18 changed lines vs main; no hand-resolution. + +REGRESSION FOUND AND FIXED (class `fix-trades-sibling-gate`): r5's mv-stack change wired +libaom's WHOLE `has_top_right`, position mask included, without its three shape +refinements (`is_last_vertical_rect`, `is_first_horizontal_rect`, the `PARTITION_VERT_A` +bottom-left square) that `mvstack::has_top_right`'s own doc calls a corner-cut. Correct +at 128 (`bs > 64` -> no candidate) and WRONG below it once main decodes rect/AB inter +leaves: `a_real_aomenc_stream_with_ab_partitions`, `..._with_free_partitions` and +`real_aomenc_1to4_streams...` all lost frame 16 luma (seed 48), and the +`all_same_mv_neighbourhood_dedupes_to_one_entry` unit test lost the corner weight +(648 vs 652). Now gated on the size half only (`mvstack::top_right_scan_allowed`, +`bw4.max(bh4) <= 16`), with the ceiling and upgrade path named at the helper. + +EVIDENCE: $HOME/.cache/sb128c-gate-r6e.log | cargo test -p ec-av1 --lib -- ab_partitions +free_partitions real_aomenc_1to4_streams inter_128x128_none_root +key_frame_with_a_128x128_none_partition a_real_aomenc_128x128_superblock_stream +all_same_mv_neighbourhood | test result: ok. 9 passed; 0 failed + +The five 128 arms the charter asks for, from $HOME/.cache/sb128c-gate-r6a.log (all green +already at the merge commit, i.e. arm 3 was fixed by the golomb merge): +- inter 128 NONE arm 1 (yuv420p, tx_search=0, seed 61): 9/9 decode-order frames exact, + `inter_sb128_none_hits=14 chroma_units=16 intra_128_in_inter=0` +- arm 2 (yuv420p10le, tx_search=0, seed 61): 9/9 exact, `hits=29 chroma_units=28 + intra_128_in_inter=1` +- arm 3 (yuv420p, tx_search=1, seed 62): 9/9 exact, `hits=15 chroma_units=24` -- was RED + (7 bytes, a phantom chroma deblock edge) at r5. +- `a_real_aomenc_key_frame_with_a_128x128_none_partition_decodes_pixel_exact`: ok +- `a_real_aomenc_128x128_superblock_stream_decodes_pixel_exact`: ok + +## (2) 128-level HORZ/VERT + AB partitions -- NOT STARTED, but scoped by measurement + +deferred: the whole of charter step 2 -- fix-now for r7, unblocked by nothing; the round's +budget went to the merge, the has_top_right regression and the measurements below. +`refusal_inventory.rs:45` is untouched, no refusal lifted this round. + +What r6 measured instead (this is what r7 should build against, full detail in +`lanes/sb128c-r6.handoff.md`): +- 72 aomenc streams (6 seeds x 256x256/384x384 x cq 40/55/63 x 8+10-bit, `--sb-size=128 + --cpu-used=0 --min-partition-size=64 --enable-rect-partitions=1 --enable-ab-partitions=1`): + the 128-root partition symbol is ONLY 0 (NONE) or 3 (SPLIT). aomenc picks no 128-level + HORZ/VERT/AB on that recipe at all -- a gate built on it would be vacuous. +- 18 further streams with sources designed for the arms (512x512): an AB-shaped source + DOES produce `value=1` = PARTITION_HORZ at the 128 root, at cq 32/50/63 and both + min-partition-size 64 and 16. Recipe + kept streams in the handoff. +- Whether VERT / the four AB values are reachable stays UNKNOWN: our decoder stops at the + first refusing root, so nothing past it is observable. Any "aomenc never picks it" + claim needs a re-sweep AFTER HORZ decodes. + +EVIDENCE: $HOME/.cache/sb128c-work/sweep.out + sweep2 stdout | 90 aomenc encodes decoded +with EC_AV1_TRACE=1 | partition_w128 value histogram: {0,3} in all 72 sweep-A streams, +{0,1} in the 6 abshape streams + +## (3) Full suite + +`cargo test -p ec-av1 --lib` (systemd unit, MemoryMax=10G) at the merge commit: +**381 passed / 4 failed / 35 ignored** -- the four failures are the has_top_right +regression described above. Re-run at tip cf0bd84: **385 passed / 0 failed / 35 ignored** +(1125.89 s), log `$HOME/.cache/sb128c-suite-r6.log`. + +EVIDENCE: $HOME/.cache/sb128c-suite-r6.log | systemd-run --user --unit=sb128c-suite2-... +-p MemoryMax=10G cargo test -p ec-av1 --lib -j3 | test result: ok. 385 passed; 0 failed; +35 ignored + +## (4) Film re-probe (1080p 10-bit AV1, four extracts) + +| stream | bytes | stop string | FINAL_DUMP frames | +|---|---|---|---| +| `sb128c-work/reelc2s.obu` | 1428 | 128x128 superblock HORZ/VERT or AB partition | 1 | +| `~/.cache/reelc-head.obu` | 1428 | same | 1 | +| `sb128c-work/reelc-8100.obu` (`-ss 8100 -t 2`) | 326696 | same | 0 | +| `sb128c-work/reelc-9000.obu` (`-ss 9000 -t 2`) | 1287780 | same | 0 | + +The one shown frame the head extract does decode is byte-identical to ffmpeg's 10-bit +output. No film grain on this title. + +NEW, decisive for r7: on all four extracts `EC_AV1_TRACE=1 | grep partition_w128` shows +values 0 and 3 ONLY right up to the stop. The full-alphabet symbol traces every value it +reads, so the refusing partition came from `read_sb128_root`'s GATHERED branch +(decode.rs:13317, untraced): 1080 luma rows -> `mi_rows = 270`, the bottom 128 row has +`mi_r128 = 256`, `256 + 16 > 270`, one gathered bit, and the film codes it +`PARTITION_HORZ` -- a 128x64 block at the frame's bottom edge. Width 1920 = 15*128 +exactly, so the VERT gathered arm is unreachable on this title. The film's minimum ask is +therefore the 128x64 block, not the whole 128-level partition set. + +EVIDENCE: $HOME/.cache/sb128c-work/fd/o.f0 vs reelc-ff.yuv | EC_AV1_FINAL_DUMP decode of +reelc2s.obu + `ffmpeg -pix_fmt yuv420p10le -frames:v 1` | cmp: identical, 4561920 B + +## Open residue + +- fix-now (r7): 128-level HORZ (128x64) on the key and inter paths, gated on the abshape + recipe; then re-sweep for VERT/AB and keep the unreached arms refused BY NAME. +- accepted: `top_right_scan_allowed`'s corner-cut (mask half unported) -- identical to + main's behaviour below 128, ceiling named in the doc comment. +- deferred: the three `has_top_right` shape refinements -- unblocked by nothing, but only + observable once a gate exercises a rect/AB inter leaf whose top-right differs; none of + the 416 lib tests does today.