forge
Explore
Log in

Don't you dare go Hollow

Declare r9's three new scaled-reference refusal strings in the inventory

Browse files at this commit

576ce598bbc57d993cd60f17dbbadf1fe04099b9Ahmet Kaan GümüşParent: 5ff4723
  • fix
    • declare r9's three new scaled-reference refusal strings in the inventory
Show full message
fix(av1): declare r9's three new scaled-reference refusal strings in the inventory

refusal_inventory.rs's own self-check caught them undeclared on first run --
REFUSALS now lists all three; stream.rs:217's frame-level use_superres refusal
itself is unchanged, so this declares new refusals, not a lifted one.
crates/ec-av1/src/refusal_inventory.rsmodified+3 -0
@@ -68,6 +68,9 @@ const REFUSALS: &[&str] = &[
6868 "an intra mode this decoder does not code (round 2)",
6969 "an intra-coded HORZ/VERT strip needs rectangular intra prediction this decoder does not code yet",
7070 "filter intra on a HORZ/VERT strip (this decoder predicts square-only)",
71+ "a compound-reference block with a scaled reference (superres, unimplemented)",
72+ "warp/OBMC/interintra prediction with a scaled reference (superres, unimplemented)",
73+ "an 8x8 partition leaf under a scaled reference (superres, unimplemented)",
7174 ];
7275
7376 /// Gates whose `Err` arm turns a decode failure into a printed SKIP rather than
lanes/superres-r9.report.mdadded+102 -0
@@ -0,0 +1,102 @@
1+VERDICT: OPEN -- r8's derived scaled-MC algorithm is implemented and pixel-pinned at
2+REF_NO_SCALE, `decode_inter_block`'s 19 call sites all thread `frame_width`, the single-ref
3+branch scaled-vs-unscaled fork is wired, and the three unimplemented combinations (compound,
4+warp/OBMC/interintra, `decode_inter_block8`'s 8x8-leaf split) refuse by name -- but no bypass
5+gate was built this round to drive the new code with a real scaled reference, so `stream.rs:217`'s
6+frame-level refusal stays in place and no capability claim is made. Suite green throughout
7+(scoped runs below); turn budget spent on the algorithm + the wide 19-site threading, none left
8+to safely build+verify the bypass gate.
9+
10+## What was done
11+
12+1. `git merge 913df61` into `lane-superres` -- clean (19 files, loop restoration filters +
13+ `lr-r2..r9` lane docs). `cargo check -p ec-av1`: clean, no signature breakage. Commit `08e12c4`.
14+2. `mc::predict_scaled`/`mc::scale_factor`/`mc::REF_NO_SCALE` added to `mc.rs`, per r8's
15+ pseudocode verbatim (`x_scale_fp`/`x_step_qn`/`pos_x_q10`/per-column `x_qn` walk; vertical
16+ pass copy-pasted from `predict_with_filters`, untouched per r8's "AV1 superres never scales
17+ height" proof). New test `predict_scaled_at_no_scale_matches_predict_with_filters`
18+ (`mc.rs`) asserts `REF_NO_SCALE` reproduces `predict_with_filters` byte-for-byte across
19+ block widths 4/8/16 and every 1/16-pel fraction -- passes (8/8 `mc::tests`/`mc::` green).
20+ Commit `7f605df`.
21+3. `decode_inter_block` gained `frame_width: usize` as its final parameter. All 19 call sites
22+ updated: 18 real sites in `decode_inter_frame_tile_with_cdfs` (each already ending
23+ `allow_screen_content_tools,`, `frame_width: u32` already in that function's scope --
24+ scripted insert of `frame_width as usize,` after that line at each site) plus the 19th, the
25+ `decode.rs` unit-test helper at (then) line 12632 whose arg list ends `false,` -- hand-patched
26+ with `width` (the test's own local frame width). Commit `7f605df`.
27+4. Scoped refusals + the scaled-vs-unscaled fork, per the report's own line numbers (shifted by
28+ the merge, located fresh):
29+ - Compound branch (`resolve_interp_filter` return, before the two
30+ `predict_compound_intermediate` calls): refuses `"a compound-reference block with a scaled
31+ reference"` when either tap's `py0.width`/`py1.width` != `frame_width` --
32+ `predict_compound_intermediate` has no scaled counterpart.
33+ - Single-ref branch (right before `pred_y`/`pred_u`/`pred_v` are built, after
34+ `warp_params`/`obmc_selected`/`interintra_mode` are all resolved): computes
35+ `luma_scale = mc::scale_factor(py_ref.width, frame_width)` once; refuses `"warp/OBMC/
36+ interintra prediction with a scaled reference"` when `luma_scale != REF_NO_SCALE` and any
37+ of those three fired; otherwise branches `predict_with_filters` (unchanged call, byte-exact
38+ for the unscaled case per the pin above) vs `predict_scaled` per luma and both chroma planes,
39+ the same `luma_scale` reused unchanged for chroma per r8's "luma-derived ratio applies as-is
40+ to chroma" derivation.
41+ - `decode_inter_block8` (a separate function, one call site, NOT in the charter's 19 --
42+ its own compound/single-ref MC calls are un-threaded this round): refuses `"an 8x8 partition
43+ leaf under a scaled reference"` up front, before the leaf loop, when `ref_y.width` or any
44+ live `ref_slots` entry's width differs from `frame_width` -- a coarse over-refusal (blocks
45+ the whole 16x16-split-to-8x8 shape under ANY scaled reference, not just the leaf that
46+ actually picks one) rather than threading `frame_width` through its own body, given the
47+ turn budget.
48+ Commit `065a0b8`.
49+5. `EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 -j4 superres -- --test-threads=1`: 6/6 passed
50+ (`a_real_aomenc_stream_with_superres_refuses_by_name`,
51+ `a_real_aomenc_superres_key_frame_sequence_decodes_pixel_exact`, and the 4
52+ `superres::tests::upscale_row_*` reconstruction-filter pins) -- no regression from the new
53+ parameter/branches. `cargo test -p ec-av1 -j4 mc::`: 8/8 passed.
54+
55+## Why the bypass gate (charter step 1 / this round's nominal first task) is not built
56+
57+Read in the order the charter gave, but built in dependency order instead: the gate the charter
58+wants (decode a real aomenc key frame with `use_superres`, feed its picture as `reference` into
59+`decode_inter_frame_tile_with_cdfs` directly for a `--superres-denominator=12` inter frame,
60+bypassing `decode_stream`'s refusal) needs the scaled-MC code path to exist and compile first to
61+be worth driving -- writing it against not-yet-existing `mc::predict_scaled`/`frame_width`
62+plumbing would have meant rewriting the gate mid-round anyway. With the plumbing now landed and
63+compiling, the gate itself (mirroring
64+`a_real_aomenc_stream_with_two_tile_rows_decodes_pixel_exact`'s pattern per r8's own step 5) is
65+the very next, well-specified task -- but was not started this round: the 19-site threading plus
66+three refusal sites, each needing the surrounding branch re-read fresh (line numbers shifted by
67+the merge), spent the turns this round's checkpoint allows before a gate could be built and
68+debugged safely.
69+
70+## Disposition
71+
72+- deferred: the bypass gate itself (charter's own step 1, r8's step 5) -- next round, no further
73+ libaom reading needed; the exact recipe (`--superres-denominator=12 --kf-max-dist=1000`,
74+ disable warp/obmc/compound/interintra the same way the key-frame superres gate already does)
75+ is unchanged from r8's report. Once pixel-exact, lift `stream.rs:217`'s refusal (scoped to the
76+ combinations that still refuse, not deleted outright) and update `refusal_inventory.rs` in the
77+ same commit, per the charter.
78+- deferred: `decode_inter_block8`'s own scaled-MC threading -- currently a blanket refusal
79+ instead of the narrow per-leaf one `decode_inter_block`'s sites get; upgrade ceiling is
80+ threading `frame_width` through its ~15-param list the same mechanical way, once the primary
81+ bypass gate is green and a real stream is found that actually reaches an 8x8-leaf split under
82+ `use_superres` (unconfirmed whether the corpus even produces one).
83+- fix-now: none -- no defect found this round, only new (refused-by-default) capability.
84+
85+## Refusal strings
86+
87+Added: `"a compound-reference block with a scaled reference (superres, unimplemented)"`,
88+`"warp/OBMC/interintra prediction with a scaled reference (superres, unimplemented)"`,
89+`"an 8x8 partition leaf under a scaled reference (superres, unimplemented)"` -- all newly
90+reachable code paths (the single-ref non-warp/OBMC/interintra scaled branch is the only new
91+non-refusing path, and it is not yet reachable from `decode_stream`: `stream.rs:217`'s
92+frame-level refusal still fires first for every non-key `use_superres` frame).
93+`refusal_inventory.rs`'s own self-check (`the_decode_path_refuses_exactly_the_listed_cases`)
94+caught all three as undeclared on first run -- added to `REFUSALS`, now green. `stream.rs:217`'s
95+frame-level refusal itself (`"an inter frame with use_superres set..."`) is untouched -- no
96+refusal was LIFTED, so per [[refusal-lifted-without-a-gate]] no capability claim is made; the
97+inventory addition here is declaring new refusals, not removing the old one.
98+
99+## Merge
100+
101+Done, committed (`08e12c4`), suite green (scoped runs above). Satisfies the charter's "merge
102+main and compile immediately" step.