forge
Explore
Log in

Don't you dare go Hollow

Lane-sbpart round-1 report -- entropy-context facts + gate recipe, no decode wiring yet

Browse files at this commit

664f2e4ad7e45abe3f86b2b64ca0fc3fca1b9bf3Ahmet Kaan GümüşParent: 086ca56
  • docs
    • lane-sbpart round-1 report -- entropy-context facts + gate recipe, no decode wiring yet
Show full message
docs(av1): lane-sbpart round-1 report -- entropy-context facts + gate recipe, no decode wiring yet
lanes/sbpart.report.mdadded+98 -0
@@ -0,0 +1,98 @@
1+VERDICT: PARTIAL -- one green, inert building-block commit landed; the four
2+named refusals this lane owns are all still refused. Recon-heavy round; ran
3+out of turn budget before the actual decode wiring.
4+
5+## What landed (commit 0e04b79)
6+- `crates/ec-av1/src/cdf.rs`: `EOB_PT_512_CHROMA`, the true 512-position
7+ end-of-block CDF for a chroma transform, extracted from libaom's
8+ `av1_default_eob_multi512_cdfs[*][1][*]` (`token_cdfs.h:874-901`). Unlike
9+ every other `EOB_PT_*` table in this crate, libaom's default is the
10+ identical flat distribution at all four q-contexts, so this is one
11+ constant, no `_Q0`/`_Q1`/`_Q3` siblings.
12+- `crates/ec-av1/src/cdf_state.rs`: `TxbSet::ChromaRect32x16` (+ field
13+ `eob_pt_512_chroma`, reset wiring, `pick()`/defaults wiring, `txb()`
14+ resolve arm). Shares every table `Chroma32` does except `eob_pt`.
15+- `cargo check -p ec-av1`: clean. `cargo test -p ec-av1 --lib round_trip`:
16+ 16/16 passed (no regression). Neither is wired into any decode path yet
17+ (dead code, by design -- next round's first move).
18+
19+## The gate recipe that reproduces the SB-level refusal (verified live)
20+`~/.cache/aom-oracle/build/aomenc --codec=av1 --passes=1 --end-usage=q
21+--cq-level=45 --cpu-used=0 --threads=1 --row-mt=0 --sb-size=64
22+--enable-rect-partitions=1 --enable-ab-partitions=0
23+--enable-1to4-partitions=0 --min-partition-size=32 --max-partition-size=64
24+--enable-restoration=0 --enable-palette=0 --deltaq-mode=0
25+--enable-filter-intra=0 --enable-cfl-intra=0 --enable-intrabc=0 --obu` on a
26+`gradients` source (192x128, blended with `testsrc2` so it isn't flat) hits
27+`TRACE partition_w64 ... value=2` (VERT) and refuses by name
28+("a superblock-level partition type other than NONE or SPLIT"). `min`/`max`
29+-partition-size=32/64 is the key: it keeps the RD search from ever
30+recursing below 32x32, so every SB-level decision is genuinely NONE/SPLIT/
31+HORZ/VERT rather than diving into unrelated 16x16/8x8 territory (which is
32+what a plain default recipe hits first -- see dead ends below).
33+
34+## Why this took the whole budget: the spec fact this lane's "mostly
35+extending an existing recursion" framing undersold
36+`decode_block_rect` (the existing HORZ/VERT strip decoder, 32x16/16x32) has
37+no truncation logic at all, because 32 and 16 both already fit inside the
38+32-coefficient cap. A 64x32/32x64 strip does NOT fit: its LUMA plane needs
39+the same corner-truncation `decode_block` already does for a plain 64x64
40+square (`logical_tx`/`coeff_tx_side` split, `read_plane`'s `tx_side != side`
41+branch) -- genuinely new for a *rectangular* block, `read_plane` is
42+square-only. Worked out from libaom's `get_txsize_entropy_ctx` formula
43+(`(txsize_sqr_map[tx] + txsize_sqr_up_map[tx] + 1) >> 1`,
44+`common_data.h:302-341`) which table each axis actually resolves to:
45+- LUMA (TX_64X32/TX_32X64): sqr_map=TX_32X32, sqr_up_map=TX_64X64 ->
46+ ctx resolves to **TX_64X64** = the already-landed `TxbSet::Luma64` +
47+ `SCAN_32` (used exactly as the plain-64x64-square case already does).
48+ No new table needed here.
49+- CHROMA (TX_32X16/TX_16X32, real untruncated transform, no corner-crop):
50+ sqr_map=TX_16X16, sqr_up_map=TX_32X32 -> ctx resolves to **TX_32X32** =
51+ `Chroma32`'s tables, except the true 512-position `eob_pt` -- this is what
52+ needed the new `ChromaRect32x16` variant landed this round.
53+
54+## What the next round needs to build (all groundwork above is done)
55+1. A `decode_block_rect64(bw, bh)` (or generalize `decode_block_rect`) that:
56+ mode-reads via `read_intra_mode_rect` (already bw/bh-generic, unverified
57+ above 32x16 -- check its angle-delta/filter-intra ranges don't assume
58+ `bw,bh <= 32`), then for luma reads a real `32x32` corner via
59+ `read_coeffs` (not `_rect`) with `TxbSet::Luma64`/`SCAN_32`, embeds it
60+ top-left of a `bw*bh` zero grid (mirror `read_plane`'s `tx_side != side`
61+ branch, generalized to non-square), and `dequant_and_inverse_typed_wh`
62+ the whole `bw x bh` grid; for chroma reads the real `bw/2 x bh/2` corner
63+ via `read_coeffs_rect` with `TxbSet::ChromaRect32x16` (this round's new
64+ variant) and the right `SCAN_32X16`/`SCAN_16X32` table (already exist).
65+2. Wire `PARTITION_HORZ`/`PARTITION_VERT` into the `match part` at
66+ decode.rs:5292's `_ =>` arm (intra tile path, 64x64 level) the same way
67+ `PARTITION_HORZ`/`VERT` are already wired at the 32x32 level just above
68+ (lines 5217-5283) -- two calls to the new function at `at`/`(at.0+2,
69+ at.1)` or `(at.0, at.1+2)` (mi units, `SUB_MI`-scaled for the 64-level).
70+3. Gate it with the recipe above (`EC_AV1_REQUIRE_AOMENC=1`, attempt loop,
71+ hard-assert a new `SB_RECT_HITS` thread-local fired, matched > 0)
72+ before touching the inter path or the 32x32-level part of the charter.
73+4. Only once intra HORZ/VERT is pixel-exact does stage 2 (32x32 `part32`
74+ values beyond NONE/SPLIT/HORZ/VERT the gate turns up), stage 3 (inter
75+ path, same two levels), and stage 4 (AB/4-way at these levels) become
76+ reachable -- none of those were attempted this round.
77+
78+## Refusal strings removed
79+None. All four refusals this lane owns are still in place, verbatim, in
80+`refusal_inventory.rs` and `decode.rs` -- no capability landed yet that
81+would make any of them stop firing.
82+
83+## Dead ends (worth recording so the next round doesn't re-spend budget)
84+- A plain default-ish recipe (`--codec=av1 --cpu-used=0 --threads=1
85+ --row-mt=0 --sb-size=64` with nothing else off) hits loop restoration or
86+ palette or a 16x16-level AB partition first, all lanes this one doesn't
87+ own -- `--enable-restoration=0 --enable-palette=0 --deltaq-mode=0` plus
88+ `--min-partition-size=32 --max-partition-size=64` is what isolates the
89+ SB-level decision cleanly.
90+- `testsrc2` alone at 192x128/cpu-used=0 without the min/max-partition-size
91+ clamp recurses straight to 8x8 leaves (too much local detail for the RD
92+ search to stop at 32x32) -- blended with a `gradients` source it stays
93+ coarse enough to resolve at 64/32.
94+
95+## Hard rules followed
96+Worked only in this worktree; `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-sbpart`
97+every build; no push, no merge, no touch to `main`, no other worktree
98+touched. `EC_AV1_REQUIRE_AOMENC=1` on the test run above.