forge
Explore
Log in

Don't you dare go Hollow

ec-av1: lane-av1-422g report -- split4 never reached on t422, stop line decode.rs:14888

Browse files at this commit

a43f8627d3afb1ff16953483c298d1ce3d9c1d21Ahmet Kaan GümüşParent: 6130e75
lanes/av1422g.report.mdadded+102 -0
@@ -0,0 +1,102 @@
1+# lane-av1-422g — sub-8 even-column chroma-ref arm; STOP: split4 is never reached on t422
2+
3+## Outcome
4+
5+STOP with the 4:2:2 header refusal in place, byte-identical (the local
6+`EC_AV1_ALLOW_422_PROBE` bypass was reverted before commit; the probe refuses
7+without the env — `frames_dispatched: 0`). The even-column chroma-reference
8+arm for ss (1,0) is in `decode_leaf_split4` per the parent's rule
9+(`is_chroma_ref = !(mi_col & ss_x)`, one TX_4X4 chroma unit per plane per
10+even-column leaf, 4:2:0 keeps its single bottom-right leaf), but it is
11+UNPROVEN and — the round's real finding — UNREACHABLE on this fixture:
12+
13+the frame-0 partition walk never takes an 8x8 `PARTITION_SPLIT`. An
14+`EC_AV1_TRACE` probe printed **zero** split8 group entries before the run
15+dies at `decode_rect4_16_strip`'s closed-shape panic. Our trace is
16+byte-identical to 422f's (modulo pid), so the divergence 422f attributed to
17+the mi(9,10) sub-8 chroma begins EARLIER: by the time the walk reaches the
18+8x8 at mi(8,10), ours reads a partition value that is not SPLIT, while the
19+oracle's own trace decodes four 4x4 leaves at mi(8,10)/(8,11)/(9,10)/(9,11).
20+Per instruction 2 the named stop line is:
21+
22+ crates/ec-av1/src/decode.rs:14888 — unreachable!("decode_rect4_16_strip chroma shape set is closed")
23+
24+reached with chroma shape `(16, 64)` off a `luma=32x64 tx=16x16` strip (the
25+`EC_RECTCHROMA_GAP luma=32x64 tx=16x16 chroma=16x64` diagnostic prints right
26+before the panic; the 16 prints of `luma=16x8 → chroma=8x8` earlier are the
27+4:2:2 square rows downstream and are harmless). decode_rect4_16_strip was not
28+edited; that panic is the next lane's gate, not this one's fix.
29+
30+## Change (decode.rs + decode_probe.rs only)
31+
32+- `decode_leaf_split4`: `has_chroma` now branches per subsampling — 4:4:4
33+ every leaf, 4:2:2 `(lmi.1 & 1) == 0` (every even-mi-column leaf), 4:2:0
34+ `i == 3` unchanged. A `chroma_422` flag (ss_x 1, ss_y 0) and a
35+ `last_uv422` coarse-slot value were added; the group tail gained a 4:2:2
36+ branch that only fills `above_uv_mode`/`left_uv_mode` from the group's
37+ last chroma-reference leaf (bottom-left), and the tail's chroma state
38+ stamp is skipped at 4:2:2 (the per-leaf units already stamped).
39+- New `sub8_leaf_chroma422` (beside `sub8_leaf_chroma444`): one square
40+ TX_4X4 chroma unit per plane at the chroma position
41+ (`px >> ss_x`, `py >> ss_y`) — `ss_size_lookup[BLOCK_4X4][1][0]` is
42+ BLOCK_4X4, so the (2,4) plane area rounds up to the square 4x4 read — via
43+ `read_plane`'s proven `TxbSet::Chroma4` + `TX4` route, with
44+ `Neighbours::around_mi_422_chroma(lmi, 8, 4)` context reads (the unit's 4
45+ chroma-px width spans TWO luma mi columns; sampling every second above
46+ cell counts each chroma column once), `cfl_src_rect(px, py, 8, 4)` CfL
47+ source, skip arm (predict-only, intrabc-slot disarm counted), intrabc arm
48+ (frame copy at the DV with the ss shifts), and per-leaf entropy stamping
49+ (1 mi row tall, both luma mi columns of the one chroma column).
50+- New `CHROMA422_SUB8_HITS` witness counter, bumped only on the two
51+ coefficient-reading arms (skip does not count); printed as
52+ `chroma422_sub8` by `examples/decode_probe.rs`.
53+- Untouched: `decode_leaf8`, `decode_rect4_16_strip`, `decode_block_128rect`,
54+ `decode_rect_split`, the 4:2:0 group tail (including its SKIP arm at
55+ decode.rs:19169-19170 — the sibling-owned flat-DC miss), the square-block
56+ selection arm, `stream.rs` (bypass reverted; refusal string
57+ byte-identical), `refusal_inventory.rs`.
58+
59+## Measurement
60+
61+Fixture `/tmp/t422.obu`, sha256
62+`d3fa4beeb1309033e4a03f5ae5c431c8fa8386ba1ada088684710423c7938129` (reused
63+by hash, 256x144, 22 frames). Ours `decode_probe` (debug, gate-counters,
64+private target dir) with the LOCAL env bypass; oracle traces from 422f left
65+at /tmp/oracle422.txt.
66+
67+- **Reach probe**: with `EC_AV1_TRACE=1`, a temporary per-group print in
68+ `decode_leaf_split4` (since removed) fired ZERO times before the panic —
69+ split4 never runs on this stream; the arm cannot fire, and the
70+ `chroma422_sub8` counter reads 0 for the trivial reason.
71+- **Trace identity**: our full run (stderr trace, 13029 lines) is
72+ byte-identical to 422f's /tmp/ours422f.txt except the panic line's thread
73+ id — the 422g changes do not alter the trajectory, confirming the
74+ pre-split8 divergence.
75+- `cargo check -p ec-av1` (private target dir): 0 warnings.
76+- 420 gate green: `a_real_aomenc_stream_with_a_skipped_8x8_intra_leaf_
77+ whose_tx_split_decodes_pixel_exact` 1/1 passed (`cargo test -p ec-av1
78+ --lib`); all new arms are keyed on ss (1,0), unreachable at 4:2:0/4:4:4.
79+
80+## Next divergence (restated, for the lane that owns the walk)
81+
82+The first live defect is UPSTREAM of sub-8: between the last symbol-level
83+match (mi(8,0) 8x8 leaf's V) and the mi(8,10) 8x8, ours mis-reads the 8x8
84+partition symbol (oracle SPLITs, we do not), and the desynced walk later
85+lands on the 32x64 strip whose 16x64 chroma has no table row (panic above).
86+Two candidate sites for whoever picks this up: the partition-symbol context
87+feeding `partition_w8` after an 8x8 leaf run (422f's tail bookkeeping
88+changed side_mi/partition ctx for the following sibling), or an 8x8-leaf
89+chroma/context read that consumes the wrong rng count and shifts every later
90+partition read. Note the rect split4 sibling (the 8x16/16x8 group walker
91+with `bw`/`bh` args, ~decode.rs:20500) has the same 4:2:0-style chroma and
92+will need the same even-column treatment once the walk reaches any rect sub-8
93+group at 4:2:2.
94+
95+## State
96+
97+- Refusal `a chroma format of 4:2:2 (subsampling_x != subsampling_y)...`
98+ byte-identical; `git diff` touches only decode.rs and decode_probe.rs;
99+ probe refuses without the env (frames_dispatched: 0).
100+- Committed on lane-av1-422g (5e163e94). No push.
101+- Traces left at /tmp/ours422g_trace.txt (EC_TRACE_COEFF run) and
102+ /tmp/ours422g_t2.txt (EC_AV1_TRACE reach run).