Lane-arffilt report -- the ARF temporal-filter charter reconciles to merged prior art: arf_pred_census re-run at 7db5094a reproduces lane-arfpred's SAD table to the digit (film B 14.3 percent at s30 +-2, 10.2 at the shipped s2), the filter itself shipped ON in lane-arfpred/arftf/lookahead (strength 2, +-3 window, gate-measured +85.3/+6.7 -> +72.1/-1.2 on film B), so no encoder change and no EC_AV1_ARFFILT second knob
Browse files at this commit09db82719c86ff506a31fd3a1c972e0b4018c2a4Parent: 03b25c7- docs
- lane-arffilt report -- the ARF temporal-filter charter reconciles to merged prior art: arf_pred_census re-run at 7db5094a reproduces lane-arfpred's SAD table to the digit (film B 14.3 percent at s30 +-2, 10.2 at the shipped s2), the filter itself shipped ON in lane-arfpred/arftf/lookahead (strength 2, +-3 window, gate-measured +85.3/+6.7 -> +72.1/-1.2 on film B), so no encoder change and no EC_AV1_ARFFILT second knob
- witnesses re-proven (pins 8291/33227 hold, EC_AV1_ARF_TF=0 moves the stream, both-decoder sample-exactness at every preset)
1 changed file +130 -0
- lanes/arffilt.report.md +130 -0
lanes/arffilt.report.mdadded+130 -0
| @@ -0,0 +1,130 @@ | |||
| 1 | +# lane-arffilt — RECONCILED: the ARF temporal filter already shipped; the charter's experiment is its own instrument | ||
| 2 | + | ||
| 3 | +Worktree `edith_codecs-arffilt`, branch `lane-arffilt` off main `7db5094a`. | ||
| 4 | +**No encoder change was made and none was needed**: charter step 1 (check | ||
| 5 | +prior art, reconcile rather than rebuild) resolved the whole charter. Every | ||
| 6 | +piece it asks for — the lag/SAD experiment, the `exp(-mse/strength)` | ||
| 7 | +motion-compensated ARF source filter, the witnesses, the deciding-gate | ||
| 8 | +evidence — merged before this base, in three lanes whose merge commits are | ||
| 9 | +all ancestors of `7db5094a`: | ||
| 10 | + | ||
| 11 | +| prior lane | merged | what it shipped | | ||
| 12 | +|---|---|---| | ||
| 13 | +| lane-arfcen | (census) | the stream census the charter cites: top ARF 6992-8021 B/frame vs rav1e's 3872 at coarser q (118 vs 104), 61% of the gap residual | | ||
| 14 | +| lane-arfpred | `8d9d056b` | `encode::tests::arf_pred_census` (the charter's experiment, verbatim) + `encode::arf_temporal_filter` + `speed::ARF_TF`, ships strength 3, `ARF_TF_QMIN=16` | | ||
| 15 | +| lane-arftf | `aabb73eb` | strength swept ON the gate: 3 → **2** (bracketed by 1 and 5); 4-past window and mid-ARF filter refuted | | ||
| 16 | +| lane-lookahead | `0dc2f731` | one mini-GOP of lookahead (`speed::LOOKAHEAD`), symmetric **±3** filter window (`ARF_TF_WIN=ARF_TF_WIN_FUT=3`), bracketed ±0..±4 | | ||
| 17 | + | ||
| 18 | +The charter's evidence comment (`encode.rs`, the 6992-vs-3872 sketch) is not | ||
| 19 | +a proposal — it is `arf_pred_census`'s own doc-comment, written by | ||
| 20 | +lane-arfpred to describe the instrument it had already run. | ||
| 21 | + | ||
| 22 | +## 1. The SAD experiment, re-run at this base — reproduces to the digit | ||
| 23 | + | ||
| 24 | +`encode::tests::arf_pred_census` at `7db5094a` (3-4 s per arm, no encoder | ||
| 25 | +involvement; the same log-step diamond against lag 8, lag 4, and the | ||
| 26 | +temporally filtered block against lag 8): | ||
| 27 | + | ||
| 28 | +| arm | clip | lag8 SAD/px | lag4 SAD/px | tf lag8 SAD/px | tf removes | tf-vs-source PSNR | | ||
| 29 | +|---|---|---|---|---|---|---| | ||
| 30 | +| s30, ±2 both sides | film A | 2.484 | 2.369 | 2.315 | **6.8%** | 47.74 dB | | ||
| 31 | +| s30, ±2 both sides | film B | 1.199 | 1.114 | 1.028 | **14.3%** | 49.54 dB | | ||
| 32 | +| s30, 2 past (arfpred's table) | film A | 2.484 | 2.369 | 2.337 | 5.9% | 48.30 dB | | ||
| 33 | +| s30, 2 past (arfpred's table) | film B | 1.199 | 1.114 | 1.059 | 11.7% | 50.14 dB | | ||
| 34 | +| s2 (the shipped strength), ±2 | film A | 2.484 | 2.369 | 2.391 | 3.8% | 53.09 dB | | ||
| 35 | +| s2 (the shipped strength), ±2 | film B | 1.199 | 1.114 | 1.077 | 10.2% | 52.71 dB | | ||
| 36 | + | ||
| 37 | +The first four rows match `lanes/arfpred.report.md` §2 **to the digit** on | ||
| 38 | +this base, four merge-waves later — the instrument and its numbers are | ||
| 39 | +stable, and the lag reading stands: halving the anchor's prediction distance | ||
| 40 | +is worth 4.6-7.1% of prediction SAD while the byte gap is 81%; the residual | ||
| 41 | +is mostly source grain. | ||
| 42 | + | ||
| 43 | +## 2. Disposition — the charter's <15% stop-rule vs the gate evidence | ||
| 44 | + | ||
| 45 | +Read alone, the stop rule fires: the best census number (14.3%) sits under | ||
| 46 | +the 15% bar. The merged prior art resolves this exact tension, and in the | ||
| 47 | +lever's favour — **the SAD census is a weak proxy for this lever's product | ||
| 48 | +effect** (lane-arfpred's own two-point probe mispredicted the SIGN of the | ||
| 49 | +gate result; the byte savings at high strength come back as leaf bits). | ||
| 50 | +What the deciding gate actually measured, across the three lanes: | ||
| 51 | + | ||
| 52 | +| arm (long-GOP gate, BD vs libaom cpu-used 6 / rav1e speed 6) | film A | film B | | ||
| 53 | +|---|---|---| | ||
| 54 | +| no filter (lane-arfpred control, RUN not quoted) | +23.5 / −8.0 | +85.3 / +6.7 | | ||
| 55 | +| `ARF_TF=3`, 2 past (lane-arfpred ships) | +22.7 / −7.9 | +79.0 / +2.7 | | ||
| 56 | +| `ARF_TF=2`, 2 past (lane-arftf ships) | +22.2 / −8.2 | +78.6 / +2.7 | | ||
| 57 | +| `ARF_TF=2`, ±3 (lane-lookahead ships; this base) | +21.2 / −8.8 | +72.1 / −1.2 | | ||
| 58 | + | ||
| 59 | +Guard gate `bd_rate_screen_native` at every step: the two bars rows move ≤0.3, | ||
| 60 | +film rows improve or hold, screen capture byte-identical (its sequence codes | ||
| 61 | +no pyramid ARF — the filter never runs there). The current standing table | ||
| 62 | +(film A +20.9/−9.0, film B +70.4/−2.2) is measured WITH the filter on. | ||
| 63 | + | ||
| 64 | +**Disposition: the lever is alive in the only currency that counts (the | ||
| 65 | +deciding gate), and it is already shipped ON by default at every preset.** | ||
| 66 | +The charter's keep rule (one film row ≥0.5 down, other flat, screen not worse | ||
| 67 | +0.3, wall ≤+15%) was met on lane-arfpred (film B −6.3 libaom column, film A | ||
| 68 | +−0.8, screen within bounds, and the filter FASTER: 167 s → 147 s on the | ||
| 69 | +film-B two-point probe), then re-met by arftf and lookahead (down on all | ||
| 70 | +four columns each, bracketed). Step 6's "default ON + pins + lib suite + | ||
| 71 | +cargo check" therefore already happened on those lanes (suites 585/587/590 | ||
| 72 | +passed, `cargo check --workspace --all-targets` clean, pins re-taken at each | ||
| 73 | +step). Nothing here is rebuilt: **creating a second, default-OFF | ||
| 74 | +`EC_AV1_ARFFILT` knob beside the shipped `EC_AV1_ARF_TF` would be a second | ||
| 75 | +convention beside an existing one, and is refused.** The charter's OFF maps | ||
| 76 | +to `EC_AV1_ARF_TF=0` (and `EC_AV1_LOOKAHEAD=0` for the future half's buffer). | ||
| 77 | + | ||
| 78 | +## 3. The shipped state at this base (verified, not assumed) | ||
| 79 | + | ||
| 80 | +* `speed::ARF_TF = [2.0; 11]`, override `EC_AV1_ARF_TF=<strength>`; | ||
| 81 | + `ARF_TF_WIN = ARF_TF_WIN_FUT = [3; 11]` (±3, override `EC_AV1_ARF_TF_WIN` | ||
| 82 | + / `_WIN_FUT`); `ARF_TF_MID = [0.0; 11]` (refuted, ships off); | ||
| 83 | + `ARF_TF_QMIN = 16` (off at the rate loop's quantizer floor, libaom's rule). | ||
| 84 | +* `encoder.rs` (`code_group`): the top ARF's padded source is replaced by | ||
| 85 | + `arf_temporal_filter(&source, [3 past | 3 future], strength)` whenever | ||
| 86 | + strength > 0 and `base_q_idx >= 16` — per 16x16 luma block, | ||
| 87 | + motion-compensated (log-step diamond), weight `exp(-mse/strength)`, chroma | ||
| 88 | + on the halved vector with its own weight sum. The charter's | ||
| 89 | + "motion-compensated is the follow-up arm" is not pending: the shipped | ||
| 90 | + filter IS motion-compensated; only plain translational averaging would be | ||
| 91 | + a regression. | ||
| 92 | +* The bitstream is spec-legal by construction (the ARF is just a frame whose | ||
| 93 | + input is filtered; no syntax change) — and the decoder never filters, so | ||
| 94 | + exactness is encoder-recon-path only, which the witnesses cover. | ||
| 95 | + | ||
| 96 | +## 4. Witnesses, re-proven on THIS worktree at `7db5094a` | ||
| 97 | + | ||
| 98 | +| witness | result | | ||
| 99 | +|---|---| | ||
| 100 | +| `encode::tests::the_encoders_own_streams_are_byte_identical_to_their_pins` | PASS — pins `(150, 8291, 0x1f00bb0eb099a27f)`, `(60, 33227, 0x57ee6b1f8eacd881)` hold | | ||
| 101 | +| engagement probe: same test with `EC_AV1_ARF_TF=0` | FAILS AS DESIGNED — stream moves to `(150, 8229, 0x5dc0…)`: the filter genuinely engages at the default and OFF is a different, real stream (counter-substitute; no numeric TF counter ships — the pins and the stream-moves guard are the engagement guard) | | ||
| 102 | +| `encoder::tests::the_lookahead_holds_one_group_and_still_codes_every_picture` | PASS — byte-identical with future empty, stream MOVES with a future neighbour (gate-blind-to-feature guard), sample-exact through `decode_stream` AND ffmpeg at 1/7/8/9/17 pictures | | ||
| 103 | +| `encoder::tests::every_speed_preset_decodes_sample_exact_through_both_decoders` (`--ignored`) | PASS (16.6 s) — every preset's stream decodes sample-exact through ffmpeg and `decode_stream`, i.e. the filtered-source ARF reconstructs identically | | ||
| 104 | + | ||
| 105 | +## 5. Gates, walls, LOADAVG | ||
| 106 | + | ||
| 107 | +No BD gate was re-run in this lane. The arm-vs-control contrast the charter | ||
| 108 | +asks for was measured on the deciding gate itself by the three merged lanes | ||
| 109 | +(tables above, controls RUN not quoted, one gate at a time, LOADAVG pairs in | ||
| 110 | +their reports); re-running it would re-measure merged history on a base that | ||
| 111 | +has not moved. Local runs this lane: census 2×4 s, engagement probe 5 s, | ||
| 112 | +witnesses 20 s + 17 s, sequential, no sibling-visible load. | ||
| 113 | + | ||
| 114 | +## 6. What this lane did NOT do (the open levers the prior reports name) | ||
| 115 | + | ||
| 116 | +* `deferred: the top ARF's mode/partition gap (+871 B/frame, 2196 blocks vs | ||
| 117 | + rav1e's 1507) — the residual half of the census is done, the syntax half | ||
| 118 | + is not — unblocked by a partition lane at the anchor (or the parked | ||
| 119 | + 128-root work).` | ||
| 120 | +* `deferred: per-block weight refinement in arf_temporal_filter (libaom | ||
| 121 | + weights each 16x16 block against each neighbour separately, up to 7 | ||
| 122 | + frames) — untouched since lane-arftf, env knobs make the arm cheap.` | ||
| 123 | +* `deferred: the tpl future map at the ARF (the buffered future pictures | ||
| 124 | + reach the source filter only, not the temporal lambda map) — now a | ||
| 125 | + one-argument change per lane-lookahead §5.` | ||
| 126 | +* `deferred: two-pass-like allocation over the buffered group — the buffer | ||
| 127 | + the lookahead lane added exists and is unused by the rate loop.` | ||
| 128 | + | ||
| 129 | +Pins: `(150, 8291)`, `(60, 33227)` — confirmed by test on this worktree. | ||
| 130 | +No merge, no push. | ||