Lane-tiles r2 charter -- decode the tiles, starting from r1's groundwork
Browse files at this commit34716e81b23151f08a35976f09f295e95c1c9430Parent: 2380904- docs
- lane-tiles r2 charter -- decode the tiles, starting from r1's groundwork
1 changed file +61 -0
- lanes/tiles-r2.charter.md +61 -0
lanes/tiles-r2.charter.mdadded+61 -0
| @@ -0,0 +1,61 @@ | ||
| 1 | +# lane-tiles r2 — actually decode the tiles | |
| 2 | + | |
| 3 | +Worktree `/home/user/Documents/Code/Rust/edith_codecs-tiles`, branch | |
| 4 | +`lane-tiles`, at 23f412f. | |
| 5 | + | |
| 6 | +## Read first, then write code | |
| 7 | +- `lanes/tiles.report.md` — r1's report. Its "next lever" section names exact | |
| 8 | + line ranges and the staging order. Do NOT redo r1's recon (class | |
| 9 | + `worker-cap-spent-reading`). | |
| 10 | +- `lanes/tiles.charter.md` — the original charter: the three hard parts | |
| 11 | + (entropy reset per tile, tile-clipped neighbour availability, | |
| 12 | + `context_update_tile_id`), the gate rules, the hard rules. Still binding. | |
| 13 | + | |
| 14 | +## What r1 landed (1231cd5, suite green 232/0, currently a no-op) | |
| 15 | +`Neighbours` gained `tile_row0_mi` / `tile_col0_mi` and `start_tile()`, and every | |
| 16 | +literal-`0` availability check — `skip_txfm_ctx`, `tx_size_context`, | |
| 17 | +`tx_size_context_rect`, and the has_above / has_left in `decode_inter_block` and | |
| 18 | +`decode_inter_block8` — now compares against the tile origin instead of 0. | |
| 19 | +Nothing calls `start_tile()` yet, so the origin stays 0 and behaviour is | |
| 20 | +unchanged. | |
| 21 | + | |
| 22 | +## Still missing (r1's list, verbatim) | |
| 23 | +- entropy-per-tile restructuring in `decode_key_frame_tile_with_cdfs` / | |
| 24 | + `decode_inter_frame_tile_with_cdfs` | |
| 25 | +- `PlaneBuf` tile-pixel-origin clipping — not started | |
| 26 | +- `mvstack.rs` neighbour scan still frame-relative | |
| 27 | +- multi-OBU tile-group collection — not started | |
| 28 | +- the refusal at `stream.rs:294-296` is unchanged and still fires | |
| 29 | + | |
| 30 | +## Order — COMMIT AFTER EVERY GREEN STEP | |
| 31 | +1. Restructure `decode_key_frame_tile_with_cdfs` to loop tiles: fresh msac over | |
| 32 | + each tile's byte range, fresh copy of the frame's initial CDFs per tile, and | |
| 33 | + only `context_update_tile_id`'s end-of-tile CDFs kept. Wire `start_tile()` | |
| 34 | + and the new `PlaneBuf` tile-pixel-origin fields. Prove it on an intra-only | |
| 35 | + two-tile column split, pixel-exact. COMMIT. | |
| 36 | +2. Tile rows, then non-uniform spacing. COMMIT. | |
| 37 | +3. Inter frames — thread the tile origin into `mvstack.rs`'s neighbour scan. | |
| 38 | + This is where it will break. COMMIT. | |
| 39 | +4. Several tile-group OBUs per frame. COMMIT. | |
| 40 | +5. `context_update_tile_id` proven with a stream where it is not tile 0, the | |
| 41 | + FOLLOWING frame decoding pixel-exact off those inherited CDFs. COMMIT. | |
| 42 | + | |
| 43 | +## Gate (mandatory) | |
| 44 | +Same rules as r1's charter: `EC_AV1_REQUIRE_AOMENC=1` on every run, `-t <seconds>` | |
| 45 | +on every ffmpeg generate, fixtures through `gradients_source(seed, w, h, tail)`, | |
| 46 | +aomenc `--threads=1 --row-mt=0` plus tile-columns/tile-rows log2, a frame large | |
| 47 | +enough to be splittable, and a HARD-asserted thread-local `Cell<usize>` counter | |
| 48 | +proving more than one tile was decoded. | |
| 49 | + | |
| 50 | +## Hard rules | |
| 51 | +- `export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-tiles`. Foreground builds, | |
| 52 | + `nice -n 19 cargo ... -j4`; give every `cargo test` a timeout of at least | |
| 53 | + 600000 ms (the suite runs ~3-4 min; a 120 s default kills it mid-run). | |
| 54 | +- Sibling worktrees (edith_codecs, -chroma, -realworld, -lr, -superres) have | |
| 55 | + live agents. Never build in or edit them. | |
| 56 | +- Baseline 232 passed / 0 failed on this tree; main is at 234 with two new | |
| 57 | + guard tests you inherit at merge. | |
| 58 | +- NEVER push, never merge, never touch `main`. Commit on `lane-tiles` only. | |
| 59 | +- 75-turn cap: commit at every green step. Stage 1 alone committed and green is | |
| 60 | + a good outcome; a perfect uncommitted tree is not. | |
| 61 | +- End with `lanes/tiles-r2.report.md`, VERDICT on the first line. |