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