lane-av1unwritten r5: every subsize-selecting site guarded, not just VERT
Browse files at this commit22c01115e8a055f6ba38dacfdfe2c1ea051359b7Parent: e898fd72 changed files +72 -9
- crates/ec-av1/src/decode.rs +32 -8
- lanes/av1unwritten.report.md +40 -1
crates/ec-av1/src/decode.rsmodified+32 -8
| @@ -35464,9 +35464,7 @@ fn read_sb128_root( | |||
| 35464 | // whose 4:2:2 plane block is BLOCK_INVALID; the AB arms select 64x64 | 35464 | // whose 4:2:2 plane block is BLOCK_INVALID; the AB arms select 64x64 |
| 35465 | // quadrants (valid), so PARTITION_HORZ / PARTITION_NONE / SPLIT keep | 35465 | // quadrants (valid), so PARTITION_HORZ / PARTITION_NONE / SPLIT keep |
| 35466 | // decoding untouched. | 35466 | // decoding untouched. |
| 35467 | - if matches!(part128, PARTITION_VERT) { | ||
| 35468 | refuse_invalid_subsize((128, 128), part128, fctx)?; | 35467 | refuse_invalid_subsize((128, 128), part128, fctx)?; |
| 35469 | - } | ||
| 35470 | match part128 { | 35468 | match part128 { |
| 35471 | PARTITION_SPLIT => hit!(PART128_SPLIT_HITS), | 35469 | PARTITION_SPLIT => hit!(PART128_SPLIT_HITS), |
| 35472 | PARTITION_NONE => hit!(PART128_NONE_HITS), | 35470 | PARTITION_NONE => hit!(PART128_NONE_HITS), |
| @@ -36148,6 +36146,14 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 36148 | } | 36146 | } |
| 36149 | } | 36147 | } |
| 36150 | }; | 36148 | }; |
| 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)?; | ||
| 36151 | match part { | 36157 | match part { |
| 36152 | PARTITION_NONE => { | 36158 | PARTITION_NONE => { |
| 36153 | decode_block( | 36159 | decode_block( |
| @@ -36275,9 +36281,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 36275 | // block selects BLOCK_32X16, whose (1,0) cell is | 36281 | // block selects BLOCK_32X16, whose (1,0) cell is |
| 36276 | // BLOCK_16X16 (valid) and MUST keep decoding, so the | 36282 | // BLOCK_16X16 (valid) and MUST keep decoding, so the |
| 36277 | // check is on the symbol's subsize, not the parent's. | 36283 | // 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)?; | 36284 | refuse_invalid_subsize((32, 32), part32, fctx)?; |
| 36280 | - } | ||
| 36281 | match part32 { | 36285 | match part32 { |
| 36282 | PARTITION_NONE => { | 36286 | PARTITION_NONE => { |
| 36283 | decode_block( | 36287 | decode_block( |
| @@ -36496,9 +36500,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 36496 | // selects BLOCK_16X4, whose (1,0) | 36500 | // selects BLOCK_16X4, whose (1,0) |
| 36497 | // cell is BLOCK_8X4 (valid, the | 36501 | // cell is BLOCK_8X4 (valid, the |
| 36498 | // shape r2 wrongly refused). | 36502 | // shape r2 wrongly refused). |
| 36499 | - if matches!(part16, PARTITION_VERT_4) { | ||
| 36500 | refuse_invalid_subsize((16, 16), part16, fctx)?; | 36503 | refuse_invalid_subsize((16, 16), part16, fctx)?; |
| 36501 | - } | ||
| 36502 | match part16 { | 36504 | match part16 { |
| 36503 | PARTITION_HORZ_A => { | 36505 | PARTITION_HORZ_A => { |
| 36504 | let m_tl = | 36506 | let m_tl = |
| @@ -53823,6 +53825,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 53823 | cdef_copy($src, $dst); | 53825 | cdef_copy($src, $dst); |
| 53824 | }}; | 53826 | }}; |
| 53825 | } | 53827 | } |
| 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)?; | ||
| 53826 | match part128 { | 53836 | match part128 { |
| 53827 | PARTITION_HORZ_A => { | 53837 | PARTITION_HORZ_A => { |
| 53828 | square64_inter!(base_mi); | 53838 | square64_inter!(base_mi); |
| @@ -54282,9 +54292,7 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 54282 | // BLOCK_32X64 -- INVALID at 4:2:2. HORZ on the same block | 54292 | // BLOCK_32X64 -- INVALID at 4:2:2. HORZ on the same block |
| 54283 | // selects BLOCK_64X32, whose (1,0) cell is BLOCK_32X32 | 54293 | // selects BLOCK_64X32, whose (1,0) cell is BLOCK_32X32 |
| 54284 | // (valid) and MUST keep decoding. | 54294 | // (valid) and MUST keep decoding. |
| 54285 | - if matches!(part64, PARTITION_VERT) { | ||
| 54286 | refuse_invalid_subsize((64, 64), part64, fctx)?; | 54295 | refuse_invalid_subsize((64, 64), part64, fctx)?; |
| 54287 | - } | ||
| 54288 | match part64 { | 54296 | match part64 { |
| 54289 | PARTITION_HORZ_A => { | 54297 | PARTITION_HORZ_A => { |
| 54290 | ab_square32!(tl); | 54298 | ab_square32!(tl); |
| @@ -54416,6 +54424,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 54416 | } | 54424 | } |
| 54417 | } | 54425 | } |
| 54418 | }; | 54426 | }; |
| 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)?; | ||
| 54419 | match part32 { | 54435 | match part32 { |
| 54420 | PARTITION_NONE => { | 54436 | PARTITION_NONE => { |
| 54421 | decode_inter_block( | 54437 | decode_inter_block( |
| @@ -54764,6 +54780,14 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 54764 | ) | 54780 | ) |
| 54765 | }; | 54781 | }; |
| 54766 | } | 54782 | } |
| 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)?; | ||
| 54767 | match part16 { | 54791 | match part16 { |
| 54768 | PARTITION_HORZ_A => { | 54792 | PARTITION_HORZ_A => { |
| 54769 | inter_leaf8!(at16, tl); | 54793 | inter_leaf8!(at16, tl); |
lanes/av1unwritten.report.mdmodified+40 -1
| @@ -24,6 +24,17 @@ Branch `lane/av1unwritten`, base `main` = `8d6998d7`. No push. | |||
| 24 | > fixture carries a 16x8 block split `PARTITION_HORZ` at 4:2:2 — and that table | 24 | > fixture carries a 16x8 block split `PARTITION_HORZ` at 4:2:2 — and that table |
| 25 | > test is what covers that direction. | 25 | > test is what covers that direction. |
| 26 | > | 26 | > |
| 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 | +> | ||
| 27 | > **r4, on top of r3.** Main: "a found defect is swept whole, not partly." | 38 | > **r4, on top of r3.** Main: "a found defect is swept whole, not partly." |
| 28 | > r3 named the six remaining sites instead of installing them. r4 installs four | 39 | > r3 named the six remaining sites instead of installing them. r4 installs four |
| 29 | > of them, via a helper that takes the PARTITION SYMBOL and maps it to its | 40 | > 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)) | |||
| 180 | 191 | ||
| 181 | Same refusal class as the oracle, same rule, same shape named. | 192 | Same refusal class as the oracle, same rule, same shape named. |
| 182 | 193 | ||
| 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 | + | ||
| 183 | ### 3.2 The r4 site table | 222 | ### 3.2 The r4 site table |
| 184 | 223 | ||
| 185 | | site | subsize it can select | cell it guards | sibling that must keep decoding | | 224 | | 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. | |||
| 235 | * **Corpus, both trees.** Every fixture decoded with `EC_AV1_FINAL_DUMP`, every | 274 | * **Corpus, both trees.** Every fixture decoded with `EC_AV1_FINAL_DUMP`, every |
| 236 | `.f*` hashed. Pre-fix vs post-fix the **126 valid fixtures are byte-identical** | 275 | `.f*` hashed. Pre-fix vs post-fix the **126 valid fixtures are byte-identical** |
| 237 | and **none newly refuses**; the witness is the only difference and it now | 276 | 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: |
| 239 | ['440_request_is_422']`, 126 fixtures emitting dumps, and exactly one fixture | 278 | ['440_request_is_422']`, 126 fixtures emitting dumps, and exactly one fixture |
| 240 | whose output contains `REFUSED` — the witness. **The sweep cannot see the | 279 | whose output contains `REFUSED` — the witness. **The sweep cannot see the |
| 241 | (16,4)-at-4:2:2 false positive**: no committed fixture carries a 16x8 block | 280 | (16,4)-at-4:2:2 false positive**: no committed fixture carries a 16x8 block |