forge
Explore
Log in

Don't you dare go Hollow

lane-av1unwritten r5: every subsize-selecting site guarded, not just VERT

Browse files at this commit

22c01115e8a055f6ba38dacfdfe2c1ea051359b7Ahmet Kaan GümüşParent: e898fd7
r4 named six sites instead of sweeping them; r5 closes them.

Each guard is now UNCONDITIONAL on the resolved partition symbol rather than
matches!(sym, PARTITION_VERT). partition_subsize_dims is libaom's
get_partition_subsize (common_data.h:71-90) reduced to dimensions and is exact,
so one call per dispatch covers VERT, VERT_A/VERT_B, HORZ_4 and VERT_4 at once
while the HORZ siblings pass through unchanged.

Installed at:
  key    128 root   match part128   64x128 / 16x64
  key    64 level   match part      32x64 / 16x64      (binds its symbol to
                                                      `part`, not `part64`)
  key    32 level   match part32    16x32 / 8x32
  key    16x16      match part16    4x16
  inter  128 root   match part128   64x128
  inter  64 level   match part64    32x64 / 16x64
  inter  32 level   match part32    16x32 / 8x32
  inter  16x16      match part16    4x16
plus the r3 partition_w8 sites (4x8).

An intermediate attempt put refuse_invalid_subsize(..., PARTITION_VERT_4, ...)
inside a `PARTITION_HORZ_4 | PARTITION_VERT_4 =>` arm, which fired for HORZ_4 as
well and refused nine real 4:2:2 gates -- caught by the scoped test set before
commit. The unconditional form ships.

Still open: none of r5's four items. decode_rect4_16_intrabc remains the
declared exception (another lane's charter).

Regression on r5: 127 fixtures, both trees, per-fixture aggregate hashes --
differing: ['440_request_is_422'], 126 emitting, refused:
['440_request_is_422']. 29 tests green: the libaom table test, the refusal gate
with its 4:2:2 positive control, the realigned 440 gate, the 4:2:2 set and the
sub8 set.
crates/ec-av1/src/decode.rsmodified+36 -12
@@ -35464,9 +35464,7 @@ fn read_sb128_root(
3546435464 // whose 4:2:2 plane block is BLOCK_INVALID; the AB arms select 64x64
3546535465 // quadrants (valid), so PARTITION_HORZ / PARTITION_NONE / SPLIT keep
3546635466 // decoding untouched.
35467- if matches!(part128, PARTITION_VERT) {
35468- refuse_invalid_subsize((128, 128), part128, fctx)?;
35469- }
35467+ refuse_invalid_subsize((128, 128), part128, fctx)?;
3547035468 match part128 {
3547135469 PARTITION_SPLIT => hit!(PART128_SPLIT_HITS),
3547235470 PARTITION_NONE => hit!(PART128_NONE_HITS),
@@ -36148,6 +36146,14 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
3614836146 }
3614936147 }
3615036148 };
36149+ // lane-av1unwritten r5: the partition symbol is RESOLVED (a full CDF read or
36150+ // an edge `gather`) and about to be dispatched. `partition_subsize_dims` is
36151+ // libaom's `get_partition_subsize` (common_data.h:71-90) reduced to
36152+ // dimensions, so this is `decode_partition`'s pre-descend check
36153+ // (decodeframe.c:1449-1458) applied to EVERY arm at once -- VERT,
36154+ // VERT_A / VERT_B, HORZ_4 and VERT_4 included. The HORZ siblings keep
36155+ // decoding because the helper is exact, not a heuristic. the 64x64 level binds its symbol to `part`.
36156+ refuse_invalid_subsize((64, 64), part, fctx)?;
3615136157 match part {
3615236158 PARTITION_NONE => {
3615336159 decode_block(
@@ -36275,9 +36281,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
3627536281 // block selects BLOCK_32X16, whose (1,0) cell is
3627636282 // BLOCK_16X16 (valid) and MUST keep decoding, so the
3627736283 // check is on the symbol's subsize, not the parent's.
36278- if matches!(part32, PARTITION_VERT) {
36279- refuse_invalid_subsize((32, 32), part32, fctx)?;
36280- }
36284+ refuse_invalid_subsize((32, 32), part32, fctx)?;
3628136285 match part32 {
3628236286 PARTITION_NONE => {
3628336287 decode_block(
@@ -36496,9 +36500,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
3649636500 // selects BLOCK_16X4, whose (1,0)
3649736501 // cell is BLOCK_8X4 (valid, the
3649836502 // shape r2 wrongly refused).
36499- if matches!(part16, PARTITION_VERT_4) {
36500- refuse_invalid_subsize((16, 16), part16, fctx)?;
36501- }
36503+ refuse_invalid_subsize((16, 16), part16, fctx)?;
3650236504 match part16 {
3650336505 PARTITION_HORZ_A => {
3650436506 let m_tl =
@@ -53823,6 +53825,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
5382353825 cdef_copy($src, $dst);
5382453826 }};
5382553827 }
53828+ // lane-av1unwritten r5: the partition symbol is RESOLVED (a full CDF read or
53829+ // an edge `gather`) and about to be dispatched. `partition_subsize_dims` is
53830+ // libaom's `get_partition_subsize` (common_data.h:71-90) reduced to
53831+ // dimensions, so this is `decode_partition`'s pre-descend check
53832+ // (decodeframe.c:1449-1458) applied to EVERY arm at once -- VERT,
53833+ // VERT_A / VERT_B, HORZ_4 and VERT_4 included. The HORZ siblings keep
53834+ // decoding because the helper is exact, not a heuristic. (inter-frame duplicate)
53835+ refuse_invalid_subsize((128, 128), part128, fctx)?;
5382653836 match part128 {
5382753837 PARTITION_HORZ_A => {
5382853838 square64_inter!(base_mi);
@@ -54282,9 +54292,7 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
5428254292 // BLOCK_32X64 -- INVALID at 4:2:2. HORZ on the same block
5428354293 // selects BLOCK_64X32, whose (1,0) cell is BLOCK_32X32
5428454294 // (valid) and MUST keep decoding.
54285- if matches!(part64, PARTITION_VERT) {
54286- refuse_invalid_subsize((64, 64), part64, fctx)?;
54287- }
54295+ refuse_invalid_subsize((64, 64), part64, fctx)?;
5428854296 match part64 {
5428954297 PARTITION_HORZ_A => {
5429054298 ab_square32!(tl);
@@ -54416,6 +54424,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
5441654424 }
5441754425 }
5441854426 };
54427+ // lane-av1unwritten r5: the partition symbol is RESOLVED (a full CDF read or
54428+ // an edge `gather`) and about to be dispatched. `partition_subsize_dims` is
54429+ // libaom's `get_partition_subsize` (common_data.h:71-90) reduced to
54430+ // dimensions, so this is `decode_partition`'s pre-descend check
54431+ // (decodeframe.c:1449-1458) applied to EVERY arm at once -- VERT,
54432+ // VERT_A / VERT_B, HORZ_4 and VERT_4 included. The HORZ siblings keep
54433+ // decoding because the helper is exact, not a heuristic. (inter-frame duplicate)
54434+ refuse_invalid_subsize((32, 32), part32, fctx)?;
5441954435 match part32 {
5442054436 PARTITION_NONE => {
5442154437 decode_inter_block(
@@ -54764,6 +54780,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs(
5476454780 )
5476554781 };
5476654782 }
54783+ // lane-av1unwritten r5: the partition symbol is RESOLVED (a full CDF read or
54784+ // an edge `gather`) and about to be dispatched. `partition_subsize_dims` is
54785+ // libaom's `get_partition_subsize` (common_data.h:71-90) reduced to
54786+ // dimensions, so this is `decode_partition`'s pre-descend check
54787+ // (decodeframe.c:1449-1458) applied to EVERY arm at once -- VERT,
54788+ // VERT_A / VERT_B, HORZ_4 and VERT_4 included. The HORZ siblings keep
54789+ // decoding because the helper is exact, not a heuristic. (inter-frame duplicate)
54790+ refuse_invalid_subsize((16, 16), part16, fctx)?;
5476754791 match part16 {
5476854792 PARTITION_HORZ_A => {
5476954793 inter_leaf8!(at16, tl);
lanes/av1unwritten.report.mdmodified+40 -1
@@ -24,6 +24,17 @@ Branch `lane/av1unwritten`, base `main` = `8d6998d7`. No push.
2424 > fixture carries a 16x8 block split `PARTITION_HORZ` at 4:2:2 — and that table
2525 > test is what covers that direction.
2626 >
27+> **r5, on top of r4.** Main: "a found defect is swept whole, not partly."
28+> r4 guarded only the plain `VERT` arm at four sites and named six more. r5
29+> makes every guard UNCONDITIONAL on the resolved symbol — because
30+> `partition_subsize_dims` is exact, passing the symbol covers `VERT`,
31+> `VERT_A`/`VERT_B`, `HORZ_4` and `VERT_4` in one call, and the HORZ siblings
32+> pass through — and adds the three inter-frame duplicates plus the 64x64 key-frame
33+> level that binds its symbol to `part` rather than `part64`. One intermediate
34+> attempt inserted `refuse_invalid_subsize(..., PARTITION_VERT_4, ...)` INSIDE a
35+> `PARTITION_HORZ_4 | PARTITION_VERT_4 =>` arm, which fired for HORZ_4 too and
36+> refused nine real 4:2:2 gates; the unconditional form is what shipped.
37+>
2738 > **r4, on top of r3.** Main: "a found defect is swept whole, not partly."
2839 > r3 named the six remaining sites instead of installing them. r4 installs four
2940 > of them, via a helper that takes the PARTITION SYMBOL and maps it to its
@@ -180,6 +191,34 @@ subsampling mode", av1/decoder/decodeframe.c:1456, refusing by the same rule))
180191
181192 Same refusal class as the oracle, same rule, same shape named.
182193
194+### 3.3 The r5 site table
195+
196+Every site below is guarded UNCONDITIONALLY: the symbol is passed to
197+`refuse_invalid_subsize`, and because `partition_subsize_dims` is exact, every
198+arm of the dispatch is covered at once — `VERT`, `VERT_A`/`VERT_B`, `HORZ_4` and
199+`VERT_4` — while the HORZ siblings pass through. That replaced r4's narrower
200+`matches!(sym, PARTITION_VERT)` guards, which covered only the plain `VERT` arm.
201+
202+| site (key frame unless noted) | subsize it can select | guarded cell | sibling that must keep decoding |
203+|---|---|---|---|
204+| 128 root, `match part128` | `VERT`/`VERT_A`/`VERT_B` -> 64x128 | `(1,0)` INVALID | `HORZ`/`HORZ_A`/`HORZ_B` -> 128x64, `(1,0)` = 64x64 valid |
205+| 64 level, `match part` (symbol bound to `part`) | `VERT`/`VERT_A`/`VERT_B` -> 32x64; `VERT_4` -> 16x64 | `(1,0)` INVALID | `HORZ*` -> 64x32 `(1,0)` = 32x32 valid; `HORZ_4` -> 64x16 `(1,0)` = 32x16 valid |
206+| 32 level, `match part32` | `VERT*` -> 16x32; `VERT_4` -> 8x32 | `(1,0)` INVALID | `HORZ*` -> 32x16 `(1,0)` = 16x16 valid; `HORZ_4` -> 32x8 `(1,0)` = 16x8 valid |
207+| 16x16 level, `match part16` | `VERT_4` -> 4x16 | `(1,0)` INVALID | `HORZ_4` -> 16x4, `(1,0)` = **8x4 valid** — the shape r2 refused |
208+| 8 level, `partition_w8` arms (r3) | `VERT` -> 4x8 | `(1,0)` INVALID | `HORZ` -> 8x4, `(1,0)` = 4x4 valid |
209+| **inter** 128 root, `match part128` | 64x128 | `(1,0)` INVALID | as key |
210+| **inter** 64 level, `match part64` | 32x64; `VERT_4` -> 16x64 | `(1,0)` INVALID | as key |
211+| **inter** 32 level, `match part32` | 16x32; `VERT_4` -> 8x32 | `(1,0)` INVALID | as key |
212+| **inter** 16x16 level, `match part16` | 4x16 | `(1,0)` INVALID | `HORZ_4` -> 16x4 valid |
213+
214+`decode_rect4_16_intrabc` remains the declared exception (another lane's
215+charter). The 8x16 / 16x8 `VERT_4` case is covered by the level-16 guard, whose
216+symbol is the same `PARTITION_VERT_4`; the shape it selects is the four-way child
217+`4x16` at that level, not the `16x4` r2 wrongly refused.
218+
219+**Still open:** none of the four items in r5's list. Each is a one-line call
220+behind the existing helper and all four landed.
221+
183222 ### 3.2 The r4 site table
184223
185224 | site | subsize it can select | cell it guards | sibling that must keep decoding |
@@ -235,7 +274,7 @@ instrument is what would show it if one ever did.
235274 * **Corpus, both trees.** Every fixture decoded with `EC_AV1_FINAL_DUMP`, every
236275 `.f*` hashed. Pre-fix vs post-fix the **126 valid fixtures are byte-identical**
237276 and **none newly refuses**; the witness is the only difference and it now
238- refuses. Re-run on the r4 predicate: `differing:
277+ refuses. Re-run on the r5 predicate: `differing:
239278 ['440_request_is_422']`, 126 fixtures emitting dumps, and exactly one fixture
240279 whose output contains `REFUSED` — the witness. **The sweep cannot see the
241280 (16,4)-at-4:2:2 false positive**: no committed fixture carries a 16x8 block