Lane-realworld r3 charter -- part64 silent desync, then delta_q/delta_lf
Browse files at this commit5a8c7fe1171b4d7217f858a8e5b10063a12eb2bdParent: 14aa2ed- docs
- lane-realworld r3 charter -- part64 silent desync, then delta_q/delta_lf
1 changed file +71 -0
lanes/realworld-r3.charter.mdadded+71 -0
| @@ -0,0 +1,71 @@ | |||
| 1 | +# lane-realworld r3 — the part64 silent desync, then delta_q / delta_lf | ||
| 2 | + | ||
| 3 | +Worktree `/home/user/Documents/Code/Rust/edith_codecs-realworld`, branch | ||
| 4 | +`lane-realworld`, at ad0832c. Read `lanes/realworld-r2.report.md` first — it | ||
| 5 | +carries the spec refs, the CDF wiring checklist and a ready-made | ||
| 6 | +refusal-reproduction recipe. Do not re-derive it. | ||
| 7 | + | ||
| 8 | +## State — blocker 1 is CLOSED | ||
| 9 | +`bd61617` (cdef_idx reads) + `080acfd` (its gate) + `ad0832c` (report). Gate | ||
| 10 | +`a_real_aomenc_stream_with_cdef_decodes_pixel_exact`: 40/40 pixel-exact, zero | ||
| 11 | +refusals, `cdef_idx_hits()` hard-asserted `> 0` (24-40 per run). Suite 233/0. | ||
| 12 | + | ||
| 13 | +r2's finding worth keeping: `cdef_bits` selects among per-SUPERBLOCK strength | ||
| 14 | +profiles, so a single-64x64-superblock fixture can NEVER reach `bits > 0` — | ||
| 15 | +20 attempts kept `cdef_idx_hits()` at 0. The gate needed a 128x64, two-superblock | ||
| 16 | +fixture. | ||
| 17 | + | ||
| 18 | +## Job 1 — a silent desync, fix it before anything else | ||
| 19 | +`decode_inter_frame_tile_with_cdfs` (decode.rs ~9397) reads `part64` and then | ||
| 20 | +throws it away (`let _ = part64;`), blindly assuming SPLIT. A real non-SPLIT | ||
| 21 | +`part64` in an inter frame **silently desyncs** — it does not refuse by name. | ||
| 22 | +That is the one thing this project treats as never acceptable: refuse by name or | ||
| 23 | +decode, never desync. | ||
| 24 | + | ||
| 25 | +Minimum: make it refuse by name, accurately, and prove the refusal with a test. | ||
| 26 | +Better, if it is small: handle the non-SPLIT cases the way the intra path does. | ||
| 27 | +Either way this is its own commit, and the refusal string must describe what | ||
| 28 | +THIS DECODER does not do — not what an encoder supposedly never writes. | ||
| 29 | + | ||
| 30 | +Related, out of scope but record it: at `--cpu-used=0` aomenc picks SB-level | ||
| 31 | +`HORZ_4` / `VERT_B` partitions that the intra `part64` match at decode.rs:5049 | ||
| 32 | +does not cover, even with `--enable-rect/ab/1to4-partitions=0`. r2 sidestepped | ||
| 33 | +it with `--cpu-used=4`. Do NOT chase it here; note it in the report. | ||
| 34 | + | ||
| 35 | +## Job 2 — delta_q / delta_lf (blocker 2), unstarted | ||
| 36 | +Spec 5.11.15 `read_delta_qindex`, 5.11.16 `read_delta_lflevel`; libaom | ||
| 37 | +`av1/decoder/decodemv.c` `read_delta_qindex` / `read_delta_lflevel`. New | ||
| 38 | +ADAPTING CDFs: four wiring sites — struct field, defaults array, save/restore, | ||
| 39 | +per-frame counter reset (`cdf_state.rs`; `reset2`/`reset3` are length-generic | ||
| 40 | +and save/restore is a whole-struct Clone, so the defaults array is what needs | ||
| 41 | +hand-checking, but verify the counter reset covers the new tables — class | ||
| 42 | +`cdf-counter-not-reset`: a missing reset gives right values at the wrong | ||
| 43 | +adaptation rate). Plus the running quantizer / loop-filter-delta state threaded | ||
| 44 | +through block decode; the deltas are read once per superblock at the first | ||
| 45 | +non-skip block. Then remove the refusal at stream.rs | ||
| 46 | +("a frame with delta_q_present or delta_lf_present set"). Its own gate, its own | ||
| 47 | +hard-asserted firing counter, its own commit. | ||
| 48 | + | ||
| 49 | +## Gate rules | ||
| 50 | +`EC_AV1_REQUIRE_AOMENC=1` on every run; `-t <seconds>` on every ffmpeg generate; | ||
| 51 | +fixtures through `gradients_source(seed, w, h, tail)`; aomenc | ||
| 52 | +`--threads=1 --row-mt=0`; firing counts are HARD asserts via thread-local | ||
| 53 | +`Cell<usize>` counters. Size the fixture so the feature can actually fire — | ||
| 54 | +r2's cdef lesson generalises: a per-superblock symbol needs more than one | ||
| 55 | +superblock. | ||
| 56 | + | ||
| 57 | +## Note for the merge | ||
| 58 | +Main now carries two guards you do not have yet: `gate_coverage.rs` (pins the | ||
| 59 | +aomenc tools no gate exercises — `enable-cdef` is on that list and your gate | ||
| 60 | +closes it, so that entry must be deleted at merge) and `refusal_inventory.rs` | ||
| 61 | +(pins every decode-path refusal string; adding or removing one fails until the | ||
| 62 | +list is updated). Say in your report exactly which refusal strings you added or | ||
| 63 | +removed, verbatim, so the merge can update both lists. | ||
| 64 | + | ||
| 65 | +## Hard rules | ||
| 66 | +`export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-realworld`; foreground builds | ||
| 67 | +`nice -n 19 cargo ... -j4`; every `cargo test` a timeout >= 600000 ms. Sibling | ||
| 68 | +worktrees (edith_codecs, -chroma, -lr, -superres, -tiles, -palette) have live | ||
| 69 | +agents — never build in or edit them. Never push, never merge, never touch | ||
| 70 | +`main`. 75-turn cap, does not reset: commit at every green step. End with | ||
| 71 | +`lanes/realworld-r3.report.md`, VERDICT on line 1. | ||