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 / evidence / motor-chip-20261021 / scripts / stroke-gate.sh

45 lines · 2179 bytes Raw Blame History
1#!/usr/bin/env bash
2# L312 stroke v1 gate: 4 conversations per stroke on the chip, red before green.
3# The tool waits for memory (no lock held) and takes /tmp/aien-gb10.lock around the chip part.
4# START=n resumes at step n (the earlier steps' logs for the SAME binary sha stand as evidence).
5set -u
6B=${B:-$HOME/workspace/targets/motor/sc/release/qwen36_stroke_gate}
7M=${M:-$HOME/models/qwen3.6-35b-a3b-fp8-95a723d0}
8G=$HOME/workspace/sc-motor/evidence/q36-host-20261020
9E=$HOME/workspace/sc-motor/evidence/motor-chip-20261021
10LOG=$HOME/handoffs/motor-stroke-gate.log
11P="$G/gen-p1.json $G/gen-p2.json $G/gen-p3.json $G/gen-p4.json"
12START=${START:-1}
13say() { echo "$(date -u +%FT%TZ) $*" | tee -a "$LOG"; }
14# run NAME [ENV=VAL ...]: runs the tool, retrying (up to 6 times) when its memory guard refused
15# (exit 2 + "refusing": the box is crowded, not a verdict). Sets rc.
16run() {
17 local name=$1; shift
18 for attempt in 1 2 3 4 5 6; do
19 env "$@" nice -n 5 "$B" "$M" "$E/stroke-$name.json" $P > "$E/stroke-$name.log" 2>&1; rc=$?
20 if [ $rc -eq 2 ] && grep -q "refusing" "$E/stroke-$name.log"; then
21 say "$name attempt $attempt: memory guard refused ($(grep refusing "$E/stroke-$name.log" | tail -1 | cut -c1-120)); retrying"
22 sleep 60; continue
23 fi
24 break
25 done
26 say "$name exit $rc: $(grep '^QWEN36_STROKE_GATE' "$E/stroke-$name.log" | tail -1 | cut -c1-200)"
27}
28say "stroke gate start bin sha $(sha256sum "$B" | cut -c1-16) START=$START"
29if [ "$START" -le 1 ]; then
30 # 1. negative control: mutant 4 (shared expert dropped) must FAIL (exit 1 = judged; 2 = error = STOP)
31 run mutant4 AIEN_Q36_TEST_MUTANT=4
32 [ $rc -eq 1 ] || { say "STOP: mutant 4 did not go red (exit $rc)"; exit 4; }
33fi
34if [ "$START" -le 2 ]; then
35 # 2. negative control: head states swapped, feeds not: must FAIL
36 run swap-control AIEN_STROKE_SWAP=control
37 [ $rc -eq 1 ] || { say "STOP: swap control did not go red (exit $rc)"; exit 4; }
38fi
39if [ "$START" -le 3 ]; then
40 # 3. the real thing: p1..p4 interleaved, one stroke per step
41 run p1234
42fi
43# 4. head swap as a feature: states and feeds move together, must PASS
44run swap-feature AIEN_STROKE_SWAP=feature
45say "stroke gate done"