edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching·0 forks·Rust·370.3 MiB·9b67700·Tahinli·3 days ago·4021 commits
| 1 | # lane-tiny r4 report |
| 2 | |
| 3 | Rebased onto main `3808cf8` first (r3 was already merged there); branch head `9b1297a`. |
| 4 | |
| 5 | ## Residue closed: 32x16 seeds 42 and 47, chroma-only |
| 6 | |
| 7 | ### Fixture determinism (charter step 1) |
| 8 | The sweep's "seed" is not an encoder seed -- it is `attempt`, which shifts |
| 9 | `mandelbrot` start_x/start_y. Regenerated both failing 32x16 fixtures twice |
| 10 | each and hashed: |
| 11 | |
| 12 | attempt 0 (seed 42): c72a6a1b...5659 both runs, 152 bytes |
| 13 | attempt 5 (seed 47): fcbf0894...c388 both runs, 151 bytes |
| 14 | |
| 15 | So the sweep is genuinely reproducible and no binary fixture needed pinning |
| 16 | (per `seeded-fixture-not-reproducible.md`, checked rather than assumed). |
| 17 | |
| 18 | ### Bisection (charter step 2) |
| 19 | Not an entropy defect -- the range ladder was never needed. Stage dumps |
| 20 | settled it in one step: |
| 21 | |
| 22 | | stage | Y | U | V | |
| 23 | |---|---|---|---| |
| 24 | | pre-filter recon (`EC_AV1_PREFILT_DUMP`, ours vs aomdec) | 0 diff | **0 diff** | 0 diff | |
| 25 | | post-deblock (`EC_AV1_POSTDEBLOCK_DUMP`, ours vs aomdec) | 0 diff | **5 diff** | 0 diff | |
| 26 | |
| 27 | Reconstruction (and therefore the whole entropy/prediction path) is exact; |
| 28 | the deblocker introduces the mismatch. Printing the U plane rows 0..7 shows |
| 29 | the oracle leaves the horizontal edge at chroma row 4 **completely |
| 30 | unfiltered**, while we filter it and move rows 3/4 at columns 1, 2, 15. |
| 31 | |
| 32 | ## Root cause |
| 33 | |
| 34 | `av1_get_max_uv_txsize`: a block's chroma transform is the largest transform |
| 35 | covering the **subsampled BLOCK**, capped at 32x32. It does **not** follow |
| 36 | luma's `tx_depth` split. `tx_px_at`/`tx_h_px_at` (decode.rs) computed it as |
| 37 | `tx_grid[...] / 2` -- half the *resolved luma* transform. A 16x16 block whose |
| 38 | luma transform split to 8x8 therefore read a 4-pixel chroma transform, and the |
| 39 | deblocker filtered a chroma transform edge that does not exist in the stream. |
| 40 | |
| 41 | Reconstruction was never wrong because it derives chroma from the block side |
| 42 | (`chroma_side = side / 2`, decode.rs 4313/4850/8881) -- which is exactly why |
| 43 | the symptom was luma-bit-exact, chroma-only, +-1, and seed-dependent (the |
| 44 | phantom edge only changes pixels on the seeds where the filter masks pass). |
| 45 | V was clean on both seeds for the same reason: its masks did not pass. |
| 46 | |
| 47 | **Fix** (decode.rs): `Neighbours::uv_tx_grid` / `uv_tx_h_grid`, written per-mi |
| 48 | from the block's own mi span inside `fill_lf_grid_rect` -- the single writer |
| 49 | every `fill_lf_grid*` caller routes through -- as |
| 50 | `((span_mi * MI / 2).max(4).min(32))`; `tx_px_at`/`tx_h_px_at` read those |
| 51 | grids for chroma instead of halving luma's. |
| 52 | |
| 53 | **Class sweep**: grepped every other chroma-from-luma derivation. |
| 54 | `tx_px_at`/`tx_h_px_at` were the only sites deriving chroma tx from the luma |
| 55 | *transform*; 4313/4850/8881 derive from the block *side* and are correct. |
| 56 | No sibling instances. |
| 57 | |
| 58 | ## Gate (charter step 4) |
| 59 | |
| 60 | `probe_tiny_frame_size_boundary` -> `stream.rs` |
| 61 | `a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact`, no `#[ignore]`: |
| 62 | - wrong pixels at any size/seed = panic (was: an eprintln) |
| 63 | - a decode error that is not a NAMED `unsupported:` refusal = panic |
| 64 | - floor assert `total_exact >= 70` so refusals can never make it vacuous |
| 65 | (per `gate-skips-on-its-own-failure.md` / `refusal-lifted-without-a-gate.md`) |
| 66 | - `EC_AV1_REQUIRE_AOMENC=1` makes an absent oracle fail, not skip. |
| 67 | |
| 68 | `gate_coverage.rs` needed no change: it derives the tool set from `stream.rs` |
| 69 | source and this gate's `--enable-*` flags are unchanged (it was already in the |
| 70 | derived gate set while `#[ignore]`d). `gate_coverage` + `refusal_inventory` |
| 71 | are green. |
| 72 | |
| 73 | | size | r3 | r4 | |
| 74 | |---|---|---| |
| 75 | | 8x8 | refused 10/10 | refused 10/10 (named: 16x16 block whose true edge cuts both axes needs a rect transform) | |
| 76 | | 16x16, 32x32, 16x32, 48x48, 64x64, 24x24 | 10/10 | 10/10 | |
| 77 | | **32x16** | **8/10** | **10/10** | |
| 78 | |
| 79 | No refusal string was lifted this round (the 8x8 rect-transform refusal stays; |
| 80 | it is a genuine missing capability, now pinned by the gate). |
| 81 | |
| 82 | ## Instruments added |
| 83 | - `EC_AV1_POSTDEBLOCK_DUMP` / `EC_AV1_POSTCDEF_DUMP` (decode.rs `dump_stage`), |
| 84 | mirroring aomdec's own `EC_AV1_POSTDEBLOCK_DUMP` (decodeframe.c ~5404) -- with |
| 85 | the existing pre-filter dump these bisect which filter stage broke a frame. |
| 86 | - `decode_probe <stream.obu> [out.yuv]` now writes the decoded planes as raw |
| 87 | yuv420p, so a pixel diff against `ffmpeg -f rawvideo` needs no test harness. |
| 88 | |
| 89 | ## Verification |
| 90 | |
| 91 | - `EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib`: **268 passed, 0 failed, |
| 92 | 22 ignored** (362s). |
| 93 | - New gate alone: 9.5s. |
| 94 | |
| 95 | EVIDENCE: $SCRATCH/pre0.bin.f0 vs oracle0.bin.f0, pd0.bin.f0 vs opd0.bin.f0 | EC_AV1_PREFILT_DUMP + EC_AV1_POSTDEBLOCK_DUMP on ours and instrumented aomdec, same 32x16 seed-42 stream | pre-filter U diff 0, post-deblock U diff 5 -> defect is in deblock, not recon |
| 96 | EVIDENCE: $SCRATCH/ours0.yuv vs ff0.yuv, ours5.yuv vs ff5.yuv | decode_probe a{0,5}.obu out.yuv, cmp against ffmpeg rawvideo | both byte-identical after the fix (before: U 4 and 5 differing samples) |
| 97 | EVIDENCE: cargo test -p ec-av1 --lib a_real_aomenc_tiny_frame_size_sweep -- --nocapture | 8 sizes x 10 seeds, real aomenc -> ours -> ffmpeg | 32x16 8/10 -> 10/10; 70 pixel-exact + 10 named 8x8 refusals; gate green |
| 98 | |
| 99 | ## Open |
| 100 | |
| 101 | - 8x8 frames: `deferred(a real rectangular TX_4X8/TX_8X4 coefficient path)` -- |
| 102 | refused by name, now pinned by the gate; the same square-only-transform |
| 103 | ceiling `square-only-transform-ceiling.md` already tracks. |
| 104 | - Repo-wide `cargo fmt --check` drift exists in `cdf.rs` and elsewhere and |
| 105 | predates this lane: `accepted`, not touched (formatting the crate would bury |
| 106 | this diff). |