Lane-arfmode charter -- the top-ARF syntax gap re-censused at 0d81d6c5 (film B +2188 B/frame, film A +3528: mode+partition+mv now 44%/38% of it), carried by the intra fallback's CDF poisoning (intra_inter 138 vs rav1e's 10 B/frame on film B), compound at the ARF (ours 19-24% of area vs rav1e's 0%), and an 8x8-heavy partition mix (2.4x rav1e's split rate on film B)
Browse files at this commit20925bdb4381e995e8c1e6008e9655990b7090bbParent: d5d7c0a- docs
- lane-arfmode charter -- the top-ARF syntax gap re-censused at 0d81d6c5 (film B +2188 B/frame, film A +3528: mode+partition+mv now 44%/38% of it), carried by the intra fallback's CDF poisoning (intra_inter 138 vs rav1e's 10 B/frame on film B), compound at the ARF (ours 19-24% of area vs rav1e's 0%), and an 8x8-heavy partition mix (2.4x rav1e's split rate on film B)
- the lever is EC_AV1_ARFMODE (default OFF, bit-exact): bitmask of ARF-leaf-only offer-set cuts -- 1 no intra at 16x16/8x8 leaves, 2 no RD-optional 8x8 split, 4 no compound at leaves, 32x32 whole and spec-forced 8x8s untouched
1 changed file +154 -0
- lanes/arfmode.charter.md +154 -0
lanes/arfmode.charter.mdadded+154 -0
| @@ -0,0 +1,154 @@ | ||
| 1 | +# lane-arfmode — the top ARF's mode/partition syntax | |
| 2 | + | |
| 3 | +Worktree `edith_codecs-arfmode`, branch `lane-arfmode`, base `0d81d6c5`. The | |
| 4 | +lane the arffilt reconciliation defers: "the top ARF's mode/partition gap | |
| 5 | +(+871 B/frame, 2196 blocks vs rav1e's 1507) — the residual half of the census | |
| 6 | +is done, the syntax half is not". The +871 was written at lane-arfpred's base | |
| 7 | +`35874aef`, before the temporal filter, the tpl future map, `arf_altref` and | |
| 8 | +the 128 roots shipped; this lane re-measures the gap at its own base, forms | |
| 9 | +the lever from what is LEFT of it, and takes it to the deciding gate. | |
| 10 | + | |
| 11 | +## 1. Prior art — reconciled, nothing rebuilt | |
| 12 | + | |
| 13 | +| prior lane | what it established at the top ARF | state at this base | | |
| 14 | +|---|---|---| | |
| 15 | +| lane-arfcen | the per-level stream census; the gap sits in the six pictures coded at distance 8 | instrument shipped (`EC_CENSUS_PERFRAME=1`) | | |
| 16 | +| lane-arfpred | `arf_pred_census` (lag is NOT the cause); the +871 B mode/partition decomposition; `arf_temporal_filter` shipped at strength 3 | residual half attacked; syntax half deferred to THIS lane | | |
| 17 | +| lane-arftf | filter strength 3 -> 2, bracketed; mid-ARF filter refuted | shipped (`EC_AV1_ARF_TF`) | | |
| 18 | +| lane-lookahead | one-group lookahead; symmetric +-3 filter window | shipped (`EC_AV1_LOOKAHEAD`, `ARF_TF_WIN_FUT`) | | |
| 19 | +| lane-tplfut / lane-tplhalf / lane-tplfut-arf | the tpl future map at the ARF — shipped, re-measured ON (film B -1.0/-0.6); the arffilt pointer to it was stale | shipped (`TPL_FUT=2`, `HALF=2`, `WIN=11`) | | |
| 20 | +| lane-arfq / lane-keyq | ARF q offsets and key allocation swept | no mode/partition lever | | |
| 21 | +| lane-arfcen arm 2 (`arf_altref`) | the top ARF's second, distinct past anchor — what its compound candidates read | shipped | | |
| 22 | +| lanes av1comp3/av1comp4 | leaf compound candidates (5 shapes) shipped GLOBALLY — never A/B'd at the ARF alone | open at ARF granularity | | |
| 23 | +| lanes census-filmB / census-longgop | level allocation; leaves already cheap at 48 pictures | context | | |
| 24 | + | |
| 25 | +No knob named `EC_AV1_ARFMODE` or similar exists; nothing here is a second | |
| 26 | +convention beside a shipped one. The census instrument | |
| 27 | +(`examples/syntax_census`, `EC_AV1_BITCENSUS=1 EC_CENSUS_PERFRAME=1`) is the | |
| 28 | +charter's reader — ours and rav1e measured by the same decoder. | |
| 29 | + | |
| 30 | +## 2. The fresh census at `0d81d6c5` — where the gap is NOW | |
| 31 | + | |
| 32 | +Recipe: the long-GOP gate's own window and crops, ours `enc_probe gate 0 48 | |
| 33 | +150`, rav1e `speed 6 quantizer 110` from the 8-bit yuv (a 10-bit rav1e stream | |
| 34 | +does not decode in our reader — PSNR reads 2 dB; the 8-bit re-cut reproduces | |
| 35 | +arfpred's table to the digit: rav1e top ARF 3872 B/frame, PSNR-Y 45.97, | |
| 36 | +base_q_idx 104). `EC_CENSUS_TABLES=24`. | |
| 37 | + | |
| 38 | +### 2.1 Family decomposition, B/frame, ours (q118, 6 ARFs) vs rav1e (q104, 11 ARFs) | |
| 39 | + | |
| 40 | +| family | film A ours | film A rav1e | A delta | film B ours | film B rav1e | B delta | | |
| 41 | +|---|---|---|---|---|---|---| | |
| 42 | +| coeff | 6216 | 4568 | +1647 | 2938 | 1996 | +942 | | |
| 43 | +| literal | 1928 | 1459 | +469 | 959 | 730 | +229 | | |
| 44 | +| **mode** | **1845** | **1102** | **+744** | **1137** | **608** | **+530** | | |
| 45 | +| **mv** | **974** | **520** | **+454** | **719** | **410** | **+310** | | |
| 46 | +| **partition** | **330** | **191** | **+139** | **256** | **125** | **+131** | | |
| 47 | +| txsize+txtype | 79 | 4 | +75 | 48 | 2 | +46 | | |
| 48 | +| **total** | **11374** | **7846** | **+3528** | **6060** | **3872** | **+2188** | | |
| 49 | + | |
| 50 | +The total gap is down from +3120 to +2188 on film B (the merged levers took | |
| 51 | +~930 B/frame off the top ARF), and its SHAPE flipped: mode+partition+mv | |
| 52 | +(+971 on film B, +1337 on film A) is now 44%/38% of the gap and the single | |
| 53 | +biggest mode-family carrier is syntax this encoder OFFERS and rav1e does not | |
| 54 | +spend at its ARF. | |
| 55 | + | |
| 56 | +### 2.2 What the mode family buys (per-table, B/frame, from the census's own table shares) | |
| 57 | + | |
| 58 | +| table | A ours | A rav1e | B ours | B rav1e | | |
| 59 | +|---|---|---|---|---| | |
| 60 | +| skip | 228.0 | 226.4 | 184.8 | 132.8 | | |
| 61 | +| intra_inter | 194.5 | 76.3 | 138.3 | 10.2 | | |
| 62 | +| comp_mode | 193.0 | 0 | 119.7 | 0 | | |
| 63 | +| y_mode | 184.9 | 58.4 | 78.2 | 2.5 | | |
| 64 | +| inter_compound_mode | 162.7 | 0 | 66.9 | 0 | | |
| 65 | +| uv_mode_cfl | 205.5 | ~0 | 24.7 | 0 | | |
| 66 | +| new_mv | 157.2 | 201.7 | 145.6 | 143.5 | | |
| 67 | +| motion_mode | 90.4 | 0 | 63.9 | 0 | | |
| 68 | +| drl_mode | — | — | 58.3 | 7.0 | | |
| 69 | +| ref_mv | — | 171.4 | 31.2 | 120.1 | | |
| 70 | +| segment_id | 0 | 118.4 | 0 | 70.7 | | |
| 71 | + | |
| 72 | +Three carriers, all ARF-specific: | |
| 73 | + | |
| 74 | +1. **The intra fallback poisons shared CDFs.** Ours codes 4.0% (film B) / | |
| 75 | + 15.0% (film A) of the ARF's AREA intra where rav1e codes 0.5% / 12.3%; | |
| 76 | + the per-block `intra_inter` symbol then costs ours 138 B/frame on film B | |
| 77 | + where rav1e pays 10 — the CDF is adapted to a 1-in-5 intra rate instead | |
| 78 | + of 1-in-200. The intra blocks' own mode syntax (y_mode, uv_mode_cfl, | |
| 79 | + filter_intra) rides on top. CAUTION: on film A even rav1e keeps 12.3% | |
| 80 | + intra area — there the intra fallback is CONTENT (grain), not waste. | |
| 81 | +2. **Compound at the ARF: ours 18.8%/23.8% of area, rav1e 0.0% on both | |
| 82 | + films.** The trio (comp_mode + inter_compound_mode + comp_ref_type) costs | |
| 83 | + ~200 B/frame (film B) to ~360 (film A). Never A/B'd at the ARF alone. | |
| 84 | +3. **The partition mix is 8x8-heavy**: ours 23.3%/31.3% of blocks are 8x8 | |
| 85 | + against rav1e's 13.1%/26.3%, and ours codes 1876/2782 blocks a frame | |
| 86 | + against 1507/2272 — every extra leaf pays its own skip + intra_inter + | |
| 87 | + ref + mode + mv symbols. Ours takes the 8x8 split at 2.4x rav1e's rate on | |
| 88 | + film B. | |
| 89 | + | |
| 90 | +NEWMV share of single-ref modes: ours ~45% both films, rav1e ~25% — the | |
| 91 | ++310/+454 mv column is block count plus longer mv residuals. | |
| 92 | + | |
| 93 | +## 3. The lever — `EC_AV1_ARFMODE` (default OFF = bit-exact) | |
| 94 | + | |
| 95 | +A per-frame offer-set change, TOP ARF ONLY (`DqLevel::TopArf` — the group's | |
| 96 | +own anchor, `arf_q_offset`), leaves only; the 32x32 whole keeps its full | |
| 97 | +offer set as the scene-cut hatch, and spec-forced 8x8s at straddling edges | |
| 98 | +are untouched. Bitmask, values OR-able: | |
| 99 | + | |
| 100 | +| value | arm | census target | | |
| 101 | +|---|---|---| | |
| 102 | +| 1 | ARF leaves (16x16/8x8) offer NO intra candidate: the leaf search runs its inter set only | intra_inter + y_mode + uv_mode_cfl + filter_intra, and the CDF de-poisoning across every block | | |
| 103 | +| 2 | 16x16 is the ARF's leaf floor: the RD-optional 8x8 split is not offered | partition + the three extra leaves' mode/mv syntax per split | | |
| 104 | +| 4 | ARF leaves offer NO compound candidates | comp_mode + inter_compound_mode + comp_ref_type (~200-360 B/frame) | | |
| 105 | +| 3 / 5 / 6 / 7 | combinations | — | | |
| 106 | + | |
| 107 | +`speed::ARFMODE: [u8; 11]` ships the gate's disposition per preset; | |
| 108 | +`EC_AV1_ARFMODE=<n>` overrides for A/B on one build. OFF (0, the default) | |
| 109 | +must be byte-exact with the pre-lane encoder — pins `(150, 8291)`, | |
| 110 | +`(60, 33227)` hold at the default and at `EC_AV1_SPEED=6`. | |
| 111 | + | |
| 112 | +## 4. Witnesses BEFORE gates | |
| 113 | + | |
| 114 | +* Pins at the default AND `EC_AV1_SPEED=6` (OFF bit-exactness). | |
| 115 | +* Engagement counters (class `gate-blind-to-feature`): `ARFMODE_HITS` — | |
| 116 | + [0] ARF leaves coded with the intra trial skipped, [1] ARF 8x8 offers | |
| 117 | + refused, [2] ARF leaves with compound not offered — asserted > 0 on a real | |
| 118 | + film encode, and the armed stream must MOVE. | |
| 119 | +* Every witness stream decodes sample-exact through `decode_stream` AND | |
| 120 | + ffmpeg at the usual picture counts. | |
| 121 | + | |
| 122 | +## 5. Measurement ladder | |
| 123 | + | |
| 124 | +1. Local two-point probe (film A and film B, q150 + q90, bytes at equal PSNR) | |
| 125 | + prunes dead arms before any server time (arfpred's rule: the probe is a weak | |
| 126 | + proxy — it PRUNES, it does not PROMOTE; surviving arms go to the gate). | |
| 127 | +2. server-1 (`user@host-e`), managed skill `ec-av1-remote-gate-runners` | |
| 128 | + (repo-arfmode, target-arfmode, fixtures symlink, `.git` stub, PATH shim | |
| 129 | + inside the unit, chain as a user unit, linger on): `bd_rate_film_long_gop` | |
| 130 | + control first — must reproduce the standing table (film A +20.9/-9.0, | |
| 131 | + film B +70.4/-2.2) +-0.2/cell — then the surviving arms, one gate at a | |
| 132 | + time, LOADAVG before/after each. | |
| 133 | +3. `bd_rate_screen_native` (five rows) for the disposition arm — at 12 frames | |
| 134 | + `group_target` forms ONE group of 11 whose ARF IS a `TopArf`, so the | |
| 135 | + native gate ENGAGES this lever (no blindness claim; the arm runs). | |
| 136 | + | |
| 137 | +## 6. Keep rule and disposition | |
| 138 | + | |
| 139 | +One film row >=0.5 BD down on a column, the other film flat (±0.3), screen | |
| 140 | +not worse 0.3, wall <=+15%. Met -> default ON at the measured presets, pins | |
| 141 | +re-taken at the default and `EC_AV1_SPEED=6`, three-lane lib suite (fixtures | |
| 142 | +symlinked), `cargo check --workspace --all-targets -j4`. Not met -> default | |
| 143 | +OFF / revert, document. | |
| 144 | + | |
| 145 | +## 7. Risks | |
| 146 | + | |
| 147 | +* Arm 1 on film A: 15% intra area would flip to inter where even rav1e keeps | |
| 148 | + 12% — the residual cost may eat the syntax win on the grain film exactly. | |
| 149 | +* Arm 2: the 8x8 splits it refuses won RD; the syntax win (~280 B/frame | |
| 150 | + film B by the block arithmetic) has to beat the residual regression. | |
| 151 | +* Arm 4: the two-ref prediction win at the ARF is real (arf_altref exists | |
| 152 | + for it); only the syntax half is measured. | |
| 153 | +* The probe has mispredicted gate signs before (arfpred); nothing ships off | |
| 154 | + a probe alone. |