From 44a4ba019f0457a3829a9235250fa2ba217c86d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 18:47:34 +0300 Subject: [PATCH] palette lane: refutation PARTIAL -- code, fixtures and gate survive; three report figures corrected in place, plus two small in-code defects the pass found The refutation of `0bfee517` reproduced the reach on the pinned bytes with its own rung (`mi=22,8 px=128 py=352 bw=64 bh=16 cw=64 ch=16 uw=32 uh=16 nw=2 nh=1 puv=1` for the RECT-unit arm; the same block with `cw=64 ch=32 uw=uh=32` for the SQUARE-unit arm), re-measured exactness at both depths with a comparator it proved live at each depth (one-byte oracle flip -> +1), and reproduced the mutation exactly (byte 738176, 54278 bytes). What did NOT survive is three figures, now corrected in the report as an annotation rather than a rewrite: 1. REACH CENSUS: "exactly three committed fixtures carry this walk" is wrong -- all 110 re-swept print the walk in 19 of them (17 pre-existing), and three PRE-EXISTING fixtures do carry an nw>=2 walk (r512, 444_rect_strip_leaf_tx_type, 444_sb128rect_lr_witness). The load-bearing sub-claim survives and is now measured: only three fixtures corpus-wide carry a CHROMA PALETTE on this walk at all -- the two new cells and r512_rect2x1_1x2_444 (nw=1 nh=2). 2. PER-PLANE MUTATION COUNTS do not reconcile with the report's own totals: the u16 surface gives 26832+27446 = 54278 (10-bit) and 6656+6656 = 13312 (12-bit), which equal the headline totals, while the printed per-plane rows sum to 51692 and 12800. Two surfaces under one claim; both marked unpinned until re-derived. 3. "NOT A CASCADE" is dropped: with BOTH sites reverted the 10-bit damage spans 372 rows and columns 128..639 and the first wrong sample lies outside every palette-bearing walked block, so luma 0 rules out luma-side context only. The ARM-ISOLATED result replaces it and is stronger: rect-unit arm alone reds the 10-bit cell (first wrong r352 c160, inside the horizontal block) and leaves 12b clean; square-unit arm alone reds 12b AND 10b. That isolation also corrects an in-code comment: windowing is load-bearing for EVERY tiled block, and `nw > 1` is merely the case the corpus could not reach -- the counter's doc now says so instead of inviting the "only the horizontal term matters" reading. The reviewer also read the counter floors directly: 8 and 4 on the new cells, 4 on the pinned cell, and 0 on 420_intrabc_rect4_witness (proof the guard discriminates). Two in-code defects fixed here, both found by that pass: - `EC_PALWALK` printed the label `py` for TWO different quantities (the block origin and `palette_y.is_some()`), so any census script could silently read the wrong one: the second is now `py_pal`. - the `CHROMA_PALETTE_WINDOW_HITS` doc block carried the claim the isolated-arm mutation refutes (see 3). --- crates/ec-av1/src/decode.rs | 11 ++++- lanes/av1444palw.report.md | 40 +++++++++++++++++ lanes/av1offtile.report.md | 90 +++++++++++++++++++------------------ 3 files changed, 96 insertions(+), 45 deletions(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 43855b28..0cfdf5b8 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -2751,6 +2751,15 @@ thread_local! { /// measured value is unchanged at 4 (one block with nw = 1, nh = 2 x two /// planes x two unit rows); a stream whose palette chroma blocks are all /// single-unit now leaves it at zero. + /// + /// FURTHER CORRECTED the same day by the palette lane's refutation + /// (`lanes/av1444palw.report.md` + the arm-isolated mutation): the guard is + /// about TILING, not about `nw > 1` specifically. Isolating the two window + /// sites shows the RECT-unit arm alone reds the 10-bit cell, and the + /// SQUARE-unit arm alone reds the 12-bit cell *and* the 10-bit one -- so + /// windowing is load-bearing for every tiled block, and `nw > 1` is merely + /// the case the corpus could not reach. Do not read this counter as + /// evidence that only the horizontal term matters. static CHROMA_PALETTE_WINDOW_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; } @@ -20165,7 +20174,7 @@ fn decode_block_rect64( eprintln!( "EC_PALWALK mi={r},{c} px={px} py={py} bw={bw} bh={bh} cw={chroma_w} \ ch={chroma_h} uw={uw} uh={uh} nw={nw} nh={nh} ast={allow_screen_content_tools} \ - puv={} py={}", + puv={} py_pal={}", palette_uv.is_some() as i32, palette_y.is_some() as i32 ); diff --git a/lanes/av1444palw.report.md b/lanes/av1444palw.report.md index 1c1f4bd3..905363d6 100644 --- a/lanes/av1444palw.report.md +++ b/lanes/av1444palw.report.md @@ -1,5 +1,45 @@ # lane-av1444palw — the 4:4:4 palette chroma walk's HORIZONTAL arm (nw >= 2) and a 12-bit cell +> **CORRECTIONS FROM THE REFUTATION PASS (added by Main 2026-09-30; VERDICT: PARTIAL — the merged code, the +> fixtures and the gate SURVIVED independent refutation, three report FIGURES did not).** The reviewer +> reproduced the reach independently on the pinned bytes (10-bit: `mi=22,8 px=128 py=352 bw=64 bh=16 cw=64 +> ch=16 uw=32 uh=16 nw=2 nh=1 puv=1`, the RECT-unit arm; 12-bit: the same block with `cw=64 ch=32 uw=uh=32 +> nw=2 nh=1`, the SQUARE-unit arm; both sha256s matched), re-measured exactness with its own comparator +> (Y/U/V = 0/0/0 at both depths, one-byte oracle flip moving the count 0 -> 1 at BOTH depths) and reproduced +> the mutation exactly (byte 738176, 54278 differing bytes). Corrections: +> +> 1. **Reach census (§ around lines 41-53): "exactly three committed fixtures carry this walk" is wrong.** All +> 110 committed `.obu` re-swept with `EC_PALWALK=1`: **19 fixtures print the walk** (17 pre-existing -- +> `reelb_intra14_witness` 259, `reelb_ss600_key_frame` 153, `reelc_sb128_inter_witness` 99, `reelb_ss300_key_frame` +> 101, `reelc_kf2700` 93, `reelb_head_mvclamp_witness` 69, `reelb_arf_witness` 41, `reelb_rect64_intra16x4_witness` +> 41, `420_intrabc_rect4_witness` 30, `rect64_dq_drift` 19, `r512` 18, `gm_small_side_witness` 10, +> `superres_alltools_sb128_320x180` 3, `444_rect_strip_leaf_tx_type` 2, `444_sb128rect_lr_witness` 2, plus +> the two new cells), and **three pre-existing fixtures DO carry an `nw>=2` walk** (`r512`, +> `444_rect_strip_leaf_tx_type`, `444_sb128rect_lr_witness`). The LOAD-BEARING sub-claim survives and is now +> measured: only three fixtures corpus-wide carry a CHROMA PALETTE on this walk at all -- the two new cells +> (`nw=2`) and `r512_rect2x1_1x2_444` (`nw=1 nh=2`) -- so "no pre-existing `nw>=2` chroma-palette block" +> holds. The table was not measured over the corpus it names. +> 2. **Per-plane mutation counts (lines ~131-137) do not reconcile with the report's own totals.** On the u16 +> surface the mutation differs by `26832 + 27446 = 54278` (10-bit) and `6656 + 6656 = 13312` (12-bit) -- +> those sums equal the headline totals exactly, while the printed per-plane rows (`0/25553/26139` and +> `0/6400/6400`) sum to 51692 and 12800. The per-plane row comes from a DIFFERENT surface than the headline +> above it; one of the two must be re-derived. Treat both as unpinned until then. +> 3. **Drop the "it is the `cu_col=1` unit, not a cascade" reasoning (lines ~138-140).** Luma 0 rules out +> luma-side neighbour context, not a chroma cascade: with BOTH sites reverted the 10-bit diff spans 372 rows +> and columns 128..639, and the first wrong sample (frame 0 plane U r96 c448) lies outside every +> palette-bearing walked block. The claim holds only for the ARM-ISOLATED mutation, and that is the better +> statement: **rect-unit arm alone reds the 10-bit cell (first wrong r352 c160, inside the horizontal block) +> and leaves 12b at 0/0/0; square-unit arm alone reds 12b AND 10b.** That isolation also corrects the +> in-code comment about this counter: windowing is load-bearing for EVERY tiled block, and `nw>1` is merely +> the case the corpus could not reach (comment in `decode.rs` corrected, and the counter doc no longer +> invites the "only the horizontal term matters" reading). The reviewer also read the counter floors +> directly: 8 and 4 on the new cells, 4 on the pinned gate's cell, and **0 on `420_intrabc_rect4_witness`** +> -- direct proof the guard cannot be satisfied by a single-unit stream. +> 4. **`EC_PALWALK` printed the label `py` for two different quantities** (`decode.rs:20166-20168`): the block's +> pixel origin and, later, `palette_y.is_some()`. The second is renamed `py_pal` in the same commit as this +> annotation, so a census script cannot silently read the wrong one. + + ## Verdict | claim | before this lane | after | diff --git a/lanes/av1offtile.report.md b/lanes/av1offtile.report.md index e6debc49..5d1daae7 100644 --- a/lanes/av1offtile.report.md +++ b/lanes/av1offtile.report.md @@ -359,53 +359,28 @@ walk never reaches `mi=(80,110)` in a state where the override matters. The chain is strictly ordered: off-tile walk (this lane) -> var-tx conjunct (Agent05-5) -> TXFM_CONTEXT band gap (Agent05-5). -## 6c. Re-measure PROTOCOL for the 640x480 cell (word-for-word with `lanes/av1mixllconj.report.md` §4.3) +## 6c. Re-measure protocol for the 640x480 cell — VERBATIM from `lanes/av1mixllconj.report.md` §4.3 -**Two reports describing the same discriminator in different words is how -outcome 2 gets argued away.** This table is the canonical text; the twin in -`lanes/av1mixllconj.report.md` is byte-identical. Copy it, do not paraphrase it. - -**The pixel run cannot discriminate the two candidate causes.** A green -byte-exact compare against the oracle is EQUALLY consistent with the TXFM band -write being closed and with the forced-`ctx=1` mask doing the work — because -that mask makes the cell exact on its own (§6b: ctx=1 gives 457 907/457 907 -bit-identical without any band change). The pixel run reports the CONSEQUENCE. -The operand pair is the cause, and the pair is readable from rungs that already -exist **before the fix lands**. - -**Earliest discriminator, no decode needed — read the diff first.** A -band-write site touched with `decode_leaf_rect8` untouched settles it: the band -was the cause. The reverse settles the other way: the band was a symptom and -§4.3 was directionally right but causally wrong. - -**Then the operand pair**, re-read on the same two rungs at `mi=(80,110)`: - -```text -oracle EC_TXCTXB mi=80,110 abv=4 lft=8 above=0 left=1 ctx=1 -ours EC_TXCTX mi=80,110 above_txfm=? left_txfm=8 above=? left=true -``` - -| # | `above_txfm` after the fix | `ctx` after the fix | reading | -|---|---|---|---| -| 1 | **4** | **1** (reached on its own) | The band write at `mi=(36,108)` was publishing 16 where libaom has 4. The fix closed the band; the `ctx=1` lock is **retired as a symptom mask** and the chain off-tile walk -> var-tx conjunct -> band gap is confirmed end to end. | -| 2 | **16** | 1 | **The dangerous one.** The fix was in the ctx formula or the arm, the band is still wrong, and the cell's exactness is a MASK, not a repair. A green pixel compare reports this as success. | -| 3 | 4 | not 1 | A further defect remains. The cell should NOT go exact; if it does, another mask is in play. | - -**Assert this, do not log it.** The table's outcomes are an assertion, not a -line a reader has to notice — outcome 2 in particular passes a pixel compare -cleanly, so an assert is the only form that fails loudly. +**Why verbatim and not a paraphrase.** Two reports describing the same +discriminator in different words is how the second outcome gets argued away, and +the second outcome is the one a green pixel compare reports as success. So the +text below is copied character for character from the conjunct report and is the +canonical wording for both. My first attempt at this section paraphrased it and +claimed the two tables were "byte-identical" — **they were not**: the rows +matched in meaning but not in wording, and the claim was false. That is why the +canonical text is theirs and this section defers to it. **Comparison conventions for the run**, so the numbers are comparable with the -ones already in these reports: +ones already in both reports: * Compare on the **convention-free** `EC_SYMR` fields only — `pre[0]`, `pre[1]`, `n`, `s`, `post_rng`. `pre[2]` is a bit counter carrying a per-site constant offset and `cdf0` the 32768-x ICDF mirror; neither is signal. * The third field's regex is **`-?\d+`**, not `\d+`. The oracle prints a - NEGATIVE `pre[2]` on a stream-dependent fraction of lines (211 of this - stream's 457 907; 52 of 96 997 on the 256x128 pin) because it tracks + NEGATIVE `pre[2]` on a stream-dependent fraction of lines — 211 of this + stream's 457 907, 52 of 96 997 on the 256x128 pin — because it tracks bit-counter wraparound. A `\d+` field drops them and the pair count reads - short, which looks like a length mismatch rather than a comparator bug. + short, which presents as a length mismatch rather than a comparator bug. * **Name which override sweep produced any ctx table.** Per-site (keyed on one `lmi`) and global (every site of the category) give different non-answer rows without contradicting: a global override perturbs sites that are not the fork. @@ -414,12 +389,39 @@ ones already in these reports: not the line: the site is the `tx_size_cat0` arm of `fn decode_leaf_rect8`, and a merge moves every line below it. -**Ordering, as evidence rather than sequence.** This lane's fix moved 176x144's -first divergence from read 25 792 to 29 411 and changed **nothing** on 640x480; -Agent05-5's conjunct is what makes `mi=(80,110)` reachable in a state where its -context matters at all. Those two facts are what make the chain ORDERED rather -than merely sequential — and they are also why the operand pair is readable -pre-fix. +**Re-measure protocol — the operand pair, not the pixel run, is the +discriminator.** When the band write lands, a green 640x480 pixel compare +establishes only that the cell is exact; it cannot say WHICH cause closed, +because the ctx=1 lock would produce the same green. Assert on the two rungs +instead, on the same tree, after the fix: + +```text +oracle EC_TXCTXB mi=80,110 abv=4 lft=8 above=0 left=1 ctx=1 +ours EC_TXCTX mi=80,110 above_txfm=? left_txfm=8 above=? left=true +``` + +Three outcomes, and they are genuinely distinct: + +| `above_txfm` after the fix | `ctx` after | what it means | +|---|---|---| +| 4 | 1 on its own | the band write at `mi=(36,108)` was publishing 16 where libaom has 4; the fix closed the band and the ctx=1 lock is **retired** as a symptom mask. This section's chain is confirmed end to end. | +| **16** | 1 anyway | the fix was in the ctx formula or the arm, **the band is still wrong**, and the cell going exact is the mask doing the work rather than a repair. This is the case worth catching: the pixel run alone reports it as success. | +| 4 | not 1 | something else is still there and the cell should NOT go exact. If it does, a further defect is being masked too. | + +This is an ASSERTION, not a log line, precisely because the second outcome is the +one a green pixel compare hides. The cheaper first discriminator is the diff +itself: a band-write site touched with `decode_leaf_rect8` untouched means the +band was the cause; the reverse means the band was a symptom and §4.3 was +directionally right but causally wrong. `git diff --stat` answers it without a +decode run at all. + +**The off-tile link is evidence for the ORDER, not just a step in it.** +`lane-av1offtile`'s chroma-plane walk moved the 176x144 first divergence from +25 792 to 29 411 and changed **nothing at all** on 640x480; the var-tx conjunct +is what made `mi=(80,110)` reachable in a state where its context matters at all +(with base + their clip alone the cell reads 860 431 and no `ctx` value moves it). +Those two facts are what make the chain *ordered* rather than merely +*sequential*, and they are the reason the operand pair is readable now. ## 7. Class sweep