forge
Explore
Log in

Don't you dare go Hollow

Lane-realworld r2 report -- CDEF gate landed, delta_q/delta_lf handoff

Browse files at this commit

14aa2ed8dbfd654957a7ec99aa63eb2d6d876c59Ahmet Kaan GümüşParent: 24f08c2
  • docs
    • lane-realworld r2 report -- CDEF gate landed, delta_q/delta_lf handoff
Show full message
docs(av1): lane-realworld r2 report -- CDEF gate landed, delta_q/delta_lf handoff
lanes/realworld-r2.report.mdadded+98 -0
@@ -0,0 +1,98 @@
1+# lane-realworld r2 report
2+
3+VERDICT: Step 1 (suite verify) and step 2 (CDEF gate) landed and committed
4+(080acfd on branch lane-realworld). Step 3 (delta_q/delta_lf) is
5+UNSTARTED -- next agent picks it up fresh, nothing half-done to unwind.
6+
7+## Step 1 -- suite verify
8+`EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -j4` on bd61617:
9+**232 passed, 0 failed, 17 ignored** -- matches the baseline exactly, no
10+fix needed. bd61617's CDEF code compiled clean and the suite was
11+already green; r1's risk (apply_cdef's guard) turned out fine in
12+practice (see below).
13+
14+## Step 2 -- the CDEF gate (committed 080acfd)
15+`a_real_aomenc_stream_with_cdef_decodes_pixel_exact` in
16+`crates/ec-av1/src/stream.rs` (~4668-4870). Latest run:
17+**40/40 pixel-exact matches, 0 named refusals, `cdef_idx_hits()` 24-40
18+per run (hard-asserted > 0)**.
19+
20+### The real finding: the charter's recipe (copy masked-compound's
21+64x64 single-SB fixture) is structurally incapable of firing cdef_idx.
22+`cdef.bits` selects among per-*superblock* strength profiles; a 64x64
23+frame is exactly one superblock, so aomenc's RD has nothing to
24+differentiate and always writes `bits=0` -- confirmed empirically
25+(20-attempt runs at 64x64, `cdef_idx_hits()` stayed 0 every time).
26+Needed a multi-SB fixture (128x64, 2 SBs) instead.
27+
28+### Two pre-existing gaps this multi-SB fixture immediately hit (NOT
29+this lane's to fix, named so the next lane can find them by grep):
30+1. At `--cpu-used=0` (every other real-stream gate's setting), aomenc's
31+ RD on multi-SB content picks SB-level (part64) partition types this
32+ decoder's intra key-frame path doesn't cover -- only
33+ `PARTITION_NONE`/`PARTITION_SPLIT` are handled at
34+ `decode_key_frame_tile_with_cdfs`'s top match (`decode.rs` ~4684),
35+ everything else (`HORZ_4`=8, `VERT_B`=7 observed live) falls into the
36+ catchall `unsupported("a partition type this encoder never writes")`
37+ at `decode.rs:5049`. This reproduced with `--enable-rect-partitions=0
38+ --enable-ab-partitions=0 --enable-1to4-partitions=0` all set --
39+ aomenc chose them anyway (this build/cpu-used=0 combo doesn't fully
40+ honor those flags for the top-of-tree decision, empirically). The
41+ INTER path (`decode_inter_frame_tile_with_cdfs`, `decode.rs:9397`)
42+ has a worse latent bug for the same reason: it reads `part64` and
43+ then does `let _ = part64;` -- discards it and blindly recurses as
44+ if it were always `SPLIT`. If a real inter frame's SB ever writes
45+ anything but SPLIT there, this **silently desyncs** rather than
46+ refusing by name. Not exercised by this gate (avoided via
47+ `--cpu-used=4`, see below) but is a live landmine for any future
48+ multi-SB real-stream gate.
49+2. `--cpu-used>=1`'s default `aq-mode` writes `delta_q_present`/
50+ `delta_lf_present`, which this decoder already refuses by name
51+ (correctly) -- but that's exactly this lane's *next* step, so
52+ sidestepped for now with `--aq-mode=0 --deltaq-mode=0`.
53+
54+### The working recipe: 128x64 (2 SBs), `--cpu-used=4` (steers RD away
55+from the unsupported part64 types), `--aq-mode=0 --deltaq-mode=0`
56+(keeps delta_q/delta_lf off), `--enable-cdef=1`, everything else same
57+shape as the masked-compound gate (rich inter toolset: warped-motion,
58+obmc, masked-comp, interintra-comp all =1, since a starved toolset was
59+also observed to push RD toward the same unsupported partition types
60+even at `--cpu-used=0`/min-max-partition=64).
61+
62+No refusal strings were added or altered -- the pre-existing
63+"a partition type this encoder never writes" and "delta_q_present or
64+delta_lf_present" refusals are both genuine (proven by direct
65+reproduction, not assumed).
66+
67+## Step 3 -- delta_q / delta_lf: NOT STARTED
68+Ran out of budget before beginning. Per charter: spec 5.11.15
69+`read_delta_qindex` / 5.11.16 `read_delta_lflevel`; libaom
70+`av1/decoder/decodemv.c` same names. Needs: new adapting CDFs (struct
71+field + defaults array + verify counter-reset coverage per
72+`cdf-counter-not-reset` class -- save/restore and reset2/reset3 are
73+already length-generic per `cdf_state.rs:590+`), running
74+quantizer/loop-filter-delta state threaded through block decode, read
75+once per SB at the first non-skip block. Its own gate/counter/commit.
76+The existing refusal ("a frame with delta_q_present or delta_lf_present
77+set") is reproducible on demand with `--aq-mode=1` or default
78+`cpu-used>=1` at 128x64+ -- a ready-made fixture recipe for that gate's
79+own "still refuses correctly until landed" check, then flip once wired.
80+
81+## Remaining refusal strings verbatim (still true, not touched)
82+- `"a partition type this encoder never writes"` (SB-level, intra;
83+ `decode.rs:5049`) -- pre-existing, real, out of scope.
84+- `"a partition type this encoder never writes (value={part32})"` (32
85+ level, intra; `decode.rs:5042`) -- pre-existing.
86+- `"an INTER 32x32 partition type this encoder never writes
87+ (value={part32})"` (`decode.rs:10555`) -- pre-existing.
88+- `"a frame with delta_q_present or delta_lf_present set (this decoder
89+ never reads the per-superblock delta symbols)"` -- this lane's step 3
90+ target, still refuses correctly.
91+- `"a partition below 16x16 other than a clean split..."`,
92+ `"a partition below 8x8..."`, `"a 16x16 block whose true edge cuts
93+ through both axes..."` -- untouched, unrelated.
94+
95+## Next lever
96+delta_q/delta_lf (charter step 3), exactly as scoped. The part64
97+multi-SB gap (finding #1 above) is a separate, larger lane -- flagged,
98+not fixed, not this lane's job.