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 @@
7 # started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever7 # started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever
8 # `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...".8 # `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...".
9 #9 #
10-# nasm/yasm are absent on this box, so the build uses AOM_TARGET_CPU=generic10+# Needs an assembler (nasm or yasm) for the SIMD build. Without one it falls
11-# (C only). Decode is normative, so aomdec stays bit-exact; encode is slower.11+# back to AOM_TARGET_CPU=generic (C only) automatically -- decode is normative
12-# Install nasm and drop that flag for a faster oracle.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.
13 set -euo pipefail14 set -euo pipefail
14 15
15 VERSION="${AOM_VERSION:-v3.13.3}"16 VERSION="${AOM_VERSION:-v3.13.3}"
@@ -21,11 +22,19 @@ if [ ! -d "$SRC/.git" ]; then
21 git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC"22 git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC"
22 fi23 fi
23 24
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+
24 cmake -S "$SRC" -B "$BUILD" -G Ninja \33 cmake -S "$SRC" -B "$BUILD" -G Ninja \
25 -DCMAKE_BUILD_TYPE=Release \34 -DCMAKE_BUILD_TYPE=Release \
26 -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \35 -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \
27 -DCONFIG_INSPECTION=1 \36 -DCONFIG_INSPECTION=1 \
28- -DAOM_TARGET_CPU="${AOM_TARGET_CPU:-generic}"37+ "${CPU_ARGS[@]}"
29 ninja -C "$BUILD" aomenc aomdec38 ninja -C "$BUILD" aomenc aomdec
30 39
31 echo "oracle ready:"40 echo "oracle ready:"