forge
Explore
Log in

Don't you dare go Hollow

ec-av1: the oracle SKIP class — 13 gates could skip their pixel compare SILENTLY

Browse files at this commit

1f09dc095e78e911180d921afb7b7b9fce3a4470Ahmet Kaan GümüşParent: 7bd9ad4
lane-av1gates444's three live 4:4:4 gates reported green having measured
nothing on a host without the oracle: encode_444_lossy_live returned an empty
Vec and gate_444_lossy_live_exact turned it into a second, silent early return,
so "no oracle" and "aomenc produced nothing" were the same value at the call
site. One exit now, Option instead of an empty-Vec sentinel, and the SKIP names
the env var that would make it a failure.

The sweep behind it found a worse instance of the same class that nobody had
named: THIRTEEN gates wrapped their oracle arm in a bare
`if aomdec_path().is_file()`, with NO env escape at all. With
EC_AV1_REQUIRE_AOMENC=1 set and aomdec absent they encoded, decoded, asserted
their geometry and their counters, skipped the compare and reported green —
four of the thirteen printed nothing at all. New probe `aomdec_available`, in
the have_ffmpeg shape (probe, assert LAST, env escape), now guards all
thirteen and prints its own SKIP; the nine ad-hoc `else` SKIP branches are
deleted so the notice and the assert cannot drift apart.

Proven in both directions with absence simulated through the crate's own path
overrides (EC_AV1_AOMENC / EC_AV1_AOMDEC -> /nonexistent/oracle/...):
- oracle present: the three gates pass (13/12/24 own-extent gathers) and the
  eleven re-routed pinned gates still pass — nothing about what they measure
  changed;
- aomdec absent + EC_AV1_REQUIRE_AOMENC=1: RED on the parent commit ("ok. 3
  passed", compare never run, one gate silent), 3 FAILED here with a message
  naming the gate, the path and the fix;
- absent + env unset: SKIP printed naming the path and the escape hatch, gate
  still green — a developer-only convenience, stated as such in the text so no
  batch can mistake it for evidence.

The ~445 `if !have_aomenc()` / `if !have_ffmpeg()` early-return SKIPs are
REPORTED, not changed: both probes already assert last with the env escape, so
those sites already fail under the REQUIRE vars. Full per-site table in
lanes/av1oracleSkip.report.md, which also records a PRE-EXISTING red on this
base that is not this lane's: gate_coverage's enable-rect-tx entries are stale
because a gate merged in 7f8817cb passes --enable-rect-tx=1.
crates/ec-av1/src/stream.rsmodified+83 -74
@@ -6701,7 +6701,7 @@ pub(crate) mod tests {
67016701 }
67026702
67036703 // The oracle aomdec, rawvideo out: FRAMES concatenated yuv444p frames.
6704- if aomdec_path().is_file() {
6704+ if aomdec_available(NAME) {
67056705 let dir = std::env::temp_dir().join(format!("ec-av1-ll444-{}", std::process::id()));
67066706 let _ = std::fs::remove_dir_all(&dir);
67076707 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -6750,11 +6750,6 @@ pub(crate) mod tests {
67506750 );
67516751 }
67526752 }
6753- } else {
6754- eprintln!(
6755- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
6756- aomdec_path().display()
6757- );
67586753 }
67596754
67606755 // ffmpeg's decoder: same frames, full-resolution chroma.
@@ -6885,13 +6880,8 @@ pub(crate) mod tests {
68856880 );
68866881 let _ = decode_stream(&ctrl_stream)
68876882 .unwrap_or_else(|e| panic!("{NAME}: the control arm no longer decodes cleanly: {e}"));
6888- if aomdec_path().is_file() {
6883+ if aomdec_available(NAME) {
68896884 assert_rawvideo_matches(&ctrl, &ctrl_stream, NAME, FRAMES);
6890- } else {
6891- eprintln!(
6892- "SKIP {NAME} control aomdec arm: no oracle aomdec at {}",
6893- aomdec_path().display()
6894- );
68956885 }
68966886 }
68976887
@@ -7075,7 +7065,7 @@ pub(crate) mod tests {
70757065 }
70767066
70777067 // The oracle aomdec, rawvideo out: FRAMES concatenated yuv444p frames.
7078- if aomdec_path().is_file() {
7068+ if aomdec_available(NAME) {
70797069 let dir = std::env::temp_dir().join(format!("ec-av1-llminp8-{}", std::process::id()));
70807070 let _ = std::fs::remove_dir_all(&dir);
70817071 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -7125,11 +7115,6 @@ pub(crate) mod tests {
71257115 );
71267116 }
71277117 }
7128- } else {
7129- eprintln!(
7130- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
7131- aomdec_path().display()
7132- );
71337118 }
71347119
71357120 // ffmpeg's decoder: same frames, full-resolution chroma.
@@ -7269,7 +7254,7 @@ pub(crate) mod tests {
72697254 // was a stage-ladder mixup, refuted in lane-av1lrflush r3.
72707255
72717256 // The oracle aomdec, rawvideo out: FRAMES concatenated yuv444p frames.
7272- if aomdec_path().is_file() {
7257+ if aomdec_available(NAME) {
72737258 let dir = std::env::temp_dir().join(format!("ec-av1-444sb-{}", std::process::id()));
72747259 let _ = std::fs::remove_dir_all(&dir);
72757260 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -7319,11 +7304,6 @@ pub(crate) mod tests {
73197304 );
73207305 }
73217306 }
7322- } else {
7323- eprintln!(
7324- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
7325- aomdec_path().display()
7326- );
73277307 }
73287308
73297309 // ffmpeg's decoder: same frames, full-resolution chroma. Same
@@ -7441,7 +7421,7 @@ pub(crate) mod tests {
74417421 f.u.len()
74427422 );
74437423 }
7444- if aomdec_path().is_file() {
7424+ if aomdec_available(NAME) {
74457425 let (decoded, _hidden) = decode_all_frames_vs_oracle(&stream, NAME);
74467426 eprintln!(
74477427 "{NAME}: {decoded} frame(s) byte-exact vs aomdec, {own_chroma} \
@@ -7531,7 +7511,7 @@ pub(crate) mod tests {
75317511 // The identity half: the fix adds an arm gated on `ss_x == 0`, so a
75327512 // 4:2:0 stream must stay byte-exact through it. This is the arm that
75337513 // would go red if the new arm were ever widened past ss_x 0.
7534- if aomdec_path().is_file() {
7514+ if aomdec_available(NAME) {
75357515 decode_all_frames_vs_oracle(&out.stdout, &format!("{NAME}-420"));
75367516 }
75377517 eprintln!("{NAME}: 4:2:0 control {h4} HORZ_4 / {v4} VERT_4 strips, 0 own-extent gathers");
@@ -7563,13 +7543,24 @@ pub(crate) mod tests {
75637543 /// in [`decode_inter_block`]'s `around_c` (a 4:2:0 stream of the same
75647544 /// content leaves it at 0), and a counter at 0 would mean the gate
75657545 /// measured a different route than it names.
7566- fn encode_444_lossy_live(name: &str, w: usize, h: usize) -> Vec<u8> {
7546+ /// The guard is [`have_aomenc`], which probes first and asserts LAST with
7547+ /// the env escape: with `EC_AV1_REQUIRE_AOMENC` set, a missing oracle is
7548+ /// a hard failure naming the path it looked for, and a batch run cannot
7549+ /// report green off three skipped gates. With it unset the `None` below is
7550+ /// a developer-only convenience for a checkout without an oracle -- it is
7551+ /// the ONLY way this gate can return without measuring, and it announces
7552+ /// itself on stderr naming the env var that would make it a failure.
7553+ /// (It used to return an empty `Vec` that the caller turned into a silent
7554+ /// early `return`: the same green, reached through a second exit nobody
7555+ /// was reading.)
7556+ fn encode_444_lossy_live(name: &str, w: usize, h: usize) -> Option<Vec<u8>> {
75677557 if !have_aomenc() {
75687558 eprintln!(
7569- "SKIP {name}: no aomenc oracle at {} -- run scripts/build-aom-oracle.sh",
7559+ "SKIP {name}: no aomenc oracle at {} -- set EC_AV1_REQUIRE_AOMENC=1 to make this \
7560+ a failure, or run scripts/build-aom-oracle.sh",
75707561 aomenc_path().display()
75717562 );
7572- return Vec::new();
7563+ return None;
75737564 }
75747565 let source = format!("testsrc2=size={w}x{h}:rate=25");
75757566 let y4m = Command::new("ffmpeg")
@@ -7628,7 +7619,7 @@ pub(crate) mod tests {
76287619 "{name}: aomenc produced no OBU for {w}x{h} -- a zero-length stream would \
76297620 decode to nothing and the compare below would compare nothing"
76307621 );
7631- out.stdout
7622+ Some(out.stdout)
76327623 }
76337624
76347625 /// The body every 4:4:4 lossy live gate runs: assert the oracle compare
@@ -7637,19 +7628,20 @@ pub(crate) mod tests {
76377628 /// own-extent route really ran, then compare every frame in decode order
76387629 /// against the oracle aomdec with the length asserted first.
76397630 ///
7640- /// The aomdec assert is deliberately a HARD failure, not the
7641- /// `if aomdec_path().is_file()` skip the older gates use: a gate that
7642- /// measures exactness and then quietly skips the compare reports green
7643- /// for a decoder it never looked at (class gate-blind-to-the-arm). It
7644- /// fires only when the gate is actually running, i.e. the oracle aomenc
7645- /// resolved -- and aomenc and aomdec ship in the same build directory,
7646- /// so an aomdec that is missing while aomenc is present is a broken
7647- /// oracle, not a checkout without one.
7631+ /// The aomdec arm is a HARD failure, not a skip: these three gates encode
7632+ /// LIVE, so reaching this point means the oracle aomenc resolved, and
7633+ /// aomenc and aomdec ship in the same build directory -- an aomdec that is
7634+ /// missing beside a present aomenc is a broken oracle, not a checkout
7635+ /// without one. (The older shape, `if aomdec_path().is_file()`, let the
7636+ /// compare vanish with no env escape at all; that is what
7637+ /// [`aomdec_available`] replaced for the pinned gates, and it cannot be
7638+ /// used here because these gates have no stream to compare without one.)
76487639 fn gate_444_lossy_live_exact(name: &str, w: usize, h: usize) {
7649- let stream = encode_444_lossy_live(name, w, h);
7650- if stream.is_empty() {
7651- return; // no oracle at all: the SKIP above already said so
7652- }
7640+ // The ONLY way out without measuring, and it has already printed a
7641+ // SKIP naming the env var that would turn it into a failure.
7642+ let Some(stream) = encode_444_lossy_live(name, w, h) else {
7643+ return;
7644+ };
76537645 assert!(
76547646 aomdec_path().is_file(),
76557647 "{name}: the oracle aomenc resolved to {} but no aomdec sits beside it at {} -- \
@@ -7842,7 +7834,7 @@ pub(crate) mod tests {
78427834 // lengths match before it compares anything -- the check whose absence
78437835 // turned an out-of-window divergence into a reported EXACT in this
78447836 // lane's own round 1.
7845- if aomdec_path().is_file() {
7837+ if aomdec_available(NAME) {
78467838 decode_all_frames_vs_oracle(&stream420, &format!("{NAME}-420"));
78477839 crate::decode::reset_intrabc_rect4_own_chroma444_hits();
78487840 decode_stream(&stream420)
@@ -7973,7 +7965,7 @@ pub(crate) mod tests {
79737965 }
79747966
79757967 // Frames 0/1 through the PIPELINE, byte-exact vs both oracles.
7976- if aomdec_path().is_file() {
7968+ if aomdec_available(NAME) {
79777969 let dir = std::env::temp_dir().join(format!("ec-av1-lrflush-{}", std::process::id()));
79787970 let _ = std::fs::remove_dir_all(&dir);
79797971 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -8023,11 +8015,6 @@ pub(crate) mod tests {
80238015 );
80248016 }
80258017 }
8026- } else {
8027- eprintln!(
8028- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
8029- aomdec_path().display()
8030- );
80318018 }
80328019 if have_ffmpeg() {
80338020 let refs = ffmpeg_decode_sequence_444(&stream, W, H, FRAMES);
@@ -8123,7 +8110,7 @@ pub(crate) mod tests {
81238110 );
81248111
81258112 // The oracle aomdec, rawvideo out: FRAMES concatenated yuv444p frames.
8126- if aomdec_path().is_file() {
8113+ if aomdec_available(NAME) {
81278114 let dir = std::env::temp_dir().join(format!("ec-av1-ll444dp-{}", std::process::id()));
81288115 let _ = std::fs::remove_dir_all(&dir);
81298116 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -8164,11 +8151,6 @@ pub(crate) mod tests {
81648151 );
81658152 }
81668153 }
8167- } else {
8168- eprintln!(
8169- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
8170- aomdec_path().display()
8171- );
81728154 }
81738155 }
81748156
@@ -8265,7 +8247,7 @@ pub(crate) mod tests {
82658247 }
82668248
82678249 // The oracle aomdec, rawvideo out: FRAMES concatenated yuv444p frames.
8268- if aomdec_path().is_file() {
8250+ if aomdec_available(NAME) {
82698251 let dir = std::env::temp_dir().join(format!("ec-av1-leaf8oob-{}", std::process::id()));
82708252 let _ = std::fs::remove_dir_all(&dir);
82718253 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -8292,11 +8274,6 @@ pub(crate) mod tests {
82928274 0x3821_0bcb_f572_973c,
82938275 "{NAME}: aomdec raw fingerprint moved"
82948276 );
8295- } else {
8296- eprintln!(
8297- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
8298- aomdec_path().display()
8299- );
83008277 }
83018278 }
83028279 /// lane-lossless128: a LOSSLESS key frame that codes a 128-axis
@@ -8697,7 +8674,7 @@ pub(crate) mod tests {
86978674 );
86988675
86998676 // The oracle aomdec, rawvideo out: one concatenated yuv444p frame.
8700- if aomdec_path().is_file() {
8677+ if aomdec_available(NAME) {
87018678 let dir = std::env::temp_dir().join(format!("ec-av1-ibcskip2-{}", std::process::id()));
87028679 let _ = std::fs::remove_dir_all(&dir);
87038680 std::fs::create_dir_all(&dir).expect("scratch dir");
@@ -8738,11 +8715,6 @@ pub(crate) mod tests {
87388715 predictor or the rect walk"
87398716 );
87408717 }
8741- } else {
8742- eprintln!(
8743- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
8744- aomdec_path().display()
8745- );
87468718 }
87478719 eprintln!(
87488720 "{NAME}: frame sample-exact vs oracle aomdec; {luma}+{chroma} rect \
@@ -9147,6 +9119,48 @@ pub(crate) mod tests {
91479119 present
91489120 }
91499121
9122+ /// lane-av1oracleskip: the probe for the ORACLE COMPARER, in the same
9123+ /// shape as [`have_ffmpeg`] -- probe first, then `assert!` LAST, with the
9124+ /// env escape -- and it prints its own SKIP so a caller cannot skip the
9125+ /// compare silently.
9126+ ///
9127+ /// Why this exists: thirteen gates wrapped their oracle arm in a bare
9128+ /// `if aomdec_path().is_file()`, and that shape had NO env escape at all.
9129+ /// An oracle build with `aomenc` but no `aomdec` beside it (or an
9130+ /// `EC_AV1_AOMDEC` override pointing at a moved path) made the gate
9131+ /// encode, decode, assert its geometry and its counters, and then quietly
9132+ /// never compare -- green having measured nothing, with no line in the
9133+ /// output to notice. Nine of the thirteen printed a SKIP in an `else` and
9134+ /// four printed nothing at all; both are the same defect, and both are
9135+ /// closed by one probe.
9136+ ///
9137+ /// With `EC_AV1_REQUIRE_AOMENC` (or the aomdec-specific
9138+ /// `EC_AV1_REQUIRE_AOMDEC`) set, the absence is a HARD failure naming the
9139+ /// path that was looked for -- that is the batch-run guarantee, and it is
9140+ /// what the bare `is_file()` could not give. With it unset the SKIP below
9141+ /// is printed and the gate still passes: that remains a developer-only
9142+ /// convenience for a checkout without an oracle, never evidence.
9143+ fn aomdec_available(name: &str) -> bool {
9144+ let present = aomdec_path().is_file();
9145+ let require = std::env::var_os("EC_AV1_REQUIRE_AOMDEC").is_some()
9146+ || std::env::var_os("EC_AV1_REQUIRE_AOMENC").is_some();
9147+ assert!(
9148+ present || !require,
9149+ "{name}: no oracle aomdec at {} -- the pixel compare this gate exists for would be \
9150+ skipped, and EC_AV1_REQUIRE_AOMDEC/EC_AV1_REQUIRE_AOMENC is set. Build the oracle \
9151+ with scripts/build-aom-oracle.sh, or point EC_AV1_AOMDEC at a real aomdec.",
9152+ aomdec_path().display()
9153+ );
9154+ if !present {
9155+ eprintln!(
9156+ "SKIP {name}: no oracle aomdec at {} -- the pixel compare is NOT running (set \
9157+ EC_AV1_REQUIRE_AOMDEC=1 to make this a failure)",
9158+ aomdec_path().display()
9159+ );
9160+ }
9161+ present
9162+ }
9163+
91509164 /// The instrumented `aomdec` beside the `aomenc` oracle
91519165 /// (`scripts/build-aom-oracle.sh` + `scripts/instrument-aom-oracle.sh`).
91529166 fn aomdec_path() -> std::path::PathBuf {
@@ -11180,18 +11194,13 @@ pub(crate) mod tests {
1118011194 // The oracle, DECODE order, every frame including hidden alt-ref
1118111195 // frames. This is the arm that proves the repair against aomdec's
1118211196 // own reconstruction, not just ffmpeg's.
11183- if aomdec_path().is_file() {
11197+ if aomdec_available(NAME) {
1118411198 let (decoded, hidden) = decode_all_frames_vs_oracle(&stream, NAME);
1118511199 assert!(
1118611200 decoded >= FRAMES,
1118711201 "{NAME}: oracle decoded {decoded} frames, expected at least {FRAMES}"
1118811202 );
1118911203 let _ = hidden;
11190- } else {
11191- eprintln!(
11192- "SKIP {NAME} aomdec arm: no oracle aomdec at {}",
11193- aomdec_path().display()
11194- );
1119511204 }
1119611205
1119711206 // ffmpeg's decoder: DISPLAY order, full-resolution chroma.
@@ -14198,7 +14207,7 @@ pub(crate) mod tests {
1419814207 );
1419914208 }
1420014209 }
14201- if aomdec_path().is_file() {
14210+ if aomdec_available(name) {
1420214211 let (decoded, hidden) = decode_all_frames_vs_oracle(&stream, name);
1420314212 eprintln!(
1420414213 "{name}: {decoded} decode-order frame(s) ({hidden} hidden) byte-exact vs aomdec \
lanes/av1oracleSkip.report.mdadded+159 -0
@@ -0,0 +1,159 @@
1+# lane-av1oracleskip — gate-honesty: the oracle SKIP class
2+
3+**Tree.** `lane-av1oracleskip` off **main `7f8817cb`** ("Merge lane-av1pins @
4+44a05b40"), worktree `~/.cache/wt/av1oracleskip`, branch
5+`lane-av1oracleskip`. Commit `ee4f2d55` (see §5). The primary checkout was
6+mid-merge when this lane started (`UU crates/ec-av1/src/stream.rs` in its
7+index), so this worktree is pinned to the last merge commit rather than to a
8+moving HEAD. Built in a lane-private `CARGO_TARGET_DIR`
9+(`~/.cache/cargo-target-av1oracleskip`).
10+
11+**Scope.** (1) the three `lane-av1gates444` gates that reported green having
12+measured nothing on a host without the oracle; (2) the class sweep behind it,
13+one row per site for every site this commit touches and per shape for the rest.
14+
15+---
16+
17+## 1. What was wrong, exactly
18+
19+`encode_444_lossy_live` (the helper all three gates call) opened with
20+
21+```rust
22+if !have_aomenc() {
23+ eprintln!("SKIP {name}: no aomenc oracle at {path} -- run scripts/build-aom-oracle.sh");
24+ return Vec::new();
25+}
26+```
27+
28+and `gate_444_lossy_live_exact` then did
29+
30+```rust
31+let stream = encode_444_lossy_live(name, w, h);
32+if stream.is_empty() {
33+ return; // no oracle at all: the SKIP above already said so
34+}
35+```
36+
37+Two exits, the second one silent, and — the part that matters for a batch — the
38+empty `Vec` is indistinguishable at the call site from a stream aomenc
39+produced and then lost. The gates
40+`a_444_lossy_odd_66x66_stream_decodes_pixel_exact`,
41+`a_444_lossy_odd_130x122_stream_decodes_pixel_exact` and
42+`a_444_lossy_256x128_stream_decodes_pixel_exact` inherit that shape: without the
43+oracle they assert nothing, encode nothing, compare nothing, and report
44+**passed**.
45+
46+The escape hatch already existed and was already correct in the probe:
47+`have_aomenc()` asserts when `EC_AV1_REQUIRE_AOMENC` is set, naming the path it
48+looked for. So the fix is not a new mechanism — it is to stop putting a second,
49+silent exit in the gate, and to make the SKIP say what it is.
50+
51+## 2. The class sweep
52+
53+`grep -c` over the crate's three test-bearing files (there is no `tests/`
54+directory; the crate's tests live in `src/*.rs`):
55+
56+| file:line | gate(s) | shape | fixed or reported |
57+|---|---|---|---|
58+| `stream.rs:7422` (`encode_444_lossy_live`), `stream.rs:7505` (`gate_444_lossy_live_exact`) | `a_444_lossy_odd_66x66_stream_decodes_pixel_exact`, `a_444_lossy_odd_130x122_stream_decodes_pixel_exact`, `a_444_lossy_256x128_stream_decodes_pixel_exact` | **C** — `if !have_aomenc() { SKIP; return Vec::new() }` + a silent `if stream.is_empty() { return; }` in the caller | **FIXED** |
59+| `stream.rs:6692` | `a_lossless_444_min_partition64_inter_stream_decodes_pixel_exact` | **B** — bare `if aomdec_path().is_file() { …compare… }`, no else, no env escape | **FIXED** |
60+| `stream.rs:6871` | `a_lossless_444_128_root_lossless_stream_reads_chunks_chunk_major` | B (had an `else` SKIP, still no env escape) | **FIXED** |
61+| `stream.rs:6934` | `a_lossless_444_min_partition8_inter_stream_decodes_sample_exact` | B (else SKIP) | **FIXED** |
62+| `stream.rs:7123` | `a_444_sb128_root_rect_stream_with_restoration_decodes_pixel_exact` | B (no else) | **FIXED** |
63+| `stream.rs:7290` | `a_444_lossy_rect4_inter_stream_decodes_pixel_exact` | B (no else) | **FIXED** |
64+| `stream.rs:7380` | `a_444_lossy_rect4_inter_stream_decodes_pixel_exact` (4:2:0 control arm) | B (no else) | **FIXED** |
65+| `stream.rs:7703` | `a_444_intrabc_rect4_reads_its_own_chroma_plane_block` | B (no else) | **FIXED** |
66+| `stream.rs:7834` | `a_444_sb128_witness_lr_pipeline_flushes_ru_row_0_pixel_exact` | B (else SKIP) | **FIXED** |
67+| `stream.rs:7979` | `a_lossless_444_defaultp_inter_strip_stream_decodes_byte_exact` | B (else SKIP) | **FIXED** |
68+| `stream.rs:8116` | `an_intrabc_8x8_leaf_chroma_frame_copy_at_444_decodes_without_the_oob` | B (else SKIP) | **FIXED** |
69+| `stream.rs:8543` | `a_lossless_444_intrabc_rect_leaf_walks_per_4x4_units` | B (else SKIP) | **FIXED** |
70+| `stream.rs:11063` | `a_lossless_444_rect16x4_chroma_reach_is_ss_aware` | B (else SKIP) | **FIXED** |
71+| `stream.rs:14076` | the superres/upscaled-bit-depth helper (`name: &str`) | B (no else) | **FIXED** |
72+| `stream.rs` — 153 sites | (the `aomenc`-live gates) | **A** — `if !have_aomenc() { eprintln!("SKIP …"); return; }` | REPORTED, not changed |
73+| `stream.rs` — 218 sites, `decode.rs` — 4, `encode.rs` — 43 | (the ffmpeg-backed gates) | **A** — `if !have_ffmpeg() { …; return; }` | REPORTED, not changed |
74+| `stream.rs` — 26, `decode.rs` — 1, `encode.rs` — 1 | (compound guards) | **A** — `if !have_ffmpeg() \|\| !have_aomenc() { … }` | REPORTED, not changed |
75+| `stream.rs:7511` | the three live 4:4:4 gates | **D** — a hard `assert!(aomdec_path().is_file(), …)` | REPORTED, kept: these gates encode LIVE, so reaching that point means aomenc resolved, and an aomdec missing beside a present aomenc is a broken oracle, not a checkout without one |
76+
77+**Why shape A is reported and not changed.** Both probes (`have_ffmpeg`,
78+`have_aomenc`) already have the correct shape — probe, then `assert!` last,
79+with the env escape — and `have_ffmpeg`'s doc comment already records the
80+earlier version's short-circuit bug. Every shape-A site therefore already FAILS
81+under `EC_AV1_REQUIRE_AOMENC=1` / `EC_AV1_REQUIRE_FFMPEG=1` and prints a SKIP
82+when those are unset. Changing 445 call sites would restate a convention the
83+probe already enforces; the honest statement is that a batch run MUST set the
84+env var, and this commit does not change that.
85+
86+**Shape B is the part the sweep found that nobody had named**, and it is worse
87+than the three gates Main pointed at: those three fail loudly in REQUIRE mode
88+(through `have_aomenc`), while all thirteen B sites had **no env escape at
89+all** — with `EC_AV1_REQUIRE_AOMENC=1` set and aomdec absent, they encoded,
90+decoded, asserted their geometry and counters, skipped the compare, and
91+reported green. Four of the thirteen printed nothing at all.
92+
93+## 3. The fix
94+
95+1. New probe `aomdec_available(name)` beside `have_aomenc`, in the
96+ `have_ffmpeg` shape: probe `aomdec_path().is_file()`, then `assert!` **last**
97+ that the absence is a hard failure when `EC_AV1_REQUIRE_AOMDEC` or
98+ `EC_AV1_REQUIRE_AOMENC` is set (the message names the path looked for and
99+ how to fix it), then print a SKIP naming the env var when the flag is unset
100+ and return the bool. All thirteen sites now call it; the nine `else { … }`
101+ SKIP branches they carried are deleted, so the skip notice comes from one
102+ place and cannot drift from the assert.
103+2. `encode_444_lossy_live` returns `Option<Vec<u8>>` and
104+ `gate_444_lossy_live_exact` takes it with `let Some(stream) = … else { return }`
105+ — one exit instead of two, and the empty-`Vec` sentinel that made "no
106+ oracle" look like "aomenc produced nothing" is gone. Nothing about what the
107+ gates measure changed: they still encode live, still assert the parsed
108+ geometry, the frame count, the full-resolution chroma extent and
109+ `rect4_inter_own_chroma444_hits()`, and still compare every decode-order
110+ frame against `aomdec` through `decode_all_frames_vs_oracle`.
111+
112+## 4. Proof, all six directions
113+
114+Absence is simulated the way the crate's own path resolution allows: the
115+`EC_AV1_AOMENC` / `EC_AV1_AOMDEC` env overrides point at
116+`/nonexistent/oracle/aomenc` and `/nonexistent/oracle/aomdec`, so
117+`aomenc_path()` / `aomdec_path()` resolve to files that are not there.
118+
119+| # | condition | before this commit | after |
120+|---|---|---|---|
121+| a | oracle present, `EC_AV1_REQUIRE_AOMENC=1` | 3 passed | 3 passed, each printing its line: `66x66 … 13 own-extent 1:4 chroma gather(s)`, `130x122 … 12 …`, `256x128 … 24 …` |
122+| a2 | oracle present, the 11 re-routed pinned gates | 11 passed | **11 passed** (no behaviour change with the oracle there) |
123+| b | aomenc absent + `EC_AV1_REQUIRE_AOMENC=1` | 3 passed (green, measured nothing) | **3 FAILED**: `EC_AV1_REQUIRE_AOMENC is set but no aomenc at /nonexistent/oracle/aomenc -- run scripts/build-aom-oracle.sh` |
124+| b2 | aomdec absent + `EC_AV1_REQUIRE_AOMENC=1` | **3 passed, silently** — one of the three printed no SKIP line at all | **3 FAILED**: `<gate>: no oracle aomdec at /nonexistent/oracle/aomdec -- the pixel compare this gate exists for would be skipped, and EC_AV1_REQUIRE_AOMDEC/EC_AV1_REQUIRE_AOMENC is set.` |
125+| c | aomenc absent, env unset | 3 passed, one SKIP line per gate | 3 passed, `SKIP <gate>: no aomenc oracle at /nonexistent/oracle/aomenc -- set EC_AV1_REQUIRE_AOMENC=1 to make this a failure, or run scripts/build-aom-oracle.sh` |
126+| c2 | aomdec absent, env unset | 3 passed, 2 SKIP lines, 1 silent | 3 passed, 3 SKIP lines naming the gate and the path |
127+
128+**(b2) is the red-before for the class fix**: the same command on the parent
129+commit printed `test result: ok. 3 passed` with the compare never running, and
130+prints `3 failed` here. `(c)` and `(c2)` remain a **developer-only
131+convenience** — a checkout without an oracle still runs the rest of the suite
132+green, and the SKIP line now says which env var turns that into a failure. No
133+batch run may rely on it: `EC_AV1_REQUIRE_AOMENC=1` (or the aomdec-specific
134+`EC_AV1_REQUIRE_AOMDEC=1`) is what makes a missing oracle red, and that is
135+stated in the SKIP text itself.
136+
137+## 5. Pre-existing red on this base, NOT this lane's
138+
139+`gate_coverage::tests::never_exercised_{8,10}bit_matches_the_gate_recipes` are
140+RED on base `7f8817cb` before any edit of mine (`the 8-bit list still names
141+["enable-rect-tx"], but a 8-bit gate now passes '=1' for them`). Reproduced on
142+the stashed, unmodified tree. A gate merged in `7f8817cb` spells
143+`--enable-rect-tx=1`, so the `enable-rect-tx` entries in
144+`NEVER_EXERCISED_8BIT` / `NEVER_EXERCISED_10BIT` are stale and the rule is to
145+delete them in the same commit as the gate that closes the hole — that gate is
146+not mine, and `crates/ec-av1/src/gate_coverage.rs` is one of the files the
147+in-flight merge on the primary checkout has staged as modified, so editing it
148+here would collide. **Reported, not touched.** The fix is deleting the
149+`("enable-rect-tx", …)` entry from both lists.
150+
151+## 6. One more thing this lane does not change
152+
153+`aomdec_available` deliberately keeps a SKIP (rather than the hard assert shape
154+D uses) because those thirteen gates decode a **pinned fixture** and their
155+oracle arm is one assertion among several; the live-encode gates have no
156+fixture to fall back on, so a missing aomdec there really is a broken oracle
157+and stays a hard failure. If the house wants the pinned gates to fail
158+unconditionally too, that is a one-line change per site and a policy call, not
159+a bug.