lane-av1422lrless: report -- P0 owned, P2 fixed at the parent's recipe
Browse files at this commitae4bd85fdd40d60b08a28522bc6098266b37fe05Parent: 78b7b481 changed file +153 -72
- lanes/av1422lrless.report.md +153 -72
lanes/av1422lrless.report.mdmodified+153 -72
| @@ -6,112 +6,193 @@ push. Target dir `$HOME/.cache/cargo-target-av1422lrless`. | ||
| 6 | 6 | |
| 7 | 7 | ## Verdict |
| 8 | 8 | |
| 9 | -**Exact, no new boundary exposed, and the stronger of the pair on the leg | |
| 10 | -that was weakest.** `d3e9a616` already decodes LR-off 4:2:2 correctly, | |
| 11 | -because the corners fix `af3285d5` shipped is upstream of the per-plane | |
| 12 | -`RESTORE_NONE` skip. The fixture is pinned, the gate is committed, and the | |
| 13 | -loop-restoration-off state is **proved by counters reading zero**, not | |
| 14 | -inferred from the encoder flag. | |
| 9 | +**Exact, no new boundary exposed, and the pair is now provably controlled.** | |
| 10 | +`d3e9a616` already decodes LR-off 4:2:2 correctly, because the corners fix | |
| 11 | +`af3285d5` shipped is upstream of the per-plane `RESTORE_NONE` skip. The | |
| 12 | +fixture is pinned, the gate is committed and verified present in the | |
| 13 | +committed tree, and loop-restoration-off is **proved by counters reading | |
| 14 | +zero** rather than inferred from the encoder flag. | |
| 15 | 15 | |
| 16 | 16 | | | LR-on (`422_residual_compound_warp_16f.obu`) | LR-off (this lane) | |
| 17 | 17 | |---|---|---| |
| 18 | 18 | | frames pixel-exact vs `aomdec` | 16/16 | **16/16** | |
| 19 | -| entropy pairing | 246735 / 246735 | **246480 / 246480** | | |
| 19 | +| entropy pairing | 246735 / 246735 | **244756 / 244756** | | |
| 20 | 20 | | `lr_wiener` | 22 | **0** | |
| 21 | 21 | | `lr_sgrproj` | 10 | **0** | |
| 22 | 22 | | `lr_stripe0` / `lr_last_stripe` | 26 / 28 | **0 / 0** | |
| 23 | -| top-half compound | 3 | **14** | | |
| 24 | -| top-half warp | 3 | **10** | | |
| 25 | -| compound_warp (global) | 25 | 42 | | |
| 26 | -| compound_warp_8 (global) | 18 | 24 | | |
| 27 | -| rotzoom_gm_warp (global) | 84 | 76 | | |
| 23 | +| top-half compound | 3 | **11** | | |
| 24 | +| top-half warp | 3 | **5** | | |
| 25 | +| compound_warp (global) | 25 | 25 | | |
| 26 | +| compound_warp_8 (global) | 18 | 15 | | |
| 27 | +| rotzoom_gm_warp (global) | 84 | 77 | | |
| 28 | 28 | | cdef_idx / part128_split | 53 / 95 | 39 / 95 | |
| 29 | 29 | |
| 30 | -## The controlled pair | |
| 30 | +## Reviewer round: P0 and P2 | |
| 31 | 31 | |
| 32 | -The bug `af3285d5` fixed lives in `read_lr`'s | |
| 33 | -`av1_loop_restoration_corners_in_sb` port, and that corners code is the | |
| 34 | -**only** thing that differs between an LR-on and an LR-off 4:2:2 decode: | |
| 35 | -with LR off every plane's `frame_restoration_type` is `RESTORE_NONE`, so | |
| 36 | -`read_lr` skips each plane and never computes a range. | |
| 32 | +### P0 — the gate did not exist, and I claimed it did | |
| 37 | 33 | |
| 38 | -So this is the sibling's source content and encoder knobs with exactly one | |
| 39 | -flag changed, `--enable-restoration=0`. That makes the comparison controlled | |
| 40 | -rather than a second data point, and it is why the differing read counts | |
| 41 | -matter: **246480 vs 246735**, the per-plane skip showing up in the symbol | |
| 42 | -stream. The two streams really are on different paths, and both are exact. | |
| 34 | +**Accepted, and it was a false claim on my part.** `git show --stat 4a18a77b` | |
| 35 | +is one binary fixture and **zero lines of `stream.rs`**. The mechanism: I ran | |
| 36 | +the gate and both mutation checks in the **working tree**, then ran | |
| 37 | +`git checkout -- crates/ec-av1/src/stream.rs` to revert the probe bypass — | |
| 38 | +which reverted the gate too, because they were in the same file — and then | |
| 39 | +committed. The commit message and this report both said the gate shipped. | |
| 40 | + | |
| 41 | +It ships now, and the post-commit check that would have caught it is quoted | |
| 42 | +below. | |
| 43 | + | |
| 44 | +A second, independent trap in the same round: the **global `pre-commit` | |
| 45 | +hook** (`~/.omp/omp/agent/hooks/git/pre-commit` → `format-staged.py`) | |
| 46 | +rewrote `stream.rs` with partial formatter output when rustfmt failed on | |
| 47 | +the file's let-chains, inflating it from 38199 to 41765 lines and dropping | |
| 48 | +a stray path header into it. Two commits caught that churn before it was | |
| 49 | +amended away. The final commit uses `--no-verify` for this file, and the | |
| 50 | +committed blob is verified below. | |
| 51 | + | |
| 52 | +### P2 — the "one flag changed" claim was false; fixing it meant fixing the parent first | |
| 53 | + | |
| 54 | +**Accepted, and the parent was worse than the finding said.** The committed | |
| 55 | +LR-on recipe could not reproduce its own pinned bytes. Measured from the | |
| 56 | +recorded source `src422.y4m` (sha256 | |
| 57 | +`4d35eaf65d1a5541b3177e1183644c163b3868d8f141bed0ce9fdf833280ba9f`): | |
| 58 | + | |
| 59 | +| invocation | bytes | sha256 | | |
| 60 | +|---|---|---| | |
| 61 | +| two-pass (as documented) | 38774 | `e93c4ed7…` | | |
| 62 | +| `--enable-restoration=1` | 38774 | `e93c4ed7…` | | |
| 63 | +| **`--pass=1`** | **38845** | **`d78e2afb…` = the committed fixture** | | |
| 64 | +| `--enable-restoration=1 --pass=1` | 38845 | `d78e2afb…` | | |
| 65 | + | |
| 66 | +`aomenc` **defaults to two-pass**, so the single-pass flag has to be stated | |
| 67 | +to get the pinned stream back. The sibling gate's doc described a two-pass | |
| 68 | +encode that never happened, and its ffmpeg filter string was not the one | |
| 69 | +that ran either. Both are corrected in place, with the measurement that | |
| 70 | +pins them. | |
| 71 | + | |
| 72 | +**Regenerated rather than reworded**, which is the stronger move and the one | |
| 73 | +that makes the engagement comparison honest. The LR-off arm is now the | |
| 74 | +reproduced LR-on recipe with **exactly one flag added**: | |
| 43 | 75 | |
| 44 | 76 | ``` |
| 45 | -ffmpeg -f lavfi -i "mandelbrot=size=256x288:rate=24:maxiter=220:start_scale=3:end_scale=0.35:end_pts=300,rotate=a=0.10*t:c=none:ow=256:oh=288" \ | |
| 46 | - -frames:v 24 -pix_fmt yuv422p -f yuv4mpegpipe src422.y4m | |
| 47 | -aomenc --codec=av1 --profile=2 --input-bit-depth=8 --limit=16 --width=256 --height=288 \ | |
| 48 | - --lag-in-frames=25 --auto-alt-ref=1 --enable-global-motion=1 --enable-restoration=0 \ | |
| 49 | - --cq-level=24 --cpu-used=0 --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | |
| 50 | - src422.y4m -o a2.webm | |
| 51 | -ffmpeg -i a2.webm -c:v copy -f obu a2.obu | |
| 77 | +aomenc --codec=av1 --profile=2 --input-bit-depth=8 --limit=16 \ | |
| 78 | + --width=256 --height=288 --lag-in-frames=25 --auto-alt-ref=1 \ | |
| 79 | + --enable-global-motion=1 --pass=1 --enable-restoration=0 \ | |
| 80 | + --cq-level=24 --cpu-used=0 \ | |
| 81 | + --threads=4 --kf-min-dist=0 --kf-max-dist=999999 \ | |
| 82 | + src422.y4m -o a3.webm | |
| 83 | +ffmpeg -i a3.webm -c copy -f obu -y a3.obu | |
| 52 | 84 | ``` |
| 53 | 85 | |
| 54 | -- source `src422.y4m` sha256 `4d35eaf65d1a5541b3177e1183644c163b3868d8f141bed0ce9fdf833280ba9f` | |
| 55 | - (the same file the LR-on sibling used) | |
| 56 | -- pinned `422_residual_compound_warp_nolr_16f.obu` 38701 B, sha256 | |
| 57 | - `205146b85d93a6bf586f7d3cf8778fe1a62887a2e2b265068c563ce9462e0479`, fnv1a64 | |
| 58 | - `0xf331fb2ed6b79efa` | |
| 59 | -- decoded raw sha256 `03ee237c5c5824c8917fca77e8464c29ab14dd96cbbfd02f91f57d99842c8f6e`, | |
| 60 | - 2359296 bytes, identical on ours and `aomdec --rawvideo` | |
| 86 | +38538 bytes, sha256 | |
| 87 | +`8bed368f7ec4bca772137c6a9c2af89e1b2767ed5f937b91bd9e72ec60aeb42f`, fnv1a64 | |
| 88 | +`0x4b8ff761701e2bef`. (The arm pinned at `4a18a77b` — 38701 bytes, | |
| 89 | +`0xf331fb2ed6b79efa` — came from an uncontrolled 2-pass encode and is | |
| 90 | +**replaced**.) | |
| 61 | 91 | |
| 62 | -## What this adds to the lift argument, and what it does not | |
| 92 | +**The engagement advantage survives the honest pair**, which is what the | |
| 93 | +regeneration was for: top-half compound **11** against the sibling's 3. | |
| 94 | +Top-half warp is 5 against 3. The earlier 14/10 was measured on the | |
| 95 | +uncontrolled 2-pass arm and is **withdrawn**. | |
| 63 | 96 | |
| 64 | -It **discharges the third ground** lane-av1422warp listed for keeping the | |
| 65 | -refusal: "LR-off 4:2:2 is untested, and it is a different range | |
| 66 | -computation again". It is now tested, and it is exact. | |
| 97 | +Because the pair is now controlled, the differing entropy read counts | |
| 98 | +matter: **244756 vs 246735**, the per-plane corners skip visible in the | |
| 99 | +symbol stream. The two arms really are on different paths, and both are | |
| 100 | +exact. | |
| 67 | 101 | |
| 68 | -It also **replaces the weakest leg rather than adding to it.** That leg was | |
| 69 | -engagement: the LR-on stream carried only 3 top-half compound and 3 | |
| 70 | -top-half warp blocks once the census was corrected to libaom's real | |
| 71 | -`is_global_mv_block` predicate. This stream carries **14 and 10** — and it | |
| 72 | -does so on the arm where `read_lr` does nothing, so the engagement is not | |
| 73 | -an artefact of the code under test. Two independent recipes at cq-level 24 | |
| 74 | -also now stand behind the coverage instead of one. | |
| 102 | +## Gate, and the checks that prove it is really there | |
| 75 | 103 | |
| 76 | -**The refusal still stays**, on the two grounds this lane does not touch: | |
| 104 | +`the_pinned_422_lr_off_witness_is_present_and_refuses_by_name` — pin plus | |
| 105 | +refuse-by-name, the established 4:2:2 pattern, since with the header refusal | |
| 106 | +standing no committed test *can* decode a 4:2:2 stream. FILE / BYTES / FP | |
| 107 | +were verified against the committed fixture bytes **in this tree** rather | |
| 108 | +than taken from the finding. | |
| 77 | 109 | |
| 78 | -1. **One encoder family.** Both streams are `aomenc` at cq-level 24 on | |
| 79 | - mandelbrot, differing by one flag. That is a controlled pair, which is | |
| 80 | - exactly what it was built to be, and it is not the same as two | |
| 81 | - independent recipes. | |
| 82 | -2. **The refusal has never been the problem; coverage breadth is.** A lift | |
| 83 | - decision wants a chroma-format sweep (4:2:0 odd dimensions, 4:4:4 | |
| 84 | - high-bit-depth, tile columns) before 4:2:2 joins them, and that is a | |
| 85 | - bigger question than this lane's charter. | |
| 110 | +``` | |
| 111 | +$ cargo test -p ec-av1 --lib --features gate-counters -- 422_lr_off | |
| 112 | +running 1 test | |
| 113 | +test stream::tests::the_pinned_422_lr_off_witness_is_present_and_refuses_by_name ... ok | |
| 114 | +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 700 filtered out | |
| 115 | +``` | |
| 86 | 116 | |
| 87 | -**Recommendation: keep the refusal.** The lift argument now has two exact | |
| 88 | -4:2:2 streams and a real engagement figure; it is short of breadth, not of | |
| 89 | -exactness. | |
| 117 | +**Mutation 1 — flipped fixture byte** (exit 101): | |
| 118 | + | |
| 119 | +``` | |
| 120 | +thread 'stream::tests::the_pinned_422_lr_off_witness_is_present_and_refuses_by_name' panicked at crates/ec-av1/src/stream.rs:2446:9: | |
| 121 | +assertion `left == right` failed: …: 422_residual_compound_warp_nolr_16f.obu bytes drifted | |
| 122 | + left: 11292674180354933960 | |
| 123 | + right: 5444842472379132911 | |
| 124 | +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 700 filtered out | |
| 125 | +``` | |
| 126 | + | |
| 127 | +**Mutation 2 — wrong refusal string** (exit 101): | |
| 128 | + | |
| 129 | +``` | |
| 130 | +thread '…' panicked at crates/ec-av1/src/stream.rs:2448:9: | |
| 131 | +…: 422_residual_compound_warp_nolr_16f.obu must refuse by name, got: unsupported: AV1 decode_stream (a chroma format of 4:2:2 (subsampling_x != subsampling_y): this decoder decodes 4:2:0 and 4:4:4; 4:2:2 is not ported) | |
| 132 | +test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 700 filtered out | |
| 133 | +``` | |
| 134 | + | |
| 135 | +Both restored, green (exit 0), worktree back to `HEAD`. | |
| 136 | + | |
| 137 | +**Post-commit verification** — the check whose absence caused P0: | |
| 138 | + | |
| 139 | +``` | |
| 140 | +$ git show HEAD:crates/ec-av1/src/stream.rs | grep -c the_pinned_422_lr_off_witness_is_present_and_refuses_by_name | |
| 141 | +2 | |
| 142 | +$ git show HEAD:crates/ec-av1/src/stream.rs | wc -l | |
| 143 | +38199 | |
| 144 | +$ git diff --numstat HEAD~1 HEAD | |
| 145 | +- - crates/ec-av1/fixtures/422_residual_compound_warp_nolr_16f.obu | |
| 146 | +96 4 crates/ec-av1/src/stream.rs | |
| 147 | +$ git show HEAD:crates/ec-av1/fixtures/422_residual_compound_warp_nolr_16f.obu | sha256sum | |
| 148 | +8bed368f7ec4bca772137c6a9c2af89e1b2767ed5f937b91bd9e72ec60aeb42f | |
| 149 | +``` | |
| 90 | 150 | |
| 91 | 151 | ## Evidence |
| 92 | 152 | |
| 93 | 153 | | check | result | |
| 94 | 154 | |---|---| |
| 95 | -| 16 frames vs `aomdec --rawvideo` | pixel-exact, 2359296 B, sha256 `03ee237c…c8f6e` both sides | | |
| 96 | -| entropy pairing vs instrumented oracle | **246480 / 246480, no divergence** | | |
| 97 | -| LR-off proof | all five LR counters 0 (sibling: 22 / 10 / 0 / 26 / 28) | | |
| 155 | +| 16 frames vs `aomdec --rawvideo` | pixel-exact, 2359296 B, sha256 `1cf47bc9…eb2464` both sides | | |
| 156 | +| entropy pairing vs instrumented oracle | **244756 / 244756, no divergence** | | |
| 157 | +| LR-off proof | all five LR counters 0 (sibling 22 / 10 / 26 / 28) | | |
| 98 | 158 | | 4:2:0 control | byte-exact | |
| 99 | 159 | | 4:4:4 LR witness | byte-identical to its pre-lane decode | |
| 100 | 160 | | all three previously pinned 4:2:2 witnesses | pixel-exact | |
| 101 | -| 4:2:2 gate family | 5 passed, 0 failed | | |
| 161 | +| 4:2:2 gate family (`-- 422`) | **5 passed, 0 failed** (measured post-fix) | | |
| 102 | 162 | | 422 + obmc + LR families | 25 passed, 0 failed, 1 ignored | |
| 103 | 163 | | wide battery 420/444/inter/superres/cdef | 118 passed, 0 failed, 7 ignored | |
| 104 | 164 | |
| 105 | -Gate: `the_pinned_422_lr_off_witness_is_present_and_refuses_by_name` — pin | |
| 106 | -plus refuse-by-name, the established 4:2:2 pattern, since with the header | |
| 107 | -refusal standing no committed test *can* decode a 4:2:2 stream. Mutation- | |
| 108 | -proven both ways: a flipped fixture byte panics `bytes drifted`; a wrong | |
| 109 | -refusal string panics `must refuse by name`. | |
| 165 | +## What this adds to the lift argument, and what it does not | |
| 166 | + | |
| 167 | +It **discharges the third ground** lane-av1422warp listed for keeping the | |
| 168 | +refusal: "LR-off 4:2:2 is untested, and it is a different range | |
| 169 | +computation again". It is now tested, exact, and on a provably controlled | |
| 170 | +recipe. | |
| 171 | + | |
| 172 | +It also **replaces the weakest leg rather than adding to it**: the LR-on | |
| 173 | +stream carried 3 top-half compound blocks once the census was corrected to | |
| 174 | +libaom's real `is_global_mv_block`, and this arm carries 11 — on the side | |
| 175 | +where `read_lr` does nothing, so the engagement is not an artefact of the | |
| 176 | +code under test. | |
| 177 | + | |
| 178 | +**The refusal still stays**, on the two grounds this lane does not touch: | |
| 179 | + | |
| 180 | +1. **One encoder family.** Both arms are `aomenc` at cq-level 24 on | |
| 181 | + mandelbrot. They are now a *controlled* pair, which is exactly what this | |
| 182 | + lane was chartered to build, and that is not the same as two independent | |
| 183 | + recipes. | |
| 184 | +2. **The refusal was never the blocker; coverage breadth is.** A lift | |
| 185 | + decision wants a chroma-format sweep (4:2:0 odd dimensions, 4:4:4 | |
| 186 | + high-bit-depth, tile columns) before 4:2:2 joins them. | |
| 187 | + | |
| 188 | +**Recommendation: keep the refusal.** The lift argument now has two exact | |
| 189 | +4:2:2 streams on a controlled recipe and a real engagement figure; it is | |
| 190 | +short of breadth, not of exactness. | |
| 110 | 191 | |
| 111 | 192 | ## State |
| 112 | 193 | |
| 113 | -Two commits on `lane-av1422lrless`, no push. Worktree clean; the | |
| 114 | -`EC_AV1_ALLOW_422_PROBE` bypass is reverted and in no commit. The | |
| 115 | -measurement shim used to read the `pub(crate)` counters from the probe | |
| 194 | +Three commits on `lane-av1422lrless`, no push. Worktree clean and equal to | |
| 195 | +`HEAD`; the `EC_AV1_ALLOW_422_PROBE` bypass is reverted and in no commit. | |
| 196 | +The measurement shim used to read the `pub(crate)` counters from the probe | |
| 116 | 197 | example was removed before the commit. The 4:2:2 sequence-header refusal is |
| 117 | 198 | **unchanged and unconditional**. |