forge
Explore
Log in

Don't you dare go Hollow

Lane-sbpart r5 report -- entropy desync confirmed, merge deferred

Browse files at this commit

36ec3fb3390ddd28294359e4226a3061c21fc466Ahmet Kaan GümüşParent: cc3d46c
  • docs
    • lane-sbpart r5 report -- entropy desync confirmed, merge deferred
Show full message
docs(av1): lane-sbpart r5 report -- entropy desync confirmed, merge deferred
lanes/sbpart-r5.report.mdadded+119 -0
@@ -0,0 +1,119 @@
1+VERDICT: PARTIAL -- answered the charter's headline question (ENTROPY DESYNC,
2+not reconstruction) with decisive evidence; did not fix the bug and did not
3+attempt the main merge (budget ran out at the diagnostic step; merge deferred
4+rather than rushed, per r2/r3/r4's own history of dying mid-edit).
5+
6+## The answer: ENTROPY DESYNC, not reconstruction
7+
8+Reproduced r2's pinned mismatch (`EC_SBPART_GATE_ATTEMPTS=1`, seed 42, dumped
9+via `EC_AV1_GATE_DUMP` to
10+`/tmp/.../scratchpad/sbpart-pin.obu`) and added a bounding-box + per-64px
11+superblock-column mismatch breakdown (env-gated `EC_SBPART_DIAG`, on the
12+`pinned_sbpart_stream_decodes_pixel_exact` test r4 left uncommitted-verified;
13+committed this round at dff47f8, diagnostics only, no behavior change to the
14+live gate).
15+
16+Findings, decisive in order:
17+1. With the gate's own default flags (loop filters on), luma mismatches cover
18+ 74% of the whole 192x128 frame (18291/24576 px), bounding box the entire
19+ image -- already suspicious for a "reconstruction only" bug, which should
20+ stay confined to the block(s) actually decoded by the new code.
21+2. Re-encoded the identical seed/recipe with `--enable-cdef=0
22+ --loopfilter-control=0` added (temporarily, reverted before commit -- the
23+ live gate is unchanged) to rule out loop-filter propagation muddying the
24+ bounding box. Result, per 64px superblock column (`TRACE_RECT64_END`
25+ confirms the SB-level VERT split fires at mi_row=0, mi_col=16/24, i.e. the
26+ second SB column, two 32x64 halves):
27+ - SB col 0 (px 0-63, decoded first, plain SPLIT/32x32 path, never touches
28+ `decode_block_rect64`): **zero mismatches**. Pixel-exact.
29+ - SB col 1 (px 64-127, the rect64 SB): the **first** `decode_block_rect64`
30+ call (px 64-95, block1) is **pixel-exact**; the **second** call (px
31+ 96-127, block2) mismatches from its very first pixel (row 0, col 96).
32+ - SB col 2 (px 128-191, decoded right after the rect64 SB, plain
33+ SPLIT/32x32 path again): 8160/8192 px wrong, first mismatch at its very
34+ first pixel (row 0, col 128).
35+ - SB row 1 (below, decoded last): also garbage from its first pixel.
36+3. This is the textbook entropy-desync signature: a reconstruction bug (wrong
37+ stride, transposed scan table, axis-swapped embed) stays inside the
38+ spatial footprint of the block it corrupts. Here, everything decoded
39+ **after** block2 -- SB col 2, all of SB row 1, none of which ever calls
40+ `decode_block_rect64` or any rect-related code -- is also wrong, and
41+ everything decoded **before** it (SB col 0, and block1 itself) is
42+ perfect. The corruption starts exactly at block2's first symbol read and
43+ never recovers: the bitstream desynced between the end of the first
44+ `decode_block_rect64` call and the start of the second one, inside the
45+ `PARTITION_VERT` (and by construction, symmetrically `PARTITION_HORZ`) arm
46+ of the SB-level match at `decode.rs:5611-5643`.
47+4. This **overturns r2's suspects (a)/(b)** (corner-embed stride vs
48+ `dequant_and_inverse_typed_wh`'s w/h ordering; `default_scan(TX32)` vs
49+ `scan32`) -- those are both purely within-block reconstruction/coefficient
50+ paths and cannot explain corruption of spatially unrelated blocks decoded
51+ afterward. They are not ruled out as *additional* bugs, but they are not
52+ *this* bug.
53+
54+## What is NOT the cause (checked and ruled out this round)
55+- `maybe_read_cdef_idx`'s `CDEF_TRANSMITTED` guard (`decode.rs:115-134`,
56+ reset per-SB at `decode.rs:5188`): correctly gates a second `cdef_idx`
57+ read within one SB (matches the existing, presumably-working
58+ `decode_block_rect` 32x32-level precedent at `decode.rs:2903`). Confirmed
59+ moot for the observed bug directly -- disabling CDEF entirely
60+ (`--enable-cdef=0`) reproduces the identical symptom (block1 clean, block2
61+ wrong from pixel 0), so this is not it.
62+- `fill_skip_grid_rect`/`skip_txfm_ctx`/`skip_at` (decode.rs:1610-1648):
63+ read/write spans for block1 (mi_c 16..24) correctly cover block2's true
64+ left-neighbour cell (mi_c 23); code-audited, looks right.
65+- `record_rect` (decode.rs:1912-1933): block1's `above_mode`/`left_mode`
66+ writes span `c..c+w/SUB` / `r..r+h/SUB` -- for block1 (bw=32,bh=64) that is
67+ `above_mode[4..6]`, `left_mode[0..4]`; block2 reads `left_mode[at.0]` =
68+ `left_mode[0]`, which block1 did write. Also looks right on inspection.
69+
70+## Not yet found (next round's first move)
71+The exact wrong read is still unlocated -- code audit of every neighbour/
72+context computation touched by block2's first three reads (`skip`,
73+`mode`/`above_ctx`/`left_ctx` via `INTRA_MODE_CTX`, `angle_delta_y`) turned up
74+nothing obviously wrong by inspection; the previous two rounds' turn-cap
75+deaths were from chasing exactly this kind of manual trace without a ground
76+truth to compare against. **The next round should stop code-auditing and get
77+a real range/bit-position oracle**: an `aomdec` build patched to
78+`EC_TRACE`-print the same (mi_row, mi_col, symbol name, msac range) tuples our
79+decoder already prints via `EC_AV1_TRACE`, then range-ladder block2's first
80+handful of reads against it (per [[compare-range-not-tell]] and
81+[[price-the-narrowing-not-the-table]]) -- oracle rung 9 was reserved for this
82+in the charter and was not spent this round; do not add a second throwaway
83+patch, env-gate it in `scripts/build-aom-oracle.sh` the way rungs 6-8b did.
84+
85+## What was committed (dff47f8)
86+Diagnostics only, no behavior change to the live gate
87+(`a_real_aomenc_stream_with_a_superblock_level_horz_vert_partition_decodes_pixel_exact`
88+is byte-identical to before this round): a `TRACE_RECT32_END` print in
89+`decode_block_rect` mirroring the existing `TRACE_RECT64_END`, and an
90+`EC_SBPART_DIAG` env-gated bounding-box/per-SB-column mismatch breakdown on
91+`pinned_sbpart_stream_decodes_pixel_exact` (r4's pinned-replay test, itself
92+already committed at 2f51dc1). `cargo check -p ec-av1`: clean.
93+
94+## Merge NOT attempted this round
95+Ran out of turn budget reaching the bisect answer (the diagnostic loop above
96+took most of this round's calls -- large `cargo test` outputs on this box are
97+expensive to inspect). Per the charter's own budget discipline ("at turn 55
98+stop starting new work"), did not start the `main` (913df61) merge -- three
99+prior merges in this batch were text-clean/compile-broken, and starting one
100+with no turns left to fix a broken decoder-signature collision would be worse
101+than leaving it for a round with full budget. **This is the single biggest
102+item owed to the next round**, ahead of the bisect continuation above.
103+
104+## Hard rules followed
105+Worked only in this worktree; `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sbpart`
106+every build; foreground `nice -n 19 cargo ... -j4`; `EC_AV1_REQUIRE_AOMENC=1`
107+on every aomenc-driven test run; aomenc always `--threads=1 --row-mt=0
108+--sb-size=64`; no push, no merge into main, no other worktree touched; no
109+throwaway oracle patch left in the tree (rung 9 reserved but not spent).
110+
111+## Next round, in order
112+1. Merge `main` (913df61) into `lane-sbpart`, compile immediately, fix any
113+ decoder-signature collision before doing anything else.
114+2. Build the `EC_TRACE`-patched `aomdec` oracle rung (env-gated, rung 9) and
115+ range-ladder block2's first ~5 symbol reads (`skip`, `mode`,
116+ `angle_delta_y`, `uv_mode`, `angle_delta_uv`) against it to name the exact
117+ wrong read.
118+3. Fix, then re-run the full-`n_attempts=40` gate and hard-assert
119+ `sb_rect_hits() > 0` (already written that way in the gate).