interplane.Get Omega
Read in your language

aien-sovereign-core-mv

AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core-mv / docs / campaigns / next-phase-1 / run-v7.sh

72 lines · 4199 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# NEXT-PHASE-1 v7 campaign (ACCEPTANCE-v7.md): run-v6.sh with the v7 wiring of
18# ACCEPTANCE-v7 Section 2 and nothing else. Same five launches of tasks-v6.json
19# (ACCEPTANCE-v6 Section 2, kept unchanged by ACCEPTANCE-v7 Section 1), same
20# goals, max_tokens, T5 seed and CPU reference run; each receipt is built by
21# make-receipt.sh with V6_ROWS=rows-v7.jq (the S3 committed-flag fix) and records
22# that module and its sha256 as v6_rows_module; the verdict is score-rows.sh
23# (scoring-v5) over np1-v7.decl.json. Usage (inside the caller's quietlock hold,
24# ACCEPTANCE-v6 Section 8):
25# AIEN_BIN=... AIEN_MODEL_PATH=... AIEN_TOKENIZER_PATH=... \
26# run-v7.sh RUN_BASE OUT_DIR SC_COMMIT OMEGA_COMPOSE_COMMIT OMEGA_GPU_COMMIT REFERENCE_BIN
27# Writes RUN_BASE/<launch>/ (run roots), RUN_BASE/R1.reference.json, one
28# receipt per launch in OUT_DIR, OUT_DIR/v7-results.jsonl and OUT_DIR/v7-score.json.
29set -u
30HERE=$(cd "$(dirname "$0")" && pwd)
31BASE=${1:?RUN_BASE} OUT=${2:?OUT_DIR} SC=${3:?SC_COMMIT} OMC=${4:?OMEGA_COMPOSE} OMG=${5:?OMEGA_GPU} REFBIN=${6:?REFERENCE_BIN}
32TASKS=$HERE/tasks-v6.json
33DECL=$HERE/../scoring/declarations/np1-v7.decl.json
34SCORER=$HERE/../scoring/score-rows.sh
35[ -f "$DECL" ] && [ -x "$SCORER" ] && [ -x "$REFBIN" ] || { echo "run-v7: declaration, scorer or reference binary missing" >&2; exit 2; }
36MODEL_DIR=$(dirname "${AIEN_MODEL_PATH:?}")
37mkdir -p "$BASE" "$OUT"
38RES=$OUT/v7-results.jsonl
39: >"$RES"
40for id in $(jq -r '.tasks[].id' "$TASKS"); do
41 t=$(jq -c --arg id "$id" '.tasks[] | select(.id == $id)' "$TASKS")
42 goal=$(jq -r .goal <<<"$t"); max=$(jq -r .max_tokens <<<"$t"); seed=$(jq -r '.seed // empty' <<<"$t")
43 seed_dir=; [ -n "$seed" ] && seed_dir=$HERE/$seed
44 NP1_GOAL=$goal AIEN_COMPOSE_MAX_TOKENS=$max NP1_SEED_DIR=$seed_dir \
45 bash "$HERE/run-campaign.sh" "$BASE/$id" >"$BASE/$id.driver.out" 2>&1
46 echo "launch $id driver exit $? (max_tokens $max${seed:+, seed $seed})"
47 ref=
48 if [ "$(jq -r .kind <<<"$t")" = identity ] && [ -d "$BASE/$id/ws" ]; then
49 ws=$(cd "$BASE/$id/ws" && pwd -P)
50 "$REFBIN" "$MODEL_DIR" "$goal" "$ws" "$max" new >"$BASE/$id.reference.json" 2>"$BASE/$id.reference.err"
51 echo "launch $id CPU reference exit $?"
52 ref=$BASE/$id.reference.json
53 fi
54 if [ -f "$BASE/$id/run.json" ]; then
55 v5env=(); [ "$(jq -r '.destination // empty' <<<"$t")" != "" ] && [ "${id#N}" = "$id" ] && \
56 v5env=(TASK_ID="$id" TASK_SPEC="$TASKS" TASK_ACCEPTANCE="$HERE/ACCEPTANCE-v6.md")
57 env "${v5env[@]}" V6_ROWS=rows-v7.jq V6_TASK="$id" V6_MAX_TOKENS="$max" V6_REFERENCE="$ref" \
58 SPEC="ACCEPTANCE-v7.md spec_version 7" bash "$HERE/make-receipt.sh" \
59 "$BASE/$id" "$OUT" "$SC" "$OMC" "$OMG" 0 "NEXT-PHASE-1 v7 launch $id" >"$BASE/$id.receipt.out" 2>&1
60 rec=$OUT/$(head -1 "$BASE/$id.receipt.out" | sed -n 's/.*receipt \([0-9a-f]*\.json\).*/\1/p')
61 if [ -f "$rec" ]; then bash "$HERE/v6-results.sh" "$id" "$rec" >>"$RES"
62 else bash "$HERE/v6-results.sh" "$id" - "$DECL" "receipt not written" >>"$RES"; fi
63 echo "launch $id receipt $(basename "$rec")"
64 else
65 bash "$HERE/v6-results.sh" "$id" - "$DECL" "launch failed: no run.json" >>"$RES" # ACCEPTANCE-v6 Section 7
66 echo "launch $id FAILED to launch"
67 fi
68 jq -r --arg id "$id" 'select(.row | startswith($id + "/")) | select(.verdict != "PASS") | " \(.verdict) \(.row)"' "$RES"
69done
70bash "$SCORER" "$DECL" "$RES" >"$OUT/v7-score.json"; rc=$?
71echo "NEXT-PHASE-1 v7 campaign verdict (scoring-v5, score-rows.sh exit $rc): $(jq -r .verdict "$OUT/v7-score.json" 2>/dev/null || echo ERROR)"
72exit $rc