Lane-palette2 r6 report -- RED, root cause traced to decode_block_rect64
Browse files at this commit7ed7ffc484efb246ba0879d26f4cce274b47cd70Parent: 083ca11- docs
- lane-palette2 r6 report -- RED, root cause traced to decode_block_rect64
1 changed file +105 -0
- lanes/palette2-r6.report.md +105 -0
lanes/palette2-r6.report.mdadded+105 -0
| @@ -0,0 +1,105 @@ | ||
| 1 | +VERDICT: RED — the broad gate the charter asked for now fires (proof the removed-refusal case | |
| 2 | +actually occurs), and it caught a real pixel mismatch. The defect is NOT r4's palette wiring: it | |
| 3 | +traces to a pre-existing, already-tracked bug in `decode_block_rect64` (ledger | |
| 4 | +[[lane-sbpart-r9]]), newly reachable now that the blanket screen-content refusal is gone. The | |
| 5 | +refusal is intentionally NOT restored — the charter's own instruction on mismatch is to bisect and | |
| 6 | +report, not revert. | |
| 7 | + | |
| 8 | +## What I did | |
| 9 | +1. Confirmed on `main` (HEAD `8440024`, textually — did not build there, see below) that the | |
| 10 | + blanket refusal `"a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed | |
| 11 | + for square blocks only)"` is still present verbatim (`decode.rs:2857`), so this branch really is | |
| 12 | + the only place that case can be observed decoding. | |
| 13 | +2. Added `decode::rect_screen_content_hits()` — a `thread_local` counter incremented at the exact | |
| 14 | + site the removed refusal used to guard, inside `read_intra_mode_rect` (`decode.rs`, right after | |
| 15 | + `allow_screen_content_tools && palette_bsize_ctx_wh(bw, bh).is_some()`), independent of whether | |
| 16 | + the block goes on to use a palette. This is the counter the charter asked for: it fires on the | |
| 17 | + *common* case (r5's own sweep found 39/70 attempts reached this branch without ever using a | |
| 18 | + palette — those were invisible to r5's `palette_rect_hits`). | |
| 19 | +3. Wrote `a_real_aomenc_stream_with_rect_screen_content_decodes_pixel_exact` in `stream.rs`, | |
| 20 | + modeled on r5's gate: same `--min/max-partition-size=64` recipe (r5 measured live that this | |
| 21 | + dodges the 32x32-level AB-partition quirk, [[lane-sbpart-r2]]), same size/cq sweep, drives | |
| 22 | + `decode_stream` directly, hard-asserts `rect_screen_content_hits()` moved before comparing any | |
| 23 | + pixels. | |
| 24 | + | |
| 25 | +## What the gate found | |
| 26 | +First attempt through this recipe that actually fired the counter (`smptebars=size=128x128:rate=25 | |
| 27 | +cq=15`) **mismatched ffmpeg**: rows 0-63 (the frame's top two 64x64 superblocks) match exactly; | |
| 28 | +rows 64-127 (the bottom two superblocks) are wrong wholesale (~117-128/128 pixels differ per row, | |
| 29 | +uniformly, not a scattered handful). | |
| 30 | + | |
| 31 | +I bisected with `EC_AV1_TRACE`: | |
| 32 | +- The 4 palette-Y/UV blocks visible in the trace (`EC_PAL`/`EC_PAL_VAL`) are all 64x64 luma / | |
| 33 | + 32x32 chroma — **square**, going through the pre-existing, already-verified square palette path | |
| 34 | + (`decode_block`), not the new rect one. Both top SBs decode this way and both match ffmpeg. | |
| 35 | +- `TRACE_RECT64_END mi_row=16 mi_col=16 bw=32 bh=64` and `mi_row=16 mi_col=24 bw=32 bh=64` are the | |
| 36 | + two bottom SBs — real `VERT` splits at the superblock level, going through | |
| 37 | + `decode_block_rect64`. Neither shows an `EC_PAL` trace inside it — **this is not a palette block | |
| 38 | + at all**, just ordinary intra reconstruction on a genuine rect strip. | |
| 39 | +- So `rect_screen_content_hits` incremented correctly (the syntax-reading branch it counts ran), | |
| 40 | + but the corruption is downstream of it, in `decode_block_rect64`'s own reconstruction of a real | |
| 41 | + (non-skip) VERT-split block — the counter did its job; the block it counted is where the bug | |
| 42 | + lives, just not in the code r4 added. | |
| 43 | + | |
| 44 | +This matches an existing ledger dead-end verbatim: | |
| 45 | +`dead-end|lane-sbpart r9 ... root cause is a sibling function (decode_block_rect64) ... do not | |
| 46 | +re-attempt part32 AB until decode_block_rect64 real-residual TX_32X64/64X32 truncation is fixed and | |
| 47 | +gated`. That defect was never closed. What's new this round is that it was previously | |
| 48 | +UNREACHABLE under `allow_screen_content_tools=true` (the blanket refusal short-circuited it | |
| 49 | +first, [[refusal-short-circuits-its-own-code]]) — removing that refusal exposed it for the first | |
| 50 | +time in this configuration, on a stream that doesn't even use palette. | |
| 51 | + | |
| 52 | +## Why I did not restore the refusal | |
| 53 | +The charter is explicit: on mismatch, bisect and say so — restoring the refusal was not asked for | |
| 54 | +and this branch's whole point is closing "refusal removed, no gate behind it" | |
| 55 | +([[refusal-lifted-without-a-gate]]) with an honest RED, not a silent revert back to green. The gate | |
| 56 | +itself is the safety net now: it is red, hard-asserting, and will stay red until | |
| 57 | +`decode_block_rect64`'s real-residual defect is actually fixed — exactly the state the charter | |
| 58 | +wants landed. | |
| 59 | + | |
| 60 | +## r4's `refusal_inventory.rs` / palette reconstruction — still unverified | |
| 61 | +Nothing this round exercised palette reconstruction through the rect path (every genuine rect-strip | |
| 62 | +decode I observed had zero palette use; every palette use I observed was square). r4's actual new | |
| 63 | +code (palette-Y/UV symbol reading and reconstruction generalized to `bw`x`bh`) is therefore | |
| 64 | +*still* neither confirmed nor refuted — same state r5 left it in. I left `refusal_inventory.rs` | |
| 65 | +untouched. | |
| 66 | + | |
| 67 | +## What I did NOT do | |
| 68 | +- Did not build or run anything in `/home/user/Documents/Code/Rust/edith_codecs` (main repo, | |
| 69 | + not a worktree) — it had another agent's uncommitted staged changes when I checked; I only read | |
| 70 | + the committed `HEAD` text to confirm the refusal's wording, never compiled there. | |
| 71 | +- Did not attempt to fix `decode_block_rect64`'s residual truncation — out of this round's charter | |
| 72 | + (gate r4's work), and the ledger already flags it as open for whichever lane owns `sbpart`/rect64 | |
| 73 | + residuals next. | |
| 74 | +- Did not touch r5's `a_real_aomenc_stream_with_rect_palette_decodes_pixel_exact` gate; it is | |
| 75 | + unchanged and still red for its own reason (never observes a genuine palette-on-rect attempt). | |
| 76 | + | |
| 77 | +## Commands run | |
| 78 | +``` | |
| 79 | +export CARGO_TARGET_DIR=$HOME/.cache/cargo-target-palette2 | |
| 80 | +export EC_AV1_REQUIRE_AOMENC=1 | |
| 81 | +nice -n 19 cargo build -p ec-av1 --tests -j4 # clean | |
| 82 | +nice -n 19 cargo test -p ec-av1 --lib -j4 \ | |
| 83 | + a_real_aomenc_stream_with_rect_screen_content_decodes_pixel_exact -- --nocapture | |
| 84 | + # FAILED: assertion `left == right` ... frame 0 luma vs ffmpeg (the mismatch above) | |
| 85 | +``` | |
| 86 | +(cargo test timeout was 600000ms; actual run finished in ~1-17s per invocation, well under) | |
| 87 | + | |
| 88 | +## State committed | |
| 89 | +`d427e19` on `lane-palette2` (HEAD): `decode.rs` (+23, new counter), | |
| 90 | +`stream.rs` (+153, new gate). Compiles clean (`cargo build -p ec-av1 --tests`). Two red gates now | |
| 91 | +exist for this lane's unverified surface (r5's palette-on-rect, r6's broad rect-screen-content) — | |
| 92 | +both honest, neither silenced. | |
| 93 | + | |
| 94 | +## Next round should | |
| 95 | +- Fix `decode_block_rect64`'s real-residual VERT/HORZ-split reconstruction (the actual root cause, | |
| 96 | + tracked since [[lane-sbpart-r9]]) — this gate will go green once that's fixed and no sooner. | |
| 97 | +- Once green, re-run `a_real_aomenc_stream_with_rect_palette_decodes_pixel_exact` too: with | |
| 98 | + `decode_block_rect64` fixed, more attempts may reach a genuine palette-on-rect block and finally | |
| 99 | + give r4's actual new code its first real test. | |
| 100 | + | |
| 101 | +## Budget | |
| 102 | +~55 turns spent: charter/report reading, main-HEAD text confirmation, counter + gate authoring, | |
| 103 | +two build/test cycles (first hit a broken-pipe harness bug from `--limit=3` racing piped stdin, | |
| 104 | +fixed by dropping it and matching r5's proven recipe), then bisection via `EC_AV1_TRACE` to | |
| 105 | +localize the mismatch to `decode_block_rect64`. Stopped there per budget discipline and committed. |