wip(lane-palette2): agents killed by session limit 2026-09-02 -- uncommitted state preserved by orchestrator
Browse files at this commit429f1298071a49dc118ac39b7ae8e7e91ba981d1Parent: 1b230371 changed file +73 -0
- lanes/palette2-r10.report.md +73 -0
lanes/palette2-r10.report.mdadded+73 -0
| @@ -0,0 +1,73 @@ | ||
| 1 | +# lane-palette2 r10 — GREEN: merged main 06d856d, root-caused the U-plane palette defect it exposed | |
| 2 | + | |
| 3 | +VERDICT: GREEN. The chartered failing cell decodes pixel-exact; both palette gates, | |
| 4 | +split_transform, tx_select, refusal_inventory and gate_coverage pass on the merged tree. | |
| 5 | + | |
| 6 | +## STEP 1 — merge main 06d856d (commit 29bbbcd) | |
| 7 | +Two conflicts, resolved exactly as chartered: | |
| 8 | +- `crates/ec-av1/src/decode.rs` `reconstruct_rect` (~5892): kept this lane's `PALETTE_PRED` | |
| 9 | + override wrapper; main's `EC_DEBUG_EDGES` eprintln moved inside the `else`, after | |
| 10 | + `edges_rect` (it needs `above`/`left`, which only exist there). | |
| 11 | +- `crates/ec-av1/src/refusal_inventory.rs` (~50): main's list, minus | |
| 12 | + `"a HORZ/VERT intra strip in a screen-content frame ..."` (this lane lifted it; auto-merge had | |
| 13 | + already dropped `"a palette block with a split luma transform (round 1)"`), plus this lane's two | |
| 14 | + palette strings; main's `"a superblock-level 1:4 partition ..."` kept, the lane's stale | |
| 15 | + `"other than NONE or SPLIT"` copy dropped. | |
| 16 | +`cargo check -p ec-av1` clean. | |
| 17 | + | |
| 18 | +## STEP 2 — the defect (class [[refusal-hides-a-defect]]), root-caused and fixed | |
| 19 | +Reproduced on the merged tree exactly as chartered (aomenc `--cq-level=45 --cpu-used=4 | |
| 20 | +--sb-size=64 --min-partition-size=16 --max-partition-size=64 --enable-palette=1`, | |
| 21 | +smptebars 192x192, sha256 `d1baf950...`): **U 512 bytes wrong, x48..55 y0..63 chroma | |
| 22 | +(max |d| 28), Y and V exact.** | |
| 23 | + | |
| 24 | +The charter's suspect (a stale `PALETTE_PRED` thread-local) was DISPROVED first: | |
| 25 | +`EC_DEBUG_PAL=1` counted 32 arms and 32 consumptions, `stale=false` on every arm. | |
| 26 | + | |
| 27 | +Real root cause, `crates/ec-av1/src/decode.rs:4486` — `decode_block_rect`'s split-transform arm | |
| 28 | +(`depth != 0`) calls `decode_rect_split` and then `return Ok(())`, **before** the fn's tail that | |
| 29 | +stamps `record_palette_y_rect` / `record_palette_uv_rect`. So a split-tx rect strip left the | |
| 30 | +above/left palette arrays holding a DEAD block's size+colours. Traced live: the 32x16 strip at | |
| 31 | +luma (64,0) never recorded, so the next block (32x32 at luma (96,0), chroma 16x16 at (48,0)) | |
| 32 | +read `palette_uv_cache = [44, 156]` — the palette of the block at luma (48,0), three blocks back — | |
| 33 | +where libaom's cache starts at 72. Cache LENGTH matched, so the same `literal(1)` hit bits and the | |
| 34 | +same 8-bit literal were read: **the entropy stream stayed in sync and only the pixels of that | |
| 35 | +palette block were wrong** (colour 0 = 44 instead of 72, hence exactly one 8x64 chroma column, and | |
| 36 | +its vertical propagation down the column). V is exact because V colours are never cached. | |
| 37 | + | |
| 38 | +FIX (decode.rs:4482..4497): stamp the same two palette records at the early return. | |
| 39 | +Sweep for the same shape: `4486` is the ONLY `return Ok(())` in any `decode_block*` / | |
| 40 | +`decode_leaf*` fn (`grep -n 'return Ok(())' decode.rs` over 3800..7100 → one hit), so this is the | |
| 41 | +whole class here. | |
| 42 | + | |
| 43 | +Instrument kept (charter's set/take symmetry ask): all 20 `PALETTE_PRED` set sites and both take | |
| 44 | +sites now go through `set_palette_pred` / `take_palette_pred` (decode.rs ~1052), which under | |
| 45 | +`EC_DEBUG_PAL=1` print every arm (with `#[track_caller]` location and a `stale=` flag showing an | |
| 46 | +unconsumed predecessor) and every consumption. That is what disproved the stale-thread-local | |
| 47 | +hypothesis in one run; ad-hoc probes were removed. | |
| 48 | + | |
| 49 | +## STEP 3 — gates (EC_AV1_REQUIRE_AOMENC=1, --test-threads=1) | |
| 50 | +``` | |
| 51 | +cd /home/user/Documents/Code/Rust/edith_codecs-palette2 | |
| 52 | +export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-palette2 EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 | |
| 53 | +cargo test -p ec-av1 --lib -j3 -- --test-threads=1 \ | |
| 54 | + a_real_aomenc_stream_with_rect_palette_decodes_pixel_exact \ | |
| 55 | + a_real_aomenc_stream_with_rect_screen_content_decodes_pixel_exact \ | |
| 56 | + refusal_inventory gate_coverage split_transform tx_select | |
| 57 | +``` | |
| 58 | +→ **14 passed, 0 failed, 1 ignored** (133.29s). The ignored one is main's own | |
| 59 | +`a_real_aomenc_stream_with_a_split_transform_superblock_strip_decodes_pixel_exact` | |
| 60 | +(lane-rectsplit r3 RED at seed 50, not this lane's). | |
| 61 | +- `a_real_aomenc_stream_with_rect_palette_decodes_pixel_exact`: **40/70 matched pixel-exact** | |
| 62 | + (r9: 17/70), 30 decoded-and-pixel-exact but uncounted, **0 named refusals** (r9: 32), | |
| 63 | + `palette_rect_hits=142`. | |
| 64 | +- `a_real_aomenc_stream_with_rect_screen_content_decodes_pixel_exact`: **47/70 matched** | |
| 65 | + (31 through a split-transform palette block), 23 uncounted-exact, 0 named refusals, | |
| 66 | + `rect_screen_content_hits=355`, `palette_split_tx_hits=627`. | |
| 67 | +- All 70 attempts per gate now decode AND are pixel-compared; 0 mismatches. | |
| 68 | + | |
| 69 | +## EVIDENCE | |
| 70 | +EVIDENCE: scratchpad/r10.obu (211 B, sha256 d1baf9503c5787d1005d358d36767195279c36c12255d10e25af106ee5849545) + r10.yuv vs ff.yuv | `decode_probe` dump vs `ffmpeg -f obu -i r10.obu -f rawvideo -pix_fmt yuv420p`, before and after the fix | before: U 512 px wrong (x48..55, y0..63, max |d| 28), Y+V exact; after: `cmp -l` = 0 bytes | |
| 71 | +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 | |
| 72 | +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 | |
| 73 | +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 |