forge
Explore
Log in

Don't you dare go Hollow

Lane-screen r1 charter (consume palette/intrabc syntax)

Browse files at this commit

d393fb5d33d856726c6eb6bd675f8fa65ee2b72aAhmet Kaan GümüşParent: e33ddfa
  • docs
    • lane-screen r1 charter (consume palette/intrabc syntax)
Show full message
docs(av1): lane-screen r1 charter (consume palette/intrabc syntax)
lanes/screen-r1.charter.mdadded+58 -0
@@ -0,0 +1,58 @@
1+# lane-screen r1 charter — consume screen-content-tools syntax (palette + intrabc)
2+
3+Worktree /home/user/Documents/Code/Rust/edith_codecs-screen, branch lane-screen @ 00de8d3.
4+Build/test ONLY: `env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-screen CARGO_BUILD_JOBS=4 nice -n 19 cargo test -p ec-av1 --release --lib <name> -- --nocapture` (full lib ~70s, run it whole; EC_AV1_REQUIRE_AOMENC=1 on gate runs).
5+Never push, never merge, never touch sibling worktrees (lane-gm and lane-intradisp are live).
6+libaom oracle: ~/.cache/aom-oracle/src (v3.13.3); binaries in ~/.cache/aom-oracle/build/ (aomdec is instrumented: EC_TRACE=1 prints EC_PART with msac range; EC_AV1_PREFILT_DUMP=<prefix> dumps pre-filter recon).
7+
8+## Why: this is the widest cheap win left
9+`stream.rs:169` refuses ANY frame with `allow_screen_content_tools` set. That is
10+14/40 attempts in the AB-partition gate, it blocks the 8x8-OBMC recipe search
11+(the content that fires 8x8 OBMC trips this bit), and it makes several gates
12+skip. Crucially the encoder in those gates runs `--enable-palette=0
13+--enable-intrabc=0`: the tools are SIGNALLED as allowed but never USED. So the
14+decoder does not need palette reconstruction — it needs to CONSUME the symbols
15+so the arithmetic decoder stays in sync (class: symbol-consumption-gap).
16+
17+## Scope
18+1. `read_palette_mode_info` (~/.cache/aom-oracle/src/av1/decoder/decodemv.c:567,
19+ called at :840 and :1103): read it wherever libaom does, gated by
20+ `av1_allow_palette` (blockd.h:1498 — `allow_screen_content_tools &&
21+ block_size_wide <= 64 && block_size_high <= 64 && bsize >= BLOCK_8X8`;
22+ confirm the exact constants in the header, do not guess).
23+ - luma branch only when `mode == DC_PRED`; chroma branch only when
24+ `uv_mode == UV_DC_PRED` and the block has chroma.
25+ - You need `palette_y_mode_cdf[bsize_ctx][palette_mode_ctx]`,
26+ `palette_y_size_cdf[bsize_ctx]`, the uv equivalents, plus
27+ `av1_get_palette_bsize_ctx` and `av1_get_palette_mode_ctx` (blockd.h /
28+ reconintra) and the palette COLOR reads that follow a nonzero size.
29+ - If `palette_size != 0` for either plane, refuse BY NAME ("a block that
30+ actually uses a palette") — reconstruction is out of scope. The point of
31+ this lane is that a size of zero must decode, not desync.
32+2. `read_intrabc_info` (decodemv.c:693, called at :811): read `use_intrabc`
33+ where libaom does (intra frames with `allow_intrabc`); if it is 1, refuse by
34+ name. If 0, continue — note libaom's `use_intrabc` path also affects which
35+ later syntax is read, so mirror the structure exactly.
36+3. Remove the whole-frame refusal at stream.rs:169 once 1-2 land. Leave the
37+ `delta.q_present || delta.lf_present` refusal below it ALONE.
38+4. New CDF tables must be wired at all four sites (field, defaults, save/restore,
39+ and the per-frame counter reset) — a table missing from the counter reset
40+ adapts at the wrong RATE and desyncs later, which cost an earlier lane a full
41+ round (class cdf-counter-not-reset).
42+
43+## Gate ladder (commit at each green step)
44+(a) full lib suite — every existing stream bit-identical;
45+(b) 14-pin default list (`pinned_warp_stream_decodes_pixel_exact -- --ignored`);
46+(c) `a_real_aomenc_stream_with_ab_partitions_decodes_pixel_exact` — report the
47+ `allow_screen_content_tools` refusal count before and after (that is this
48+ lane's score; it is ~14/40 today);
49+(d) `a_real_aomenc_filter_intra_stream_decodes_pixel_exact` currently SKIPS
50+ because this same refusal eats it — check whether it now runs.
51+Any pixel mismatch: pin with EC_AV1_GATE_DUMP=/tmp/claude-1000/screen-flake-N.obu,
52+then localize (our EC_AV1_PREFILT_DUMP vs the oracle aomdec's, then EC_TRACE=1
53+vs EC_AV1_TRACE range ladder). Never guess-fix.
54+
55+## Done criteria
56+Frames that ALLOW screen content but do not USE it decode pixel-exact; actual
57+palette/intrabc use refuses by name; suite + pins green; report
58+lanes/screen-r1.report.md with VERDICT first line and the before/after count.