Round 1+2 report
Browse files at this commit5d4c55529541f18ad48ba93ca82088baa879f937Parent: 4940cb1- docs
- round 1+2 report
1 changed file +108 -0
- lanes/sub8-r1.report.md +108 -0
lanes/sub8-r1.report.mdadded+108 -0
| @@ -0,0 +1,108 @@ | |||
| 1 | +# lane-sub8 report (rounds 1-2) | ||
| 2 | + | ||
| 3 | +## Round 1 (2f35dec, a564705) | ||
| 4 | +Implemented `read_intra_mode_sub8` + `decode_leaf_split4` in | ||
| 5 | +`crates/ec-av1/src/decode.rs` (~5140-5370): decodes `PARTITION_SPLIT` of an | ||
| 6 | +8x8 intra block into four `BLOCK_4X4` leaves (spec `decode_partition`'s | ||
| 7 | +recursion bottom). Both intra call sites (the straddle path and the clean | ||
| 8 | +16x16-SPLIT path) branch on the new `part8` read; `PARTITION_HORZ`/`VERT` | ||
| 9 | +below 8x8 and all inter sub-8x8 stay refused by name. | ||
| 10 | + | ||
| 11 | +**is_chroma_reference derivation** (spec/libaom `av1_common_int.h:1454`): | ||
| 12 | +for 4:2:0 subsampling, only the *last* (bottom-right, index 3) of the four | ||
| 13 | +4x4 leaves in a split 8x8 group carries chroma syntax at all -- the whole | ||
| 14 | +8x8 group's one 4x4 chroma unit is read and reconstructed once, on that | ||
| 15 | +leaf. `decode_leaf_split4` implements this via `has_chroma = i == 3`. | ||
| 16 | + | ||
| 17 | +**Filter-intra CDF row**: `BLOCK_4X4`'s own row (`cdf.rs FILTER_INTRA[0] = | ||
| 18 | +4621`) is already present and is what every sub-8x8 leaf here uses | ||
| 19 | +(`filter_intra_size_class(4)` in libaom is class 0 for all sub-8x8 sizes). | ||
| 20 | +If 4x8/8x4 (HORZ/VERT below 8x8) were ever implemented, they would need two | ||
| 21 | +*more* rows: `BLOCK_4X8 = 6743`, `BLOCK_8X4 = 5893` (libaom | ||
| 22 | +`BLOCK_SIZES_ALL` order, values from `entropymode.c:821`) -- not present | ||
| 23 | +in this table yet. | ||
| 24 | + | ||
| 25 | +**Why HORZ/VERT below 8x8 stays refused**: this decoder's transform | ||
| 26 | +primitive is square-only. A real 4x8/8x4 leaf needs an actual rectangular | ||
| 27 | +TX_4X8/TX_8X4 transform (scan order, EOB context, coefficient CDF set all | ||
| 28 | +differ from the square 4x4 case); faking it as two 4x4 squares would desync | ||
| 29 | +against a real encoder immediately. This is a scope cut, not a bug -- | ||
| 30 | +tracked by refusal name in `refusal_inventory.rs`. | ||
| 31 | + | ||
| 32 | +## Round 2 (6703411) | ||
| 33 | +Round 1 left the gate (`a_real_aomenc_stream_with_a_sub8_split_decodes_pixel_exact`, | ||
| 34 | +`stream.rs` ~6604) uncompiled. It now compiles clean | ||
| 35 | +(`cargo check -p ec-av1 --lib`, zero errors). **The gate is still RED.** | ||
| 36 | + | ||
| 37 | +### What was tried | ||
| 38 | +1. `--enable-rect-partitions=0` added to the aomenc recipe: necessary but | ||
| 39 | + not sufficient. Without it, aomenc picks a real `PARTITION_HORZ`/`VERT` | ||
| 40 | + at 8x8 (still refused by name) in ~63% of the original 40 attempts | ||
| 41 | + (25/40). With it, that specific refusal drops but the gate still hits | ||
| 42 | + 0/160 total passing attempts across two fixture shapes (see below). | ||
| 43 | +2. Shrinking the fixture to a single-16x16-leaf frame (16x16 pixels, so at | ||
| 44 | + most four 8x8 candidates exist in the whole frame) to structurally rule | ||
| 45 | + out a second, still-refused HORZ/VERT leaf sharing the tile. This | ||
| 46 | + surfaced an **unrelated, pre-existing tiny-frame defect**: a plain | ||
| 47 | + 16x16 aomenc stream with NO `--min-partition-size`/`--max-partition-size` | ||
| 48 | + override and no sub8 code involved at all (`decode_leaf_split4` never | ||
| 49 | + called) still decodes with wrong pixels for most seeds (2/3 sampled). | ||
| 50 | + `EC_AV1_TRACE=1` shows the bitstream parses cleanly (no refusal, no | ||
| 51 | + panic, valid-looking symbol values throughout) but the picture desyncs | ||
| 52 | + silently partway through -- consistent with the frame-edge/"true edge | ||
| 53 | + straddle" logic (`decode.rs` ~6864-6957, the `has_cols16`/`has_rows16` | ||
| 54 | + branch) being exercised at a degenerate case (frame == exactly one | ||
| 55 | + 16x16 block, most of the SB out of frame) that larger sub-SB frames | ||
| 56 | + (32x32, 64x64, used successfully elsewhere in this file) don't reach. | ||
| 57 | + **Out of scope for this lane** -- not touched, not fixed, flagged here | ||
| 58 | + for whichever lane owns edge-straddle handling next. | ||
| 59 | +3. Widening the seed/cq sweep for the 64x64 fixture (with | ||
| 60 | + `--enable-rect-partitions=0`) to 160 total attempts across two batches: | ||
| 61 | + still 0 passes. | ||
| 62 | + | ||
| 63 | +### The actual finding | ||
| 64 | +`EC_AV1_TRACE=1` on failing 64x64 attempts shows the pattern directly: | ||
| 65 | +`partition_w8 mi=(0,0) ... value=3` (a real, clean `PARTITION_SPLIT`, | ||
| 66 | +`decode_leaf_split4` fires, `SUB8_SPLIT_HITS` increments) is immediately | ||
| 67 | +followed by `partition_w8 mi=(0,2) ... value=2` (`PARTITION_VERT`) on the | ||
| 68 | +very next sibling 8x8 leaf in the same 16x16 parent -- and that leaf hits | ||
| 69 | +the (correct, by-design) HORZ/VERT-below-8x8 refusal. This happened on | ||
| 70 | +every single attempt that reached a SPLIT at all, which is not consistent | ||
| 71 | +with random encoder choice given `--enable-rect-partitions=0` is set (per | ||
| 72 | +libaom `partition_search.c`'s `do_rectangular_split` gating, that flag | ||
| 73 | +should make `PARTITION_HORZ`/`VERT` unreachable via RD at 8x8 too). The | ||
| 74 | +more consistent read: `decode_leaf_split4`/`read_intra_mode_sub8` leaves | ||
| 75 | +some piece of decoder, CDF, or neighbour-context state wrong on return, and | ||
| 76 | +the very next `partition_w8` symbol read (on the sibling leaf) decodes a | ||
| 77 | +value the real bitstream did not write -- i.e. a real desync introduced by | ||
| 78 | +this round's own new code, immediately after it runs. | ||
| 79 | + | ||
| 80 | +**This was not chased down further this round** -- turn budget spent | ||
| 81 | +finding and narrowing it. Next round should NOT try more fixture-shape | ||
| 82 | +workarounds; instead: trace `dec`'s range/tell before and after | ||
| 83 | +`decode_leaf_split4` against a byte-identical aomdec run (mirror the | ||
| 84 | +`av1-mvstack-refmv-corner`/`cdf-counter-not-reset` class method: exact | ||
| 85 | +range ladder up to the read, compare the step) to find which of | ||
| 86 | +`read_intra_mode_sub8`'s reads or which piece of `Neighbours`/CDF | ||
| 87 | +bookkeeping in `decode_leaf_split4`'s tail (the chroma-neighbour section, | ||
| 88 | +lines ~5346-5369) is wrong. | ||
| 89 | + | ||
| 90 | +### Suite / build state at HEAD (6703411) | ||
| 91 | +- `cargo check -p ec-av1 --lib`: clean, 0 errors. | ||
| 92 | +- Gate `a_real_aomenc_stream_with_a_sub8_split_decodes_pixel_exact`: FAILS | ||
| 93 | + (0/40 in-suite attempts pass; `sub8_split_hits()` DOES go nonzero during | ||
| 94 | + the run -- the SPLIT path fires -- but no attempt completes pixel-exact). | ||
| 95 | +- Full `cargo test -p ec-av1 --lib` and ReelB extract probe: not run | ||
| 96 | + this round (turn budget spent on the above investigation). Deferred to | ||
| 97 | + round 3. | ||
| 98 | + | ||
| 99 | +## Open (round 3 charter should start here) | ||
| 100 | +- fix-now candidate: the desync in `decode_leaf_split4`/ | ||
| 101 | + `read_intra_mode_sub8` (see "the actual finding" above) -- root cause, | ||
| 102 | + not yet found. | ||
| 103 | +- deferred: tiny-frame (exactly-16x16) edge-straddle defect, unrelated to | ||
| 104 | + sub8, found as a side effect of workaround #2 above -- needs its own | ||
| 105 | + charter, not this lane's. | ||
| 106 | +- deferred: ReelB extract probe (charter step 4) and the ledger | ||
| 107 | + append for round 1's findings (charter step 5) -- partially done here | ||
| 108 | + (this file), full ledger append below. | ||