forge
Explore
Log in

Don't you dare go Hollow

Oracle lives in ~/.cache, not reaped /tmp -- 20 gates were silently vacuous

Browse files at this commit

1fc2eb056032d9fbea203ad9a05691941e9474ccAhmet Kaan GümüşParent: f03f2a3
  • fix
    • oracle lives in ~/.cache, not reaped /tmp -- 20 gates were silently vacuous
Show full message
fix(av1): oracle lives in ~/.cache, not reaped /tmp -- 20 gates were silently vacuous

A tmpfs reclaim wiped /tmp/libaom-src between sessions. aomenc_path()'s only
default pointed there, so every one of the 20 aomenc gates hit the SKIP branch
and the suite stayed green while proving nothing.

- scripts/build-aom-oracle.sh provisions source + aomenc/aomdec under
  ~/.cache/aom-oracle (pinned v3.13.3, AOM_TARGET_CPU=generic since this box
  has no nasm; measured same 15.3s/gate as the old SIMD build).
- aomenc_path() searches the durable location first, /tmp last (legacy).
- EC_AV1_REQUIRE_AOMENC=1 turns a missing oracle into a hard failure so a
  batch run cannot report green off 20 skips.

EVIDENCE: free-partition gate with EC_AV1_REQUIRE_AOMENC=1 -- 5 pixel-exact
matches, rect_partition_hits=7 partab_hits=2, 15.34s.
crates/ec-av1/src/stream.rsmodified+29 -4
@@ -1111,13 +1111,38 @@ mod tests {
11111111 /// default dev-build path; the test skips (not fails) when neither this
11121112 /// nor `ffmpeg` is present.
11131113 fn aomenc_path() -> std::path::PathBuf {
1114- std::env::var_os("EC_AV1_AOMENC")
1115- .map(std::path::PathBuf::from)
1116- .unwrap_or_else(|| "/tmp/libaom-src/build/encoder/aomenc".into())
1114+ if let Some(p) = std::env::var_os("EC_AV1_AOMENC") {
1115+ return std::path::PathBuf::from(p);
1116+ }
1117+ // The oracle used to live only under `/tmp`, which this box's tmpfs
1118+ // guard reclaims -- when it did, all 20 aomenc gates below went
1119+ // silently vacuous (SKIP, suite still green). The durable location
1120+ // is provisioned by `scripts/build-aom-oracle.sh`; the `/tmp` path
1121+ // stays last as a legacy fallback.
1122+ let mut candidates = Vec::new();
1123+ if let Some(home) = std::env::var_os("HOME") {
1124+ candidates.push(std::path::PathBuf::from(&home).join(".cache/aom-oracle/build/aomenc"));
1125+ }
1126+ candidates.push("/tmp/libaom-src/build/encoder/aomenc".into());
1127+ candidates
1128+ .iter()
1129+ .find(|p| p.is_file())
1130+ .cloned()
1131+ .unwrap_or_else(|| candidates.remove(0))
11171132 }
11181133
1134+ /// Whether the aomenc oracle is present. Absence normally SKIPs (a
1135+ /// checkout without the oracle should still run the rest of the suite),
1136+ /// but `EC_AV1_REQUIRE_AOMENC=1` turns it into a hard failure so a batch
1137+ /// run cannot report green off 20 skipped gates.
11191138 fn have_aomenc() -> bool {
1120- aomenc_path().is_file()
1139+ let present = aomenc_path().is_file();
1140+ assert!(
1141+ present || std::env::var_os("EC_AV1_REQUIRE_AOMENC").is_none(),
1142+ "EC_AV1_REQUIRE_AOMENC is set but no aomenc at {} -- run scripts/build-aom-oracle.sh",
1143+ aomenc_path().display()
1144+ );
1145+ present
11211146 }
11221147
11231148 /// A real `aomenc` filter-intra fixture: every other intra mode disabled
scripts/build-aom-oracle.shadded+34 -0
@@ -0,0 +1,34 @@
1+#!/usr/bin/env bash
2+# Provision the libaom oracle the ec-av1 gates and every decode-verification
3+# claim depend on: the C source (read as ground truth) plus aomenc/aomdec.
4+#
5+# It lives under ~/.cache, NOT /tmp: on 2026-08-30 a tmpfs reclaim wiped
6+# /tmp/libaom-src and all 20 aomenc gates in crates/ec-av1/src/stream.rs
7+# started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever
8+# `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...".
9+#
10+# nasm/yasm are absent on this box, so the build uses AOM_TARGET_CPU=generic
11+# (C only). Decode is normative, so aomdec stays bit-exact; encode is slower.
12+# Install nasm and drop that flag for a faster oracle.
13+set -euo pipefail
14+
15+VERSION="${AOM_VERSION:-v3.13.3}"
16+ROOT="${AOM_ORACLE_ROOT:-$HOME/.cache/aom-oracle}"
17+SRC="$ROOT/src"
18+BUILD="$ROOT/build"
19+
20+if [ ! -d "$SRC/.git" ]; then
21+ git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC"
22+fi
23+
24+cmake -S "$SRC" -B "$BUILD" -G Ninja \
25+ -DCMAKE_BUILD_TYPE=Release \
26+ -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \
27+ -DCONFIG_INSPECTION=1 \
28+ -DAOM_TARGET_CPU="${AOM_TARGET_CPU:-generic}"
29+ninja -C "$BUILD" aomenc aomdec
30+
31+echo "oracle ready:"
32+echo " source $SRC"
33+echo " aomenc $BUILD/aomenc"
34+echo " aomdec $BUILD/aomdec"