R2 report
Browse files at this commit3f2d6aef995d5e6dd74c3135a5cc11c5ce83d908Parent: 5925aee- docs
- r2 report
1 changed file +69 -0
- lanes/rect16-r2.report.md +69 -0
lanes/rect16-r2.report.mdadded+69 -0
| @@ -0,0 +1,69 @@ | ||
| 1 | +# lane-rect16 r2 report | |
| 2 | + | |
| 3 | +## What 34827e1 (builder's in-flight commit) actually contained | |
| 4 | +- Discovered mandelbrot's real first refusal was `PARTITION_VERT_B` at mi=(3,2), not plain HORZ/VERT | |
| 5 | + (the lane's original charter premise). Wired VERT_B: left 8x16 strip via existing `decode_block_rect` | |
| 6 | + (skip-only, at its natural SUB-grid position) + two 8x8 leaves via existing `decode_leaf8`. | |
| 7 | +- Added a gate test `a_real_aomenc_stream_with_mandelbrot_fires_the_vert_b_partition_arm` asserting | |
| 8 | + `vert_b_intra_hits() > 0`. | |
| 9 | +- BUG: that gate's aomenc invocation was missing `--passes=1` (every one of the other 42 aomenc | |
| 10 | + recipes in stream.rs has it) -- aomenc silently ran 2-pass and pass 1 wrote an EMPTY stream to | |
| 11 | + stdout, still exit 0. So the gate always decoded zero bytes and never actually fired anything; | |
| 12 | + it was vacuous, and it is the 1 failing test in the pre-merge suite (266 passed/1 failed). | |
| 13 | + | |
| 14 | +## Premise re-check | |
| 15 | +Confirmed still-live with `decode_probe` against a real aomenc stream (`--cpu-used=4 --end-usage=q | |
| 16 | +--cq-level=32 --passes=1`, sb-size=64, threads=1): before my fix, mandelbrot still stopped at | |
| 17 | +`REFUSED: ... (a partition below 16x16 other than a clean split or a VERT_B ...)`. Added a | |
| 18 | +`EC_RECT16_DEBUG` temporary eprintln (removed) to find WHICH part16 value: **`part16=1` | |
| 19 | +(`PARTITION_HORZ`) at mi=(0,7)`** -- the mandelbrot blocker is a plain HORZ, decode-order-earlier | |
| 20 | +than VERT_B's mi=(3,2), even though VERT_B's own doc claimed "frame 0's very first non-NONE/SPLIT | |
| 21 | +symbol" (that claim was about z-order recursion, and was simply wrong once traced against real | |
| 22 | +decode order). So the ORIGINAL lane charter target (plain HORZ/VERT below 16x16) was correct all | |
| 23 | +along; the r1 VERT_B work was real and worth keeping, just not the frontmost blocker. | |
| 24 | + | |
| 25 | +## What I built | |
| 26 | +New `decode_leaf_rect` (crates/ec-av1/src/decode.rs), sibling to `decode_leaf8` the way | |
| 27 | +`decode_block_rect` is sibling to `decode_block`: takes REAL mi coordinates (not derived from an | |
| 28 | +SUB-grid `outer_at`), so it can address a HORZ/VERT split's offset second strip, which | |
| 29 | +`decode_block_rect`'s `px = c * SUB` formula cannot name (that was VERT_B's r1 doc-noted gap). | |
| 30 | +Uses `read_intra_mode_rect` for mode/skip/tx-depth, `record_mi_rect`/`fill_skip_grid_rect`/ | |
| 31 | +`fill_lf_grid_rect` for fine-grained neighbour bookkeeping (never the coarse `record_rect`), and | |
| 32 | +`prev_leaf` chaining exactly like `decode_leaf8` for the second strip's above/left context. | |
| 33 | +Wired into `decode_key_frame_tile_with_cdfs` next to the VERT_B arm: `PARTITION_HORZ` -> two 16x8 | |
| 34 | +strips (top/bottom, mi row step 2); `PARTITION_VERT` -> two 8x16 strips (left/right, mi col step 2). | |
| 35 | +New hit counter `horz_vert_intra_hits()` (thread-local `Cell<usize>`, same pattern as | |
| 36 | +`vert_b_intra_hits`). | |
| 37 | + | |
| 38 | +## Ceiling hit | |
| 39 | +Only the SKIP case is ported (matches `decode_block_rect`'s own precedent at this size range and | |
| 40 | +VERT_B's own left-strip precedent): a coded (non-skip) HORZ/VERT strip below 16x16 has no | |
| 41 | +rectangular-transform coefficient tables here yet (same square-only-transform ceiling as the | |
| 42 | +sibling `lane-sub8`/`decode_block_rect` non-skip refusal at (16,8)/(8,16)), refused by name: | |
| 43 | +`"a coded (non-skip) HORZ/VERT rect strip below 16x16 (this decoder ports only the skip case at | |
| 44 | +this size)"`. Filter-intra on this strip is also refused by name (mirrors the existing | |
| 45 | +`decode_block_rect` refusal). Both added to `refusal_inventory.rs`'s pinned `REFUSALS` list. | |
| 46 | +Generic multi-way refusal string updated to `"a HORZ_A/HORZ_B/VERT_A partition below 16x16 ..."` | |
| 47 | +(HORZ_A/HORZ_B/VERT_A remain out of scope this round) and repinned. | |
| 48 | + | |
| 49 | +## Live mandelbrot re-probe after the fix | |
| 50 | +Decode now gets PAST mi=(0,7)'s HORZ arm entirely (structurally proven -- reads real symbols, | |
| 51 | +reconstructs) and stops at the coded-strip ceiling: `REFUSED: ... (a coded (non-skip) HORZ/VERT | |
| 52 | +rect strip below 16x16 ...)`. Tried cq=20/40/50/63 too: 20 hits the same coded-strip ceiling, | |
| 53 | +40 hits an unrelated pre-existing "partition below 8x8" refusal, 50/63 hit the filter-intra-on-strip | |
| 54 | +refusal (also newly wired, proving it reads real symbols too). No recipe reached a pixel-exact full | |
| 55 | +decode of this stream -- consistent with VERT_B's own r1 finding, not a regression I introduced. | |
| 56 | + | |
| 57 | +## Gate | |
| 58 | +`stream::tests::a_real_aomenc_stream_with_mandelbrot_fires_the_vert_b_partition_arm` (kept its old | |
| 59 | +name to avoid extra churn; doc comment rewritten to explain r1 vs r2 findings): fixed the missing | |
| 60 | +`--passes=1` (now asserts `!stream.is_empty()` as a guard against the same vacuous-gate class | |
| 61 | +recurring), swapped its hard assertion from `vert_b_intra_hits() > 0` (never true on this stream | |
| 62 | +post-fix, since HORZ blocks decode first) to `horz_vert_intra_hits() > 0`. | |
| 63 | +`EVIDENCE: cargo test -p ec-av1 --lib -- a_real_aomenc_stream_with_mandelbrot_fires_the_vert_b_partition_arm --nocapture | horz_vert_intra_hits=1, vert_b_intra_hits=0, decode result: Err("... coded (non-skip) HORZ/VERT ...")` | |
| 64 | + | |
| 65 | +## Suite / check | |
| 66 | +`cargo test -p ec-av1 --lib -j4 -- --test-threads=4`: 267 passed, 0 failed, 20 ignored (was 266/1 | |
| 67 | +pre-fix, the 1 failure being the vacuous gate above). | |
| 68 | +`cargo check --workspace --all-targets -j4`: clean, no errors, only pre-existing warnings. | |
| 69 | +HEAD: 7a49307 (branch lane-rect16). |