forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

refute-av1444d10.report.md8.8 KiBHistoryRawDownload

refutation-av1444d10 — reviewer verdict on the 4:4:4 10-bit 352x242 palette-window fix (merge e4787782)

Transcribed verbatim from the reviewer seat's output (agent Agent20-5), 2026-09-30. The ONLY edit is the P3 flag below, which main acted on in the same batch (the counter is now guarded on nw*nh>1 and its doc corrected; gate re-run green at 4 windowed units). The P3 finding's own BODY was stored truncated at its 1068-byte tail ("Fix the c…"); the gist -- the counter must be fixed or its doc corrected so that a hit proves the TILED arm ran -- is what was acted on, and a doc-only change was NOT taken as sufficient because the counter is used as the gate's non-vacuity arm.

VERDICT: PASS FLAGS: crates/ec-av1/src/decode.rs:2721-2731 (P3 doc-vs-behaviour, non-blocking) EVIDENCE: (1) COMPARATOR LIVENESS: my own one-byte-wrong-oracle shim (wraps ~/.cache/aom-oracle/build/aomdec, flips bit0 of ONE byte of {EC_AV1_FINAL_DUMP}.f0 at byte 328192) run through the gate's own comparator (EC_AV1_AOMDEC=PWD/shim/aomdec-tamper, EC_AV1_REQUIRE_AOMDEC=1) turns the byte-exact cell RED with "1 bytes differ" at byte 328192 (ours 216 vs 217) — the count moved by exactly +1, and the comparison point is the census's first bad sample. Green baseline on the un-tampered oracle: "17 decode-order frame(s) (1 hidden) byte-exact vs aomdec, 4 windowed palette chroma unit(s)". The crate comparator reads the oracle's dump file bytes and diffs them against ours (stream.rs:10836-10855) — not a self-comparison, so it is the live kind, unlike the withdrawn av1422 re-measurement. (2) CLAIM 2, my own instrument: a temporary #[cfg(test)] module in my worktree ran aomdec with EC_AV1_FINAL_DUMP against our set_final_dump_prefix dumps and counted wrong u16 SAMPLES per plane over all 17 decode-order frames (352x242 10-bit 4:4:4; dump layout Y,U,V each 352242 samples). TIP: Y=0 U=0 V=0 on every frame, 0/0/0 total. FIX OUT (only the two palette_window calls reverted, counter left in place): Y=0 U=1166 V=1413, per-frame U = 53,54,54,54,170,54,162,54,58,54,61,54,54,61,61,54,54 and V = 51,51,51,52,160,52,158,52,58,52,158,52,51,156,156,52,51 — a term-for-term match with the report's table. First bad sample on both planes: decode frame 0, row 224, col 64, ours 209 vs oracle 216 (U). (3) MUTATION PROOF reproduced by name: reverting the two windows reds the gate at stream.rs:10848 with "decode-order frame 0 of 17 (16 shown, 1 hidden) differs from the oracle at byte 328192 (ours 209 vs 216), 104 bytes differ" — identical to the report. Green again on restore (worktree diff empty afterwards). (4) CLAIM 4 measured on the lane's own sweep .obu files (not the report's numbers): 320x242, 320x250, 352x250, 416x242, 416x250 all 0/0/0 over 17 decode frames AFTER, and 320x242 also 0/0/0 BEFORE the fix. 352x242's sweep .obu is byte-identical to the committed fixture (sha256 84df2f37…a0ad2, 24875 B), so the provenance chain holds. (5) CLAIM 7 reproduced in a clean worktree at e4787782 with EC_AV1_REQUIRE_AOMDEC=1: "cargo test -p ec-av1 --lib -- 444 420 lossless warp intra --skip bitrate_target_lands_within_5_percent_over_48_frames" -> test result: ok. 178 passed; 0 failed; 2 ignored; 623 filtered out (345.66s). (6) SEMANTIC CHANGE BEYOND THE TWO WINDOWS (claim 4 of my brief): the diff is exactly 2 sites, 10 insertions / 2 deletions, no offsets or guards touched. The no-op-at-nwnh==1 property is verified, not assumed: cu_col/cu_row are both 0 when nwnh==1, so palette_window(buf, chroma_w, 0, 0, uw, uh) with uw=chroma_w, uh=chroma_h is a re-stride copy; and the buffer's own stride equals chroma_w because the map is built by decode_color_index_map_wh(…, cw, ch) with cw=(bw>>ss_x).max(4), and the only case where cw>chroma_w (chroma_w<4, e.g. 4:2:0 bw=4) returns unsupported earlier at the (uw,uh) match arm before the palette windowing is reached. Both arms' set_palette_pred are consumed exactly once by the same reconstruct/inline_intra path as before (take_palette_pred at decode.rs:4026/4113), so no new stale-override window. (7) CLAIM 8 audited mechanically, not by reading: of 98 set_palette_pred sites, all 6 multi-line ones are palette_window hand-offs; every whole-buffer .clone() hand-off that sits lexically near a unit loop was checked by hand (12776, 17281 = single-push whole-block arms; 25542 = an inter-copy 4x4 unit whose buffer is built per unit). No remaining whole-buffer hand-off inside a tiled unit loop. The two 4x8 sub-8 windows that pass ox=0 with only unit_row are single-column walks, so omitting unit_col is correct there. (8) CLAIM 6's counter: an EC_NWTRACE probe on the pinned fixture shows exactly 4 windowed units = ONE block with nw=1, nh=2, x 2 planes (U,V) x 2 unit rows, so MIN_WINDOWED_UNITS=4 is the exact measured value, and every hit is a genuinely tiled unit. nw>1 is reached NOWHERE in the committed fixture corpus: a corpus-wide sweep (all 106 .obu, tracer on both fixed sites) produced 16 windowed units, all with nw=1; zero with nw>=2. (9) CLAIM 3 partially re-run: the full 106-fixture before/after oracle sweep (95/1/9/1 -> 96/0/9/1) was NOT re-run — it is ~106 aomdec decodes x2 builds. What I did run: the pinned cell, the six sweep cells, the 178-test regression scope with the oracle REQUIRED, and a corpus-wide decode sweep of all 106 fixtures under my tracer (96 decoded, 10 refused, no panics) — consistent with 9 4:2:2 refusals plus the request-only 440 file, but I did not re-measure per-fixture byte-exactness on the other 95. RISK: (a) The gate's pixel arm is silently SKIPPED unless an oracle is present — every run above set EC_AV1_REQUIRE_AOMDEC=1; a green run without it proves nothing about pixels. (b) The nw>1 (horizontal) windowing arm of the fixed code is UNMEASURED: it is unreachable in all 106 committed fixtures and in all six 4:4:4 sweep cells. It is correct by construction (a unit's window is cu_coluw at the block's own chroma_w stride, matching libaom's per-unit ref pointer), but a 4:4:4 stream with a 64-wide luma rect block carrying a UV palette (chroma_w=64 -> uw=32, nw=2) is what it would take, and no such fixture exists. (c) CHROMA_PALETTE_WINDOW_HITS fires on EVERY palette chroma unit, including single-unit blocks where the window is a no-op, so the counter alone does not prove the tiled path ran; the floor of 4 and the byte compare carry that, and the floor would need re-measuring if a second palette-chroma fixture is ever added to the same test. (d) Do not trust the report's claim 3 numbers as re-measured — they are plausible and consistent with everything I measured, but I did not re-run the two-build 106-fixture sweep. (e) The window indexes buf[(oy+r)*stride+ox..][..w] and would panic (or, with a mismatched stride, misread) if a future block shape ever gave cw != chroma_w; today that shape returns unsupported first, which is the only thing keeping it safe.

Flags (structured)

P3 Counter doc claims it counts only non-top-left units; it counts every palette chroma unit

file: crates/ec-av1/src/decode.rs:2721-2731 confidence: 0.75

The doc comment on CHROMA_PALETTE_WINDOW_HITS (decode.rs:2721-2731, added by eb73ef89) says it counts 'units that are NOT the block's top-left corner', but the hit! sits unconditionally next to set_palette_pred(palette_window(...)) on both fixed lines, so it also fires for nwnh==1 blocks where the window is a pure re-stride copy of the whole buffer — the exact units the comment says it excludes. Measured on the pinned fixture the two coincide (all 4 hits are nw=1, nh=2), so nothing is mis-gated today, but a reader auditing non-vacuity would conclude the counter proves the TILED arm ran, which the counter cannot distinguish: a stream whose palette chroma blocks are all single-unit would still produce hits >= 1 and pass the reachability assert. Fix the comment to say 'units handed a windowed slice (all palette chroma units on the 32-capped walk; the window is a no-op when nwnh==1)' and let the MIN_WINDOWED_UNITS floor plus the byte compare carry the tiled-arm claim, or gate the hit! on bigger (nw*nh > 1) if the tiled arm is what it is meant to witness.


Addendum (lane-av1444palw): the counter floor of 4 was never a census

a_444_lossy_palette_chroma_unit_window_is_byte_exact_at_352x242_10bit asserts MIN_WINDOWED_UNITS = 4, documented there as "measured 4 on this stream". That is a floor from ONE stream and stays correct as a floor, but it must not be read as "this walk runs 4 units". Re-measured per stream across every committed palette-chroma stream (EC_PALWALK=1, the rung added in decode_block_rect64 by lane-av1444palw):

stream windowed units of which nw >= 2
444_lossy_palette_chroma_352x242_10b.obu 4 0
444_palette_chroma_hstrip_640x480_10b.obu (new, lane-av1444palw) 8 4
444_palette_chroma_hstrip_640x480_12b.obu (new, lane-av1444palw) 4 4

Totals: 16 units, 8 on the horizontal arm. See lanes/av1444palw.report.md.