diff --git a/lanes/COMMON-20260901.md b/lanes/COMMON-20260901.md new file mode 100644 index 00000000..6da7ff3d --- /dev/null +++ b/lanes/COMMON-20260901.md @@ -0,0 +1,91 @@ +# COMMON CHARTER PREAMBLE — batch 2026-09-01 (ec-av1 decode, his real films) + +GOAL (why): ec-av1 must decode the user's two real AV1 films bit-exact +(`/home/user/Videos/Films/reelc.mkv`, +`/home/user/Downloads/reelb.mkv`, +both yuv420p10le). 47 refusal strings remain in crates/ec-av1/src/refusal_inventory.rs. +Each lane lifts its cluster of refusals WITH a real-aomenc gate proving it. + +WORKING RULES (binding): +- Work ONLY in your worktree; branch named in your charter. Never touch main, never + merge into main, never `git checkout ` to revert (copy to scratch first). +- `export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-` (named in charter) for EVERY cargo + command. sccache is the global rustc wrapper. Use `nice -n 10 cargo ... -j3` — 10 lanes + run concurrently on 12 cores / 30G RAM. Long/lavfi runs under + `systemd-run --user --scope -p MemoryMax=8G` and bound ffmpeg with `-t`. +- Test scope: `cargo test -p ec-av1 --lib` only (plus `cargo check -p ec-av1`). Never the + workspace suite. Set `EC_AV1_REQUIRE_AOMENC=1` so an absent oracle FAILS, never SKIPs. +- Oracle: `~/.cache/aom-oracle/build/aomenc` and instrumented `aomdec` (scripts/build-aom-oracle.sh, + scripts/instrument-aom-oracle.sh; rungs EC_TRACE=1 / EC_TRACE_COEFF=1 / EC_TRACE_MODE=1 / + EC_AV1_PREFILT_DUMP). Ours: EC_TRACE_COEFF / EC_TRACE_MODE / EC_TRACE_MODE_STEP in decode.rs. + Cross-decoder bisection compares msac RANGE element by element, never tell(). + The reference is at the oracle source tree (find via scripts/build-aom-oracle.sh). +- FIRST STEP, always: `git log --oneline -8 main` and rebase your branch onto main + (`git rebase main`; resolve conflicts, keeping main's fixes). Then RE-MEASURE your lane's + premise before building — charters may carry stale premises. Cite the command that + produced every premise you act on. +- Fixtures: `fixtures` is a symlink to main's fixtures dir (shared). Pin any new stream + fixture under crates/ec-av1/fixtures/ or fixtures/ with a hash; hash an aomenc output + TWICE before trusting a seed (lavfi gradients ignores its seed). +- A refusal is lifted ONLY together with a gate: a real-aomenc stream (tool explicitly + enabled on the aomenc command line) decoded pixel-exact vs ffmpeg/aomdec, that + HARD-ASSERTS a hit counter proving the feature fired, and never turns a decode error or + pixel mismatch into SKIP. Update refusal_inventory.rs + gate_coverage.rs in the same + commit. `refusal_inventory` and `gate_coverage` tests must stay green. +- Defect classes to check first (memory-proven, each cost rounds): CDF row indexed by a + field that moves; table indexed by RAW vs adjusted tx_size; scan/ctx tables transposed + vs spec (libaom layout is not the spec's — gate on asymmetric behaviour); neighbour ctx + read from one cell instead of gathered over the span; a symbol we read that the + reference never wrote (reference range unchanged = unread); a header field parsed then + never consumed; counter-reset list missing a table; call-site arg order; a probe loop + reusing last run's output file (rm -f first, check exit status). +- Tool-call ceiling ~70. If you hit it: commit everything on your branch, write + `lanes/-r.handoff.md` with exact facts (ranges, stream, element) so a fresh + agent continues without re-reading. +- DONE = commit(s) on your branch + `lanes/-r.report.md` in your worktree with: + what changed (path:line), gate name + command + result, refusals lifted, test totals + (`cargo test -p ec-av1 --lib` passed/failed/ignored), and EVIDENCE lines of the form + `EVIDENCE: | | `. State open residue with + fix-now | deferred() | accepted. Never claim "done" beyond what you ran. +- Film check, when your lane targets a film blocker: extract 0.4s with + `ffmpeg -t 0.4 -i -c:v copy -f obu .obu` (bounded), run + `cargo run -p ec-av1 --example decode_probe -- .obu` before and after; report + the refusal string each film now stops at. + +VERIFIERS (added 2026-09-01 22:40 after a verifier left a lane worktree on a detached HEAD +while its builder was mid-round): a verifier NEVER runs `git checkout`, `git switch`, +`git stash` or any tree-changing git command inside a lane worktree. To test a specific +commit, `git worktree add --detach /tmp/claude-1000/.../scratchpad/verify- ` with its +own CARGO_TARGET_DIR, and remove it when done. + +NEIGHBOUR MAPS (added 2026-09-02 00:50, class new-map-ignores-tile-edge): any per-mi side band +you add or inherit (mode, uv_mode, skip, ref, filter, txfm ctx, palette) MUST (1) guard +availability with `mi_r > tile_row0_mi` / `mi_c > tile_col0_mi`, never `> 0`; (2) be reset in +start_tile AND start_row; (3) have a `--tile-columns=1` arm in the lane's gate. Gate Err arms +tolerate ONLY messages containing "unsupported"; lavfi sources carry an explicit seed +(noise=all_seed=N) and the report shows two identical hashes. + +SIBLING GATES (added 2026-09-02 03:00, rectsplit r3): a root-cause fix that turns YOUR gate green +is not done until every gate that exercises the same tables/paths (grep the table name and the +function in stream.rs) is re-run — rectsplit r2 shipped a transposition that fixed its gate and +broke the merged SB HORZ/VERT gate at seed 43. Run the siblings before writing "root cause". + +FORMAT + LOGS (added 2026-09-02 03:30): never run a repo-wide `cargo fmt` in a lane (txselect +carried 5000 lines of churn that the merge had to strip; format only files you touched, or +not at all). Suite logs go to a PRIVATE path (`$CARGO_TARGET_DIR/../-suite.log`), never +a shared scratchpad name — another session overwrote a verifier's log mid-run. + +## AOMENC FLAG PRECEDENCE (measured 2026-09-02 08:45, md5 of 4 orderings) +aomenc keeps the LAST occurrence of a repeated `--enable-*` flag. Per-arm overrides go AFTER the +base recipe. Every gate proves its flag arrived through a decoder-side counter or a header field; +a counter at 0 means the flag did not arrive or the encoder declined — never weaken the assert. + +## SUITE RUNS (3 self-kills on 2026-09-02; setsid -f ALSO died ~10 min in, twice) +Run the full suite as a user systemd unit — the only form that survived every time today: +`systemd-run --user --unit=-suite-$(date +%s) -p MemoryMax=10G --same-dir bash -lc 'EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target- nice -n 10 cargo test -p ec-av1 --lib -j3 > $HOME/.cache/-suite.log 2>&1'` +Then continue other work; check with single instantaneous `grep -E "^test result|FAILED" ` calls. +NEVER wait with a foreground `until/while ... sleep` loop or `tail --pid`. + +## NEVER pkill BY BINARY NAME (2026-09-02: one lane's `pkill -f ec_av1-` killed another lane's suite) +The test binary hash is identical across worktrees. Kill only by PID you own (`$!`, or the systemd unit +name you started). `pkill -f`/`killall` on cargo/ec_av1 patterns is forbidden. diff --git a/lanes/palette2-r10.report.md b/lanes/palette2-r10.report.md index 24b76ded..f6e6f56e 100644 --- a/lanes/palette2-r10.report.md +++ b/lanes/palette2-r10.report.md @@ -1,7 +1,10 @@ -# lane-palette2 r10 — GREEN: merged main 06d856d, root-caused the U-plane palette defect it exposed +# lane-palette2 r10 — merged main 06d856d, fixed the U-plane palette defect; full suite finds ONE lane regression -VERDICT: GREEN. The chartered failing cell decodes pixel-exact; both palette gates, -split_transform, tx_select, refusal_inventory and gate_coverage pass on the merged tree. +VERDICT: AMBER (corrected after the full suite ran; the first draft said GREEN off a 6-test +filter run). The chartered work is done — the failing cell decodes pixel-exact and both palette +gates, split_transform, tx_select, refusal_inventory and gate_coverage pass — but the full +`cargo test -p ec-av1 --lib` is 294 passed / 2 failed / 27 ignored, and one of those two +failures is a gate this lane REGRESSES. See STEP 4. ## STEP 1 — merge main 06d856d (commit 29bbbcd) Two conflicts, resolved exactly as chartered: @@ -71,3 +74,40 @@ EVIDENCE: scratchpad/r10.obu (211 B, sha256 d1baf9503c5787d1005d358d36767195279c EVIDENCE: scratchpad/pal.log (EC_DEBUG_PAL=1 trace of the same stream) | 32 PALSET / 32 PALTAKE lines | every arm `stale=false` — the charter's stale-thread-local suspect disproved, not patched around EVIDENCE: scratchpad/pal4.log + pal5.log | per-block `palette_uv_cache` and palette-record trace | block r=0 c=6 (luma 96,0) read cache [44,156] stamped by luma (48,0); the strip at luma (64,0) has NO record line — the missing stamp EVIDENCE: cargo test -p ec-av1 --lib -j3 (EC_AV1_REQUIRE_AOMENC=1), 6 filters | full 70-attempt sweep on both palette gates | 14 passed, 0 failed, 1 ignored, 133.29s + + +## STEP 4 — full suite on the merged tree (the r10 restart's only new work) +``` +cd /home/user/Documents/Code/Rust/edith_codecs-palette2 +EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j3 -- --test-threads=1 +# log: $HOME/.cache/palette2-suite.log +``` +→ **294 passed; 2 failed; 27 ignored** (1390.10s). + +Both failures were attributed against the merge base by building 06d856d in a detached +worktree (own CARGO_TARGET_DIR) and running the same two test names there: + +1. `decode::tests::nz_map_ctx_offset_tables_match_the_rect_rule` — **INHERITED, not this lane.** + FAILS identically at 06d856d (`32x64 nz_map offset at display (row 0, col 2) left: 6 right: 11`). + `git diff 06d856d HEAD` touches neither `cdf.rs` (0 lines) nor this test. Diagnosis: the test + reads `table[col][row]` while the live consumer (`decode.rs:1804`) reads + `table[row.min(4)][col.min(4)]`; commit 44e8768 transposed the two tables and left the test on + the old layout, so **the test is the stale half** — 24 of the 50 cells disagree, exactly a + transposition. NOT fixed here: this lane owns neither the table nor the orientation question + (decode.rs:1785-1795 records the orientation as still unproven), and flipping the test to + `[row][col]` would only pin the current storage. `deferred: nz_map test/consumer layout — + inherited from main, orientation itself unproven — needs the lane that owns the rect nz_map + orientation`. +2. `stream::tests::a_real_aomenc_stream_with_filter_intra_on_a_horz_vert_strip_decodes_pixel_exact` + — **THIS LANE REGRESSES IT.** PASSES at 06d856d, FAILS on lane-palette2 HEAD: + `seed 46 first luma mismatch at (188, 62) ours=116 ffmpeg=115 -- 2242 mismatching samples, + bbox x 135..=191 y 62..=127` (stream.rs:12360). Values differ by 1 over a contiguous region = + a prediction/reconstruction difference, not an entropy desync. The gate is new on main + (lane-fistrip), so it never ran against this lane's rect-strip work until the r10 merge; the + suspects are the lane's `read_intra_mode_rect` / `decode_block_rect` / `reconstruct_rect` + changes (492 inserted lines vs the base), starting with the merge-resolved `PALETTE_PRED` + override wrapper in `reconstruct_rect` and the r7 per-TU palette window. + `fix-now: r11 — do not merge this lane into main until seed 46 is exact.` + +EVIDENCE: $HOME/.cache/palette2-suite.log | `EC_AV1_REQUIRE_AOMENC=1 ec_av1 --test-threads=1` on lane-palette2 HEAD (merged tree) | test result: FAILED. 294 passed; 2 failed; 27 ignored; 1390.10s +EVIDENCE: detached worktree at 06d856d (scratchpad/base06d, CARGO_TARGET_DIR=~/.cache/cargo-target-palette2-base) | same binary run with the two failing test names | `nz_map... FAILED` (identical message) + `filter_intra_on_a_horz_vert_strip ... ok` — 1 passed; 1 failed