forge
Explore
Log in

Don't you dare go Hollow

R2 report -- phase table, two twin-drift root causes, entropy ladder 570/570, open pixel residue

Browse files at this commit

969c1b9a5f2d2e2d1a66948db86e7f1a2e268a8bAhmet Kaan GümüşParent: db58f21
  • docs
    • r2 report -- phase table, two twin-drift root causes, entropy ladder 570/570, open pixel residue
Show full message
docs(interp3): r2 report -- phase table, two twin-drift root causes, entropy ladder 570/570, open pixel residue
lanes/interp3-r2.report.mdadded+88 -0
@@ -0,0 +1,88 @@
1+# lane-interp3 r2 -- the compound 8x8 leaf's ENTROPY desync is closed (two twin drifts); gate now RED on a small luma reconstruction residue
2+
3+Base: b702853 (r1) + `git merge main` (4eff3a1, brings lane-mvtwin's mvstack fixes).
4+Merge diffstat: `crates/ec-av1/src/mvstack.rs`, `crates/ec-av1/src/stream.rs`,
5+`lanes/mvtwin-r1.report.md` only -- `cdf.rs` untouched by either side (byte-compare
6+trivially clean), no fixtures churn, no conflicts.
7+
8+## Phase table -- libaom `read_inter_block_mode_info` (decodemv.c ~1400-1600)
9+
10+`IB` = `decode_inter_block` compound arm, `L8` = `decode_inter_block8` compound arm
11+(both in `crates/ec-av1/src/decode.rs`; line numbers are this commit's).
12+
13+| # | phase (libaom) | IB | L8 | verdict |
14+|---|---|---|---|---|
15+| 1 | `skip_mode` (ctx = above+left skip_mode) | 16363 | 19087 | matches |
16+| 2 | `skip` | 16375 | 19093 | matches |
17+| 3 | cdef / delta_q / delta_lf | 16377-16382 | (16x16 slot's, per this fn's doc) | matches (leaf never a delta root) |
18+| 4 | `is_inter` (`intra_inter_ctx`) | 16389 | 19105 | matches |
19+| 5 | `comp_mode` (`read_comp_mode`, ref-count ctx) | 16475 | 19147 | matches (`skip_mode \|\| (reference_select && ...)` vs `reference_select \|\| skip_mode` then `skip_mode \|\| ...` -- same predicate) |
20+| 6 | `read_ref_frames`: `comp_ref_type`, uni/bi trees | 16480 | 19151 | **DIFFERENT -> FIXED**: L8 passed a hard-coded `LAST_FRAME` (or `-1`) as the above/left reference; IB passes the real `neighbours.above_ref[cmi]`/`left_ref[rmi]` |
21+| 7 | `av1_find_mv_refs` (`find_mv_stack_compound`, sign bias + gm table + tpl) | 16519 | 19195 | matches (L8's doc comment claiming "no sign-bias table nor tpl_frame" is stale -- both are passed) |
22+| 8 | `compound_mode` CDF (`COMPOUND_MODE_CTX_MAP`) | 16532 | 19205 | matches |
23+| 9 | drl + `read_mv` per ref (`assign_compound_mv`, has_nearmv/have_newmv rules) | 16537 | 19226 | matches (one shared fn) |
24+| 10 | `interintra` | n/a compound | n/a | matches (never read on compound -- correct) |
25+| 11 | `read_motion_mode` | n/a compound | n/a | matches (`has_second_ref` -> SIMPLE_TRANSLATION) |
26+| 12 | `comp_group_idx` (neighbour ctx) | 16675 | 19263 | matches |
27+| 13 | `compound_type` -> wedge idx+sign / diffwtd `mask_type` | 16710 | 19279 | matches |
28+| 14 | `compound_idx` (distance-weight ctx) | 16936 | 19310 | matches |
29+| 15 | `read_mb_interp_filter` (after `read_compound_type`; suppressed by `skip_mode` / `is_nontrans_global_motion`; `get_ref_filter_type` on ref0 matching EITHER neighbour ref) | 16980 | 19383 | matches (landed r1) |
30+| 16 | tail: grid `MiInfo` stamp -- per-slot `is_global_mv_block` | 16577+16660 | 19424 | **DIFFERENT -> FIXED**: L8 stamped `is_global_mv0/1 = false` unconditionally |
31+| 17 | tail: `record_inter_rect_mi` + `record_compound_ctx_rect_mi` (skip/skip_mode/inter/ref/ref1/filter/comp_group_idx/compound_idx bands) | 18870 | via `compound_ctx8` + caller, 19000 | matches -- verified by the range ladder staying exact for the whole stream |
32+
33+Root causes 6 and 16 are the round's fix. Both are the same class the charter named
34+(twin functions drift), and both are invisible to any value-only check: (6) changes a
35+CDF ROW, (16) changes a LATER block's mv-stack composition.
36+
37+## Changed (path:line)
38+
39+- `crates/ec-av1/src/decode.rs:19151` -- `read_compound_ref_frames` now gets
40+ `above_ref0`/`left_ref0` (the per-mi bands the leaf already reads at 19078-19081)
41+ instead of `LAST_FRAME`/`-1`. `-1` on an unavailable band is `start_tile`'s /
42+ `start_row`'s own reset value, so no `has_above` guard is needed (IB has none either).
43+- `crates/ec-av1/src/decode.rs:19410` -- the leaf's grid stamp computes libaom's
44+ per-slot `is_global_mv_block` (mode `GLOBAL_GLOBALMV`, that slot's gm model >
45+ TRANSLATION; the >= 8x8 size predicate is always true for this leaf).
46+- `crates/ec-av1/src/decode.rs:19726` -- the leaf's SINGLE-ref arm prints the same
47+ per-entry `EC_STACK` ladder `decode_inter_block`'s single-ref arm prints (this is
48+ the instrument that isolated cause 16).
49+- `crates/ec-av1/src/stream.rs:6315` -- the gate's ignore reason + comment replaced
50+ with this round's measurement (entropy closed, pixel residue open).
51+
52+## Gate: still RED, still `#[ignore]`d -- but on a different, much smaller failure
53+
54+`a_real_aomenc_dual_filter_obmc_8x8_inter_sequence_decodes_pixel_exact`
55+(`--enable-dual-filter=1 --enable-obmc=1 --enable-warped-motion=1
56+--enable-onesided-comp=1`, `--min-partition-size=8 --enable-ab-partitions=0
57+--enable-1to4-partitions=0`, 16 frames, 64x64).
58+
59+- r1: decode STOPPED at a bogus refusal at frame 5 (0 frames ever compared).
60+- r2: the whole 16-frame stream parses; the failure is now
61+ `frame 7 mismatch vs ffmpeg` -- a reconstruction residue, luma-only,
62+ |delta| <= 8, first sample (42,15) inside/around the 8x8 leaf at mi (10,4),
63+ spilling 1 px across that leaf's left and bottom deblock edges. It grows by pure
64+ propagation to 222 Y + 4 U + 1 V samples at frame 15 (chroma stays exact until
65+ frame 14).
66+
67+EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/{aom16.trace,ours16e.trace} | `EC_TRACE_MODE=1 aomdec --rawvideo` and `EC_TRACE_MODE=1 decode_probe` on the pinned 16-frame stream, `diff` of every `EC_MODE`/`EC_MODE_VAL` line (mi + msac RANGE, never tell) | 570 vs 570 elements, diff EMPTY, no refusal (before the fix: ours stopped at 347 elements, first RANGE divergence at the 8x8 leaf mi (8,8), stack 3 entries vs libaom's 2)
68+EVIDENCE: same dir, `pin.obu` (EC_INTERP3_FRAMES=5) | ladder before fix 1 | ours read refs (LAST,LAST2) + NEW_NEWMV at leaf mi (10,2) where aomdec reads (LAST,GOLDEN) + NEAREST_NEARESTMV -- the two differ only in a CDF row of `uni_comp_ref`
69+EVIDENCE: same dir, `mm.{aom,ours}.yuv` | `aomdec --rawvideo` vs `decode_probe` on the pinned mismatch stream, per-frame per-plane sample compare | frames 0-6 byte-exact; frame 7: 36 Y / 0 U / 0 V wrong, max |delta| 5; frame 15: 222 Y / 4 U / 1 V, max |delta| 8
70+
71+## Refusals
72+
73+None lifted this round (the r1 refusal `an OBMC neighbour whose interp filter was
74+never recorded` stays; `refusal_inventory` unchanged). Two refusals this stream used
75+to hit -- `an inter 16x16-level AB or 1:4 partition` and `an inter partition below
76+8x8` -- were our own desync (class refusal-from-own-desync) and no longer fire on it.
77+
78+## Residue
79+
80+- fix-now(next round): the luma reconstruction residue above. First suspect is the
81+ OBMC blend over a COMPOUND neighbour -- the leaf now records a real filter pair
82+ where it used to record the `[3,3]` sentinel, and the oracle's `EC_OBMC` rung
83+ prints `nbmv`/`nbref`/`nbbsize`/`filt` per neighbour while THIS decoder has no
84+ `EC_OBMC` emitter at all. Build that emitter first (instrument-before-excuse), then
85+ diff the 325 oracle `EC_OBMC` lines of `mm.obu` against ours.
86+- deferred(needs that fix): the gate's counter asserts (compound-8x8 filter reads,
87+ dual-filter differing directions, 8x8 OBMC blends) are never reached while the
88+ pixel compare fails first; the 10-bit arm; a `--tile-columns=1` arm.