# lane-sb128c r7 report -- the 128 root's gathered frame-edge HORZ/VERT arm Branch `lane-sb128c`, worktree `edith_codecs-sb128c`, `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sb128c`. Commits this round: `d10a641` (the interrupted r7 builder's partial, committed as wip), `52e4458` (feature + gate), `5bd4556` (inventory). ## What changed - `crates/ec-av1/src/decode.rs:13446` `read_sb128_root`: HORZ/VERT are no longer refused there; they are counted (`PART128_HORZ_HITS`, `PART128_VERT_HITS`, and the gathered-edge pair `PART128_EDGE_HORZ_HITS`/`PART128_EDGE_VERT_HITS`) and only the four AB shapes still refuse, by their own name. - `crates/ec-av1/src/decode.rs:21881` inter tile path: a 128 root that resolves to HORZ/VERT decodes two `inter_piece!` blocks of 128x64 / 64x128 (the second skipped when its origin is outside the frame, libaom `decode_partition`'s `if (mi_row + hbs < mi_rows)`), then fans one `cdef_idx` out over the 64x64 CDEF units the block covers. - `crates/ec-av1/src/decode.rs:12029` `read_block_tx_size_rect`: `bw.max(bh) > 64` reads TWO square TX_64X64 top-level units (libaom `read_block_tx_size`'s `idy/idx` loop), each with its own `txfm_partition` symbol at depth 0. - `crates/ec-av1/src/decode.rs:11897` `rect_inter_residual_supported`: (128,64) and (64,128) admitted. - `crates/ec-av1/src/decode.rs:18008` / `:19109`: the `side > 64` mu-chunk chroma branch now precedes the `rect_tu` one -- at the 128 root a rect block's chroma is per mu chunk, not one unit for the block. - `crates/ec-av1/src/decode.rs:16891`: the `whole_sb` test that gates delta-q / delta-lf reads is against `sb_mi_cur() * 4`, not a hardcoded 64. - `crates/ec-av1/src/decode.rs:3948` `Neighbours::new`: the per-mi side arrays are padded to a superblock multiple. ROOT CAUSE of two index-out-of-bounds panics (`decode.rs:5018`, `:4537`, len 200 index 200) on the 1080p film: a 128x64 at the bottom edge records neighbour state for its whole 64-row extent, past the frame's last mi row -- libaom's own context buffers are `MAX_MIB_SIZE`-aligned for exactly that reason. The two `get_mut` guards in `record_mi_rect` are the belt; the padding is the fix. - `crates/ec-av1/src/decode.rs:13700` key-frame path: HORZ/VERT at the 128 root now REFUSE by name. Before this round they fell through into the four-quadrant SPLIT visit and silently decoded wrong pixels (the first version of the gate caught it as a frame-0 mismatch on a `gradients` source). - `crates/ec-av1/src/stream.rs:18957` new gate; `:84` `sb128_rect_counters()`; `crates/ec-av1/examples/decode_probe.rs:40` prints them. - `crates/ec-av1/src/refusal_inventory.rs:46`: the old "a 128x128 superblock HORZ/VERT or AB partition" line is REPLACED by "a 128x128 superblock AB partition (HORZ_A/HORZ_B/VERT_A/VERT_B at the 128 root)" plus the new intra-frame one and the var-tx >64 leaf guard. ## Gate (GREEN) `cargo test -p ec-av1 --lib gathered_edge_horz -- --nocapture` (`a_real_aomenc_sb128_gathered_edge_horz_partition_decodes_pixel_exact`): 4 real `aomenc --sb-size=128 --cpu-used=0 --min-partition-size=64 --enable-rect-partitions=1` streams, 5 frames each, every decode-order frame (hidden alt-ref included) compared against the instrumented aomdec through `decode_all_frames_vs_oracle`; hard asserts the gathered-edge counter and the inter 128x64/64x128 block counter. seed 42 cq55 384x320 8bit HORZ: 6 frames pixel-exact (1 hidden), edge +2 inter_128rect +2 seed 43 cq55 384x320 10bit HORZ: 6 frames pixel-exact (1 hidden), edge +24 inter_128rect +24 seed 44 cq32 192x256 8bit VERT: 6 frames pixel-exact (1 hidden), edge +2 inter_128rect +2 seed 45 cq45 192x256 10bit VERT: 6 frames pixel-exact (1 hidden), edge +2 inter_128rect +2 test result: ok. 1 passed; 0 failed EVIDENCE: $HOME/.cache/sb128c-gate3-r7.log | cargo test -p ec-av1 --lib gathered_edge_horz --nocapture | 4/4 arms pixel-exact vs aomdec, edge counters +2/+24/+2/+2 ## Film (1080p 10-bit AV1, 4 extracts) | extract | before r7 | after r7 | edge_horz | inter_128x64 | |---|---|---|---|---| | 2 s head (1920x792) | stopped: 128 HORZ/VERT/AB | **OK: 48/48 frames, 49/49 dumps bit-exact vs aomdec** | 720 | 720 | | `~/.cache/reelc-head.obu` | stopped: 128 HORZ/VERT/AB | **OK: 48/48 frames, 49/49 dumps bit-exact** | 720 | 720 | | `-ss 8100` 2 s | stopped: 128 HORZ/VERT/AB | stops at another lane: "a split intra strip whose transform unit is 32x64" | 1 | 0 | | `-ss 9000` 2 s | stopped: 128 HORZ/VERT/AB | stops at another lane: "a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding" | 12 | 0 | EVIDENCE: $HOME/.cache/sb128c-r7/d2 vs $HOME/.cache/sb128c-r7/o2 | EC_AV1_FINAL_DUMP on decode_probe head2s.obu and on aomdec head2s.obu, cmp per frame | frames=49 frames_differing=0 The 128-partition wall is gone from all four extracts; two of them now decode their whole 2 s window bit-exact, the other two stop at OTHER lanes' refusals. ## Suite `cargo test -p ec-av1 --lib` (systemd unit, MemoryMax=10G): **386 passed; 0 failed; 35 ignored** in 1133 s -- `$HOME/.cache/sb128c-suite-r7.log`. ## Residue - deferred: the INTRA (key-frame) 128x64/64x128 block -- refused by name, was a silent wrong decode before this round. Unblocked by a rect-capable `decode_block` at 128 (`decode_block_rect64` is corner-cropped for a 32x32 transform and does not generalise). A smooth `gradients` source at `--min-partition-size=64` reaches it in one encode, so a gate is one recipe away. - deferred: the four AB shapes at the 128 root (HORZ_A/HORZ_B/VERT_A/VERT_B), still refused by name. Unblocked by the intra rect block above plus the libaom visit order recorded in `lanes/sb128c-r6.handoff.md`. Whether aomenc ever picks them is still unmeasured -- our decoder used to stop at the first refusing root, so the r6 sweeps could not observe past it; the 512x512 abshape source now decodes further and the sweep can be re-run. - accepted: `PART128_HORZ_HITS`/`PART128_VERT_HITS` (the non-gathered, full-alphabet arms) are counted but were 0 in every stream measured this round; the gate asserts the gathered pair only.