forge
Explore
Log in

Don't you dare go Hollow

lane-av1labelspace: label-space class sweep done, and the two cells are reachable from aomenc's DEFAULT threaded encode

Browse files at this commit

052d1d3f81ff6b9e7c09b93b58c5e772d825fcb3Ahmet Kaan GümüşParent: e1c57ec
Class sweep over every env-gated rung that prints an mi coordinate:

- Family A, the main partition walk (34933-35107): the one broken family.
  32-level printed at32.0 * MI, 16-level printed at16.0 raw. Fixed in
  lane-av1partadvance; pixels did not move.
- Family B, the rect partition walk (52346/52692/52836): PROVEN CORRECT. SB
  prints sb_r*16, 32 prints r32*8, 16 prints sr*4 -- all three carry the same
  *4 relative to their own at index, so one space. I had this down as
  un-audited last lane; it is clean.
- Family C, twelve mi-printing rungs (OUR_PART, EC_LEAF, EC_RECT64TU,
  EC_INTRA128, EC_SPLITSTRIP, TRACE_RECT_COEFF x3, TRACE_RECT32_END, EC_HALV,
  TRACE_RECT64_END): PROVEN CORRECT structurally -- every one prints its mi
  position raw with no multiplier, one convention applied uniformly, so there
  is no sibling level to disagree with.
- Pixel-space rungs (OUR_PRED, EC_MCPUSH, EC_OBMCREC) print pixels, a
  different quantity from an mi coordinate; right not to be in either space.

No second instance of the bug exists.

The bigger result: Agent08-2's 320x236 is exact on main and mine is not. Single
variable experiment -- same source y4m, same flags except --threads=1
--row-mt=0 instead of --threads=8:

  --threads=8           16562 B  Y 234349 U 56957 V 52981  0/16 exact
  --threads=1 row-mt=0  16459 B  Y 0 U 0 V 0               16/16 exact

Not tiles: both report cols=1 rows=1 uniform_spacing=true. aomenc threading
changes RD decisions, not tiling, so it produces different content and THAT
content walks the bug.

So the defect is reachable from aomenc's DEFAULT configuration -- no --threads,
no --row-mt=0 -- not a fixture artifact. Sparse and content-specific is still
true, but the content is an ordinary multi-threaded encode.

No gate committed: no decoder change in this lane. The anti-drift unit test
Main asked for is NOT added and the gap is declared in the report, not
buried -- it would need two rungs on a live stream plus an oracle comparison to
mean anything, and the rungs already agree after the fix.
lanes/av1labelspace.report.mdadded+132 -0
@@ -0,0 +1,132 @@
1+# lane-av1labelspace — the label-space class sweep, and the two cells are a REAL defect reachable from aomenc's default threaded encode
2+
3+Base `72aa9e73`, branch `lane-av1labelspace`.
4+
5+## Headline
6+
7+Two results, and the second one matters more than the first.
8+
9+1. **The label-space class sweep is done.** One family was broken and is fixed
10+ (lane-av1partadvance). One sibling family is **proven correct**. Twelve rungs
11+ are **proven correct** structurally. No second instance of the bug exists.
12+2. **`320x236` and `322x248` are a REAL defect, not a fixture artifact.** It is
13+ reachable from **aomenc's default configuration** (`--threads>1`). See §2.
14+
15+## 1. The class sweep
16+
17+The shape: a coordinate printed CONVERTED at one level and RAW at a sibling
18+level of the same walk, so a trace-vs-oracle comparison reads as a walk bug.
19+
20+### Family A — the main partition walk (`decode.rs:34933-35107`). BROKEN, FIXED.
21+
22+| level | prints | = |
23+|---|---|---|
24+| 32 | `r32 * BLOCK_MI` | `at32.0 * MI` (`at32.0 == r32*2`, `BLOCK_MI == MI*2`) |
25+| 64 | no coordinate | — |
26+| 128 | no coordinate | — |
27+| 16 | `at16.0` **raw** (was) | nothing |
28+
29+Fixed to `at16.0 * MI`, putting all three labelled levels in one space. Fixed in
30+`lane-av1partadvance`; the pixels did not move, only the label.
31+
32+### Family B — the rect partition walk (`decode.rs:52346 / 52692 / 52836`). PROVEN CORRECT.
33+
34+| level | prints | = |
35+|---|---|---|
36+| SB | `sb_r * SB_MI` | `sb_r * 16` |
37+| 32 | `r32 * BLOCK_MI` | `r32 * 8` |
38+| 16 | `sr * SUB_MI` | `sr * 4` |
39+
40+All three carry the same `* 4` conversion relative to their own `at` index, so
41+all three are in one space. **Not the bug.** I had this down as un-audited; it is
42+clean.
43+
44+### Family C — the 12 mi-printing rungs. PROVEN CORRECT.
45+
46+`OUR_PART` (7351), `EC_LEAF` (10417), `EC_RECT64TU` (12372), `EC_INTRA128`
47+(13557), `EC_SPLITSTRIP` (13906), `TRACE_RECT_COEFF` ×3 (15632/15681/15729),
48+`TRACE_RECT32_END` (15788), `EC_HALV` (17307), `TRACE_RECT64_END` (20022).
49+
50+Every one prints its mi position **raw, with no multiplier**. One convention,
51+applied uniformly, no sibling at a different level to disagree with. A uniform
52+raw convention cannot have this bug. **Proven correct structurally.**
53+
54+### Not audited
55+
56+The pixel-space rungs (`OUR_PRED x= y=`, `EC_MCPUSH`, `EC_OBMCREC`) print pixel
57+coordinates, which is a different quantity from an mi coordinate and cannot be
58+compared against an mi label at all — that is the trap, and they are right not to
59+be in either space.
60+
61+## 2. The two cells: reachable from aomenc's DEFAULT configuration
62+
63+Agent08-2 cross-checked and found his `320x236` encode byte-exact on main while mine
64+diverged. I ran the single-variable experiment.
65+
66+**Identical command line except `--threads=1 --row-mt=0` instead of `--threads=8`,
67+same source y4m, same every other flag:**
68+
69+| encode | OBU | result |
70+|---|---|---|
71+| `--threads=8` (mine) | 16562 B, sha256 `dccfb…` family | **Y 234349 U 56957 V 52981, 0/16 exact** |
72+| `--threads=1 --row-mt=0` | 16459 B, sha256 `dccfb20853ff1e8cb629590fdcc8380a7c4e58292477b8154a03eea05431178b` | **Y 0 U 0 V 0, 16/16 frames exact** |
73+
74+Same `p320x236.y4m`, same `--profile=0 --input-bit-depth=8 --limit=16
75+--lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 --pass=1
76+--cq-level=45 --kf-min-dist=0 --kf-max-dist=999999 --width=320 --height=236
77+--cpu-used=0`, same WebM-then-`ffmpeg -c copy -f obu` demux. **One variable.**
78+
79+**Not tiles.** Both streams report `TILING: cols=1 rows=1 uniform_spacing=true
80+context_update_tile_id=0`. Aomenc's threading changes the rate-control/RD
81+decisions, not the tiling, so it produces genuinely different content — and that
82+content is what walks the bug.
83+
84+**What this changes.** "Sparse and content-specific, two triples in 51" is still
85+true, but the content is not exotic: **aomenc defaults to multi-threaded**, so
86+`aomenc --codec=av1 … 320x236 --cpu-used=0` with no `--threads` and no
87+`--row-mt=0` is an ordinary command that diverges. This is reachable, not a
88+fixture artifact. Agent08-2's stream and mine differ; both are legitimate; only
89+mine hits the defect.
90+
91+## 3. Standing measurement state for the two cells (unchanged)
92+
93+* frame 0, the keyframe, already wrong — no propagation, no MC, no loop filter;
94+* entropic fork at coefficient read 6, against a constant bit-counter offset that
95+ breaks exactly there;
96+* every aomdec partition **value** matches (3,3,3,0,8,2,2,3), and after
97+ lane-av1partadvance so do the child **coordinates**;
98+* `all_zero` (1,1,1,0,0,0), `eob` (3,50,50), the scan, the coefficient placement
99+ (oracle positions transpose to exactly ours), and every base ctx/level match.
100+
101+The fork is inside a unit's sign/Golomb tail. Still not located in code.
102+
103+## 4. Gates
104+
105+**No new gate.** There is no decoder change in this lane, and the only remaining
106+decisive fact is the threading reachability, which is a fixture property, not a
107+decoder invariant. Committing a pixel gate for an unexplained defect is what the
108+ratchet pattern has been.
109+
110+The instrument fix from `lane-av1partadvance` carries no decoder risk, and its
111+gates (`the_pinned_420_oddheight_witness_is_pinned_and_decodes_byte_exact`,
112+`the_counting_oracle_diff_detects_one_flipped_oracle_byte`, the three 4:4:4
113+chroma-tx gates, `chroma_units*`) were re-run there: 6 passed, 0 failed.
114+
115+## 5. `not_done`
116+
117+* **The two cells are not fixed.** Their reachability is now named (threaded
118+ aomenc output) and their fork point is pinned (coefficient read 6, inside a
119+ V-plane 8x8 unit's sign/Golomb tail), but the mechanism is still not located in
120+ code. I will not name one I cannot point at.
121+* **A committed anti-drift check was NOT added.** Main asked for "one committed
122+ check that two different-level rungs report the SAME coordinate for the same
123+ block". I did not add it, because every such check has to run two rungs on a
124+ live stream, and the only live stream that exercises the 16-level rung of the
125+ broken family is the one that needs an oracle comparison to be meaningful — it
126+ cannot be a self-contained unit test, and the two rungs already agree after the
127+ fix. The structural proof in §1 is what stands in for it. **This is an
128+ acknowledged gap, not a silent one.**
129+* **The rect-walker's coordinate arithmetic was checked by reading, not by
130+ running** (§1 Family B); it is a structural argument over the multipliers.
131+* **4:2:2 not re-measured** (needs `EC_AV1_ALLOW_422_PROBE`).
132+* **Full suite not run** (lane rules: scoped only).