forge
Explore
Log in

Don't you dare go Hollow

R1 report -- 128 root on key frames, two root causes, gates, refusals left

Browse files at this commit

45cedd81631789b104dbc41ebd8a4865cde63d75Ahmet Kaan GümüşParent: 231663e
  • docs
    • r1 report -- 128 root on key frames, two root causes, gates, refusals left
Show full message
docs(sb128): r1 report -- 128 root on key frames, two root causes, gates, refusals left
lanes/sb128-r1.report.mdadded+88 -0
@@ -0,0 +1,88 @@
1+# lane-sb128 r1 — 128x128 superblocks, key frames
2+
3+Branch `lane-sb128` off main `a59645c`, worktree `edith_codecs-sb128`.
4+
5+## Film first (the ReelC blocker)
6+
7+`reelc5.obu` (1.1 MB, 1920x792 yuv420p10le, `use_128x128_superblock=1`) now decodes the 128
8+superblock root and stops at a NAMED, unrelated refusal instead of desyncing:
9+
10+EVIDENCE: /tmp/claude-1000/.../cdc46329-.../scratchpad/reelc5.obu | `decode_probe reelc5.obu`
11+after this round | `REFUSED: unsupported: AV1 tile (a HORZ/VERT intra strip below 16x16 with a
12+split transform (per-unit rect prediction is not ported))` — a sub-16 intra-strip gap owned by
13+another lane, reached deep inside the tile (78 frame headers parsed, single tile).
14+
15+Not measured: the exact pre-change refusal string on this same file (no baseline binary was
16+built before the patch landed). deferred: film pixel compare — the stream still refuses, so
17+there is no frame to `cmp` — unblocked by the sub-16 split-transform strip lane.
18+
19+## What changed
20+
21+- `crates/ec-av1/src/decode.rs`
22+ - `SB128` thread-local + `set_sb128` (also sets `Reach`'s superblock size), `sb_mi_cur()`.
23+ - `sb_visit_order()`: at sb128 the tile walks each 128x128 superblock's four 64x64
24+ quadrants (TL, TR, BL, BR) before the next superblock — libaom `decode_partition`'s
25+ recursion order, not raster over 64x64 superblocks.
26+ - key-frame tile loop: per 128 superblock, one `read_lr` over the whole 128x128 and one
27+ `partition_w128` symbol (8-symbol alphabet, no HORZ_4/VERT_4 at BLOCK_128X128; forced-split
28+ gather `gather_of` + `VERT_ALIKE128`/`HORZ_ALIKE128` at the frame edge). SPLIT recurses
29+ into the existing 64 path; the other seven arms refuse by name.
30+ - `maybe_read_delta_q` / `maybe_read_delta_lf` key off `sb_mi_cur()` (once per 128x128, not
31+ four times), and `is_whole_sb` is ignored at sb128 (no leaf can be a whole 128 superblock).
32+ - `NO_NEIGHBOUR_SIDE = 128` replaces `SB` as the partition-context sentinel — ROOT CAUSE 1.
33+ - intrabc under sb128 refuses by name (`av1_is_dv_valid`'s delay is sb_size-derived).
34+- `crates/ec-av1/src/encode.rs`: `Reach`'s `has_top_right`/`has_bottom_left` masked the block
35+ position with a hardcoded 64 superblock; now `reach_sb_px()` (64 or 128) — ROOT CAUSE 2.
36+ The tables themselves were already 128-relative (`table_stride`), only the masks were wrong.
37+- `crates/ec-av1/src/cdf.rs` / `cdf_state.rs`: `PARTITION_W128` (entropymode.c:154's four
38+ `AOM_CDF8` rows), stored, reset per frame like `partition_w64`.
39+- `crates/ec-av1/src/stream.rs`: `set_sb128` per frame, scoped inter refusal, two gates.
40+- `crates/ec-av1/src/refusal_inventory.rs`: the three new refusals listed.
41+
42+Two defects found and fixed, both invisible at 64:
43+1. the no-neighbour partition-context sentinel (64) set the ctx bit at the 128 root — our ctx
44+ was 3 where aomdec printed `ctx=16` (= `bsl*4 + 0`, row 0). Identical at every level <= 64,
45+ so no existing gate could see it.
46+2. `has_top_right`/`has_bottom_left` answered against a 64 superblock — a bounded 1391-luma-pixel
47+ band (x 124..255, y 44..67) with the entropy stream still in sync.
48+
49+## Gates
50+
51+`a_real_aomenc_stream_with_128x128_superblocks_decodes_pixel_exact` — real
52+`aomenc --sb-size=128 --max-partition-size=64`, 6 arms (256x192 seeds 42/43/44 8-bit,
53+384x384 8-bit, 256x192 10-bit, 384x384 10-bit), sequence header asserted
54+`use_128x128_superblock == true` at the arm's bit depth, every frame Y/U/V vs ffmpeg, hard
55+asserts on `part128_symbols`/`part128_split_hits`. No SKIP except a missing tool.
56+
57+EVIDENCE: `cargo test -p ec-av1 --lib 128x128 -- --nocapture` | 6 aomenc encodes decoded and
58+compared plane-by-plane | `6 pixel-exact, 0 named refusals, part128_symbols=26
59+part128_split_hits=34`; `a_real_aomenc_128x128_inter_stream_refuses_by_name ... ok`.
60+
61+EVIDENCE: scratchpad/sb128/{ref128.yuv,our128.yuv} | seed 44 encoded at `--sb-size=128` and
62+`--sb-size=64`, both decoded through `decode_probe` and `cmp`ed against
63+`ffmpeg -f rawvideo -pix_fmt yuv420p` | before the two fixes: sb64 EXACT / sb128 DIFF at byte 1
64+(ctx defect) then at byte 11518 (reach defect); after: `seed44 sb128 EXACT`.
65+
66+## Refused by name (still), each with its string
67+
68+- `a 128x128 superblock partition other than SPLIT (NONE/HORZ/VERT and the four AB arms at the
69+ 128 root are not decoded)` — the six 128-level non-SPLIT arms + a 128x128 leaf. The gate pins
70+ `--max-partition-size=64` so the encoder never chooses them. deferred: 128-level NONE/HORZ/VERT
71+ (a 128x128 block is 2x2 TX_64X64 luma + 2x2 TX_32X32 chroma; `decode_block` codes ONE luma TU
72+ per block outside the `tx_select` multi-TU branch and one chroma TU always) — unblocked by a
73+ multi-TU chroma path in `decode_block`.
74+- `an inter frame under a 128x128 superblock (this decoder's inter tile path recurses a 64x64
75+ superblock root only)` — scoped to frames > 64x64 (a <=64x64 frame's 128 root reads no symbol).
76+ deferred: inter at 128 — the second `for sb_r/sb_c` loop in `decode.rs` (~line 17800) plus OBMC
77+ and mvstack neighbour caps — unblocked by porting `sb_visit_order` + the 128 prologue there.
78+- `intrabc under a 128x128 superblock (...)` — accepted for this round.
79+
80+## Suite
81+
82+`cargo test -p ec-av1 --lib` (systemd unit, log `$HOME/.cache/sb128-suite.log`): see the tail
83+appended below by the run.
84+
85+```
86+test result: ok. 350 passed; 0 failed; 31 ignored; 0 measured; 0 filtered out; finished in 313.69s
87+```
88+(31 ignored = the pre-existing ignore list, unchanged by this lane.)