forge
Explore
Log in

Don't you dare go Hollow

Oracle build auto-detects nasm/yasm (SIMD when present, generic fallback)

Browse files at this commit

1db238b50f45feffe4254d3dcf41dcbd9b925736Ahmet Kaan GümüşParent: 6632737
  • chore
    • oracle build auto-detects nasm/yasm (SIMD when present, generic fallback)
Show full message
chore(av1): oracle build auto-detects nasm/yasm (SIMD when present, generic fallback)

nasm landed on the box, so the pinned rebuild now uses SIMD. Verified the SIMD
oracle is functionally identical to the C-only one before swapping it in:
EC_PART range ladder byte-identical, prefilt recon dumps 24/24 frames identical
on rect-flake-2.
scripts/build-aom-oracle.shmodified+13 -4
@@ -7,9 +7,10 @@
77 # started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever
88 # `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...".
99 #
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.
10+# Needs an assembler (nasm or yasm) for the SIMD build. Without one it falls
11+# back to AOM_TARGET_CPU=generic (C only) automatically -- decode is normative
12+# so aomdec stays bit-exact either way, but encode is slower, which matters
13+# because every gate shells out to aomenc 40 times. Install nasm for speed.
1314 set -euo pipefail
1415
1516 VERSION="${AOM_VERSION:-v3.13.3}"
@@ -21,11 +22,19 @@ if [ ! -d "$SRC/.git" ]; then
2122 git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC"
2223 fi
2324
25+CPU_ARGS=()
26+if [ -n "${AOM_TARGET_CPU:-}" ]; then
27+ CPU_ARGS=(-DAOM_TARGET_CPU="$AOM_TARGET_CPU")
28+elif ! command -v nasm >/dev/null && ! command -v yasm >/dev/null; then
29+ echo "no nasm/yasm found -- falling back to the C-only (generic) build" >&2
30+ CPU_ARGS=(-DAOM_TARGET_CPU=generic)
31+fi
32+
2433 cmake -S "$SRC" -B "$BUILD" -G Ninja \
2534 -DCMAKE_BUILD_TYPE=Release \
2635 -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \
2736 -DCONFIG_INSPECTION=1 \
28- -DAOM_TARGET_CPU="${AOM_TARGET_CPU:-generic}"
37+ "${CPU_ARGS[@]}"
2938 ninja -C "$BUILD" aomenc aomdec
3039
3140 echo "oracle ready:"