interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / evidence / audit / 2026-11-05-2954d46 / runner / audit-runs.sh

112 lines · 6054 bytes Raw Blame History
1#!/bin/sh
2# DRA-106: run every AUDIT_SCOPE.md command (and the unlisted tests on main) from clean clones.
3# Each step runs under env -i with only the variables named in its "env" column, so a missing
4# requirement shows up as a failure of the doc-exact row and a separate labeled variant row.
5# Heavy steps (MAX): MemAvailable >= 20 GiB and /tmp/pdra4-heavy.lock, cores 5-9 (DRA-102 A.2;
6# heavy.sh's 18091=200 clause not applied, 18091 down). Device steps are NOT_RUN (GPU gate).
7set -u
8REV=${REV:?bridge revision}
9A=/tmp/sweep/A106b
10O=$A/out
11W=$A/omega-bridge
12L7=/tmp/sweep/L7
13ZIGD=$HOME/.local/opt/zig-linux-aarch64-0.13.0
14GOD=$HOME/.local/opt/go1.27.3/bin
15BPATH=$ZIGD:$GOD:$HOME/.cargo/bin:/usr/local/bin:/usr/bin:/bin
16MAXPY=$HOME/workspace/maxinterop/venv/bin/python
17QORACLE=~/work/bridge-x86/build/qemu-oracle/build/qemu-x86_64
18mkdir -p $O
19RC=$O/rc.tsv
20printf 'step\trc\twall_s\tenv\tcommand\n' >$RC
21note() { echo "$(date -u +%FT%TZ) $*" >>$O/run.log; }
22
23# r STEP "ENV ..." CMD... : light step, cores 0-4,15-19
24r() {
25 n=$1 e=$2; shift 2
26 s=$(date +%s); note "start $n"
27 (cd $W && env -i HOME=$HOME PATH=$BPATH GOCACHE=$A/gocache LANG=C.UTF-8 $e \
28 nice -n 19 taskset -c 0-4,15-19 "$@") >$O/$n.log 2>&1
29 rc=$?; printf '%s\t%s\t%s\t%s\t%s\n' "$n" "$rc" "$(( $(date +%s) - s ))" "$e" "$*" >>$RC
30 note "end $n rc=$rc"
31}
32# h STEP "ENV ..." CMD... : heavy MAX step behind the box-wide lock, cores 5-9
33h() {
34 n=$1 e=$2; shift 2
35 while :; do
36 avail=$(awk '/^MemAvailable/{print int($2/1048576)}' /proc/meminfo)
37 [ "$avail" -ge 20 ] && break
38 note "$n waiting MemAvailable=${avail}G"; sleep 60
39 done
40 s=$(date +%s); note "start $n mem_available_kib=$(awk '/^MemAvailable/{print $2}' /proc/meminfo)"
41 (cd $W && env -i HOME=$HOME PATH=$BPATH LANG=C.UTF-8 TMPDIR=/dev/shm $e \
42 flock -w 14400 /tmp/pdra4-heavy.lock taskset -c 5-9 nice -n 19 ionice -c3 "$@") >$O/$n.log 2>&1
43 rc=$?; printf '%s\t%s\t%s\t%s\t%s\n' "$n" "$rc" "$(( $(date +%s) - s ))" "$e" "$*" >>$RC
44 note "end $n rc=$rc"
45}
46nr() { printf '%s\tNOT_RUN\t-\t-\t%s\n' "$1" "$2" >>$RC; }
47
48note "clone"
49rm -rf $W $A/cudapp $A/cudapp-dbb1
50git clone -q https://github.com/aien-dev/omega-bridge $W && git -C $W checkout -q "$REV" || { note "clone failed"; exit 2; }
51git clone -q https://github.com/aien-dev/CUDApp $A/cudapp && git -C $A/cudapp checkout -q ab025d04
52git clone -q https://github.com/aien-dev/CUDApp $A/cudapp-dbb1 && git -C $A/cudapp-dbb1 checkout -q dbb1b5002fd7d96ff4695b2da4dcb3238db226c2
53{
54 echo "bridge_head=$(git -C $W rev-parse HEAD)"
55 echo "cudapp_sibling_head=$(git -C $A/cudapp rev-parse HEAD)"
56 echo "cudapp_freest_head=$(git -C $A/cudapp-dbb1 rev-parse HEAD)"
57 echo "date_utc=$(date -u +%FT%TZ)"
58 echo "uname=$(uname -srm)"
59 echo "gcc=$(gcc --version | head -1)"
60 echo "x86_64-linux-gnu-gcc=$(x86_64-linux-gnu-gcc --version | head -1)"
61 echo "python3=$(python3 --version 2>&1)"
62 echo "zig=$($ZIGD/zig version)"
63 echo "go=$($GOD/go version)"
64 echo "rustc=$(rustc --version)"
65 echo "qemu_path=$(qemu-x86_64 --version | head -1) sha256=$(sha256sum </usr/bin/qemu-x86_64 | cut -c1-64)"
66 echo "qemu_oracle=$($QORACLE --version | head -1) sha256=$(sha256sum <$QORACLE | cut -c1-64)"
67 echo "max=$($MAXPY -c 'import importlib.metadata as m; print(m.version("max"))' 2>&1)"
68 for f in omc-734f omc-13ce omc-be8c omc-2c82; do echo "$f=$(sha256sum <$L7/$f | cut -c1-64)"; done
69 echo "omega_repo_55f9b0af=$(git -C $HOME/workspace/omega rev-parse 55f9b0af)"
70 echo "omega_repo_ec07d25d=$(git -C $HOME/workspace/omega rev-parse ec07d25d)"
71} >$O/env.txt 2>&1
72
73note "cudapp make"
74s=$(date +%s); nice -n 19 taskset -c 0-4,15-19 make -C $A/cudapp -j4 all >$O/cudapp-make.log 2>&1
75printf 'cudapp-make\t%s\t%s\t-\tmake -C ../cudapp all\n' "$?" "$(( $(date +%s) - s ))" >>$RC
76
77OMC=OMEGA_NATIVE_OMC=$L7/omc-734f
78X86="OMEGA_NATIVE_X86_OMC=$L7/omc-be8c"
79X86F="$X86 $OMC QEMU_X86_64=$QORACLE OMEGA_NATIVE_X86_PYTHON=/tmp/sweep/tools/py-x86/python/bin/python3.12 OMEGA_NATIVE_X86_LIBPATH=/tmp/sweep/tools/py-x86/python/lib"
80
81# AUDIT_SCOPE.md "Build from source at a pin"
82r bootstrap "" sh tools/bootstrap.sh
83r build "" tools/build.sh
84# AUDIT_SCOPE.md "Run every test", in order
85r test "" tools/test.sh
86r attachments "" python3 tests/attachments.py
87r native "$OMC" sh tests/native/run.sh
88r v2 "$OMC" sh tests/native/v2/run.sh
89r v2+omc2 "$OMC OMEGA_NATIVE_OMC2=$L7/omc-13ce" sh tests/native/v2/run.sh
90r kinds "$OMC" sh tests/native/kinds.sh
91r x86 "$X86" sh tests/native/x86/run.sh
92r x86+oracle "$X86F" sh tests/native/x86/run.sh
93r buildfail "" sh tests/native/test_build_failures.sh
94r buildfail+omc "$OMC ZIG=$ZIGD/zig" sh tests/native/test_build_failures.sh
95r gpu-adapter-build "OMEGA_SEED=build/bootstrap/omc" sh tools/build-gpu-adapter.sh
96r gpu-adapter-test "" python3 tests/gpu/test_gpu_adapter.py
97h conformance "MAXPY=$MAXPY" conformance/run.sh
98r max-cpu-evidence-test "" python3 max-cpu/test_run_evidence.py
99h max-cpu "MAXPY=$MAXPY" max-cpu/run.sh
100nr conformance-device "conformance/run.sh --device (GB10 inside an authorized spark-window)"
101nr device-window "tools/run-device-window.sh --ledger <ID> (GB10 inside an authorized spark-window)"
102# On main but not in AUDIT_SCOPE.md
103r g1 "$OMC" sh tests/native/g1/run.sh
104r v2-verdict "" python3 tests/native/v2/test_verdict.py
105r x86-buildfail "" python3 tests/native/x86/test_build_failures.py
106r x86-buildfail+env "$X86F OMEGA_NATIVE_X86_BAD_QEMU=/usr/bin/qemu-x86_64" python3 tests/native/x86/test_build_failures.py
107r seeded "OMEGA_SEEDED_OMC=$L7/omc-2c82 OMEGA_SEED=$W/build/bootstrap/omc" python3 tests/seeded.py
108r seeded-float "OMEGA_SEEDED_OMC=$L7/omc-2c82 OMEGA_SEED=$W/build/bootstrap/omc" python3 tests/seeded_float.py
109r freest "OMEGA_SEED=$W/build/bootstrap/omc FREEST_CUDAPP_ROOT=$A/cudapp-dbb1" python3 tests/freest.py
110printf '#!/bin/sh\nexec qemu-x86_64 -L /usr/x86_64-linux-gnu "$@"\n' >$A/qemu-x86-L && chmod +x $A/qemu-x86-L
111r freest-x86 "OMEGA_SEED=$W/build/bootstrap/omc FREEST_CUDAPP_ROOT=$A/cudapp-dbb1 CC=x86_64-linux-gnu-gcc FREEST_RUNNER=$A/qemu-x86-L" python3 tests/freest.py
112note ALLDONE