forge
Explore
Log in

Don't you dare go Hollow

Lane-inter4 r3 report -- 16-level rect inter leaf, two shipped-code defects, OBMC residue

Browse files at this commit

e4c2a0b79aa5f8286963c6fed9ed0875159e3914Ahmet Kaan GümüşParent: b2eabdd
  • docs
    • lane-inter4 r3 report -- 16-level rect inter leaf, two shipped-code defects, OBMC residue
Show full message
docs(av1): lane-inter4 r3 report -- 16-level rect inter leaf, two shipped-code defects, OBMC residue
lanes/inter4-r3.report.mdadded+125 -0
@@ -0,0 +1,125 @@
1+# lane-inter4 r3 — the 16x16-level rectangular INTER leaf
2+
3+Branch `lane-inter4`, worktree `/home/user/Documents/Code/Rust/edith_codecs-inter4`,
4+off r2's `d2d7327` (main `11633d7`). No rebase needed (main unchanged since r2).
5+
6+## What shipped (commit `d913935`)
7+
8+The refusal r2 named as the reach blocker is gone: `PARTITION_HORZ`/`PARTITION_VERT`
9+at 16x16 on an inter frame now decodes two 16x8 / 8x16 inter blocks.
10+
11+- `crates/ec-av1/src/decode.rs` (16-level partition site, ~17930): the HORZ/VERT
12+ arms. `side = SUB` keeps every CDF / prediction-buffer decision square (the
13+ corner-cut the 32-level rect arm already ships), `write_w`/`write_h` carry the
14+ true 16x8 / 8x16 footprint into the mv stack, the motion-mode row, the neighbour
15+ stamps and the rect residual path. AB / 1:4 at 16 refuse by name.
16+- `rect_inter_residual_supported` + `rect_inter_luma_set` / `rect_inter_chroma_set`
17+ (decode.rs ~9020): 16x8/8x16 joins 32x16/16x32; the residual call sites pick the
18+ TxbSet from the block's TRUE shape instead of the hard-coded 32x16 pair.
19+- `TxbSet::LumaRect16x8Inter` / `LumaRect16x8InterSet1` (cdf_state.rs):
20+ `LumaRect16x8`'s coefficient tables with the INTER `tx_type` alphabet.
21+ `av1_get_ext_tx_set_type(TX_16X8, is_inter=1, reduced)` = `EXT_TX_SET_DCT_IDTX`
22+ reduced, `EXT_TX_SET_ALL16` otherwise (`tx_size_sqr == TX_8X8`, not TX_16X16),
23+ both at the **TX_8X8** CDF row -- i.e. the existing `inter_tx_type_8` /
24+ `inter_tx_type_8_set1` tables, no new CDF and no new counter-reset entry.
25+ **r2's report was wrong here** (it predicted the 12-symbol
26+ `default_inter_ext_tx_cdf[2][TX_8X8]`); checked against
27+ `blockd.h:1092-1122` + `av1_num_ext_tx_set = {1,2,5,7,12,16}` in the oracle tree.
28+- **Defect found in shipped code (class: table narrowed to the reachable sizes):**
29+ `eob_pt_128_luma_class1` and `eob_pt_32_chroma_class1` did not exist, so
30+ `LumaRect16x8`/`LumaRect16x8Set1` (the INTRA rect leaf, already shipping) and
31+ `ChromaRect8x4` fell back to the 2D `eob_pt` alphabet for `V_DCT`/`H_DCT`
32+ units. Added from `token_cdfs.h:792-848` (plane 0 / plane 1, class index 1),
33+ wired into all four `LumaRect16x8*` sets, `ChromaRect8x4`, and the per-frame
34+ `reset1` list.
35+- **Second defect in shipped code:** `obmc_blend`'s `max_nb` closure was
36+ `1..=4 => 2`, while libaom's `max_neighbor_obmc[] = {0,1,2,3,4,4}` indexed by
37+ `mi_size_{wide,high}_log2` gives 0 for 1 mi and 1 for 2 mi. Only a block under
38+ 16 px on that axis can expose it -- i.e. exactly this round's leaves.
39+- `size_group_wh` (decode.rs): `y_mode` (intra block in an inter frame) and the
40+ `interintra` / `interintra_mode` rows now come from `size_group_lookup[bsize]`
41+ of the block's TRUE footprint. The 32-level rect strips were reading the square
42+ row (3 where libaom says 2); a 16x8 leaf would have read 2 where libaom says 1.
43+ Deviation from charter: not requested, but it is the same defect shape and one
44+ helper covers every caller.
45+- `MOTION_MODE` / `OBMC` CDFs extended from 12 to 14 packed rows with libaom's
46+ `BLOCK_8X16` (index 4) and `BLOCK_16X8` (index 5) entries.
47+
48+## Gate — GREEN
49+
50+`a_real_aomenc_inter_sequence_with_a_16_level_rect_leaf_decodes_pixel_exact`
51+(stream.rs): 16 attempts x {2 axis-structured sources, 2 quantisers, 2
52+`--enable-tx-size-search` arms, 2 motion steps} x {8-bit, 10-bit}, 192x128, 6
53+frames, `--enable-rect-partitions=1 --enable-ab-partitions=0
54+--enable-1to4-partitions=0 --min-partition-size=8 --max-partition-size=16
55+--enable-obmc=0`, per-arm overrides LAST. Every decoded frame compared Y/U/V vs
56+ffmpeg; a refusal is counted, never SKIPped; an attempt carrying no 16-level rect
57+leaf is still required pixel-exact (`oos_mismatch == 0`). Hard asserts: a
58+pixel-exact attempt carrying a 16x8 leaf AND one carrying an 8x16 leaf, per bit
59+depth, plus at least one coded (non-skip) rectangular inter transform unit across
60+the two depths.
61+
62+ cargo test -p ec-av1 --lib 16_level_rect_leaf -- --nocapture
63+
64+EVIDENCE: $HOME/.cache/inter4-suite-r3.log (gate line) | 32 aomenc encodes, decode + ffmpeg Y/U/V compare of every frame | 8-bit: 6 refusals, 5 pixel-exact leaf-carrying attempts, 16x8=3, 8x16=2, coded rect TUs=2, 0 mismatches; 10-bit: 2 refusals, 4 leaf-carrying attempts, 16x8=2, 8x16=3, 0 mismatches
65+
66+## Refusals
67+
68+Lifted: `"an inter partition below 16x16 other than SPLIT (16x8/8x16 rect inter
69+leaves are not coded yet)"`.
70+
71+Added (both in `refusal_inventory.rs`, both named, both narrow):
72+
73+- `"an inter 16x16-level AB or 1:4 partition (HORZ_A/HORZ_B/VERT_A/VERT_B/HORZ_4/VERT_4; ...)"`
74+- `"OBMC on a 16x8/8x16 inter leaf (blend mismatches the reference on this shape)"`
75+
76+## The OBMC residue (open, instrumented)
77+
78+With `--enable-obmc=1` and everything else identical, attempt 10 (8-bit, cq 22,
79+tx-size-search off) decodes all 6 frames but frame 5 has **5302 luma pixels
80+wrong, max |delta| 84, first at (176,0)**; frames 0-4 are exact. The same recipe
81+with `--enable-obmc=0` decodes 5 leaf-carrying attempts pixel-exact, and a run
82+with obmc/warp/interintra/masked-compound ALL off is also exact -- re-enabling
83+obmc alone reproduces it, so warp, interintra and masked compound are exonerated
84+for this shape. The blend geometry in `obmc_blend` was checked element by element
85+against libaom `build_obmc_inter_pred_above`/`_left` and
86+`av1_skip_u4x4_pred_in_obmc` and matches for these shapes; `max_neighbor_obmc`
87+was wrong and is fixed, but the fix left the mismatch byte-identical, so the
88+cause is upstream of the blend (the neighbour walk's `size`/`size_h` stamps for a
89+rect leaf, or `has_top_right`, whose doc still says "no rectangular partition
90+ever produces an inter leaf here"). Refused by name rather than shipped.
91+
92+EVIDENCE: gate run with `--enable-obmc=1` | same 16 attempts, decode + ffmpeg compare | attempt 10 frame 5: 5302 luma pixels differ, max |delta| 84; with `--enable-obmc=0`: 0 mismatches over 5 leaf-carrying attempts
93+
94+## Suite
95+
96+ $HOME/.cache/inter4-suite-r3.log (systemd user unit inter4-suite-1788315557)
97+ test result: ok. 324 passed; 0 failed; 31 ignored; finished in 412.37s
98+
99+Same 323 as r2's baseline plus this round's new gate; the one ignored addition
100+is still r2's own 32x16/16x32 gate. Sibling gates inside that run: every
101+`inter_sequence*`, `8x8_leaf_split`, `tx_select`, `superblock_level_rect_partition`,
102+`obmc`, `warp`, `globalmv`, `force_integer_mv`, `refusal_inventory`,
103+`gate_coverage` -- all green, including the ones that read the tables this round
104+touched (`MOTION_MODE`/`OBMC` rows, `LumaRect16x8*`, `ChromaRect8x4`).
105+
106+EVIDENCE: $HOME/.cache/inter4-suite-r3.log | ec-av1 --lib under a systemd user unit at d913935 | 324 passed / 0 failed / 31 ignored
107+
108+## Residue
109+
110+- **fix-now (r4): OBMC on a 16x8/8x16 leaf** -- named refusal today. Next step is
111+ `has_top_right` for rect inter blocks (libaom's `xd->width < xd->height` /
112+ `> ` / `PARTITION_VERT_A` branches are dropped in our copy) and the
113+ `overlappable_above/left` step caps (`AOMMIN(xd->width, mi_size_wide[nb])`).
114+- **deferred: r2's 32x16/16x32 gate** (`..._with_a_coded_rectangular_residual_...`)
115+ -- still `#[ignore]`d; not re-measured this round (budget). With the 16-level
116+ leaves reachable it may now get past its first rect strip; unblocked by simply
117+ re-running it, which r4 should do before anything else.
118+- **deferred: 16x16 SPLIT under this recipe** -- the gate counts `16x16 SPLITs=0`
119+ on every attempt (aomenc picks NONE/HORZ/VERT at 16 here); the 8x8-leaf path is
120+ gated by its own sibling test, so the count is printed, not asserted.
121+- **accepted: the 10-bit arm proves no residual** -- every 10-bit rect leaf in
122+ this recipe is `skip` at cq 34/22, and cq 30/26 or 24/12 stops reaching a rect
123+ leaf at all (measured). The residual half is asserted across both depths.
124+- **accepted: `_size_group` is now a dead parameter** of `decode_inter_block`
125+ (superseded by `size_group_wh`), kept rather than editing twenty call sites.