forge
Explore
Log in

Don't you dare go Hollow

Error map generalised to any gate source

Browse files at this commit

19ef3ae00b46e38d0c440e42a065c97b4e144acaAhmet Kaan GümüşParent: f521fd8
  • test
    • error map generalised to any gate source
Show full message
test(opus-reell/r3): error map generalised to any gate source

her_err_map_96k -> err_map_vs_libopus; EC_ERRMAP_SRC / EC_ERRMAP_KBPS /
EC_ERRMAP_TAG select source, rate and output file, her@96 defaults kept.
crates/ec-opus/tests/conformance.rsmodified+12 -6
@@ -5282,31 +5282,37 @@ fn short_block_bits_vs_libopus() {
52825282 // error share) are printed with our encoder flags plus both encoders' coded
52835283 // decisions — libopus's packets decoded with our decoder, the reell-r2 method.
52845284 // Frame mapping is in source-sample time (±1 frame of codec delay).
5285-// Output: lanes/opus-her-r1.map.txt. HER_KBPS overrides the rate (default 96).
5285+// Output: lanes/<EC_ERRMAP_TAG>.map.txt (default `opus-her-r1`). HER_KBPS (or
5286+// EC_ERRMAP_KBPS) overrides the rate, EC_ERRMAP_SRC the source file: the map is
5287+// the same analysis for any row of the library gate, not just her@96.
52865288 // ---------------------------------------------------------------------------
52875289
52885290 #[test]
52895291 #[ignore]
5290-fn her_err_map_96k() {
5292+fn err_map_vs_libopus() {
52915293 const SECS: f64 = 120.0;
52925294 const FRAME: usize = 960;
52935295 const CH: usize = 2;
52945296 const HOP: usize = 120; // WIN_STEP: one opus_compare hop = 2.5 ms
52955297 const HOPS_PER_WIN: usize = 48_000 / HOP; // 1 s window = 400 hops
5296- let kbps_env: u32 = std::env::var("HER_KBPS")
5298+ let kbps_env: u32 = std::env::var("EC_ERRMAP_KBPS")
5299+ .or_else(|_| std::env::var("HER_KBPS"))
52975300 .ok()
52985301 .and_then(|v| v.parse().ok())
52995302 .unwrap_or(96);
5303+ let tag = std::env::var("EC_ERRMAP_TAG").unwrap_or_else(|_| "opus-her-r1".to_string());
53005304
5301- let src = shellexpand("~/Music/reeli.mp3");
5305+ let src = shellexpand(
5306+ &std::env::var("EC_ERRMAP_SRC").unwrap_or_else(|_| "~/Music/reeli.mp3".to_string()),
5307+ );
53025308 if !src.exists() {
53035309 eprintln!("SKIP: missing {}", src.display());
53045310 return;
53055311 }
53065312 let lanes_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../lanes");
53075313 fs::create_dir_all(&lanes_dir).unwrap();
5308- let scratch = lanes_dir.join("opus-her-r1.scratch.ogg");
5309- let out_path = lanes_dir.join("opus-her-r1.map.txt");
5314+ let scratch = lanes_dir.join(format!("{tag}.scratch.ogg"));
5315+ let out_path = lanes_dir.join(format!("{tag}.map.txt"));
53105316
53115317 let source_pcm = ffmpeg_decode_pcm(&src, SECS);
53125318 let source_frames = source_pcm.len() / CH;
lanes/opus-her-r1.report.mdmodified+3 -3
@@ -3,13 +3,13 @@
33 **Verdict: no fix. The charter's premise (her@96 err_ratio 10.126, target < 5) is
44 superseded — `706596b` (lane-opus-64, transient_analysis port) already took her@96
55 from 10.1 → 1.05 and her@64 from 4.65 → 1.10.** This lane delivers the requested
6-error map (`lanes/opus-her-r1.map.txt`, test `her_err_map_96k`) and the certified
6+error map (`lanes/opus-her-r1.map.txt`, test `err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3)) and the certified
77 current 14-row baseline. No `src` change: the gate target is met and a change would
88 be tuning a passing row.
99
1010 ## What the map is
1111
12-`her_err_map_96k` (`#[ignore]`, `crates/ec-opus/tests/conformance.rs`, 30 s): the
12+`err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3) (`#[ignore]`, `crates/ec-opus/tests/conformance.rs`, 30 s): the
1313 gate's exact encode path for both encoders (ffmpeg libopus ref → realised ref_kbps
1414 → ours CVBR at that rate), `opus_compare_err_parts` per-2.5 ms-hop ef² bucketed
1515 into 1 s windows. Prints top-10 windows by ours/ref ratio and by ours share, with
@@ -66,6 +66,6 @@ Worst row is now **reell@96 at 4.499** — the next gate lane's premise.
6666
6767 ## Files
6868
69-- `crates/ec-opus/tests/conformance.rs` — `her_err_map_96k` (commit 233d47e).
69+- `crates/ec-opus/tests/conformance.rs` — `err_map_vs_libopus` (was `her_err_map_96k`, renamed in r3) (commit 233d47e).
7070 - `lanes/opus-her-r1.map.txt` — the map (commit 233d47e).
7171 - `lanes/` gate artifacts restored via `git checkout --` after the runs.