forge
Explore
Log in

Don't you dare go Hollow

Lane-sbpart r2 report -- decode_block_rect64 landed, gate reaches it but mismatches (bisect next round)

Browse files at this commit

c0c9306eef86cbe9a42dd6c0d28e77633d479b13Ahmet Kaan GümüşParent: cd6e176
  • docs
    • lane-sbpart r2 report -- decode_block_rect64 landed, gate reaches it but mismatches (bisect next round)
Show full message
docs(av1): lane-sbpart r2 report -- decode_block_rect64 landed, gate reaches it but mismatches (bisect next round)
lanes/sbpart-r2.report.mdadded+106 -0
@@ -0,0 +1,106 @@
1+VERDICT: PARTIAL -- decode_block_rect64 built and wired (green, committed,
2+c34be7c); the gate reaches it and fires `sb_rect_hits() > 0` live against a
3+real aomenc stream, but the decoded pixels do NOT yet match ffmpeg's own
4+decode -- a real mismatch, not a refusal. Gate test is uncommitted (red);
5+next round's first move is to bisect it.
6+
7+## What landed (commit c34be7c, compiles clean, no regression)
8+- `decode_block_rect64(bw, bh)` in `crates/ec-av1/src/decode.rs`, right after
9+ `decode_block_rect`: mode via `read_intra_mode_rect` (unchanged, its
10+ `filter_intra_size_class_rect` already returns `None` for `(64,32)`/
11+ `(32,64)` since `av1_filter_intra_allowed_bsize` caps at 32 on both axes,
12+ so no extra work was needed there); `tx_size_cat2` depth read gated on
13+ `tx_select`, `depth != 0` refused by name (per-unit rect prediction not
14+ ported, matching `decode_block_rect`'s own scope limit); LUMA reads a
15+ real 32x32 corner via `read_coeffs` with `TxbSet::Luma64` + a locally
16+ computed `default_scan(TX32)` (matching what `decode_block`'s own 64x64
17+ corner case uses), embeds it top-left of a zeroed `bw*bh` grid (mirrors
18+ `read_plane`'s `tx_side != side` branch, generalized to non-square);
19+ CHROMA reads a real, untruncated `bw/2 x bh/2` transform via
20+ `read_coeffs_rect` with `TxbSet::ChromaRect32x16` (the r1-landed table)
21+ and `SCAN_32X16`/`SCAN_16X32` depending on orientation, with
22+ `default_tx_type = TxType::DctDct` forced (per r1's derivation: chroma at
23+ this size resolves to TX_32X32, `av1_get_ext_tx_set_type`'s `>= TX_32X32`
24+ rule forces DCT_DCT regardless of mode -- the same rule `read_plane`
25+ already applies via its own `side >= 32` check).
26+- `PARTITION_HORZ`/`PARTITION_VERT` wired into the SB-level `match part` at
27+ decode.rs (was the `_ =>` catchall): two `decode_block_rect64` calls at
28+ `at`/`(at.0+2, at.1)` (HORZ, two 64x32 strips) or `at`/`(at.0, at.1+2)`
29+ (VERT, two 32x64 strips), mirroring the already-landed 32x32-level
30+ pattern exactly.
31+- New `SB_RECT_HITS` thread-local + `sb_rect_hits()` accessor
32+ (decode.rs), same pattern as `RECT_PARTITION_HITS`/`RECT_COEFF_HITS`.
33+- `cargo check -p ec-av1`: clean. `cargo test -p ec-av1 --lib round_trip`:
34+ 16/16 passed, no regression (`EC_AV1_REQUIRE_AOMENC=1`).
35+
36+## The gate (uncommitted, RED -- pixel mismatch, not a refusal)
37+`a_real_aomenc_stream_with_a_superblock_level_horz_vert_partition_decodes_pixel_exact`
38+in `crates/ec-av1/src/stream.rs` (end of `mod tests`). Recipe, tuned live
39+this round from the charter's starting point:
40+- charter's own flags (`--min/max-partition-size=32/64`, rect on/AB off/
41+ 1to4 off, restoration/palette/deltaq/filter-intra/cfl-intra/intrabc off)
42+ PLUS `--enable-tx-size-search=0` (missing from the charter's recipe --
43+ without it every HORZ/VERT strip picks a split transform and hits this
44+ function's own `depth != 0` refusal, never reaching the coefficient
45+ reader at all; same fix `decode_block_rect`'s own gate needed, r1's
46+ report just didn't carry it forward to the 64-level recipe).
47+- **Dead end, recorded so the next round doesn't re-spend budget**: the
48+ charter's "gradients blended with testsrc2" source (`blend=all_mode=
49+ average` lavfi filter) made `allow_screen_content_tools` fire on nearly
50+ every attempt (screen-content strips are refused by
51+ `read_intra_mode_rect` unconditionally) and, worse, made aomenc pick an
52+ SB-level AB partition (`partition_w64` value 7, VERT_B) on almost every
53+ remaining attempt *despite* `--enable-ab-partitions=0` -- a real,
54+ separate aomenc quirk (AB-at-64 is not gated by that flag the way AB
55+ below 64 is; unconfirmed root cause, not investigated further this
56+ round) -- 40/40 attempts refused, zero decodes. Plain `gradients_source`
57+ alone (no blend) reliably avoids both and reaches real HORZ/VERT single-
58+ TU blocks; the gate now uses that.
59+- With both fixes the gate reaches `decode_block_rect64` and increments
60+ `sb_rect_hits`, but the one attempt run this round (`EC_SBPART_GATE_
61+ ATTEMPTS=1`, seed 42, 192x128 single frame) MISMATCHES ffmpeg's own
62+ decode on luma starting partway through row 0 -- not a desync (the
63+ stream still parses/finishes, `matched` would be the only counter that
64+ stays 0), a real wrong-pixel bug in the new function. Not bisected this
65+ round (turn budget) -- **next round's first move**: dump the mismatching
66+ stream (`EC_AV1_GATE_DUMP`, same mechanism the masked-compound gate
67+ uses) and range-ladder the luma corner read / chroma read / the
68+ `dequant_and_inverse_typed_wh` call against a real aomdec EC_TRACE,
69+ the same method that closed `decode_block_rect`'s own r3-r5 desync
70+ (lane-rectwire history, memory `[[Interintra decode landed]]`'s sibling
71+ entries) -- suspects in order of likelihood: (a) the corner-embed loop's
72+ stride (`luma_levels[row*bw..][..32]`) vs whatever `dequant_and_
73+ inverse_typed_wh`'s `w,h` ordering actually expects for a `64x32` vs
74+ `32x64` grid (an axis swap here would look exactly like this symptom --
75+ right at first, wrong once the strip's true width diverges from 32); (b)
76+ `default_scan(TX32)` vs the packed/stored `scan32` other call sites
77+ reuse -- should be identical (pure function of `TX32`) but not directly
78+ diffed against the working square-64x64 path's own copy this round.
79+
80+## Refusal strings removed
81+None removed outright -- the SB-level catchall
82+("a superblock-level partition type other than NONE or SPLIT...") still
83+fires for AB/4-way/split-tx cases, verbatim, unchanged in
84+`decode.rs`/`refusal_inventory.rs`. For a genuine single-TU HORZ/VERT it no
85+longer fires (replaced by the new function), but that path is proven WRONG
86+(pixel mismatch) by the gate above, not proven right -- so functionally no
87+capability should be considered landed yet; the gate is red and
88+uncommitted for exactly that reason.
89+
90+## What the next round needs to do
91+1. Bisect the mismatch (see suspects above) -- likely a small, mechanical
92+ bug given `decode_block_rect`'s own precedent (the 32x16/16x32 sibling
93+ needed 5 rounds for something this shape: a spurious/missing symbol
94+ read, not deep coefficient-context math).
95+2. Once pixel-exact, re-run the gate with the full `n_attempts=40` default
96+ and hard-assert `sb_rect_hits() > 0` (already written that way, just
97+ currently failing before reaching that assert).
98+3. Only then move to stage 2 (32x32-level `part32` values beyond NONE/
99+ SPLIT/HORZ/VERT) and the inter path's two refusals, per the charter.
100+
101+## Hard rules followed
102+Worked only in this worktree; `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sbpart`
103+every build; foreground `nice -n 19 cargo ... -j4`; `EC_AV1_REQUIRE_AOMENC=1`
104+on every test run; no push, no merge, no touch to `main`, no other worktree
105+touched. The one green step (`decode_block_rect64` + wiring, no regression)
106+is committed; the gate test is left uncommitted because it is red.