interplane.Get Omega
Read in your language

benchmarks-mv

Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS.

Brought by drakestapleton

branch main Branches Tags History

benchmarks-mv / tests / gates / run.sh

97 lines · 4081 bytes Raw Blame History
1#!/usr/bin/env bash
2# SPDX-License-Identifier: Apache-2.0
3# Copyright 2026 Drake Stapleton (AIEN / aien-dev)
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# tests/gates/run.sh: the one entry point for the local verification gates of benchmarks.
18# The canonical CI of this repository, .forgejo/workflows/ci.yml (runs on the Spark), calls
19# this script once per step word, so CI and the local gates run the same commands; GitHub is
20# not used (removed for DRA-166). Manifests under tests/gates/ name this script plus one step
21# word, so no manifest needs shell expansion (ADR 0028 P6).
22ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
23cd "$ROOT"
24step="${1:?usage: tests/gates/run.sh <step>}"
25obs() { printf 'AIEN-OBS %s %s\n' "$1" "$2"; }
26
27# Cargo.toml pins five aien-sovereign-core-mv crates by git commit (DRA-166); they used to come
28# by path from a sibling ../canonical-branch-native-runtime. Record the commit Cargo.lock
29# resolved them to, so a gate result names the runtime source it compiled.
30record_runtime_info() {
31 obs runtime_pin "\"$(grep -m1 -o 'aien-sovereign-core-mv\.git?rev=[0-9a-f]*#[0-9a-f]*' Cargo.lock | sed 's/.*#//')\""
32}
33
34case "$step" in
35 fmt)
36 record_runtime_info
37 cargo fmt -p aien-benchmarks -- --check
38 ;;
39 check)
40 record_runtime_info
41 cargo check --all-targets
42 ;;
43 clippy)
44 record_runtime_info
45 cargo clippy --all-targets -- -D warnings
46 ;;
47 test)
48 record_runtime_info
49 cargo test --verbose
50 ;;
51 verify)
52 record_runtime_info
53 cargo run --release -- verify
54 ;;
55 generate)
56 record_runtime_info
57 # Rewrites the tracked files under assets/; the runner's clean_tree_after check (and the
58 # final `git diff --exit-code` step of the Forgejo CI) then proves the committed assets are
59 # exactly what the generator produces (a drift is a FAIL here, not hidden).
60 cargo run --release -- generate --output assets
61 obs assets_changed "$( [ -z "$(git status --porcelain -- assets)" ] && echo false || echo true)"
62 ;;
63 verify-records)
64 record_runtime_info
65 # Offline evidence-integrity check (aien-architecture#233 lane P2): one stdout line per
66 # defect, exit 1 on any. --tracked adds every record git tracks, found by its schema
67 # wherever it sits (not a typed directory list); artifacts/ holds the SHA256SUMS bundles,
68 # records/ is local llm-stream output, and an absent records/ is a note on stderr.
69 out="$(cargo run --release --bin bench_verify_records -- --tracked records artifacts)"
70 rc=$?
71 [ -n "$out" ] && printf '%s\n' "$out"
72 obs record_defects "$( [ -z "$out" ] && echo 0 || printf '%s\n' "$out" | wc -l | tr -d ' ')"
73 exit "$rc"
74 ;;
75 perf-index)
76 record_runtime_info
77 # Rewrites docs/PERF_INDEX.md; like generate, a drift from the committed copy shows as a
78 # dirty tree and perf_index_changed == true.
79 cargo run --release --bin bench_index
80 obs perf_index_changed "$( [ -z "$(git status --porcelain -- docs/PERF_INDEX.md)" ] && echo false || echo true)"
81 ;;
82 zero-disk-secrets)
83 # The same invariant the sibling repos enforce.
84 echo "Auditing repository for prohibited plaintext secret files..."
85 if find . -maxdepth 4 -name ".env*" -not -path "*/.git/*" -not -path "*/target/*" | grep -q .; then
86 echo "::error::Prohibited plaintext .env file found. Use an approved AIEN SecretProvider."
87 obs env_files_found true
88 exit 1
89 fi
90 obs env_files_found false
91 echo "Zero plaintext .env files verified."
92 ;;
93 *)
94 echo "run.sh: unknown step '$step'" >&2
95 exit 2
96 ;;
97esac