From 1db238b50f45feffe4254d3dcf41dcbd9b925736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 30 Aug 2026 07:32:27 +0300 Subject: [PATCH] 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.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/build-aom-oracle.sh b/scripts/build-aom-oracle.sh index 098807e4..fcbefde3 100755 --- a/scripts/build-aom-oracle.sh +++ b/scripts/build-aom-oracle.sh @@ -7,9 +7,10 @@ # started SKIPping, leaving a green-but-vacuous suite. Re-run this whenever # `cargo test -p ec-av1` prints "SKIP ...: no aomenc at ...". # -# nasm/yasm are absent on this box, so the build uses AOM_TARGET_CPU=generic -# (C only). Decode is normative, so aomdec stays bit-exact; encode is slower. -# Install nasm and drop that flag for a faster oracle. +# Needs an assembler (nasm or yasm) for the SIMD build. Without one it falls +# back to AOM_TARGET_CPU=generic (C only) automatically -- decode is normative +# so aomdec stays bit-exact either way, but encode is slower, which matters +# because every gate shells out to aomenc 40 times. Install nasm for speed. set -euo pipefail VERSION="${AOM_VERSION:-v3.13.3}" @@ -21,11 +22,19 @@ if [ ! -d "$SRC/.git" ]; then git clone --depth 1 --branch "$VERSION" https://aomedia.googlesource.com/aom "$SRC" fi +CPU_ARGS=() +if [ -n "${AOM_TARGET_CPU:-}" ]; then + CPU_ARGS=(-DAOM_TARGET_CPU="$AOM_TARGET_CPU") +elif ! command -v nasm >/dev/null && ! command -v yasm >/dev/null; then + echo "no nasm/yasm found -- falling back to the C-only (generic) build" >&2 + CPU_ARGS=(-DAOM_TARGET_CPU=generic) +fi + cmake -S "$SRC" -B "$BUILD" -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_TESTS=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=1 \ -DCONFIG_INSPECTION=1 \ - -DAOM_TARGET_CPU="${AOM_TARGET_CPU:-generic}" + "${CPU_ARGS[@]}" ninja -C "$BUILD" aomenc aomdec echo "oracle ready:"