forge
Explore
Log in

Don't you dare go Hollow

Lane-palette r4 report -- job 1 fixed+green, job 2 rung built

Browse files at this commit

f1654a346d3d8964e07f8f62f5662281e36729a3Ahmet Kaan GümüşParent: 71d8f67
  • docs
    • lane-palette r4 report -- job 1 fixed+green, job 2 rung built
Show full message
docs(av1): lane-palette r4 report -- job 1 fixed+green, job 2 rung built

VERDICT: PARTIAL. Refusal-by-name shape landed and verified (235/0/17);
job 2's palette range-ladder oracle rung (EC_TRACE_PALETTE) built and
compiled, bisect itself not run -- handoff for next round included.
lanes/palette-r4.report.mdadded+104 -0
@@ -0,0 +1,104 @@
1+# lane-palette r4 report
2+
3+VERDICT: PARTIAL -- Job 1 (the SKIP-on-wrong-pixels shape) is fixed and
4+committed, green. Job 2 (locate the desync) is not closed this round: the
5+oracle-side range-ladder rung for the palette colour-index map is built and
6+compiles, but no bisect run against our own decoder's ranges was completed
7+within budget.
8+
9+## Job 1 -- refuse by name instead of SKIP on wrong pixels (committed 882c2d7)
10+
11+`crates/ec-av1/src/decode.rs`, the `palette_y_mode` arm (~line 2782): after
12+`read_palette_colors_y` + `decode_color_index_map` finish and
13+`PALETTE_HITS` increments, the arm now returns
14+`Err(unsupported("a block that actually uses a palette (Y) -- the index
15+map decodes but the reconstructed pixels do not match libaom yet
16+(lane-palette r3/r4)"))` instead of building `palette_y = Some(...)` and
17+falling through to reconstruction. All the landed reconstruction code
18+(`PALETTE_PRED`, the `py.colors[idx]` buffer build, `record_palette_y`,
19+etc.) is untouched and still compiles -- it is simply unreachable until this
20+refusal is removed once the desync is fixed.
21+
22+`crates/ec-av1/src/stream.rs`: the gate is renamed
23+`a_real_aomenc_stream_with_palette_y_refuses_by_name` (was
24+`..._decodes_pixel_exact`) and rewritten to assert `decode_stream` returns
25+`Err` containing `"reconstructed pixels do not match libaom"`, with
26+`palette_hits()` still hard-asserted to have moved (proves the refusal
27+isn't vacuous -- it's reached only after a real palette block's full
28+syntax decodes). No more pixel comparison, no more SKIP path.
29+
30+**Refusal strings changed:** one message text changed (same call site, no
31+new site): `"a block that actually uses a palette (Y) -- reconstruction is
32+out of scope"` (only fired when `palette.is_none()`, a different call-site
33+condition, unchanged) is now ALSO reachable unconditionally after a full Y
34+palette decode, with message `"a block that actually uses a palette (Y) --
35+the index map decodes but the reconstructed pixels do not match libaom yet
36+(lane-palette r3/r4)"`. No refusal strings removed. `gate_coverage.rs`'s
37+`NEVER_EXERCISED` list is untouched by this round (r3 already removed
38+`enable-palette` correctly, per its own report).
39+
40+**Check:** `EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j4`: 235
41+passed, 0 failed, 17 ignored (was 234/0/17 before this round's new test;
42++1 test, all still green). Scoped run of the renamed gate alone also green.
43+
44+## Job 2 -- desync location: rung built, bisect not run
45+
46+Per charter, r3 already cleared `read_palette_colors_y`, `read_uniform`,
47+`palette_color_index_context` and the `PALETTE_Y_COLOR_INDEX` CDF table
48+against the oracle line-for-line, and the charter forbids re-reading them.
49+Added a new `EC_TRACE_PALETTE=1` rung to
50+`scripts/instrument-aom-oracle.sh` (rungs 6/6b), targeting
51+`av1/decoder/detokenize.c`'s `decode_color_map_tokens`:
52+- `EC_PAL row=.. col=.. ctx=.. n=.. rng=..` before every colour-index
53+ symbol in the wavefront (and a `row=0 col=0 ctx=-1` line before the
54+ `map[0] = av1_read_uniform(...)` read, which the loop doesn't cover),
55+ `EC_PAL_VAL row=.. col=.. color_idx=.. rng=..` after.
56+- Idempotent, env-gated, wrapper-around-impl shape matching the existing
57+ rungs; ran `bash scripts/instrument-aom-oracle.sh` (reports "palette map
58+ instrumented" / "palette map[0] instrumented", no-op on the five
59+ pre-existing rungs) then `ninja -C ~/.cache/aom-oracle/build aomdec`
60+ clean.
61+
62+**Not done this round:** our own `decode_color_index_map` (decode.rs
63+~2182) has no matching `EC_AV1_TRACE`-gated per-pixel range print yet, and
64+no bisect run comparing `aomdec EC_TRACE_PALETTE=1` against our decoder's
65+own ranges was executed against the r3 fixture stream. That is squarely
66+the charter's job 2 and is the very next step -- the oracle side is ready,
67+the decoder side isn't instrumented, and no stream was regenerated this
68+round to feed either.
69+
70+## Deferred
71+
72+- `deferred: Job 2 bisect itself (compare EC_TRACE_PALETTE against our own
73+ decode_color_index_map's ranges) -- ran out of budget after building the
74+ oracle rung -- next round: add the matching EC_AV1_TRACE print in
75+ decode_color_index_map (row, col, ctx, n, rng before; color_idx, rng
76+ after -- same shape as the oracle's), regenerate the r3 fixture stream,
77+ diff the two traces per compare-range-not-tell/equal-range-means-unread.`
78+- `deferred: "Then" milestones (palette UV refusal accuracy check, the
79+ rect-strip palette_bsize_ctx refusal, intrabc) -- never started, all
80+ budget went to job 1 + the job 2 rung.`
81+
82+## Handoff for the next round
83+
84+1. Instrument `decode_color_index_map` in `crates/ec-av1/src/decode.rs`
85+ with an `EC_AV1_TRACE`-style per-pixel print (there's already a `trace`
86+ local + `EC_AV1_TRACE` eprintln right after this function's call site at
87+ ~2792, so the flag plumbing exists -- just add the print inside the
88+ function itself, matching `EC_PAL row=.. col=.. ctx=.. n=.. rng=..` /
89+ `EC_PAL_VAL ...` from the oracle rung field-for-field). Our `SymbolDecoder`
90+ needs a `range()`/similar accessor mirroring `SymbolEncoder::rng()` (msac.rs
91+ ~83) -- check whether the decoder side already exposes `range` (msac.rs
92+ struct field `range: u32` on `SymbolDecoder`, ~260) before adding one.
93+2. Regenerate the r3 gate's exact fixture (`smptebars=size=64x64` +
94+ `hue=s=0`, the aomenc args in the (now renamed) gate test) once, save the
95+ stream bytes to a file, and run both `aomdec EC_TRACE_PALETTE=1` and our
96+ own decoder (`EC_AV1_TRACE=1`, once instrumented) against the identical
97+ bytes.
98+3. Per the charter's own steer: if the ranges match to the end of the
99+ block, the reads are right and the bug is in how the palette map is
100+ applied (per-TU slicing, `PALETTE_PRED`'s lifetime, or chroma/luma plane
101+ mixing) -- decode.rs ~3347's `PALETTE_PRED.with(...)` set/take pairing
102+ and the `buf` construction (`py.map.iter().map(|&idx| py.colors[idx as
103+ usize] as u8)`) are the first places to look, not the symbol reads
104+ again.