forge
Explore
Log in

Don't you dare go Hollow

Lane-lr r3 charter -- gate the symbols, then the filters

Browse files at this commit

5591c0e1dfbc7e0137f2c8d4fb224bfcb05d01baAhmet Kaan GümüşParent: d1f514e
  • docs
    • lane-lr r3 charter -- gate the symbols, then the filters
Show full message
docs(av1): lane-lr r3 charter -- gate the symbols, then the filters
lanes/lr-r3.charter.mdadded+63 -0
@@ -0,0 +1,63 @@
1+# lane-lr r3 — gate the symbols, then apply the filters
2+
3+Worktree `/home/user/Documents/Code/Rust/edith_codecs-lr`, branch `lane-lr`.
4+Read ONLY the r2 section of `lanes/lr.report.md` — it is a typing plan, not a
5+re-derivation task. Do not re-read libaom for what it already records
6+(class `worker-cap-spent-reading`).
7+
8+## State — the symbols are read
9+r2 landed and verified (suite 235 passed / 0 failed, 181 s — 232 baseline plus
10+three new pinned roundtrip tests):
11+- `crates/ec-av1/src/restoration.rs` (new): the msac-flavoured subexp/recenter
12+ port (`decode_subexp_msac`, `decode_unsigned_subexp_with_ref_msac`,
13+ `decode_signed_subexp_with_ref_msac`, `ns_msac`), `WienerInfo` / `SgrprojInfo`
14+ / `UnitFilter`, the `SGR_PARAMS` table, `read_wiener_filter` /
15+ `read_sgrproj_filter` / `read_lr_unit` / `read_lr`, and `RestorationGrid`.
16+- `decode.rs`: both tile functions take `lr: &LoopRestorationParams` and call
17+ `read_lr` once per superblock before `decode_partition`; the public wrappers
18+ pass `&LoopRestorationParams::default()`.
19+- `stream.rs`: both call sites thread `&header.loop_restoration`; the refusal
20+ now names the true remaining gap ("symbols read, filters not applied").
21+
22+## Order — COMMIT AFTER EVERY GREEN STEP
23+1. **The gate that proves stage 2 actually worked.** A real aomenc
24+ `--enable-restoration=1` stream must survive the partition walk and fail
25+ only on the new refusal — before this, "the symbols are read correctly" is
26+ unproven. Hard-assert a firing count with a thread-local `Cell<usize>` in
27+ `restoration.rs`'s `read_lr_unit`. Remember the shape of the trap r2's
28+ sibling lane hit: a per-superblock symbol needs a fixture with more than one
29+ superblock, or it can never fire. COMMIT.
30+2. **Wiener.** A new `apply_loop_restoration` pass after `apply_cdef` in
31+ `decode.rs`, driven by `RestorationGrid`. The 3-pixel stripe boundary
32+ save/restore (libaom's `rlbs`) is the classic trap — 64-row stripes, and the
33+ filter reads rows the next stripe has already overwritten unless you save
34+ them. COMMIT.
35+3. **Self-guided**, incl. the box-sum radii and `SGR_PARAMS`. COMMIT.
36+4. **Switchable**; drop the stream.rs refusal; the gate asserts Ok, never an Err.
37+ COMMIT.
38+
39+Ordering fact a sibling lane established, which you need for step 2: libaom's
40+`decodeframe.c` calls `superres_post_decode()` BETWEEN `av1_cdef_frame` and
41+`av1_loop_restoration_filter_frame` — **superres runs before loop restoration**.
42+Not load-bearing while superres is refused here, but get the order right now.
43+
44+## Gate rules
45+`EC_AV1_REQUIRE_AOMENC=1` on every run (a missing oracle must FAIL, not SKIP);
46+`-t <seconds>` on every ffmpeg generate; fixtures through
47+`gradients_source(seed, w, h, tail)`; aomenc
48+`--threads=1 --row-mt=0 --enable-restoration=1`; firing counts are HARD asserts.
49+
50+## Note for the merge
51+Main carries two guards you do not have: `gate_coverage.rs` (pins the aomenc
52+tools no gate exercises — `enable-restoration` is one gate away from that list)
53+and `refusal_inventory.rs` (pins every decode-path refusal string, so adding or
54+renaming one fails until the list is updated — and r2 RENAMED the LR refusal).
55+Report the refusal strings you add, rename or remove, verbatim.
56+
57+## Hard rules
58+`export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-lr`; foreground builds
59+`nice -n 19 cargo ... -j4`; every `cargo test` a timeout >= 600000 ms (the suite
60+runs ~3 min). Sibling worktrees (edith_codecs, -chroma, -realworld, -superres,
61+-tiles, -palette) have live agents — never build in or edit them. Never push,
62+never merge, never touch `main`. 75-turn cap, does not reset: commit at every
63+green step. Update `lanes/lr.report.md` with an r3 section, VERDICT first.