forge
Explore
Log in

Don't you dare go Hollow

R3 report -- uv_mode class sweep, intra 128-in-inter, four 128-root defects, gate RED on a loop-filter residue

Browse files at this commit

712eb4563a6c13ac9cc700034d4f26a9a5e38389Ahmet Kaan GümüşParent: 3084278
  • docs
    • r3 report -- uv_mode class sweep, intra 128-in-inter, four 128-root defects, gate RED on a loop-filter residue
Show full message
docs(sb128c): r3 report -- uv_mode class sweep, intra 128-in-inter, four 128-root defects, gate RED on a loop-filter residue
lanes/sb128c-r3.report.mdadded+125 -0
@@ -0,0 +1,125 @@
1+# lane-sb128c r3 report
2+
3+Tip `lane-sb128c` @ `9c36e62` (worktree `edith_codecs-sb128c`,
4+`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sb128c`).
5+
6+## VERDICT: RED
7+
8+The refusal this round targeted is gone and all three gate arms now decode every
9+frame with no refusal, but the gate is RED on a **reconstruction/loop-filter**
10+residue (98 luma px on one frame), not on an entropy desync.
11+
12+## (0) r2 suite unit
13+
14+`sb128c-suite-r2-1788326632.service` never produced a `test result:` line. It ran
15+50 min (232 `ok`, 0 `FAILED` in the log) and was still `active`; r3 stopped it to
16+free the target dir for its own suite. **No r2 suite total exists.**
17+It also ran WITHOUT the top-level `fixtures` symlink, which this worktree was
18+missing (created this round) -- that is the r2 `film_grain` 8-bit red, per the
19+COMMON note added mid-batch.
20+
21+## (1) CLASS SWEEP -- every uv_mode symbol site
22+
23+`is_cfl_allowed(xd)` = `block_size_wide[bsize] <= 32 && block_size_high[bsize] <= 32`
24+on the **luma** bsize (libaom `blockd.h`, called from `read_intra_mode_uv` at every
25+`read_intra_block_mode_info` / `read_intra_frame_mode_info` site in `decodemv.c`).
26+Six sites read a `uv_mode` symbol in `decode.rs`:
27+
28+| site (before) | reader | alphabet chosen before | after |
29+|---|---|---|---|
30+| `read_intra_mode_rect` (was 5521) | key/rect strips | caller's `cfl` param (4 call sites pass `true` unconditionally) | `cfl && bw <= 32 && bh <= 32`, decided **in the reader** |
31+| `read_intra_mode` (was 8500) | `decode_block` square path | caller's `cfl` param | `cfl && side <= 32`, decided **in the reader** |
32+| `decode_block_rect64` (was 6203) | SB-level 64x32/32x64 strips | `bw.max(bh) <= 32` (already correct) | unchanged |
33+| `decode_leaf8` sub-8 (was 10360) | 4x4 leaves | always CFL (correct, 4x4 <= 32) | unchanged |
34+| `decode_inter_block` 8x8 leaf (was 20387) | 8x8 inter-frame leaf | always CFL (correct) | unchanged |
35+| `decode_inter_block` intra tail (18722) | intra-in-inter | `write_w.max(write_h) <= 32` (r2's fix) | unchanged |
36+
37+Root-cause shape: the decision moved from six call sites to the two readers every
38+caller routes through, so a future 64/128-sized caller cannot get it wrong.
39+(Class `wrong-alphabet-same-value`: a 14- vs 13-symbol CDF gives the same VALUE and
40+a different range.)
41+
42+## (2) The INTRA-coded 128x128 block inside an inter frame
43+
44+Four distinct defects, all in `crates/ec-av1/src/decode.rs`:
45+
46+1. **Intra tail codes one whole-block chroma unit.** Now codes chroma per 64x64 mu
47+ chunk inside the luma leaf loop -- `cu_tx = 32` (`av1_get_max_uv_txsize(BLOCK_128X128)`
48+ = `av1_get_adjusted_tx_size(TX_64X64)` = TX_32X32), `txb_skip` offset-10 rows
49+ (`Some(3)` on `txb_skip_chroma_32`), per-unit `record_mi_chroma` immediately so the
50+ next chunk reads this one's context, `tu_reach` per unit. Mirrors the inter half
51+ (`decode_inter_block`'s var-tx branch) exactly. Refusal string deleted from
52+ `refusal_inventory.rs`.
53+2. **`read_block_tx_size` TX_MODE_LARGEST early return was `is_inter && side > 64`.**
54+ An INTRA 128x128 block also resolves to `max_txsize_rect_lookup[BLOCK_128X128]`
55+ = TX_64X64 = four units; it got one 128-wide unit that coded nothing. Now `side > 64`.
56+3. **`tx_size_context_txfm(n, at_mi, side)`.** `get_tx_size_context` compares the
57+ neighbour txfm contexts against `tx_size_wide[max_txsize_rect_lookup[bsize]]`,
58+ which is 64 for BLOCK_128X128 -- now `side.min(64)`.
59+4. **Two defects in the inter tile's 128 PARTITION_NONE root** (r1 code, never
60+ exercised past superblock 0):
61+ - `at128` is in SUB16 units like `sb_at`; `decode_inter_block` takes MI. Every 128
62+ root except the first entered at a quarter of its true position
63+ (`TELL ... mi_col=8` where the trace said `partition_w128` at mi col 32).
64+ Now `sub16_to_mi(at128)`.
65+ - the `inter_piece!` macro hardcoded `reject_residual = true`, so the SQUARE 128
66+ root refused at its first non-skip block with the rect-strip refusal string
67+ (class `refusal-from-own-desync` inverted: a refusal naming a shape the encoder
68+ never wrote, produced by our own wiring). Now `$ww != $side || $wh != $side`.
69+
70+### Gate
71+
72+`a_real_aomenc_inter_128x128_none_root_decodes_pixel_exact` -- `#[ignore]` REMOVED,
73+recipe `--min-partition-size=32` -> `64` (measured: at 32, the 10-bit arm stops on
74+"an inter SB-level AB partition" and the tx-search arm on "an inter 16x16-level AB or
75+1:4 partition", both other lanes' gaps; 10 seeds x 2 arms, 0/20 clean. At 64, 3/3
76+arms clean). New hard assert `intra128_total >= 1` on the new
77+`decode::intra_128_in_inter_hits()` counter.
78+
79+RESULT: **FAILED** --
80+`sb128c-inter-none-8-false: decode-order frame 4 of 9 (8 shown, 1 hidden) differs
81+from the oracle at byte 2367 (ours 125 vs 126), 372 bytes differ`.
82+
83+Plane/bbox map of the residue (display order, ours vs `aomdec --rawvideo`, same
84+recipe, seed 61 8-bit):
85+
86+```
87+frame 2 Y: 98 px rows 9..250 cols 58..66 <-- earliest, and the tell
88+frame 2 U: 151 px rows 0..126 cols 1..61
89+frame 2 V: 123 px rows 0..126 cols 0..35
90+frame 4 Y: 16932 px (whole frame; error propagates through prediction)
91+```
92+
93+Frame 2 luma is a 9-px-wide band centred on **x = 64**, spanning nearly the whole
94+frame height -- the 14-tap deblock footprint of the 128 root's INTERNAL TX_64X64
95+edge. The entropy stream stays in sync for all 9 frames (no refusal, no desync),
96+so this is the loop filter / lf grid for the 128 block, not a symbol defect.
97+Next step for r4: `EC_AV1_PREFILT_DUMP` on frame 2 -- if pre-filter is exact, it is
98+`fill_lf_grid_rect`'s tx/skip publication for the 128 root (the block-level call
99+writes `write_w = 128` as the tx dimension before the per-leaf loop overwrites 64,
100+and the chroma side reads `tx/2`, but a 128 block's chroma really is four TX_32X32).
101+
102+## (3) 128-level HORZ/VERT + AB -- NOT STARTED
103+
104+deferred: 128-level HORZ/VERT/AB on key and inter paths -- r3's budget went to (1)
105+and (2) and the four defects (2) uncovered -- unblocked by nothing; it is the next
106+lane round. This is now the FRONTIER for his 10-bit AV1 film: both `reelc2s.obu` and
107+`$HOME/.cache/reelc-head.obu` stop at
108+`a 128x128 superblock HORZ/VERT or AB partition (only SPLIT and NONE are decoded at
109+the 128 root)` (was the same string before this round; 1 `EC_AV1_FINAL_DUMP` frame
110+each).
111+
112+## EVIDENCE
113+
114+```
115+EVIDENCE: $HOME/.cache/sb128c-work/{arm-8-0,arm-10-0,arm-8-1}.obu | decode_probe on the r2 tip recipe (--min-partition-size=32) | 3/3 REFUSED before, then 1/3 (the two others on other lanes' AB refusals)
116+EVIDENCE: $HOME/.cache/sb128c-work/g-61-{8,10}-0.obu, g-62-8-1.obu | decode_probe, --min-partition-size=64 | 3/3 decode all 9 frames, 0 REFUSED
117+EVIDENCE: $HOME/.cache/sb128c-work/{o,m}.yuv | aomdec --rawvideo vs EC_PROBE_OUT on g-61-8-0.obu, per-plane bbox diff | earliest defect display frame 2, luma 98 px in cols 58..66 (x=64 edge), rows 9..250
118+EVIDENCE: cargo test -p ec-av1 --lib -- a_real_aomenc_inter_128x128_none_root_decodes_pixel_exact | single gate run | FAILED, decode-order frame 4 of 9, 372 bytes differ
119+EVIDENCE: $HOME/.cache/reelc-head.obu, $HOME/.cache/sb128c-work/reelc2s.obu | decode_probe with EC_AV1_FINAL_DUMP | both stop at "a 128x128 superblock HORZ/VERT or AB partition", 1 dumped frame each
120+```
121+
122+## Suite
123+
124+`$HOME/.cache/sb128c-suite-r3.log` (unit `sb128c-suite-r3-1788327685.service`) --
125+totals appended below by whoever reads it; the gate above is a KNOWN RED.