From 62abc0189e74e25afdd33adebabcc4b9a76720b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 03:47:50 +0300 Subject: [PATCH] ec-flac: a missing xiph corpus FAILS under EC_REQUIRE_FIXTURES `corpus()` returned `None` on an absent `fixtures/vectors/flac-xiph` tree and all four gates skipped green, decoding nothing. The assert lives in `corpus()` itself -- the one place that knows the path -- so all four gates are covered by one hunk, and each of them still pixel-compares when the corpus is there. Red: EC_REQUIRE_FIXTURES=1 with `fixtures/` unlinked fails subset_vectors_decode_bit_exact_against_ffmpeg ("the FLAC xiph subset corpus is missing at .../subset -- these gates would prove nothing"). Green: 4 passed / 0 failed with `fixtures/` linked (32.0s). --- crates/ec-flac/tests/xiph_vectors.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/ec-flac/tests/xiph_vectors.rs b/crates/ec-flac/tests/xiph_vectors.rs index dcbbef53..c5886919 100644 --- a/crates/ec-flac/tests/xiph_vectors.rs +++ b/crates/ec-flac/tests/xiph_vectors.rs @@ -21,7 +21,29 @@ fn corpus(kind: &str) -> Option> { let dir = Path::new(env!("CARGO_MANIFEST_DIR")) .join("../../fixtures/vectors/flac-xiph/flac-test-files-main") .join(kind); - let mut files: Vec = std::fs::read_dir(dir) + // A missing corpus made every gate below skip GREEN having decoded nothing + // — the "gate skips on its own failure" class. The root `fixtures/` tree is + // gitignored, so `git worktree add` hands every lane worktree a tree without + // it. `EC_REQUIRE_FIXTURES=1` turns that into a hard failure naming the + // exact path and the command that produces it; unset, the skip is kept and + // now says what it skipped. Set it in every batch run. + if !dir.is_dir() { + assert!( + std::env::var_os("EC_REQUIRE_FIXTURES").is_none(), + "the FLAC xiph {kind} corpus is missing at {} — these gates would prove \ + nothing. A worktree has no gitignored root `fixtures/`: run \ + scripts/link-fixtures.sh, or fetch it with scripts/fetch-vectors.sh.", + dir.display() + ); + eprintln!( + "SKIP the FLAC xiph {kind} corpus is missing at {} — these gates proved \ + nothing; run scripts/link-fixtures.sh, or fetch it with \ + scripts/fetch-vectors.sh (or set EC_REQUIRE_FIXTURES=1 to make this a failure).", + dir.display() + ); + return None; + } + let mut files: Vec = std::fs::read_dir(&dir) .ok()? .filter_map(|e| e.ok().map(|e| e.path())) .filter(|p| p.extension().is_some_and(|e| e == "flac"))