Files
leleka/scripts/build-cuda-q6-oracle.sh
T
Pavlo RatushnyiandClaude Sonnet 5.5 7f896a8bb8 import: Original-literal source-port snapshot (frozen 2026-10-12 06:36, uncompiled together, no GPU run)
Snapshot of target/stra169-direct-port-integration/source-port (without target/), now the tracked base for the full Strata Rust port.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 14:38:46 +02:00

23 lines
1.3 KiB
Bash

#!/usr/bin/env bash
# Test-only bounded native reference; no serving/model build or GPU execution.
# TOOLKIT must be the verified deploy/cuda-toolkit.lock.json 13.0.88 distribution.
set -euo pipefail
[[ $# == 2 ]] || { echo 'Usage: build-cuda-q6-oracle.sh TOOLKIT PRIVATE_OUTPUT' >&2; exit 2; }
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
toolkit="$(cd "$1" && pwd)"
output="$2"
[[ ! -e "$output" && -f "$toolkit/TOOLKIT-PROVENANCE.json" ]]
"$toolkit/bin/nvcc" --version | grep 'V13.0.88'
python3 - "$toolkit/TOOLKIT-PROVENANCE.json" "$root/deploy/cuda-toolkit.lock.json" <<'PY'
import json,sys
assert json.load(open(sys.argv[1]))['lock']==json.load(open(sys.argv[2]))
PY
# Exact native source identity is an oracle gate, not caller-selected reference.
echo 'f2fc636e5e8f6db9bbb8146fbf2b78a717c0e0076bf8c72ac2b784df7b3f455f engine/strata/src/kernels/cuda/native_mmvq.cu' | (cd "$root" && sha256sum --check)
sha256sum "$root/engine/strata/src/kernels/cuda/native_mmvq.cu" "$root/scripts/cuda-q6-oracle/native_fixture.cu"
"$toolkit/bin/nvcc" -std=c++17 -O3 -arch=sm_120 --use_fast_math \
-Xcompiler=-ffunction-sections,-fdata-sections -Xlinker=--gc-sections \
-I"$root/engine/strata/include" "$root/engine/strata/src/kernels/cuda/native_mmvq.cu" \
"$root/scripts/cuda-q6-oracle/native_fixture.cu" -ldl -o "$output"
sha256sum "$output"