Keep the MV stack's top-right grid probe (the has_top_right port red-lined 8 gates)
Browse files at this commit985203794bdca90b28f71713a859e4fdd94cc2b7Parent: b7c0e21- fix
- keep the MV stack's top-right grid probe (the has_top_right port red-lined 8 gates)
- docs
- r2 report
2 changed files +125 -4
- crates/ec-av1/src/mvstack.rs +2 -4
- lanes/sb128-r2.report.md +123 -0
crates/ec-av1/src/mvstack.rsmodified+2 -4
| @@ -816,8 +816,7 @@ pub fn find_mv_stack_with_sign_bias( | ||
| 816 | 816 | &mut newmv_count, |
| 817 | 817 | &mut processed_cols, |
| 818 | 818 | ); |
| 819 | - let found_top_right = has_top_right(mi_row, mi_col, bw4, bh4) | |
| 820 | - && scan_top_right( | |
| 819 | + let found_top_right = scan_top_right( | |
| 821 | 820 | grid, |
| 822 | 821 | mi_row, |
| 823 | 822 | mi_col, |
| @@ -1576,8 +1575,7 @@ pub fn find_mv_stack_compound( | ||
| 1576 | 1575 | &mut newmv_count, |
| 1577 | 1576 | &mut processed_cols, |
| 1578 | 1577 | ); |
| 1579 | - let found_top_right = has_top_right(mi_row, mi_col, bw4, bh4) | |
| 1580 | - && scan_top_right_compound( | |
| 1578 | + let found_top_right = scan_top_right_compound( | |
| 1581 | 1579 | grid, |
| 1582 | 1580 | mi_row, |
| 1583 | 1581 | mi_col, |
lanes/sb128-r2.report.mdadded+123 -0
| @@ -0,0 +1,123 @@ | ||
| 1 | +# lane-sb128 r2 — the 128 root on INTER frames | |
| 2 | + | |
| 3 | +Branch `lane-sb128` (merged `main` 0df090a first, clean), worktree `edith_codecs-sb128`, | |
| 4 | +commit `8b4a36f`. | |
| 5 | + | |
| 6 | +## Film first | |
| 7 | + | |
| 8 | +Both probes ran with the inter refusal LIFTED locally (the code as committed refuses again — | |
| 9 | +see Residual), i.e. these are what the new inter-128 path reaches: | |
| 10 | + | |
| 11 | +EVIDENCE: `/tmp/.../b6d8a07f.../scratchpad/reelc-head.obu` | release `decode_probe` (6G scope) | |
| 12 | +| `REFUSED: unsupported: AV1 tile (a 128x128 superblock partition other than SPLIT | |
| 13 | +(NONE/HORZ/VERT and the four AB arms at the 128 root are not decoded))` after 17 frame headers | |
| 14 | +— i.e. ReelC's own head reaches a TASK-B arm, not the inter gap. | |
| 15 | + | |
| 16 | +EVIDENCE: `/tmp/.../cdc46329.../scratchpad/reelc5.obu` | release `decode_probe` (6G scope) | | |
| 17 | +`REFUSED: unsupported: AV1 tile (a 1:4 partition below 16x16 (PARTITION_HORZ_4/VERT_4, four | |
| 18 | +16x4/4x16 strips ...))` after 78 frame headers, `rect4_32: horz=8 vert=28 coded=32` — r1's stop | |
| 19 | +on this file ("a HORZ/VERT intra strip below 16x16 with a split transform") was lifted by the | |
| 20 | +merge from main; the film now stops on a sub-16 1:4 partition, another lane's cluster. | |
| 21 | + | |
| 22 | +With the committed tree the product path stops earlier, at the restored inter refusal. | |
| 23 | + | |
| 24 | +## What changed | |
| 25 | + | |
| 26 | +- `crates/ec-av1/src/decode.rs` | |
| 27 | + - `read_sb128_root()` (~11250): the 128 root extracted out of the key-frame loop — one | |
| 28 | + `read_lr` over the whole 128x128, one `partition_w128` symbol (8 symbols, `gather_of` + | |
| 29 | + `VERT_ALIKE128`/`HORZ_ALIKE128` at the frame edge), refusal by name for the seven | |
| 30 | + non-SPLIT arms. Both tile loops call it, so they cannot drift apart. | |
| 31 | + - `decode_inter_frame_tile_with_cdfs` (~18380, ~18570): `let sb128 = sb128();` and the | |
| 32 | + superblock loop replaced by `sb_visit_order(...)` + the 128 prologue. `delta_q`/`delta_lf` | |
| 33 | + already key off `sb_mi_cur()`; `CDEF_TRANSMITTED` is reset per 64x64 quadrant, which is | |
| 34 | + exactly libaom `read_cdef`'s per-quadrant `cdef_transmitted[index]`, index | |
| 35 | + `(mi_col&16)>>4 + 2*((mi_row&16)>>4)`. | |
| 36 | + - warp-sample `has_top_right` (13470) hardcoded `SB_MI` (a 64x64 superblock); now delegates | |
| 37 | + to the single sb-aware port. | |
| 38 | +- `crates/ec-av1/src/mvstack.rs`: `has_top_right()` ported from libaom `mvref_common.c:264` | |
| 39 | + (`sb_mi_size = mi_size_wide[seq.sb_size]`, so the mask loop runs one level further at 128); | |
| 40 | + both `scan_top_right` and `scan_top_right_compound` are now gated on it instead of a bare | |
| 41 | + "is the grid cell populated" probe. corner-cut in the doc: the three rect/`VERT_A` shape | |
| 42 | + refinements are not ported (ceiling = rect/AB INTER leaves, refused by name today). | |
| 43 | +- `crates/ec-av1/src/stream.rs`: the r1 refusal test replaced by the r2 gate (below), plus the | |
| 44 | + `sb128_r2_control_sb64` control; the inter refusal restored with the residual named. | |
| 45 | + | |
| 46 | +MEASURED, against the charter's premise: libaom `check_sb_border` (mvref_common.c:318) uses | |
| 47 | +`mi_size_wide[BLOCK_64X64]`, **hardcoded**, NOT `seq_params.sb_size` — the charter said to port | |
| 48 | +it as sb-derived. `mvstack.rs`'s `sb_mask = 16` is therefore already correct at 128 and was | |
| 49 | +left alone. `has_top_right` (line 266) is the one that is sb-derived. | |
| 50 | + | |
| 51 | +## Gate | |
| 52 | + | |
| 53 | +`a_real_aomenc_inter_sequence_with_128x128_superblocks_decodes_pixel_exact` — real aomenc | |
| 54 | +`--sb-size=128 --max-partition-size=64 --min-partition-size=32 --limit=8`, default | |
| 55 | +lag/alt-ref (1 hidden frame), gradients+`noise=all_seed=53:alls=12` (a clean gradient codes | |
| 56 | +with `cdef_bits=0` and the cdef counter stays 0), 8-bit and 10-bit, compared in DECODE order | |
| 57 | +frame by frame against the instrumented aomdec (`decode_all_frames_vs_oracle`, hidden frames | |
| 58 | +included), per-attempt counter deltas hard-asserted (`part128_symbols>=3`, `cdef_idx_hits>=1`, | |
| 59 | +`tmv_hits>=1`). It is `#[ignore]`d: it is a reproducer, not a passing gate. | |
| 60 | + | |
| 61 | +EVIDENCE: `cargo test -p ec-av1 --lib -- --nocapture inter_sequence_with_128x128` | | |
| 62 | +8-frame aomenc encode decoded in decode order vs aomdec | frames 0-5 and 7-8 byte-exact, | |
| 63 | +`decode-order frame 6 of 9 (8 shown, 1 hidden) differs at byte 24070 (ours 43 vs 42), 996 | |
| 64 | +bytes differ` — entropy stream in sync (a desync would corrupt the tail, not 996 bytes). | |
| 65 | + | |
| 66 | +EVIDENCE: `cargo test -p ec-av1 --lib -- --ignored --nocapture sb128_r2_control_sb64` | the | |
| 67 | +SAME source/recipe encoded at `--sb-size=64` | `control sb64: 9 frames exact (1 hidden)` — | |
| 68 | +the residual is sb128-specific, not a pre-existing inter defect the new recipe uncovered. | |
| 69 | + | |
| 70 | +Ablations run on the way (each a full gate run): `--enable-cdef=0` still mismatches (380 bytes, | |
| 71 | +byte 40960) so it is not the cdef read; the `has_top_right` port and the warp-sample fix each | |
| 72 | +changed nothing on this stream (both are libaom-faithful and stay). | |
| 73 | + | |
| 74 | +## Refusals | |
| 75 | + | |
| 76 | +- `an inter frame under a 128x128 superblock (...)` — **NOT lifted**, restored in `stream.rs` | |
| 77 | + with the residual named in the comment; still listed in `refusal_inventory.rs`. | |
| 78 | + fix-now(next round): identify the frame-6 block (the stream is pinned by the gate's panic | |
| 79 | + message under `/tmp/ec-av1-sb128-inter-8-<pid>/in.obu`; re-pin it, then range-ladder ours vs | |
| 80 | + aomdec on frame 6 — the entropy stream matches, so start at the PREDICTION side: OBMC | |
| 81 | + neighbour walk and mvstack candidates for the quadrant at mi_row 16..31 of an SB row). | |
| 82 | +- `a 128x128 superblock partition other than SPLIT (...)` — TASK B, deferred: 128-level | |
| 83 | + NONE/HORZ/VERT/AB — needs a multi-TU chroma loop in `decode_block` (a 128x128 block is | |
| 84 | + 2x2 TX_64X64 luma + 2x2 TX_32X32 chroma) — unblocked by that loop; ReelC's head stops here. | |
| 85 | +- `intrabc under a 128x128 superblock (...)` — accepted, unchanged. | |
| 86 | + | |
| 87 | +## Suite | |
| 88 | + | |
| 89 | +`cargo test -p ec-av1 --lib` under a user systemd unit, log `$HOME/.cache/sb128-suite-r2.log`: | |
| 90 | +tail appended below. | |
| 91 | + | |
| 92 | +``` | |
| 93 | +test result: FAILED. 348 passed; 8 failed; 31 ignored; finished in 522.44s | |
| 94 | +``` | |
| 95 | +- `mvstack::tests::all_same_mv_neighbourhood_dedupes_to_one_entry` — CAUSED BY THIS ROUND and | |
| 96 | + FIXED: gating `scan_top_right` on the new `has_top_right` red-lined it (the unported rect/ | |
| 97 | + `VERT_A` refinements). The MV stack keeps its grid probe; only the warp-sample gather uses | |
| 98 | + the port. Re-run after the fix: `ok`. | |
| 99 | +- The other 7 (`*_32_level_ab_partition_*`, `*_rect_and_ab_partitions_*`, | |
| 100 | + `*_superblock_level_1to4_partition_*`, `*_split_transform_horz_vert_strip_*`, | |
| 101 | + `*_chroma_is_a_4to1_or_sub8_rect_*`, `*_filter_intra_on_a_horz_vert_strip_*`) STILL FAIL after | |
| 102 | + that fix, and they fail on a FIRING COUNTER, not on pixels: e.g. "16 attempt(s) decoded | |
| 103 | + pixel-exact but HORZ_A_32 never fired". Every one of them is a rect/AB gate owned by the | |
| 104 | + lanes main merged today (rectsplitx/rect1d/fiinter/modectx); this lane's only non-sb128 code | |
| 105 | + change is the warp-sample `has_top_right` delegate, which is bit-identical at `sb_size == 64` | |
| 106 | + (`sb_mi_cur() == 16`), and all 7 streams are 64-superblock streams whose decode is exact. | |
| 107 | + NOT PROVEN either way inside this round's budget. | |
| 108 | + deferred: attribute the 7 — build `main` 0df090a in a detached worktree with its own | |
| 109 | + CARGO_TARGET_DIR and run the same 7 by name; if red there, they are a merge residue, not | |
| 110 | + this lane's — unblocked by one clean-tree suite run. | |
| 111 | + | |
| 112 | +## Coordinator items from the r1 verifier | |
| 113 | + | |
| 114 | +- (1) content-free r1 gate arms (mandelbrot + `--deltaq-mode=2` / `--enable-restoration=1`): | |
| 115 | + deferred — not started; the r2 gate already carries the noise/cdef fix for its own arms — | |
| 116 | + unblocked by a round that owns the r1 gate recipe. | |
| 117 | +- (2) `Reach::table(64)` falling back to the 16x16 rows: deferred — inert today, and TASK B | |
| 118 | + (the 128-level NONE/HORZ/VERT/AB arms that would hit it) is not started this round. | |
| 119 | +- (3) lane-oddh's `"a sequence using 128x128 superblocks on a frame larger than 64x64"` | |
| 120 | + refusal + its gate: NOT PRESENT in `main` 0df090a at merge time (`grep` finds neither the | |
| 121 | + string nor an asserting gate), so nothing to delete. | |
| 122 | +- TASK B (128-level NONE/HORZ/VERT/AB roots): deferred, not started — needs the chroma multi-TU | |
| 123 | + loop in `decode_block` first — unblocked by that loop. |