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 / research / m15 / spbm / collect.sh

68 lines · 2792 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# Preliminary sensor validation, not an R15 qualification or PASS receipt.
18set -euo pipefail
19cd "$(dirname "$0")"
20if [[ $# != 1 || -e "$1" ]]; then
21 echo "usage: collect.sh NEW-run-directory" >&2
22 exit 2
23fi
24run_dir="$1"
25mkdir -p "$(dirname "$run_dir")"
26mkdir "$run_dir"
27run_dir="$(realpath "$run_dir")"
28work_pid=
29cleanup() { if [[ -n "$work_pid" ]]; then kill "$work_pid" 2>/dev/null || true; wait "$work_pid" 2>/dev/null || true; fi; }
30trap cleanup EXIT
31trap 'exit 130' INT
32trap 'exit 143' TERM
33hwmon=
34for h in /sys/class/hwmon/hwmon*; do
35 if [[ $(cat "$h/name") == aien_spbm ]]; then
36 if [[ -n "$hwmon" ]]; then echo "ambiguous SPBM device" >&2; exit 1; fi
37 hwmon="$h"
38 fi
39done
40[[ -n "$hwmon" ]]
41make tools check >"$run_dir/build.log" 2>&1
42uname -a >"$run_dir/uname.txt"
43nvidia-smi -q >"$run_dir/nvidia-smi.txt"
44mokutil --sb-state >"$run_dir/secure-boot.txt"
45modinfo aien_spbm_readonly.ko >"$run_dir/module.txt"
46cat /sys/module/aien_spbm_readonly/srcversion >"$run_dir/loaded-srcversion.txt"
47[[ $(modinfo -F srcversion aien_spbm_readonly.ko) == $(cat "$run_dir/loaded-srcversion.txt") ]]
48git rev-parse HEAD >"$run_dir/base-commit.txt"
49git status --short >"$run_dir/worktree.txt"
50ps -eo pid,comm,pcpu --sort=-pcpu >"$run_dir/processes-before.txt"
51sudo -n cat /sys/firmware/acpi/tables/DSDT >"$run_dir/DSDT.dat"
52cat /sys/devices/virtual/dmi/id/bios_version >"$run_dir/bios.txt"
53cat /sys/devices/virtual/dmi/id/bios_date >>"$run_dir/bios.txt"
54sha256sum *.c *.h Makefile collect.sh sample load reduce aien_spbm_readonly.ko >"$run_dir/source-binary.sha256"
55for round in 1 2 3; do
56 ./sample "$hwmon" 10 "$run_dir/idle-$round.jsonl"
57 for group in p e; do
58 ./load "$group" 14 >"$run_dir/load-$group-$round.jsonl" &
59 work_pid=$!
60 sleep 2
61 ./sample "$hwmon" 10 "$run_dir/$group-$round.jsonl"
62 wait "$work_pid"
63 work_pid=
64 done
65done
66./reduce "$run_dir" >"$run_dir/summary.json"
67printf '%s\n' '{"collection_complete":true,"qualified":false,"R15_PASS":false}' >"$run_dir/status.json"
68(cd "$run_dir" && sha256sum *.jsonl *.json *.txt *.log *.sha256 DSDT.dat >SHA256SUMS)