interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / arboris / host.sh

134 lines · 8700 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: AGPL-3.0-only
3set -eu
4out=${1:?supply the host build directory}
5: "${OMC:?set OMC to the seeded compiler}"
6dis=${NVDISASM:-/usr/local/cuda/bin/nvdisasm}
7[ -x "$dis" ] || { echo "NOT_RUN: nvdisasm is required for SM121 parity"; exit 3; }
8compile() {
9 dest=$1
10 shift
11 cat "$@" > "$out/unit.om"
12 sed 's/^export fn /fn /' "$out/unit.om" > "$out/program.om"
13 "$OMC" < "$out/program.om" > "$dest"
14 chmod +x "$dest"
15}
16printf 'om2\n' > "$out/signer-profile.om"
17compile "$out/world-signer" "$out/signer-profile.om" om/tls/sha2.om \
18 protocol/omnet/om/sha512/sha512.om protocol/omnet/om/ed25519/ed25519.om seed/authority/arboris-signer.om
19sed '/^fn main to int/,$d' seed/authority/arboris-signer.om > "$out/signer-unit.om"
20compile "$out/signer-ledger" "$out/signer-profile.om" om/tls/sha2.om \
21 protocol/omnet/om/sha512/sha512.om protocol/omnet/om/ed25519/ed25519.om "$out/signer-unit.om" tests/arboris/signer-ledger.om
22mkdir -p "$out/signer-ledger-fixture"
23(cd "$out/signer-ledger-fixture" && ../signer-ledger)
24grep -Fq "Arboris, Copyright 2026 Adam Pippert" NOTICE
25compile "$out/arena" om/arboris_arena.om tests/arboris_arena_test.om
26"$out/arena"
27compile "$out/native-arena" om/arboris_arena.om gpu/nvidia/native/nvrm/context.om gpu/nvidia/native/share/share.om gpu/nvidia/native/arboris/arena.om tests/arboris/native-arena.om
28"$out/native-arena"
29sh tests/arboris/build-sparse-probe.sh "$out/sparse-packet" tests/arboris/sparse-packet.om
30"$out/sparse-packet"
31sh tests/arboris/build-sparse-probe.sh "$out/commit-packet" tests/arboris/commit-packet.om
32"$out/commit-packet"
33sh tests/arboris/build-sparse-probe.sh "$out/sparse-chip"
34sh tests/arboris/build-sparse-probe.sh "$out/wave-chip" tests/arboris/sparse-silicon.om wave
35sh tests/arboris/build-sparse-probe.sh "$out/small-chip" tests/arboris/sparse-silicon.om small
36sh tests/arboris/build-sparse-probe.sh "$out/gated-chip" tests/arboris/gated-silicon.om
37sh tests/arboris/build-sparse-probe.sh "$out/wide-chip" tests/arboris/gated-silicon.om wide
38sh tests/arboris/build-sparse-probe.sh "$out/experimental-chip" tests/arboris/gated-silicon.om experimental
39"$out/experimental-chip" reference > "$out/experimental-reference.log"
40grep -qx "output_sha256=c2437a10406d7aa8902c0a46eeca1b00413461689a8345cb0f62927d6b742fe5" "$out/experimental-reference.log"
41for model in persistent hubs even; do
42 sh tests/arboris/build-sparse-probe.sh "$out/$model-chip" tests/arboris/sparse-silicon.om "$model"
43 "$out/$model-chip" reference > "$out/$model-reference.log"
44done
45for model in small sparse wave; do
46 "$out/$model-chip" reference > "$out/$model-reference.log"
47 case "$model" in
48 small) expected=33dfc6bc867a2bfbe09192038538c209c9b8bc89e16b6cedcaf0e7cf32b1a8f6 ;;
49 sparse) expected=8ded4456ffe03d54cad43b7b7b8d07ff1997919c103dd1b49b61c6782d6e3d19 ;;
50 wave) expected=b2d9f9458d97db2f5415078fbc43ad0256229175bbc28127eeaad941a708dc7a ;;
51 esac
52 grep -qx "output_sha256=$expected" "$out/$model-reference.log"
53done
54"$out/gated-chip" reference > "$out/gated-reference.log"
55"$out/wide-chip" reference > "$out/wide-reference.log"
56grep -qx "output_sha256=ca8052acb8c6306df043531ab6c116c5d8dd69a7e565974338088119f8355e34" "$out/wide-reference.log"
57compile "$out/spread" om/arboris_ontology.om om/tls/sha2.om om/arboris_records.om om/arboris_spread.om om/arboris_locality.om tests/arboris/locality.om tests/arboris_spread_test.om
58"$out/spread"
59compile "$out/gated" om/arboris_arena.om gpu/nvidia/om/numeric/numeric.om om/arboris_gated.om tests/arboris_gated_test.om
60"$out/gated"
61compile "$out/precision" om/arboris_arena.om gpu/nvidia/om/numeric/numeric.om om/arboris_gated.om om/arboris_gate_cubic.om om/arboris_q4.om tests/arboris/gate-precision.om
62"$out/precision" > "$out/precision.metrics"
63compile "$out/expert-hints" om/arboris_ontology.om om/tls/sha2.om om/arboris_records.om om/arboris_spread.om om/gpu/dsv41/arboris/prefetch.om tests/arboris/expert-hints.om
64"$out/expert-hints" > "$out/expert-hints.bin"
65compile "$out/hints-cli" "$out/signer-profile.om" om/gpu/dsv41/arboris/prefetch.om om/gpu/dsv41/arboris/hints-cli.om
66# ARH1 frame with two votes for expert 12. Only one OP3 may be emitted.
67printf 'ARH1\002\000\000\000\002\000\000\000\014\000\000\000\000\000\200\077\014\000\000\000\000\000\000\077' > "$out/frame"
68printf '\003\000\000\000\014\000\000\000' > "$out/one-hint"
69"$out/hints-cli" < "$out/frame" > "$out/frame-result"
70cmp "$out/one-hint" "$out/frame-result"
71printf 'x' >> "$out/frame"
72if "$out/hints-cli" < "$out/frame" > "$out/frame-result"; then exit 1; fi
73test ! -s "$out/frame-result"
74compile "$out/online-core" "$out/signer-profile.om" om/arboris_online.om tests/arboris/online-core.om
75"$out/online-core"
76compile "$out/compute-lock" "$out/signer-profile.om" gpu/nvidia/native/arboris/compute-lock.om tests/arboris/compute-lock.om
77"$out/compute-lock"
78compile "$out/capq" om/runtime/rx_capq_core.om seed/authority/capq.om tests/arboris/capq.om
79"$out/capq"
80compile "$out/caproot-check" seed/authority/caproot.om tests/arboris/caproot-check.om
81cc -O1 -c src/omega_om_units.c -o "$out/units.o"
82cc -D_GNU_SOURCE -std=c11 -O2 -Wall -Wextra -Werror -Isrc tests/arboris/caproot_issuer.c src/runtime/rx_caproot.c "$out/units.o" -o "$out/caproot-issuer"
83"$out/caproot-issuer" "$out/caproot-check"
84compile "$out/wave-qmd" om/gpu/bw_qmd.om om/blackwell_arboris_qmd.om tests/arboris/wave-qmd.om
85"$out/wave-qmd"
86echo om2 > "$out/profile.om"
87compile "$out/emit" "$out/profile.om" om/encoder/bw_enc_sm121.om om/blackwell_arboris_emit.om tests/arboris/emit-spread.om
88compile "$out/emit-gated" "$out/profile.om" om/encoder/bw_enc_sm121.om om/blackwell_arboris_emit.om om/blackwell_arboris_gated_emit.om tests/arboris/emit-gated.om
89"$out/emit-gated" > "$out/gated.sass"
90echo "66efbbc55e3e0434aa0e43416d25c22112c383a3f4c91da5337304d1fea85182 $out/gated.sass" | sha256sum -c -
91grep -qx "output_sha256=ad8a70b5e2935b7fca819ce4823afea8bef95c56135b6d86e7cf4ada6f16a089" "$out/gated-reference.log"
92"$dis" -b SM121 "$out/gated.sass" > "$out/gated.dis"
93diff -u tests/arboris/gated-sm121.dis "$out/gated.dis"
94"$out/emit" > "$out/wave.bin"
95echo "53058a3139706a7688ef68192a8bf8a679ef5dbad77cebc6c65b7081dfc7eb42 $out/wave.bin" | sha256sum -c -
96"$dis" -b SM121 "$out/wave.bin" > "$out/wave.dis"
97diff -u tests/arboris/spread-sm121.dis "$out/wave.dis"
98"$out/emit" compound relax > "$out/relax.bin"
99echo "c9c1f2a6c5c7de7f8379d85d8bba1ad49e20479c76d0dde70b1fca1becfeba5b $out/relax.bin" | sha256sum -c -
100"$dis" -b SM121 "$out/relax.bin" > "$out/relax.dis"
101diff -u tests/arboris/relax-sm121.dis "$out/relax.dis"
102cc -std=c11 -O2 -Wall -Wextra -Werror -Isrc tests/arboris/scoreboard_oracle.c src/omega_bw_hazard.c "$out/units.o" -o "$out/check-wave"
103"$out/check-wave" < "$out/wave.bin"
104"$out/check-wave" < "$out/relax.bin"
105"$out/check-wave" < "$out/gated.sass"
106"$out/emit-gated" wide > "$out/wide.sass"
107echo "e1950992aaf3ba1a22562f68ddf2575d27dc39fc8e50f33e2683e0f2c6ed32af $out/wide.sass" | sha256sum -c -
108"$out/check-wave" < "$out/wide.sass"
109for model in persistent hubs; do
110 compile "$out/emit-$model" om/arboris_arena.om om/encoder/bw_enc_sm121.om om/blackwell_arboris_emit.om om/blackwell_arboris_gated_emit.om "om/blackwell_arboris_$model.om" "tests/arboris/emit-$model.om"
111 "$out/emit-$model" > "$out/$model.bin"
112 "$dis" -b SM121 "$out/$model.bin" > "$out/$model.dis"
113 diff -u "tests/arboris/$model-sm121.dis" "$out/$model.dis"
114 "$out/check-wave" < "$out/$model.bin"
115done
116"$out/emit-persistent" even > "$out/even.bin"
117"$out/check-wave" < "$out/even.bin"
118grep -qx 'output_sha256=48a04a4fc0bb0f8e14dca0855e21a1d239faec514a9e1d5c6696f273a798842d' "$out/even-reference.log"
119echo "7b8e36a4edf2069a357419de0a61531387539c1a580d2726525568f073dcc489 $out/persistent.bin" | sha256sum -c -
120echo "62f2bd17c0c6d4f6460e2da38043642fe3a0d1023191c60ecdbcbd4cdcc435d3 $out/hubs.bin" | sha256sum -c -
121"$out/emit-gated" wide experimental > "$out/experimental.sass"
122echo "1e263bde57f3dad20c9048c3b87b6097b4b681c9f727b22ffa100bc5470b306d $out/experimental.sass" | sha256sum -c -
123"$dis" -b SM121 "$out/experimental.sass" > "$out/experimental.dis"
124diff -u tests/arboris/experimental-sm121.dis "$out/experimental.dis"
125"$out/check-wave" < "$out/experimental.sass"
126"$out/emit" compound relax small > "$out/small.bin"
127"$out/check-wave" < "$out/small.bin"
128"$out/emit" mutant > "$out/wave-mutant.bin"
129if "$out/check-wave" < "$out/wave-mutant.bin" > "$out/negative.log"; then
130 echo "FAIL: scoreboard accepted a missing load wait"
131 exit 1
132fi
133grep -E 'reachable, [1-9][0-9]* hazards' "$out/negative.log"
134echo "PASS Arboris CPU oracles, QMD packing, SM121 disassembly and OM/C scoreboards"