The surcharge sweep, invariants, and the lane's dispositions
Browse files at this commit4f81256aebd79363e78f0ab6cd1226aec523badaParent: f36c793- docs
- the surcharge sweep, invariants, and the lane's dispositions
2 changed files +86 -3
- crates/ec-av1/src/encoder.rs +3 -0
- lanes/txi.report.md +83 -3
crates/ec-av1/src/encoder.rsmodified+3 -0
| @@ -3822,6 +3822,9 @@ mod tests { | |||
| 3822 | /// (class `wrong-alphabet-same-value`: a disagreement here changes no | 3822 | /// (class `wrong-alphabet-same-value`: a disagreement here changes no |
| 3823 | /// symbol VALUE and desyncs the arithmetic coder anyway). | 3823 | /// symbol VALUE and desyncs the arithmetic coder anyway). |
| 3824 | #[test] | 3824 | #[test] |
| 3825 | + #[ignore = "reduced_tx_set = 0 desyncs the encoder's own trial decode when the \ | ||
| 3826 | + seven-type intra search is on -- bisected in lanes/txi.report.md; \ | ||
| 3827 | + the lever is off at every preset until that is closed"] | ||
| 3825 | fn a_wide_tx_set_clip_codes_the_new_alphabets_both_decoders_read_exactly() { | 3828 | fn a_wide_tx_set_clip_codes_the_new_alphabets_both_decoders_read_exactly() { |
| 3826 | // Every lever below is process-global: the same exclusive lock the | 3829 | // Every lever below is process-global: the same exclusive lock the |
| 3827 | // presets take. | 3830 | // presets take. |
lanes/txi.report.mdmodified+83 -3
| @@ -86,6 +86,86 @@ it is not the whole story, the desync survives it. | |||
| 86 | `speed::WIDE_TX_SET` is therefore false at every preset and | 86 | `speed::WIDE_TX_SET` is therefore false at every preset and |
| 87 | `EC_AV1_TXSET_WIDE` unset is byte-identical to main. | 87 | `EC_AV1_TXSET_WIDE` unset is byte-identical to main. |
| 88 | 88 | ||
| 89 | -## 3. Gates, invariants, suite | 89 | +## 3. The surcharge sweep (12-frame gate, `EC_AV1_TXSET=all`, film rows) |
| 90 | - | 90 | + |
| 91 | -(filled in below as the arms land) | 91 | +BD-rate vs libaom `cpu-used 6` / rav1e `speed 6`, lower is better. Every arm is |
| 92 | +the UNCONDITIONAL intra search (the shipped default is screen-gated and | ||
| 93 | +byte-identical to the control on these rows). | ||
| 94 | + | ||
| 95 | +| clip | control | 1x (the plain arm) | 2x (`EC_AV1_TXRD_LAMBDA=2`) | 0.5x | | ||
| 96 | +|---|---|---|---|---| | ||
| 97 | +| bars 1080p | -1.0% / -16.8% | -2.3% / -17.8% | -1.2% / -16.9% | (see below) | | ||
| 98 | +| film A | +21.7% / -4.4% | +22.1% / -4.0% | **+21.7% / -4.3%** | (see below) | | ||
| 99 | + | ||
| 100 | +film A bytes: control 64392/102508/170169/413430, 1x 65201/103781/172167/419156 | ||
| 101 | +(+1.2..1.4%), 2x 64518/102989/170564/414763 (+0.2..0.3%). | ||
| 102 | + | ||
| 103 | +READING: the surcharge does exactly what the instrument predicted -- it buys | ||
| 104 | +the rate back (the arm's +1.3% of bytes collapses to +0.2%) and the film A row | ||
| 105 | +walks from +22.1/-4.0 to +21.7/-4.3, i.e. onto the control against libaom and | ||
| 106 | +0.1 SHORT of it against rav1e. It neutralises the loss; it does not turn it | ||
| 107 | +into a win, because what the search wins on film (0.02-0.06 dB) is smaller | ||
| 108 | +than what its symbols cost however they are priced. The same surcharge costs | ||
| 109 | +the bars row a point of its own gain (-2.3 -> -1.2), which is the sign that a | ||
| 110 | +single flat weight cannot serve both content classes. | ||
| 111 | + | ||
| 112 | +KEEP RULE: FAIL for the unconditional arm at every weight measured -- the rule | ||
| 113 | +wants both film rows DOWN, and the best weight lands film A ON the control. | ||
| 114 | +DECISION: the intra search stays SCREEN-GATED, the surcharge ships at its | ||
| 115 | +default weight of 1.0 (`non_dct_surcharge` returns 0, so every default stream | ||
| 116 | +is byte-identical to main), and `EC_AV1_TXRD_LAMBDA` stays the swept lever. | ||
| 117 | + | ||
| 118 | +## 4. Invariants, pins, suite | ||
| 119 | + | ||
| 120 | +Default state = every lever of this lane OFF (`WIDE_TX_SET` false at all | ||
| 121 | +presets, surcharge weight 1.0, the intra/inter searches on their own screen | ||
| 122 | +gates), so the shipped encoder is byte-identical to main -- which the pins | ||
| 123 | +make below. | ||
| 124 | + | ||
| 125 | +| invariant | preset 0 | preset 6 | | ||
| 126 | +|---|---|---| | ||
| 127 | +| `an_edge_clip_codes_every_reduced_set_tx_type_both_decoders_read_exactly` | PASS | PASS | | ||
| 128 | +| `an_inter_clip_codes_both_inter_set_tx_types_both_decoders_read_exactly` | PASS | PASS | | ||
| 129 | +| `the_facade_codes_the_same_bytes_as_encode_sequence` | PASS | PASS | | ||
| 130 | +| `predicted_coeff_bits_track_the_tile_the_writer_wrote` | PASS | PASS | | ||
| 131 | +| `tile_bytes_do_not_depend_on_the_thread_count --include-ignored` | PASS | PASS | | ||
| 132 | +| the three above under `EC_COMP_MISMATCH=1` (preset 0) | 0 mismatches | -- | | ||
| 133 | + | ||
| 134 | +`the_encoders_own_streams_are_byte_identical_to_their_pins`: PASS at the | ||
| 135 | +UNCHANGED 8562 / 33357, and again under `EC_AV1_TXSET=0 EC_AV1_TXSET_INTER=0`. | ||
| 136 | +`timeout 890 cargo check --workspace --all-targets -j4`: 0 errors, 0 `ec-av1` | ||
| 137 | +warnings (the 22 the workspace prints are `ec-opus`/`ec-vorbis`, untouched). | ||
| 138 | + | ||
| 139 | +`a_wide_tx_set_clip_codes_the_new_alphabets_both_decoders_read_exactly` is | ||
| 140 | +`#[ignore]`d with the blocker in its reason string -- it is the witness that | ||
| 141 | +closes section 2 the moment the desync is found. | ||
| 142 | + | ||
| 143 | +LONG-GOP: not re-run, and it does not need to be -- what ships changes no | ||
| 144 | +byte (pins unchanged, every lever off by default), so | ||
| 145 | +`bd_rate_film_long_gop` stands at the head's own +26.4/-6.6 (film A) and | ||
| 146 | ++89.8/+9.1 (film B). | ||
| 147 | + | ||
| 148 | +## 5. Deferred | ||
| 149 | + | ||
| 150 | +* `deferred: reduced_tx_set = 0 -- the writer half is BUILT and off by default; | ||
| 151 | + what blocks it is a desync between the seven-type intra path's writer and the | ||
| 152 | + encoder's own trial decode (section 2's bisection table), which shows up as a | ||
| 153 | + refused reference slot. What unblocks it: the first symbol where the trial | ||
| 154 | + decode's range diverges from the writer's (class equal-range-means-unread / | ||
| 155 | + compare-range-not-tell), on the two-frame witness that already reproduces it | ||
| 156 | + in 2 seconds -- one lane slot, no gate wall.` | ||
| 157 | +* `deferred: the twelve/sixteen-type INTER candidate lists -- written | ||
| 158 | + (encode::inter_tx_type_candidates' INTER_WIDE) but never offered, since the | ||
| 159 | + header bit they need is the blocked one above. Unblocked by the same fix.` | ||
| 160 | +* `deferred: the reference-aware type cost the charter asked for -- NOT BUILT, | ||
| 161 | + and deliberately: the per-plane per-frame instrument (section 1) shows the | ||
| 162 | + arm equal-or-better on the key frame AND every leaf, so there is no | ||
| 163 | + propagation signal for such a term to price. What would revive it: a content | ||
| 164 | + class whose leaves DO decay under the arm.` | ||
| 165 | +* `deferred: the surcharge as a per-content lever (screen 1.0, film 2.0) -- | ||
| 166 | + measured on film A only; film B and the capture were not swept. Unblocked by | ||
| 167 | + two more gate slots. As a flat default it is a wash, which is why it ships | ||
| 168 | + at 1.0.` | ||
| 169 | +* `deferred: EC_AV1_REFPROBE=1 is a new decoder-side probe (the missing | ||
| 170 | + reference slot plus a backtrace); it is env-gated and costs a branch on an | ||
| 171 | + error path only.` | ||