Lane-b128r report
Browse files at this commitdf61f890c8d507fcf2e584928b779b88a682aadfParent: 53ce20d- docs
- lane-b128r report
1 changed file +142 -0
- lanes/b128r.report.md +142 -0
lanes/b128r.report.mdadded+142 -0
| @@ -0,0 +1,142 @@ | ||
| 1 | +# lane-b128r — a residual and a compound arm at the 128 root | |
| 2 | + | |
| 3 | +Two of the three arms the charter names are implemented and measured; the | |
| 4 | +third is deferred with its reason. One decoder defect was found on the way. | |
| 5 | + | |
| 6 | +| arm | state | | |
| 7 | +|---|---| | |
| 8 | +| 1. the 128 NONE block WITH a residual | written, witnessed, **opt-in** (`EC_AV1_B128RES=1`) — measured INERT and it leaves a filter-stage mismatch | | |
| 9 | +| 2. the 128 NONE **compound** arm | written, witnessed, **shipped on**: film A −0.2/−0.2, film B −0.2/−0.3 | | |
| 10 | +| 3. HORZ / VERT at the 128 root | **deferred**, untouched — see the disposition | | |
| 11 | + | |
| 12 | +## 1. The residual arm (opt-in) | |
| 13 | + | |
| 14 | +`search_root_128` now prices the winner's own prediction with a real | |
| 15 | +residual against the skip arm it just committed to the planes, and | |
| 16 | +`write_inter_block_128` codes it: per 64x64 mu chunk one TX_64X64 luma unit | |
| 17 | +(its coded 32x32 corner, `TxbSet::Luma64`, DCT-only at this size) then one | |
| 18 | +TX_32X32 unit per chroma plane on the offset-10 `txb_skip` rows, each | |
| 19 | +publishing its own coefficient context before the next unit reads it, with | |
| 20 | +the var-tx tree's four depth-0 `txfm_partition` symbols in front. Levels | |
| 21 | +travel as one 64-wide grid per plane, chunk (cr, cc) at (cr\*32, cc\*32). | |
| 22 | +Quantized at the qindex the ROOT signals (the delta_q unit is the 128 | |
| 23 | +superblock, lane-b128m), var-tx depth 0 only. | |
| 24 | + | |
| 25 | +**Witness** — `encode::tests::a_128_root_block_with_a_real_residual_decodes_exact_through_both_decoders` | |
| 26 | +(`--ignored`, the arm and the root forced so the clip codes the shape | |
| 27 | +rather than waiting for content): | |
| 28 | + | |
| 29 | + 128x128 blocks WITH a residual: search won 420, writer coded 420 | |
| 30 | + test ... ok | |
| 31 | + | |
| 32 | +420 residual 128x128 blocks over 8 frames at 1280x768, every frame | |
| 33 | +sample-exact against the encoder's own reconstruction through | |
| 34 | +`decode_stream` AND through ffmpeg. RED before the lane by construction | |
| 35 | +(the writer refused a non-skip 128 block) and RED again on the first draft: | |
| 36 | + | |
| 37 | +- **defect (writer)**: `write_inter_block_128` recorded `skip = true` in its | |
| 38 | + own neighbour band whatever the block was, so the NEXT root's `skip` | |
| 39 | + symbol took CDF row 1 (16515) where the reader takes row 0 (31739) — | |
| 40 | + first divergent symbol index 33, found with `EC_AV1_SYMTRACE`. | |
| 41 | + | |
| 42 | +**Why it ships off.** Two measurements: | |
| 43 | + | |
| 44 | +- it is INERT on content: over the native 12-frame gate the RD takes it | |
| 45 | + **0–2 times per frame** against ~90 whole 128 roots per frame | |
| 46 | + (`EC_AV1_B128_CENSUS=1`); | |
| 47 | +- switched on, `bd_rate_screen_native`'s bars 2160p row at q=90 frame 11 | |
| 48 | + has **8 luma samples** (rows 126..127, cols 1611..1616 — the two rows | |
| 49 | + above a 128-superblock horizontal edge) where ffmpeg and this encoder's | |
| 50 | + own reconstruction disagree. The arm's own witness is byte-exact through | |
| 51 | + ffmpeg over 420 blocks at 1280x768, so the open half is a FILTER-stage | |
| 52 | + interaction at a 128 block's own edge, not the coefficient path. | |
| 53 | + | |
| 54 | +An inert candidate does not buy a live filter mismatch. `EC_AV1_B128RES=1` | |
| 55 | +turns it on; the default encoder is byte-identical to the control (pins and | |
| 56 | +both 2160p gate rows reproduce the standing table to the digit). | |
| 57 | + | |
| 58 | +## 2. A decoder defect: one `cdef_idx` literal covers every unit its block spans | |
| 59 | + | |
| 60 | +libaom stores the `cdef_idx` it reads at the ORIGIN mi of the 64x64 CDEF | |
| 61 | +unit and `av1_cdef_frame` reads each unit's strength back off that origin — | |
| 62 | +so a block WIDER than one unit (the 128 root's block, the only one there | |
| 63 | +is) drives every unit it covers with its single literal. `maybe_read_cdef_idx` | |
| 64 | +stamped the reading block's own cell alone. No stream could reach it before | |
| 65 | +the 128 root carried a residual (class *branch dropped as unreachable*), and | |
| 66 | +the residual witness is its gate. Fixed with the block's own mi span, which | |
| 67 | +is a no-op for every block of one unit or less. | |
| 68 | + | |
| 69 | +## 3. The compound arm (shipped on) | |
| 70 | + | |
| 71 | +`search_root_128` passed an empty compound list, so a 128x128 block could | |
| 72 | +only ever name ONE reference — while the writer has had the path since | |
| 73 | +lane-b128 (`write_compound_block` for a block that names a second one). The | |
| 74 | +root now builds the `LAST`+`GOLDEN` / `LAST`+`ALTREF` stacks at its own | |
| 75 | +32x32-mi window, exactly as the 64 root builds them per superblock, and | |
| 76 | +offers the same three modes (`NEAREST_NEARESTMV`, `GLOBAL_GLOBALMV`, | |
| 77 | +`NEW_NEARESTMV`). `EC_AV1_B128COMP=0` is the attribution control. | |
| 78 | + | |
| 79 | +**It fires on real content** — census, compound 128x128 blocks per frame: | |
| 80 | + | |
| 81 | +| row | compound 128 blocks / frame | | |
| 82 | +|---|---| | |
| 83 | +| film B (2160p) | up to **80**, tens on most frames | | |
| 84 | +| bars 2160p | tens | | |
| 85 | +| screen capture | 0 (the screen path gates compound off) | | |
| 86 | +| synthetic bars pan | 1 per 8 frames | | |
| 87 | + | |
| 88 | +**Witness** — `encode::tests::a_128_root_compound_block_decodes_exact_through_both_decoders` | |
| 89 | +(`--ignored`, root forced): | |
| 90 | + | |
| 91 | + COMPOUND 128x128 blocks: search won 216, writer coded 432 | |
| 92 | + test ... ok | |
| 93 | + | |
| 94 | +(the writer count is the higher one because the filter search re-codes each | |
| 95 | +tile). 12 frames of `testsrc2` at 1280x768, sample-exact through | |
| 96 | +`decode_stream` and ffmpeg. RED before the lane: the count was 0. | |
| 97 | + | |
| 98 | +### The deciding gate | |
| 99 | + | |
| 100 | +`bd_rate_screen_native`, 12 frames, four quantizers, BD-rate vs libaom | |
| 101 | +`cpu-used 6` / rav1e `speed 6` (lower is better). Control = the standing | |
| 102 | +table of `lanes/table-20260908.md`, reproduced on this tree with the arm | |
| 103 | +off (both 2160p rows re-run here, to the digit): | |
| 104 | + | |
| 105 | +| row | control | + the 128 compound arm | | |
| 106 | +|---|---|---| | |
| 107 | +| bars 1080p | −3.4 / −19.0 | −3.4 / −19.0 | | |
| 108 | +| bars 2160p | +8.6 / −13.8 | +8.6 / −13.7 | | |
| 109 | +| film A (1080p) | +18.1 / −6.2 | **+17.9 / −6.4** | | |
| 110 | +| film B (2160p) | +23.8 / −2.8 | **+23.6 / −3.1** | | |
| 111 | +| screen capture | +14.4 / −33.2 | +14.4 / −33.2 | | |
| 112 | + | |
| 113 | +Both film rows are DOWN on both columns; screen is unchanged; bars 2160p | |
| 114 | +moves +0.1 on the rav1e column (inside the ±0.3 flat band). Wall on the 4K | |
| 115 | +film row 124.7s → 138.2s (+10.8%, under the +15% ceiling). | |
| 116 | + | |
| 117 | +## Pins | |
| 118 | + | |
| 119 | +Re-taken for the compound arm, which moves every inter frame that carries | |
| 120 | +`reference_select`: `(150, 8364, 0xcb2ad7936d5127c5)`, `(60, 33257, | |
| 121 | +0x87db250ba556e5a6)` — was `(150, 8354, ...)`, `(60, 33222, ...)`. | |
| 122 | +`EC_AV1_B128COMP=0` restores 8354 / 33222 exactly, which is also the proof | |
| 123 | +that nothing else in this lane moves the shipped stream. Green at the | |
| 124 | +default and at `EC_AV1_SPEED=6`. No other byte pin moved. | |
| 125 | + | |
| 126 | +## Disposition | |
| 127 | + | |
| 128 | +- `deferred`: **HORZ / VERT at the 128 root** (two 128x64 / 64x128 blocks), | |
| 129 | + untouched. The writer has no rect neighbour recording at this size and the | |
| 130 | + search no rect trial; `write_inter_block_128` is square throughout | |
| 131 | + (`record`/`record_inter`/`record_planes` all take one side). Unblocked by | |
| 132 | + a rect `record_inter`/`record` pair plus a rect trial in | |
| 133 | + `search_root_128`. The decoder reads both already (lane-sb128c r7). | |
| 134 | + Not attempted: the residual arm's own writer/reader bisect consumed the | |
| 135 | + budget this would have needed. | |
| 136 | +- `open`: the residual arm's **8-sample filter mismatch** (bars 2160p, q=90, | |
| 137 | + frame 11, rows 126..127 / cols 1611..1616, ffmpeg vs our reconstruction). | |
| 138 | + Next step: dump the deblock/CDEF decision at that 128 superblock's own | |
| 139 | + bottom edge for a block that carries a residual, against aomdec. Until | |
| 140 | + then the arm stays behind `EC_AV1_B128RES=1`. | |
| 141 | +- `open` (inherited): search-time vs write-time mv stacks still differ | |
| 142 | + (lane-sb128b's second open item). |