forge
Explore
Log in

Don't you dare go Hollow

Lane-gm r6 report -- multi-slot ROTZOOM refusal root-caused and lifted

Browse files at this commit

b7f796ce8157cd0b1adbd79565979e978389e04dAhmet Kaan GümüşParent: 43e5d8c
  • docs
    • lane-gm r6 report -- multi-slot ROTZOOM refusal root-caused and lifted
Show full message
docs(av1): lane-gm r6 report -- multi-slot ROTZOOM refusal root-caused and lifted
lanes/gm-r6.report.mdadded+92 -0
@@ -0,0 +1,92 @@
1+VERDICT: FIXED. Root cause: the single-reference mv-stack predictor (`mvstack.rs`
2+`find_mv_stack_with_sign_bias`) fell back to `(0, 0)` when the real neighbour scan came up
3+short of `MAX_MV_REF_CANDIDATES` (2) entries, instead of libaom's real fallback -- this
4+querying block's OWN global motion vector for its ref frame (`gm_get_motion_vector`, i.e.
5+`gm_mv(gm, ref_frame)`). The bug was invisible for every stream tested before this round
6+because a live ref's global motion was always identity/translation there (whose gm mv is
7+itself `(0,0)`), and only became visible once a ref carried a real ROTZOOM/AFFINE model *and*
8+a querying block's own stack came up short -- frame 14's `mi=(0,0)`, the very first block
9+decoded in the frame, has zero neighbours (`max_row_offset`/`max_col_offset` both 0), so its
10+entire predictor was the fallback.
11+
12+## Range-ladder evidence
13+
14+Built the missing oracle instrument last round asked for: `~/.cache/aom-oracle`'s
15+`decodemv.c` `read_inter_block_mode_info` now prints `EC_MODE mi_row mi_col rng=` before, and
16+`EC_MODE_VAL ... mode ref0 ref1 mv0 rng=` after, gated `EC_TRACE_MODE=1`. Ran it directly on
17+the recaptured pin (`/tmp/claude-1000/gm-r5-pin.obu`, still present from r5, re-verified
18+byte-identical decode twice via `EC_AV1_PIN`/`scratch_isolate_pinned_mismatch`):
19+
20+- Frame 14's `mi=(0,0)` group (14th inter-frame group in trace order, frame0 is intra/untraced):
21+ `EC_MODE mi_row=0 mi_col=0 rng=34391` ... `EC_MODE_VAL mi_row=0 mi_col=0 mode=16 ref0=4
22+ ref1=-1 mv0=(4,4) rng=46688` (mode 16 = `NEWMV`, ref 4 = `GOLDEN_FRAME` -- matches r5's own
23+ finding exactly).
24+- Our own decoder, same pin, `EC_AV1_TELL=1` (block-entry/post-* range trace already wired):
25+ `post_is_inter ... range=34391` (matches oracle's entry `rng` **exactly**) ... `post_interp_filter
26+ ... range=46688` (matches oracle's exit `rng` **exactly**). Every symbol between mode/ref/mv-joint/
27+ mv-component/interp-filter reads the identical number of bits in the identical order --
28+ **symbol consumption is bit-exact**, ruling out an entropy-side (CDF/context) defect.
29+- But `EC_AV1_TRACE`'s own decoded value at that same point (`tell=35`, matching
30+ `post_interp_filter`'s `tell=35`): `mv=(-6,-4)` -- **not** `(4,4)`. Same bits read, different
31+ final value: the defect is in *prediction-side construction* (the predictor a correctly-read
32+ delta gets added to), settling r5's open prediction-vs-entropy question decisively in favour
33+ of prediction.
34+- Confirmed against libaom source (`mvref_common.c` `setup_ref_mv_list`'s single-reference-
35+ extension tail, ~line 778): `for (idx = *refmv_count; idx < MAX_MV_REF_CANDIDATES; ++idx)
36+ mv_ref_list[idx] = gm_mv_candidates[0]` -- the GM fallback, unclamped, filled *after* the real
37+ entries are clamped. `decodemv.c`'s `read_inter_block_mode_info_impl` then reads `nearestmv[0]`
38+ from exactly this array (`av1_find_best_ref_mvs(..., ref_mvs[ref_frame[0]], &nearestmv[0], ...)`)
39+ for the non-compound, non-GLOBALMV case -- which a `refmv_count == 1`/`NEWMV` block still uses
40+ as its base predictor (`ref_mv[0]` stays `nearestmv[0]` unless `ref_mv_count > 1`).
41+
42+## Fix
43+
44+`crates/ec-av1/src/mvstack.rs`, `find_mv_stack_with_sign_bias`: `nearest_mv`/`near_mv` now
45+default to `gm_mv(gm, ref_frame)` (this block's own ref's global-motion vector, already
46+computed once per block by `build_gm_mv_table` in `decode.rs` and threaded in as `gm`) instead
47+of `(0, 0)` when the corresponding candidate slot is missing; `pred_mv` is just `nearest_mv`
48+now (the old `candidates.is_empty()` special case collapsed into the same fallback). Only the
49+single-reference path touched -- `find_mv_stack_compound` (the two-ref stack) is untouched and
50+stays out of scope; compound blocks are still refused separately by `reference_select`.
51+
52+Re-ran `scratch_isolate_pinned_mismatch` on the r5/r6 pin with the multi-slot refusal
53+temporarily neutralized (same recipe as r5's step 1): all 24 frames, all 3 planes, MATCH --
54+where r5 had 441/576 mismatching pixels on frames 14/15, this round has zero. Then reverted
55+the neutralization and re-ran the *unmodified* `decode_stream` on the same pin: still all 24
56+frames byte-exact, proving the fix holds through the real entry path, not just the bypassed one.
57+
58+## Refusal lifted
59+
60+The "more than one concurrently active ROTZOOM/AFFINE ref slot" refusal in `stream.rs` is
61+**removed** -- it was masking this predictor bug, not naming an unimplemented capability; the
62+AFFINE-on-single-ref-frame refusal right above it is untouched (still genuinely unverified,
63+per r5/r4).
64+
65+## Refusal count (wedge gate, `EC_WEDGE_GATE_ATTEMPTS=40 EC_AV1_REQUIRE_AOMENC=1`)
66+
67+- Before (r4's last measurement): 30/40 named refusals (20 of them the multi-slot-ROTZOOM
68+ string this round lifted), 10/40 matches, `wii_hits=4`.
69+- After (this round, same gate, fresh run): **7/40 refusals** (all `allow_screen_content_tools`
70+ -- an unrelated, pre-existing capability gap, `intrabc`/`palette_mode_info` unimplemented),
71+ **33/40 matches**, `wii_hits=5`. The multi-slot-ROTZOOM refusal string no longer appears at
72+ all.
73+
74+## Suite
75+
76+`cargo test -p ec-av1 --release --lib`: 230 passed, 1 failed (`a_real_aomenc_filter_intra_stream_decodes_pixel_exact`
77+-- `use_filter_intra never fired decoding this stream`, an aomenc-RD-nondeterminism gate flake,
78+unrelated to this change; reran standalone and it passed clean). 17 ignored (scratch/manual
79+tests) as usual.
80+
81+## Files touched
82+
83+- `crates/ec-av1/src/mvstack.rs` -- the predictor fallback fix (`find_mv_stack_with_sign_bias`).
84+- `crates/ec-av1/src/stream.rs` -- the multi-slot-ROTZOOM refusal removed, comment rewritten to
85+ record the r4->r5->r6 chain for the next reader.
86+
87+## Next round
88+
89+`allow_screen_content_tools` is now the widest live refusal in this gate (7/40, was already
90+present, unrelated to global motion) -- `intrabc`/`palette_mode_info` for inter frames, per the
91+refusal string's own note. AFFINE-on-single-ref-frame stays refused, unproven, not attempted
92+this round (charter scoped it out: "AFFINE stays refused unless you prove it separately").