diff --git a/lanes/sb128b-r1.report.md b/lanes/sb128b-r1.report.md new file mode 100644 index 00000000..5472a763 --- /dev/null +++ b/lanes/sb128b-r1.report.md @@ -0,0 +1,94 @@ +# lane-sb128b r1 — the 128 root's `PARTITION_NONE` arm (key frames) + +Branch `lane-sb128b` off `lane-sb128` 807c110, worktree `edith_codecs-sb128b`, commit `ceec9fa`. + +## ReelC first — the charter's premise is FALSE on ReelC's key frame + +EVIDENCE: `$HOME/.cache/sb128b-work/reelc2s.obu` (fresh cut, `ffmpeg -t 2 -c:v copy -f obu` +off the real film, 1428 bytes) | release `decode_probe` under a 6G scope with `EC_AV1_TRACE=1` +| **90 `partition_w128` symbols, value=3 (`PARTITION_SPLIT`) on every one** (ctx 3 x70, ctx 2 +x14, ctx 1 x5, ctx 0 x1); the run then stops at `an inter frame under a 128x128 superblock`. +Same numbers on the pre-existing `reelc-head.obu`. + +So ReelC's KEY frame is 100% SPLIT at the 128 root — the key-frame 128 arms are **not** its +blocker, and TASK 4's "the inter arms" is where ReelC's non-SPLIT roots live (r2 saw them only +with the inter refusal locally lifted). Charter premise "ReelC's key frame is the first thing to +decode / stops at a TASK-B arm" corrected here, measured, not argued. + +## What landed (all against libaom, each cited) + +`crates/ec-av1/src/decode.rs` +- `read_sb128_root` (11286) returns the root partition; the key-frame loop (11536) decodes + `PARTITION_NONE` as one 128x128 block and skips the superblock's other three visits + (`sb128_none`). The inter loop refuses any non-SPLIT root by name. +- `read_tx_size` (10003): `max_txsize_rect_lookup[BLOCK_128X128]` is TX_64X64 → a 128 block + reads BLOCK_64X64's own `tx_size_cat3` and resolves `max_tx >> depth`, and + `get_tx_size_context` is asked about 64, not 128. +- `decode_block`: the single-TU arm was `!tx_select || logical_tx == side`. Without `tx_select` + `logical_tx` IS `side` at every size <= 64, so the first half was redundant — and wrong at + 128. Now `logical_tx == side`, and the non-select resolve is `(side.min(64), luma_tx)`, so a + 128 block is always four TX_64X64 units. The TU loop passes the unit's **coefficient** side + (32 at TX_64X64), not its transform side. +- `delta_q`/`delta_lf` "this leaf IS the superblock" is now `side == sb_size` (was a hardcoded + 64 plus a `!sb128()` disable) — a NONE 128 root is the whole superblock. +- the 128 block's one `cdef_idx` read is copied to all four 64x64 CDEF units (libaom's four + units share one `MB_MODE_INFO`). + +`crates/ec-av1/src/stream.rs`: new gate (below). `refusal_inventory.rs`: the single +"partition other than SPLIT" string splits into three named arms. + +## Gate + +`a_real_aomenc_key_frame_with_a_128x128_none_partition_decodes_pixel_exact` — real aomenc +`--sb-size=128` with **no** `--max-partition-size` (the r1 gate's flag is exactly what made +every 128 root a forced SPLIT), smooth gradients at `--cq-level=63/55`, 384x384 + 256x256, +8- and 10-bit, `--enable-tx-size-search=0`. `#[ignore]`d: it is a reproducer, not a pass. + +EVIDENCE: `cargo test -p ec-av1 --lib -- --nocapture a_real_aomenc_key_frame_with_a_128x128_none` +| aomenc 384x384 cq63 seed 42, decoded then compared to ffmpeg | the NONE arm **fires** and the +tile decodes end to end (no desync panic, no refusal), but frame 0 luma differs from ffmpeg at +138523 of 147456 samples, first at row 0 col 60, magnitudes 1..3 (ours 114/113 where ffmpeg has +115) — a reconstruction difference, not an entropy blow-up. + +Two earlier failures on the way, both fixed and both real defects of the generalisation: +`transform.rs:843 index out of bounds (len 64, index 64)` = the redundant `!tx_select` arm +above sending a 128-wide inverse transform; then the pixel deltas. + +## Root cause of the residual (found, not guessed) + +`av1_get_max_uv_txsize` = `av1_get_adjusted_tx_size(max_txsize_rect_lookup[uv_plane_bsize])`. +The uv plane block of a 128x128 is 64x64 → TX_64X64 → **adjusted to TX_32X32**. A 128 block's +chroma is therefore FOUR TX_32X32 units per plane, and `decode_block` codes exactly one +whole-plane chroma unit. That is the desync, and it also means the charter's +"one chroma TU of 64x64 per plane / new chroma TX_64X64 path" is wrong: **no `TxbSet::Chroma64` +is needed at all.** I had transcribed the 16 libaom `[TX_64X64][PLANE_TYPE_UV]` CDF tables and +wired the variant before finding this; that work is reverted (`cdf.rs`/`cdf_state.rs` are +untouched in this commit) rather than shipped as dead code. + +## Refusals + +- `a 128x128 superblock HORZ/VERT or AB partition (only SPLIT and NONE are decoded at the 128 + root)` — NOT lifted, TASKs 2/3, not started. +- `a 128x128 superblock PARTITION_NONE root on an inter frame (...)` — NOT lifted, TASK 4. +- `a 128x128 PARTITION_NONE block's chroma (its 64x64 uv plane block is four TX_32X32 units, + and this decoder codes one whole-plane chroma unit per block)` — NEW, guards the arm this + round built. fix-now(r2): give `decode_block` a chroma TU loop (2x2 TX_32X32, `TxbSet::Chroma32`, + per-unit `chroma_skip_ctx`, grids assembled for `record_split_luma`) — unblocked by that loop; + the gate above is the reproducer and flips green the moment it is right. +- `intrabc under a 128x128 superblock` — accepted, unchanged. + +## Suite + +`cargo test -p ec-av1 --lib` under user unit `sb128b-suite-1788322151.service`, +log `$HOME/.cache/sb128b-suite.log` — result appended below by the handoff line in the report +message. The 7 rect/AB reds inherited from 807c110 (r2's `deferred: attribute the 7`) are the +sibling lane's; this round touched no rect/AB path. + +## Deferred + +- deferred: TASK 2/3 (HORZ/VERT + AB at 128) — not started — unblocked by the chroma TU loop + plus rect handling at 128. +- deferred: TASK 4 (inter 128 NONE) — refused by name — unblocked by the same loop and the + sibling lane's inter residue. +- deferred: `tx_select` at 128 (`read_tx_size` now handles it, cat3 against 64) is UNTESTED — + every gate arm here runs `--enable-tx-size-search=0` — unblocked by an r2 arm with it on.