From 712eb4563a6c13ac9cc700034d4f26a9a5e38389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Sep 2026 08:42:37 +0300 Subject: [PATCH] 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.md | 125 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lanes/sb128c-r3.report.md diff --git a/lanes/sb128c-r3.report.md b/lanes/sb128c-r3.report.md new file mode 100644 index 00000000..31d32aa0 --- /dev/null +++ b/lanes/sb128c-r3.report.md @@ -0,0 +1,125 @@ +# lane-sb128c r3 report + +Tip `lane-sb128c` @ `9c36e62` (worktree `edith_codecs-sb128c`, +`CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sb128c`). + +## VERDICT: RED + +The refusal this round targeted is gone and all three gate arms now decode every +frame with no refusal, but the gate is RED on a **reconstruction/loop-filter** +residue (98 luma px on one frame), not on an entropy desync. + +## (0) r2 suite unit + +`sb128c-suite-r2-1788326632.service` never produced a `test result:` line. It ran +50 min (232 `ok`, 0 `FAILED` in the log) and was still `active`; r3 stopped it to +free the target dir for its own suite. **No r2 suite total exists.** +It also ran WITHOUT the top-level `fixtures` symlink, which this worktree was +missing (created this round) -- that is the r2 `film_grain` 8-bit red, per the +COMMON note added mid-batch. + +## (1) CLASS SWEEP -- every uv_mode symbol site + +`is_cfl_allowed(xd)` = `block_size_wide[bsize] <= 32 && block_size_high[bsize] <= 32` +on the **luma** bsize (libaom `blockd.h`, called from `read_intra_mode_uv` at every +`read_intra_block_mode_info` / `read_intra_frame_mode_info` site in `decodemv.c`). +Six sites read a `uv_mode` symbol in `decode.rs`: + +| site (before) | reader | alphabet chosen before | after | +|---|---|---|---| +| `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** | +| `read_intra_mode` (was 8500) | `decode_block` square path | caller's `cfl` param | `cfl && side <= 32`, decided **in the reader** | +| `decode_block_rect64` (was 6203) | SB-level 64x32/32x64 strips | `bw.max(bh) <= 32` (already correct) | unchanged | +| `decode_leaf8` sub-8 (was 10360) | 4x4 leaves | always CFL (correct, 4x4 <= 32) | unchanged | +| `decode_inter_block` 8x8 leaf (was 20387) | 8x8 inter-frame leaf | always CFL (correct) | unchanged | +| `decode_inter_block` intra tail (18722) | intra-in-inter | `write_w.max(write_h) <= 32` (r2's fix) | unchanged | + +Root-cause shape: the decision moved from six call sites to the two readers every +caller routes through, so a future 64/128-sized caller cannot get it wrong. +(Class `wrong-alphabet-same-value`: a 14- vs 13-symbol CDF gives the same VALUE and +a different range.) + +## (2) The INTRA-coded 128x128 block inside an inter frame + +Four distinct defects, all in `crates/ec-av1/src/decode.rs`: + +1. **Intra tail codes one whole-block chroma unit.** Now codes chroma per 64x64 mu + chunk inside the luma leaf loop -- `cu_tx = 32` (`av1_get_max_uv_txsize(BLOCK_128X128)` + = `av1_get_adjusted_tx_size(TX_64X64)` = TX_32X32), `txb_skip` offset-10 rows + (`Some(3)` on `txb_skip_chroma_32`), per-unit `record_mi_chroma` immediately so the + next chunk reads this one's context, `tu_reach` per unit. Mirrors the inter half + (`decode_inter_block`'s var-tx branch) exactly. Refusal string deleted from + `refusal_inventory.rs`. +2. **`read_block_tx_size` TX_MODE_LARGEST early return was `is_inter && side > 64`.** + An INTRA 128x128 block also resolves to `max_txsize_rect_lookup[BLOCK_128X128]` + = TX_64X64 = four units; it got one 128-wide unit that coded nothing. Now `side > 64`. +3. **`tx_size_context_txfm(n, at_mi, side)`.** `get_tx_size_context` compares the + neighbour txfm contexts against `tx_size_wide[max_txsize_rect_lookup[bsize]]`, + which is 64 for BLOCK_128X128 -- now `side.min(64)`. +4. **Two defects in the inter tile's 128 PARTITION_NONE root** (r1 code, never + exercised past superblock 0): + - `at128` is in SUB16 units like `sb_at`; `decode_inter_block` takes MI. Every 128 + root except the first entered at a quarter of its true position + (`TELL ... mi_col=8` where the trace said `partition_w128` at mi col 32). + Now `sub16_to_mi(at128)`. + - the `inter_piece!` macro hardcoded `reject_residual = true`, so the SQUARE 128 + root refused at its first non-skip block with the rect-strip refusal string + (class `refusal-from-own-desync` inverted: a refusal naming a shape the encoder + never wrote, produced by our own wiring). Now `$ww != $side || $wh != $side`. + +### Gate + +`a_real_aomenc_inter_128x128_none_root_decodes_pixel_exact` -- `#[ignore]` REMOVED, +recipe `--min-partition-size=32` -> `64` (measured: at 32, the 10-bit arm stops on +"an inter SB-level AB partition" and the tx-search arm on "an inter 16x16-level AB or +1:4 partition", both other lanes' gaps; 10 seeds x 2 arms, 0/20 clean. At 64, 3/3 +arms clean). New hard assert `intra128_total >= 1` on the new +`decode::intra_128_in_inter_hits()` counter. + +RESULT: **FAILED** -- +`sb128c-inter-none-8-false: decode-order frame 4 of 9 (8 shown, 1 hidden) differs +from the oracle at byte 2367 (ours 125 vs 126), 372 bytes differ`. + +Plane/bbox map of the residue (display order, ours vs `aomdec --rawvideo`, same +recipe, seed 61 8-bit): + +``` +frame 2 Y: 98 px rows 9..250 cols 58..66 <-- earliest, and the tell +frame 2 U: 151 px rows 0..126 cols 1..61 +frame 2 V: 123 px rows 0..126 cols 0..35 +frame 4 Y: 16932 px (whole frame; error propagates through prediction) +``` + +Frame 2 luma is a 9-px-wide band centred on **x = 64**, spanning nearly the whole +frame height -- the 14-tap deblock footprint of the 128 root's INTERNAL TX_64X64 +edge. The entropy stream stays in sync for all 9 frames (no refusal, no desync), +so this is the loop filter / lf grid for the 128 block, not a symbol defect. +Next step for r4: `EC_AV1_PREFILT_DUMP` on frame 2 -- if pre-filter is exact, it is +`fill_lf_grid_rect`'s tx/skip publication for the 128 root (the block-level call +writes `write_w = 128` as the tx dimension before the per-leaf loop overwrites 64, +and the chroma side reads `tx/2`, but a 128 block's chroma really is four TX_32X32). + +## (3) 128-level HORZ/VERT + AB -- NOT STARTED + +deferred: 128-level HORZ/VERT/AB on key and inter paths -- r3's budget went to (1) +and (2) and the four defects (2) uncovered -- unblocked by nothing; it is the next +lane round. This is now the FRONTIER for his 10-bit AV1 film: both `reelc2s.obu` and +`$HOME/.cache/reelc-head.obu` stop at +`a 128x128 superblock HORZ/VERT or AB partition (only SPLIT and NONE are decoded at +the 128 root)` (was the same string before this round; 1 `EC_AV1_FINAL_DUMP` frame +each). + +## EVIDENCE + +``` +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) +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 +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 +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 +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 +``` + +## Suite + +`$HOME/.cache/sb128c-suite-r3.log` (unit `sb128c-suite-r3-1788327685.service`) -- +totals appended below by whoever reads it; the gate above is a KNOWN RED.