forge
Explore
Log in

Don't you dare go Hollow

R4 handoff -- shipped patch map, lifted refusals, gate recipe, measured facts, suite at 245 ok/0 failed

Browse files at this commit

6e5d3f7e9ff612e5c895391edbd44904bc840d85Ahmet Kaan GümüşParent: 242e934
  • docs
    • r4 handoff -- shipped patch map, lifted refusals, gate recipe, measured facts, suite at 245 ok/0 failed
Show full message
docs(kf900): r4 handoff -- shipped patch map, lifted refusals, gate recipe, measured facts, suite at 245 ok/0 failed
lanes/kf900-r4.handoff.mdadded+98 -0
@@ -0,0 +1,98 @@
1+# lane-kf900 r4 HANDOFF
2+
3+Tip `12c3c7c` on `lane-kf900` (parent `08c9a35`). Full detail in
4+`lanes/kf900-r4.report.md`. The work is DONE and committed; the only open item is the
5+suite, which was still running at the turn cap.
6+
7+## 1. Suite state -- INCOMPLETE, ZERO FAILURES SO FAR
8+
9+Unit `kf900-suite-r4-1788330592.service`, log `$HOME/.cache/kf900-suite-r4.log`.
10+At the cap: **245 `ok`, 0 `FAILED`, no `test result` line yet** (r3's baseline was
11+`383 passed; 0 failed; 33 ignored` in 1029 s; this run is slower because 10 lanes share
12+the box). Resolve the unit with `systemctl --user list-units --all | grep kf900` before
13+believing it finished, then
14+`grep -E "^test result|FAILED" $HOME/.cache/kf900-suite-r4.log`.
15+Expect 384 passed (383 + the new gate). If something is RED, the behavioural changes on
16+this commit are only: rect-strip palette reconstruction, the chroma palette map size, the
17+palette cache mi keying, and `record_strip_palette` -- so look at the four existing
18+palette gates first (`a_real_aomenc_stream_with_palette_y_...`, `..._palette_uv_...`,
19+`..._rect_palette_...`, `a_real_aomenc_multi_tile_palette_stream_...`).
20+
21+## 2. The patch that shipped (all sites are current `crates/ec-av1/src/decode.rs`)
22+
23+Grep the symbol, not the line number -- the file moved by ~300 lines.
24+
25+| hook | site | what |
26+| --- | --- | --- |
27+| palette mode ctx + Y colour cache | `decode_block_rect4` (32x8/8x32), just after `modes_above_left_mi` | `let pal_at = (mi_r / (SUB / MI), mi_c / (SUB / MI)); neighbours.palette_ctx_and_cache_mi(pal_at, mi_r)` -> passed as `Some((palette_ctx, &palette_cache))` where `None` used to go |
28+| UV colour cache | same | `neighbours.palette_uv_cache_mi(pal_at, mi_r)` replaces `&[]` |
29+| same two | `decode_rect4_16` (16x4/4x16), inside the 4-strip loop, `at16` + `lmi.0` | per strip, not per cell |
30+| same two | `decode_leaf_rect` (16x8/8x16) | already had the ctx/cache; switched to the `_mi` variants with `leaf_mi.0` |
31+| palette_size ctx | `palette_bsize_ctx_wh` -- UNCHANGED, already correct | `num_pels_log2_lookup[bsize] - 6`; 0 for BLOCK_16X4/4X16 (64 px), 2 for BLOCK_32X8 |
32+| colours | `read_palette_colors_y` / `_uv` -- UNCHANGED (r3 fixed the bit depth) | |
33+| colour index map read point | `read_intra_mode_rect`, after `use_filter_intra` -- UNCHANGED | `av1_visit_palette` order: Y map then chroma map, both AFTER all mode info |
34+| colour index map SIZE (fixed) | `read_intra_mode_rect`, the `palette_uv_pending.map(..)` closure | `((bw / 2).max(4), (bh / 2).max(4))`, was `(bw / 2, bh / 2)` |
35+| chroma on the odd strip | `decode_rect4_16`'s `has_chroma` (`i % 2 == 1`) -- UNCHANGED gating; the pair's 8x4/4x8 chroma now gets `set_palette_pred` per plane in both the skip and the coded arm | |
36+| reconstruction | all three fns | `palette_y_buf` / `palette_uv_bufs` (index map through the base colours) handed to each `reconstruct_rect` via `set_palette_pred`; the split-tx walks slice the block buffer per transform unit (`RectStripModes.palette_y` in `decode_rect_split`, an inline window in `decode_rect4_16`) |
37+| neighbour state | new free fn `record_strip_palette` | split axis only until the closing strip (`mi_r % 8 == 6` / `mi_c % 8 == 6` for 32x8/8x32, `i == 3` for 16x4/4x16, `leaf_mi.0 % 4 == 2` for 16x8/8x16) |
38+| counter | `RECT4_PALETTE_HITS` / `pub(crate) fn rect4_palette_hits()` | rect strips that ACTUALLY use a palette |
39+
40+libaom cited: `decodemv.c` `read_palette_mode_info` (`av1_allow_palette` -- `sb_type >=
41+BLOCK_8X8` is an ENUM-INDEX test that BLOCK_4X16/16X4 pass; `av1_get_palette_bsize_ctx`;
42+`av1_get_palette_mode_ctx`), `read_palette_colors_y` `decodemv.c:478`,
43+`read_palette_colors_uv` `:509`, `pred_common.c:73` `av1_get_palette_cache` (SB-top-row
44+guard at `:76`, `row = -xd->mb_to_top_edge >> 3` = the block's PIXEL row, hence
45+`mi_r % 16 != 0`), `decodeframe.c` `decode_color_map_tokens` reached from
46+`av1_visit_palette`, and `ss_size_lookup` (BLOCK_16X4 -> BLOCK_8X4, BLOCK_4X16 ->
47+BLOCK_4X8) for the chroma map size.
48+
49+## 3. Refusals dropped (both from decode.rs and refusal_inventory.rs, 47 -> 45)
50+
51+* `a 1:4 rect strip that actually uses a palette (reconstruction is not ported at this shape)`
52+* `a palette block on a HORZ/VERT intra strip below 16x16 (reconstruction not ported)`
53+
54+`gate_coverage.rs` needed no change (it pins aomenc FLAGS, and
55+`enable-palette` / `enable-1to4-partitions` were already in its list).
56+
57+## 4. Gate
58+
59+`crates/ec-av1/src/stream.rs::a_real_aomenc_rect_strip_palette_decodes_pixel_exact`.
60+Base recipe (arm 0 = the r3 pin): `--codec=av1 --bit-depth=N --input-bit-depth=N
61+--passes=1 --end-usage=q --cq-level=59 --cpu-used=0 --lag-in-frames=0 --kf-max-dist=1
62+--limit=1 --threads=1 --tile-columns=0 --enable-tx-size-search=1 --min-partition-size=8
63+--enable-rect-partitions=1` on `testsrc2=s=256x192:r=25`, y4m over stdin, `-t 0.2`.
64+Arms 1-2 append `--tune-content=screen --enable-palette=1 --enable-1to4-partitions=1
65+--min-partition-size=8` (testsrc2 / `smptebars=size=256x192:rate=25`). 8-bit arms append
66+`--sb-size=64` (the 8-bit twin otherwise lands on the open 128-root HORZ refusal).
67+`cargo test -p ec-av1 --lib a_real_aomenc_rect_strip_palette_decodes_pixel_exact -- --nocapture`
68+-> **1 passed**: `2 attempt(s) with a rect-strip palette block, 0 out of scope
69+(0 mismatched), 4 refused, 2 frames compared, fired 8-bit=0 10-bit=2`.
70+
71+## 5. Measured facts
72+
73+* The test's own 10-bit arm-0 encode reproduces the pin BYTE FOR BYTE:
74+ md5 `e5f033d8fe34e4418d8cca3ac9d2b595`.
75+* That stream went `REFUSED: ... a 1:4 rect strip that actually uses a palette` ->
76+ `OK: 1 frames decoded, 256x192`; `rect4_32` went `horz=8 vert=0 coded=8` ->
77+ `horz=12 vert=16 coded=28`.
78+* **The charter/r3 premise that this stream fires `skip_split_tx` is WRONG**: decoded in
79+ full, `decode_probe` prints `skip_split_tx: 0`. The gate asserts the palette counter.
80+* **64x16/16x64 needed nothing**: `decode_block_rect64` already passes the real ctx/cache
81+ and reconstructs; its remaining palette refusal is the separate corner-cropped-luma one.
82+* **No 8-bit recipe reaches a rect-strip palette.** At 8 bit aomenc palettes SQUARE
83+ blocks; every 8-bit variant tried lands on `a block that actually uses a palette (Y)`
84+ (8x8 square leaf) or `a palette block with a real transform on a superblock-level
85+ HORZ/VERT strip`. Lifting either unblocks 8-bit coverage of this shape.
86+* **NEW pre-existing 8-bit 1:4 mismatch, not palette** -- 8-bit `testsrc2=s=256x192:r=25`,
87+ base recipe + `--tune-content=screen --enable-palette=1 --enable-1to4-partitions=1
88+ --max-partition-size=32 --sb-size=64`: decodes `OK`, `rect4_32: horz=8 vert=8 coded=16`,
89+ frame 0 differs from ffmpeg. The stream reads ZERO palette symbols
90+ (`EC_AV1_TRACE=1 decode_probe | grep -c "^EC_PAL "` == 0), so every change in this
91+ commit is inert on it. Needs its own lane.
92+
93+## 6. EXACT NEXT STEP
94+
95+1. Read the suite result (above). If green, merge `12c3c7c` into main.
96+2. Then, in order: (a) the new 8-bit 1:4 non-palette mismatch in 5; (b) palette on an 8x8
97+ SQUARE leaf (`decode_leaf8` discards `_palette_y`), which is what blocks 8-bit
98+ rect-strip coverage; (c) palette + real transform on a 64x32/32x64 SB-level strip.