Encoder-vs-reference gap ranking
Browse files at this commitf8a771ee032c274f808506aa6436c74b2155b5ebParent: dccdbb8- test
- encoder-vs-reference gap ranking
1 changed file +90 -0
- lanes/survey-r1.report.md +90 -0
lanes/survey-r1.report.mdadded+90 -0
| @@ -0,0 +1,90 @@ | |||
| 1 | +# lane survey r1 — which encoder in this repo is furthest from its reference | ||
| 2 | + | ||
| 3 | +Measured 2026-08-23 on main (`f814c3e`..`4ebfd6a`), every row run inline in | ||
| 4 | +this checkout; the omp seats were all quota-exhausted, so nothing here is a | ||
| 5 | +worker's report of a measurement, it is the measurement. | ||
| 6 | + | ||
| 7 | +The question the lane exists to answer: the opus lane has been running for | ||
| 8 | +many rounds and its 14-row gate now reads parity-plus on every row, so where | ||
| 9 | +does the NEXT fix lane aim? Ranked by distance from the reference, worst | ||
| 10 | +first. | ||
| 11 | + | ||
| 12 | +## Ranked table | ||
| 13 | + | ||
| 14 | +| # | crate | metric vs reference | ours | reference | gap | evidence | | ||
| 15 | +|---|-------|--------------------|------|-----------|-----|----------| | ||
| 16 | +| 1 | ec-h264 | **no encoder-vs-reference gate exists** | — | — | unmeasured | `grep -n x264 crates/ec-h264/tests/conformance.rs` — x264 appears only as a source of streams for DECODER conformance | | ||
| 17 | +| 2 | ec-vorbis | corr vs libvorbis, 14-row real-library sweep at 96/128k | 0.9876–0.9970 | 0.9865–0.9968 | worst row `nik@96` **+0.0027 to libvorbis**; 6 of 14 rows ours ahead, 14/14 PASS | `cargo test -p ec-vorbis --release --test oracle real_library_sweep_vs_reference -- --ignored --nocapture` | | ||
| 18 | +| 3 | ec-opus | corr + opus_compare err_ratio, 14-row library gate at 64/96k | corr 0.9816–0.9954 | 0.9794–0.9948 | **all 14 rows ours ahead on corr**; err_ratio >1.10 on 2 rows (reell@64 2.697, reell@96 4.499) | `cargo test -p ec-opus --release --test conformance encoder_library_gate_vs_libopus -- --ignored --nocapture` (~12 min) | | ||
| 19 | +| 4 | ec-mp3 | encoder corr vs incumbent bar | VBR 0.99801 | bar 0.99787 | **+0.00014 margin** — thinnest pass in the repo | `cargo test -p ec-mp3 --release` | | ||
| 20 | +| 5 | ec-image | JPEG/WebP decode vs incumbent | worst `tiny.jpg` corr 0.999829 / 49.5 dB; WebP `lossy.webp` 36.06 dB | incumbent 36.09 dB | −0.03 dB on WebP, max per-sample delta 5 (JPEG) | `cargo test -p ec-image --release` | | ||
| 21 | +| 6 | ec-aac | encoder worst-channel corr vs incumbent bar | mono 96k 1.0000, 5.1 384k 0.9999, HE core 24k 0.9909 | 0.9846 / 0.9648 | **ours ahead on every row** | `cargo test -p ec-aac --release` | | ||
| 22 | +| 7 | ec-flac | encoded size vs ffmpeg, same input | 7 231 957 B | 7 528 465 B | **ratio 0.961, ours smaller**; 50/50 xiph vectors bit-exact | `cargo test -p ec-flac --release` | | ||
| 23 | +| 8 | ec-alac | encode/decode vs ffmpeg | 8/8 fixtures bit-exact | — | **no gap** (lossless) | `cargo test -p ec-alac --release` | | ||
| 24 | +| 9 | ec-ac3, ec-h265, ec-truehd, ec-matroska | suite gates | all green | — | no reference gap surfaced | `cargo test -p <crate> --release` | | ||
| 25 | + | ||
| 26 | +Every default suite in the tree is green, zero failures, zero unexplained | ||
| 27 | +skips: ec-vorbis 21 passed / 3 ignored (the ignored three are the | ||
| 28 | +`--ignored` reference sweeps, one of which is row 2 above), ec-h264 108 | ||
| 29 | +passed / 1 ignored (`real_clip_t8x8_bd_psnr`, needs `EC_H264_CLIP`), ec-h265 | ||
| 30 | +35, ec-image 40, ec-truehd 16, ec-aac 16 (sbr_real_library) + the rest. | ||
| 31 | + | ||
| 32 | +## The worst two, in mechanism terms | ||
| 33 | + | ||
| 34 | +**1. ec-h264 has no rate-quality reference at all.** Every other encoder in | ||
| 35 | +this repo is measured against the thing it replaces; the H.264 encoder is | ||
| 36 | +measured against ITSELF (`8x8 BD-PSNR over q22/26/30/34: +0.540 dB`) and | ||
| 37 | +against absolute PSNR floors (`library clip 2560x1440: 12 pictures, 4300 | ||
| 38 | +kbit/s asked 8000, luma PSNR 54.68 dB`). x264 is already invoked in | ||
| 39 | +`conformance.rs` to *produce* streams, so the encoder half is one test away: | ||
| 40 | +encode the same clip at matched rate with both, report BD-PSNR. Until that | ||
| 41 | +exists, "our H.264 encoder is N% off x264" has no answer, and the | ||
| 42 | +`transform_8x8` default-on debt is being decided without one. This ranks | ||
| 43 | +first because an unmeasured gap is worse than a measured small one. | ||
| 44 | + | ||
| 45 | +**2. ec-vorbis trails libvorbis by 0.0027 corr at its worst row** (`nik@96`), | ||
| 46 | +where ec-opus now leads libopus on all 14 of its rows. The two lanes share a | ||
| 47 | +source list and a table format, so the shapes are comparable: vorbis's losing | ||
| 48 | +rows (`nik`, `reelo`, `dl8a`) are the same sources whose rate rows sit | ||
| 49 | +*under* the reference's kbps (nik@96 −1.60%, reelo@96 −1.43%, dl8a@96 | ||
| 50 | +−0.64%), i.e. we are spending fewer bits and paying for it, while every row | ||
| 51 | +where we spend MORE (reelm +2.74%, hein +2.05%) we win. That is the | ||
| 52 | +rate-loop-windup class in [[vorbis-rate-loop-windup]] read from the other | ||
| 53 | +side: not a transient debt spike, a steady under-spend. The next vorbis lane | ||
| 54 | +should measure per-frame spend against libvorbis on `nik@96` before touching | ||
| 55 | +psy. | ||
| 56 | + | ||
| 57 | +## What could not run, and why | ||
| 58 | + | ||
| 59 | +- **Nothing was skipped for missing fixtures.** The one apparent silent skip | ||
| 60 | + (`SKIP: ~/.cache/heaac-fixtures/... absent` in ec-aac) was the survey | ||
| 61 | + worktree lacking a `.cache` symlink, not a missing fixture; re-run in the | ||
| 62 | + main checkout the SBR suite takes 42.96 s instead of 9.41 s with every | ||
| 63 | + fixture present. Same class as the known `fixtures` symlink rule. | ||
| 64 | +- **Two ec-aac SBR anchors are env-gated** and skip by default: | ||
| 65 | + `sbr_instrument_anchor_controls` (`EC_AAC_SBR_INSTRUMENT_ANCHOR=1`) and | ||
| 66 | + `sbr_actual_noise_fraction` (`EC_AAC_SBR_NOISE_ANCHOR=1`). Both were run | ||
| 67 | + for this survey. The gate is legitimate — the second one sets process env | ||
| 68 | + vars mid-run, which is unsound alongside parallel tests — but being | ||
| 69 | + invisible to default runs let a stale instrument sit unread for rounds | ||
| 70 | + (fixed in `4ebfd6a`; its SKIP lines now print the exact command). | ||
| 71 | +- **`real_clip_t8x8_bd_psnr`** needs `EC_H264_CLIP` pointed at a media file; | ||
| 72 | + its last measured value (+0.827 dB BD on natural 720p, 0.000 on obs 1440p) | ||
| 73 | + is in `lanes/h264rd-r2.report.md` and is the open `transform_8x8` debt. | ||
| 74 | +- **ec-opus's 14-row gate takes ~12 min**, so its numbers here are the | ||
| 75 | + re-measurement taken at `41cf1d1` earlier this batch, not a fresh run. | ||
| 76 | + | ||
| 77 | +## Instrument defects found and fixed while surveying | ||
| 78 | + | ||
| 79 | +Both were found because a green suite printed a number that could not be | ||
| 80 | +true, which is the only reason to read a passing suite's output at all. | ||
| 81 | + | ||
| 82 | +1. `core_only_matches_reference` printed `corr 0.402349` for a pair that | ||
| 83 | + actually correlates 0.999845 — the coarse lag search stepped by 11 and the | ||
| 84 | + true peak is one sample wide. Fixed in `f814c3e`; class swept, the sibling | ||
| 85 | + copies in three other test files were already stride-1. | ||
| 86 | +2. `sbr_actual_noise_fraction` asserted a "whole-HF" noise fraction that had | ||
| 87 | + silently started summing a dozen core-decoded bands carrying 10x the | ||
| 88 | + energy of the SBR bands, reading 0.0397 against a 0.17 floor. Nothing | ||
| 89 | + regressed: HF-only it reads 0.1774 against round-44's 0.1770. Fixed in | ||
| 90 | + `4ebfd6a`. | ||