forge
Explore
Log in

Don't you dare go Hollow

Lane-palette2 r1 charter -- UV reconstruction, rect strips, split-tx palette

Browse files at this commit

5feaca348c63b3e64e3c75079efe84762682b354Ahmet Kaan GümüşParent: 0bdb5a0
  • docs
    • lane-palette2 r1 charter -- UV reconstruction, rect strips, split-tx palette
Show full message
docs(av1): lane-palette2 r1 charter -- UV reconstruction, rect strips, split-tx palette
lanes/palette2-r1.charter.mdadded+60 -0
@@ -0,0 +1,60 @@
1+# lane-palette2 r1 — the palette frontier
2+
3+Fresh lane off main (170a5a3). Palette-Y already decodes pixel-exact; the lane
4+that landed it is merged and retired. Read its work in `git log` for
5+`decode_color_index_map` and `read_intra_mode`'s palette branch before editing.
6+
7+## Why this lane exists — measured, not guessed
8+I probed five content classes through plain default-settings aomenc
9+(`--cpu-used=4 --end-usage=q --cq-level=32`, no `--enable-*` flags) with
10+`cargo run -p ec-av1 --example decode_probe`. Three of the five stop on a
11+palette refusal:
12+- `testsrc2` -> "a block that actually uses a palette (UV) -- reconstruction
13+ is out of scope"
14+- `smptebars` and `rgbtestsrc` -> "a HORZ/VERT intra strip in a screen-content
15+ frame (palette syntax is consumed for square blocks only)"
16+- `life` -> "a palette block with a split luma transform (round 1)"
17+
18+Palette is the single biggest thing between this decoder and an ordinary AV1
19+stream. Close those three, in that order — each is a gate-then-lift.
20+
21+## Order
22+1. **UV palette reconstruction.** The reads already exist and are correct (the
23+ previous lane ported `palette_uv_mode`/`palette_uv_size`; it deliberately
24+ skipped `read_palette_colors_uv` because the refusal aborts immediately, so
25+ that reader still needs writing). Then reconstruct both chroma planes from
26+ the palette and its index map.
27+2. **Palette on a rectangular (HORZ/VERT) intra strip.** `palette_bsize_ctx`
28+ and the size/context derivation assume a square block today.
29+3. **Palette block with a split luma transform.**
30+
31+Each step: gate FIRST against a real aomenc stream, driving the tile decode
32+below `decode_stream` so the refusal cannot short-circuit the code you are
33+measuring ([[refusal-short-circuits-its-own-code]]); then the implementation;
34+then lift the refusal and update `refusal_inventory.rs` **in the same commit**.
35+A branch that lifts a refusal without a gate does not merge to main. The gate
36+must hard-assert that the feature actually fired — a pixel match on a stream
37+that never used a palette proves nothing ([[gate-blind-to-feature]]).
38+
39+Content that reaches each case is known: `testsrc2` for UV, `smptebars` or
40+`rgbtestsrc` for the rect strips, `life` for the split transform, all at the
41+default settings above and `--sb-size=64` (this decoder hardcodes 64px
42+superblocks). `gate_coverage.rs` requires an explicit `--enable-palette=1` for a
43+gate to count as exercising palette.
44+
45+## Budget discipline
46+75 turns, and they do NOT reset if you are resumed. At about turn 55, stop
47+starting new work: commit what is green and write your report. Five rounds in a
48+recent batch died mid-edit with nothing reported, each costing a whole round to
49+recover.
50+
51+Hard rules: `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-palette2`; foreground
52+`nice -n 19 cargo ... -j4`; every `cargo test` a timeout >= 600000 ms; fixtures
53+through `gradients_source(seed, w, h, tail)` where a synthetic source will do;
54+every ffmpeg generate bounded with `-t`; `EC_AV1_REQUIRE_AOMENC=1`; aomenc
55+`--threads=1 --row-mt=0 --sb-size=64`. Oracle rungs 6, 7, 8, 8b are taken — take
56+9; `~/.cache/aom-oracle` is SHARED with sibling lanes, so env-gated rungs in
57+`scripts/instrument-aom-oracle.sh` only, never a throwaway patch left in the
58+tree. Sibling worktrees have live agents — never build in or edit them. Never
59+push, never merge into main. End with `lanes/palette2-r1.report.md`, VERDICT on
60+line 1.