forge
Explore
Log in

Don't you dare go Hollow

Merge lane-av1oddgolomb: candidate 1 REFUTED -- the fork points at the 32x32 SPLIT child advance (report only)

Browse files at this commit

f7f488f1e0ceb1977fbc28c032a06dd5ba01fa35Ahmet Kaan GümüşParent: 9f86b7c46f2dab
The sign/Golomb tail I sent this lane to chase is a CONSEQUENCE, not the cause. Partition VALUES are
identical on both sides (3, 3, 3, 0, 8, 2, 2, 3) and contexts agree, so the entropy decisions are
right. What differs is the CHILD COORDINATE after step 3, a PARTITION_SPLIT at BLOCK_32X32: libaom's
four 16x16 children sit at mi(0,0), mi(0,4), mi(4,0), mi(4,4) (16-px offsets) while our trace reads
them at mi(0,0), mi(0,1), mi(1,0), mi(1,1). Step 8 still agrees (mi(0,8), the 32x32 sibling 32 px
away), so the 32x32-level advance is CORRECT and only the 16x16-level advance is in question.
Mechanism for the 312 bits: after our V-plane unit's eob=50 our trace goes straight to a dequant, a
partition_w16 and an EC_PAL palette block with NO dc_sign/golomb for that unit, while libaom reads a
full sign/Golomb tail for the same eob -- the two sides read different symbol streams from there on.
Ruled out unchanged: walk order within a block, all_zero, eob, the scan, coefficient placement, base
ctx/levels, every partition value.
NO code change and NO gate committed: the lane declined to ratchet a mechanism it had not located in
code, which is the right call. The line-level decision is the next lane's first task.
lanes/av1oddgolomb.report.mdadded+118 -0
@@ -0,0 +1,118 @@
1+# lane-av1oddgolomb — the deciding measurement: candidate 1 is REFUTED, and the real fork is the partition walk's child advance
2+
3+Base `0224d10c`, branch `lane-av1oddgolomb`. **No code change.**
4+
5+## Verdict
6+
7+**Candidate 1 (sign / Golomb tail) is refuted, and it is refuted by the
8+partition walk, not by the tail.** Every partition VALUE matches the oracle
9+symbol-for-symbol. The fork is that after a 32x32 `PARTITION_SPLIT`, our decoder
10+advances its 16x16 children by **4 px** where libaom advances by **16 px**. That
11+is the whole of the 312 bits: our walk re-enters the interior of the block it just
12+decoded, where it then reads a `PARTITION_HORZ_4`, a `TRACE_RECT_PREFI` and a whole
13+palette block that libaom never reads at that point.
14+
15+## 1. Red-before + control (unchanged from lane-av1oddluma)
16+
17+| cell | Y | U | V | exact |
18+|---|---|---|---|---|
19+| `320x236` | 234349 | 56957 | 52981 | 0/16 |
20+| `322x248` | 36286 | 13359 | 13001 | 0/16 |
21+
22+`EC_FLIP` byte 0 → `+1 Y` on each. Frame 0 (keyframe) already wrong on both.
23+
24+## 2. The measurement
25+
26+Oracle `EC_TRACE` (`EC_PART` / `EC_PART_VAL`) against our `EC_AV1_TRACE`
27+(`TRACE partition_w128 / w64 / w32 / w16`), frame 0, in order:
28+
29+| # | oracle (mi in 4-px units) | value | ours | value |
30+|---|---|---|---|---|
31+| 1 | mi(0,0) bsize=15 | 3 | `partition_w128 ctx=0` | 3 |
32+| 2 | mi(0,0) bsize=12 | 3 | `partition_w64 ctx=0` | 3 |
33+| 3 | mi(0,0) bsize=9 | 3 | `partition_w32 mi=(0,0)` | 3 |
34+| 4 | mi(0,0) bsize=6 | 0 | `partition_w16 mi=(0,0)` | 0 |
35+| 5 | **mi(0,4) bsize=6** | **8** | **`partition_w16 mi=(0,1)`** | **8** |
36+| 6 | **mi(4,0) bsize=6** | **2** | **`partition_w16 mi=(1,0)`** | **2** |
37+| 7 | **mi(4,4) bsize=6** | **2** | **`partition_w16 mi=(1,1)`** | **2** |
38+| 8 | mi(0,8) bsize=9 | 3 | `partition_w32 mi=(0,8)` | 3 |
39+
40+**Every value matches: 3, 3, 3, 0, 8, 2, 2, 3.** The entropy decisions are right
41+and the context is right (`tell`/`rng` agree up to the walk error).
42+
43+Step 3 is `PARTITION_SPLIT` at `BLOCK_32X32`, whose four 16x16 children in libaom
44+sit at 16-px offsets: mi(0,0), mi(0,4), mi(4,0), mi(4,4). Ours reads them at
45+mi(0,0), mi(0,1), mi(1,0), mi(1,1) — **1 mi = 4 px** of stride where there must be
46+4 mi = 16 px.
47+
48+Step 8 agrees (`mi(0,8)` both sides, the 32x32 sibling 32 px away), so the
49+**32x32-level advance is correct and the 16x16-level advance is not.** The bug is
50+in the child-advance of one partition arm, not in the whole walk.
51+
52+### Why this is the 312 bits
53+
54+Immediately after our V-plane unit's `TRACE eob value=50` our trace goes straight
55+to
56+
57+```
58+TRACE dequant plane=2 base_q_idx=21 tx_type=DctDct side=8 levels=[0, 0, 1, 0, …]
59+TRACE partition_w16 mi=(0,1) ctx=0 value=8
60+TRACE_RECT_PREFI mode=12 uv_mode=0 … rng=57864
61+EC_PAL row=0 col=0 ctx=-1 n=2 rng=57864
62+```
63+
64+— no `TRACE dc_sign` / `TRACE golomb` lines for that unit at all. Meanwhile
65+libaom, for the SAME `eob=50`, reads a full `tag=sign` / `tag=post_golomb` tail
66+(`c=3,4,5,12,47,49` at level 1, then `c=0 sign=1 dcctx=2 level=4`).
67+
68+So the sign/Golomb difference I was chasing is a **consequence**: libaom's walk
69+leaves the mi(0,0) leaf for mi(0,4), while ours stays inside it, and the two then
70+read completely different symbol streams. The tail is not where the bits are lost.
71+
72+## 3. The site, and what is still owed
73+
74+The named site is **the child-advance after a `PARTITION_SPLIT` at
75+`BLOCK_32X32` in `crates/ec-av1/src/decode.rs`'s partition walk** — the code that,
76+on reading a 32x32 partition symbol, steps its 16x16 child cursor. The 16x16-level
77+advance must be the block's own 16-px mi stride (4 mi), not 1 mi.
78+
79+**Deciding measurement still owed before any edit** (one `grep` + one read, which I
80+ran out of budget for): find the `PARTITION_SPLIT` arm that advances a 32x32
81+cursor, and compare its stride against the `PARTITION_HORZ`/`VERT` arms of the same
82+function, which step 32x32 correctly. The suspicion is one stride expression
83+computed from the wrong block size (the parent's 32 instead of the child's 16, or
84+a `BLOCK_32X32` constant where the child's `mi_size_wide` belongs). **I have not
85+located the line and I am not editing blind.**
86+
87+Note the entropy is still exact through the wrong walk — every partition value
88+matched — which means the decoder does not detect the mis-step. That is why it is
89+silent rather than a corruption.
90+
91+## 4. Sweep — no trigger rule claimed
92+
93+27-cell grid: 25/27 exact; `320x236` and `322x248` fail. The extended grid
94+(heights 260/264/268/272, widths 318/326/330, 12 more encodes, all on disk in
95+`/tmp/h232fix`) was **not** swept this lane — I am not quoting numbers I did not
96+measure. The "dimension not a multiple of 8" hypothesis remains **FALSE**
97+(324 is 4 mod 8 and `324x240` is exact; 236 is 4 mod 8 and `320x236` fails).
98+
99+## 5. Class sweep (which other arms carry the same derivation)
100+
101+Unmeasured, and therefore not claimed: I established that the 32x32-level advance
102+is correct and the 16x16-level one is not **for `PARTITION_SPLIT` at
103+`BLOCK_32X32` on `320x236`**. I did not sweep the other partition types
104+(`HORZ`/`VERT`/`HORZ_A`/`HORZ_B`/`VERT_A`/`VERT_B`/`HORZ_4`/`VERT_4`) or the other
105+block sizes, and the correct ones among them are not identified. Whoever fixes this
106+should gate it with the partition census (`crate::census`) rather than assume the
107+sibling arms are right.
108+
109+## 6. `not_done`
110+
111+* **Not fixed.** No decoder change; the tree matches `0224d10c`.
112+* **The exact line is not located.** §3 names the arm, not the expression.
113+* **No gate committed.** A gate cannot be written until the fix lands, and I will
114+ not commit a ratchet for a mechanism I have not identified in code.
115+* **Extended grid not swept** (§4); fixtures are on disk.
116+* **Other partition arms not surveyed** (§5).
117+* **4:2:2 not re-measured** (needs `EC_AV1_ALLOW_422_PROBE`).
118+* **Full suite not run** (lane rules: scoped only).