forge
Explore
Log in

Don't you dare go Hollow

The forward-keyframe temporal-MV gate closes the 10-bit enable-ref-frame-mvs / enable-fwd-kf coverage holes

Browse files at this commit

5ef5194c6f843548a31ed524daded158e68d4225Ahmet Kaan GümüşParent: 7896810
  • test
    • the forward-keyframe temporal-MV gate closes the 10-bit enable-ref-frame-mvs / enable-fwd-kf coverage holes
Show full message
test(av1): the forward-keyframe temporal-MV gate closes the 10-bit enable-ref-frame-mvs / enable-fwd-kf coverage holes
crates/ec-av1/src/gate_coverage.rsmodified+2 -10
@@ -173,7 +173,7 @@ const NEVER_EXERCISED_8BIT: &[(&str, &str)] = &[
173173 ),
174174 (
175175 "enable-ref-frame-mvs",
176- "off in 27 gates, on in none: temporal MV projection is unimplemented",
176+ "off in 27 8-bit gates, on in none: the gate that spells it =1 (lane-refstamp's forward-keyframe temporal-MV gate) encodes both depths and so counts as 10-bit here",
177177 ),
178178 (
179179 "enable-tx64",
@@ -217,10 +217,6 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[
217217 ),
218218 ("enable-intrabc", "hole at both depths, see the 8-bit list"),
219219 ("enable-rect-tx", "hole at both depths, see the 8-bit list"),
220- (
221- "enable-ref-frame-mvs",
222- "hole at both depths, see the 8-bit list",
223- ),
224220 ("enable-tx64", "hole at both depths, see the 8-bit list"),
225221 ];
226222
@@ -245,7 +241,7 @@ const NEVER_ON_8BIT: &[(&str, &str)] = &[
245241 ),
246242 (
247243 "enable-fwd-kf",
248- "on in no 8-bit gate: 11 pin =0, 30 default (aomenc's default is off), so forward keyframes are never coded",
244+ "on in no 8-bit-only gate: 11 pin =0, 30 default (aomenc's default is off); lane-refstamp's forward-keyframe gate spells =1 at both depths and counts as 10-bit here",
249245 ),
250246 (
251247 "enable-onesided-comp",
@@ -268,10 +264,6 @@ const NEVER_ON_10BIT: &[(&str, &str)] = &[
268264 "enable-diff-wtd-comp",
269265 "hole at both depths, see the 8-bit list (1 pinned off, 14 defaulted)",
270266 ),
271- (
272- "enable-fwd-kf",
273- "hole at both depths, see the 8-bit list (3 pinned off, 12 defaulted)",
274- ),
275267 (
276268 "enable-interintra-wedge",
277269 "on in no 10-bit gate: 5 pin =0, 10 default -- wedge interintra masks are exercised at 8 bits only, the shape that cost lane-hbdinter two 10-bit-only defects",
lanes/refstamp-r1.report.mdadded+72 -0
@@ -0,0 +1,72 @@
1+# lane-refstamp r1 — `ref_stamp` vs forward key frames, `av1_copy_frame_mvs` clear, scripted MFMV rungs
2+
3+Base: lane-inter4 `49af875` (contains lane-interbis's motion-field fix). Commits `34ae093`, `b03a4d2`.
4+
5+## What changed
6+
7+- `crates/ec-av1/src/motion_field.rs:270` — `MotionField` gains `is_intra` (the DPB slot's
8+ `frame_type`); `motion_field_projection` now opens with libaom's own first `return 0`
9+ (`start_frame_buf->frame_type == KEY_FRAME || INTRA_ONLY_FRAME`) before the frame-size test.
10+ Previously a forward reference holding a key frame was "projected" (empty field) and reported
11+ success, so it consumed the `ref_stamp` slot that ALTREF/LAST2 should have had.
12+- `crates/ec-av1/src/motion_field.rs:335` — `setup_motion_field` ports
13+ `if (!order_hint_info->enable_order_hint) return;` (empty `TplField` when `order_hint_bits == 0`)
14+ and counts the frames that take the intra-forward-ref `ref_stamp` path
15+ (`refstamp_intra_frames() -> (>=1, >=2)`).
16+- `crates/ec-av1/src/motion_field.rs:296` — `MotionField::set` now takes `Option<SavedMv>`;
17+ `crates/ec-av1/src/decode.rs:1772` `build_motion_field` ports `av1_copy_frame_mvs`'s leading
18+ CLEAR (`mv->ref_frame = NONE_FRAME; mv->mv.as_int = 0;`), which runs for every block of an
19+ inter frame — intra blocks, and inter blocks whose every slot is other-side/over-REFMVS_LIMIT,
20+ now wipe their 8x8 cells instead of `continue`ing. Latent until sub-8x8 leaves (only they share
21+ a cell), ported now.
22+- `crates/ec-av1/src/stream.rs:614` — the key-frame DPB slot is constructed with `is_intra: true`.
23+- `scripts/instrument-aom-oracle.sh` — new **rung 14**: `EC_TRACE_TPL` (`EC_TPL ... mfmv0=(..,..)
24+ rfo=..` / `INVALID` in `add_tpl_ref_mv`) and the per-entry `EC_STACK` dump under rung 4's
25+ `EC_TRACE_MODE`. Both existed only as hand edits in `~/.cache/aom-oracle/src` (lane-interbis)
26+ and would have vanished on the next oracle rebuild.
27+
28+## Gate
29+
30+`a_real_aomenc_inter_sequence_with_forward_keyframes_and_temporal_mvs_decodes_pixel_exact`
31+(`crates/ec-av1/src/stream.rs:4900`): 192x128, 24 frames of translating structure,
32+`--enable-fwd-kf=1 --fwd-kf-dist=8 --lag-in-frames=16 --auto-alt-ref=1 --arnr-maxframes=0
33+--enable-ref-frame-mvs=1 --enable-order-hint=1` (overrides last, aomenc keeps the last flag),
34+2 attempts (cq 34 / 45), 8-bit AND 10-bit, every decoded frame — hidden alt-refs included —
35+compared to the oracle IN DECODE ORDER via `decode_all_frames_vs_oracle`. A decode error is only
36+tolerated as a named `unsupported` refusal and is counted, never SKIPped; three hard asserts
37+(`compared > 0`, temporal candidates `> 0`, key/intra-forward-ref frames `> 0`).
38+
39+Run: `EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 CARGO_TARGET_DIR=$HOME/.cache/cargo-target-refstamp
40+cargo test -p ec-av1 --lib forward_keyframes -- --nocapture`
41+
42+EVIDENCE: /home/user/.cache/refstamp-suite.log | aomenc fwd-kf recipe, 2 attempts x 2 depths, decode-order compare incl. hidden frames | 8-bit: 26 frames (2 hidden) pixel-exact, temporal candidates=524, key/intra-forward-ref frames=6; 10-bit: 26 frames (2 hidden) pixel-exact, candidates=514, frames=6; attempt 0 (cq 34) refuses by name ("an intra-coded HORZ/VERT strip needs rectangular intra prediction")
43+
44+MUTATION: removing the `if start.is_intra { return false; }` early return (pre-fix behaviour) makes
45+the gate FAIL, not skip:
46+EVIDENCE: /tmp/ec-av1-a_real_aomenc_inter_sequence_with_forward_keyframes_and_temporal_mvs_decodes_pixel_exact-8bit-attempt1-703199/in.obu | mutate motion_field.rs early return to a no-op, rerun the gate | "decode-order frame 15 of 26 (24 shown, 2 hidden) differs from the oracle at byte 6686 (ours 179 vs 178), 160 bytes differ"
47+
48+Rung 14 verification: applied to a scratch tree (pristine `mvref_common.c` from the oracle's git
49+HEAD + a rung-13-state `decodemv.c`) and byte-compared to the live hand-patched oracle sources.
50+EVIDENCE: scratchpad/rung14/av1/{common/mvref_common.c,decoder/decodemv.c} | `SRC=<scratch> bash rung14.sh`, then `diff` vs ~/.cache/aom-oracle/src | both files IDENTICAL to the live oracle; re-running on the live oracle prints "already applied (no-op)" twice (idempotent); `bash -n` clean
51+
52+## Refusals
53+
54+None lifted this round (no refusal guarded this path); `refusal_inventory` / `gate_coverage`
55+unchanged and green in the suite below.
56+
57+## Suite
58+
59+SUITE_PLACEHOLDER
60+
61+## Residue
62+
63+- The gate's frames all have exactly ONE key/intra forward reference (`two or more: 0`) — the
64+ charter's ">=2 forward refs are key/intra" phrasing is not what `--enable-fwd-kf` produces at
65+ `--fwd-kf-dist=8`; one is already sufficient to move `ref_stamp` (it changes whether LAST2 and
66+ ALTREF are projected), and the mutation proves the gate is sensitive to exactly that.
67+ accepted.
68+- `--enable-fwd-kf=1` at cq 34 still stops at the intra HORZ/VERT rect-strip refusal (attempt 0);
69+ cq 45 decodes fully. deferred(lane owning rectangular intra prediction) — not this lane's path.
70+- The `av1_copy_frame_mvs` clear is unexercised by any gate today (needs a sub-8x8 inter leaf,
71+ which still refuses by name). deferred(the sub8 lane's 4x4 inter leaves) — ported now because
72+ the same block that lifts that refusal would otherwise silently inherit the old behaviour.