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 / om-bench / run-arms.sh

66 lines · 2749 bytes Raw Blame History
1#!/bin/sh
2# om-bench (#653) scored run: generate, judge, gate.om cross-judge (Omega arms), publishable summary.
3# Usage: run-arms.sh RUNROOT SPLIT ARM [ARM...] e.g. run-arms.sh ~/handoffs/OmegaEval/runs/v1 heldA a fpy fc b
4# Writes RUNROOT/ARM-SPLIT/{cand/, gen.log, verdicts-SPLIT.jsonl, gate-SPLIT.cases, gate.log, crosscheck.txt,
5# summary-SPLIT.json, status.txt}. gen skips a task that already has gen.json, so a run interrupted by a host
6# fault resumes without regenerating; such a resume is recorded in status.txt by the operator, never silent.
7# Run on the Spark, pinned with taskset by the caller; not in CI.
8set -eu
9HERE=$(cd "$(dirname "$0")" && pwd)
10BENCH=$HERE/bench
11REPO=${OMB_REPO:-$(cd "$HERE/../.." && pwd)}
12OMC=$REPO/seed/out/omc
13SHA=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
14ROOT=$1; SPLIT=$2; shift 2
15# Log the actual child status before failing closed. Candidate gate outcomes 1..3
16# are not process failures; crosscheck validates the completed gate report.
17check_stage() {
18 stage=$1; rc=$2
19 echo "$stage rc=$rc $(date -u +%FT%TZ)" >> "$S"
20 if [ "$rc" -ne 0 ]; then
21 cat "$S"
22 exit "$rc"
23 fi
24}
25mkdir -p "$ROOT"
26GATE=$ROOT/gate
27if [ ! -x "$GATE" ]; then
28 "$OMC" < "$REPO/seed/qualification/om2/gate.om" > "$GATE" && chmod +x "$GATE" || { echo "gate build failed"; exit 1; }
29fi
30for ARM in "$@"; do
31 R=$ROOT/$ARM-$SPLIT
32 mkdir -p "$R"
33 S=$R/status.txt
34 if [ -e "$R/summary-$SPLIT.json" ]; then
35 echo "REFUSED existing summary-$SPLIT.json; preserve it and use a new run directory" >> "$S"
36 cat "$S"
37 exit 1
38 fi
39 echo "start $(date -u +%FT%TZ) arm=$ARM split=$SPLIT omc=$SHA" >> "$S"
40 rc=0
41 python3 "$BENCH/ombench.py" gen --arm "$ARM" --split "$SPLIT" --run "$R" || rc=$?
42 check_stage gen "$rc"
43 rc=0
44 python3 "$BENCH/ombench.py" judge --run "$R" --split "$SPLIT" --arm "$ARM" > "$R/judge.txt" 2>&1 || rc=$?
45 check_stage judge "$rc"
46 case $ARM in
47 a|b|aeq)
48 rc=0
49 python3 "$BENCH/ombench.py" gatelist --run "$R" --split "$SPLIT" > /dev/null || rc=$?
50 check_stage gatelist "$rc"
51 rm -rf "$R/gate-scratch"
52 rc=0
53 (cd "$REPO" && "$GATE" "$OMC" "$SHA" "$R/gate-$SPLIT.cases" "$R/gate-scratch" > "$R/gate.log" 2>&1) || rc=$?
54 echo "gate rc=$rc $(grep '^OM2GATE ' "$R/gate.log" | tail -1)" >> "$S"
55 case $rc in 0|1|2|3) ;; *) check_stage gate "$rc" ;; esac
56 rm -rf "$R/gate-scratch"
57 rc=0
58 python3 "$BENCH/ombench.py" crosscheck --run "$R" --split "$SPLIT" --gate-log "$R/gate.log" > "$R/crosscheck.txt" 2>&1 || rc=$?
59 check_stage crosscheck "$rc"
60 ;;
61 esac
62 rc=0
63 python3 "$BENCH/ombench.py" summary --run "$R" --split "$SPLIT" --arm "$ARM" > /dev/null || rc=$?
64 check_stage summary "$rc"
65 cat "$S"
66done