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 / evidence / CAND3-LIVING-f816473-w2 / 00-declared / cand3_ladder.sh

120 lines · 8459 bytes Raw Blame History
1#!/bin/bash
2# CAND-3 chip ladder. Copied from cand2_ladder.sh (CAND-2) with these changes, nothing else:
3# - constants come from cand3_env.sh (placeholders filled at freeze; refuses while one is left);
4# - A7 defect fixed: no lane relies on a build made by another lane. chipwait runs `make clean`, which removes
5# build/; the r15 lane now builds its own programs (make r15-perf-silicon) before r15_qualify.sh, and every
6# lane that runs a built program builds it first (r11, m18, ladder via make targets);
7# - every build step records the sha256 of the executables it produced and compares them with the double-build
8# digests (informational: the window builds in build/, the double build in build/rb);
9# - the r15 lane refuses unless ALLOW_R15=1: R15 is declared NOT ATTEMPTED in tonight's window (no energy reader);
10# - the ladder lane now includes the R16 G6 operator tests through tools/r16_qualify.sh (host, mutants, silicon).
11# usage: cand3_ladder.sh <omega harness sha> ladder|r11|chipwait|m18|r15
12# Runs ONLY from the forge (lanes.sh queue --heavy). Never wrapped in timeout; never kills anything.
13# Run under quietlock hold; every step still records the GPU/CPU load.
14set -u
15. "$(dirname "$0")/cand3_env.sh" || exit 2
16OMEGA_SHA=${1:?usage: cand3_ladder.sh <omega harness sha> <ladder|r11|chipwait|m18|r15>}; CODE_SHA=$OMEGA_FINAL; shift
17[ "$OMEGA_SHA" = "$HARNESS_SHA" ] || { echo "harness sha $OMEGA_SHA is not HARNESS_SHA $HARNESS_SHA"; exit 2; }
18O=$W/wt-omega-chip
19P=$W/wt-physics-chip
20OUT=$EVID/CAND3-LIVING-$(echo "$CODE_SHA" | cut -c1-7)-${WINDOW_TAG:?WINDOW_TAG not set (W1 is sealed; each window has its own directory)}
21export PHYSICS_DIR=$P AIENOS_LOCK_REPO=$HOME/workspace/r16-survey/aienos ARGUS_REPO=$HOME/workspace/aienos-argus ARGUS_STREAMS=$OUT/argus-streams
22export R16_REPO_OMEGA=$O R16_REPO_SOVEREIGN_CORE=$W/survey/aien-sovereign-core \
23 R16_REPO_AEGIS_RUNTIME=$W/survey/aegis-runtime R16_REPO_AIENOS=$W/survey/aienos \
24 R16_REPO_PHYSICS=$P
25cd "$O" || exit 2
26snap() { # $1 dir, $2 tag
27 local d=$1/machine-$2; mkdir -p "$d"
28 date -u +%FT%TZ > "$d/time.txt"
29 nvidia-smi > "$d/nvidia-smi.txt" 2>&1
30 nvidia-smi --query-gpu=name,driver_version,pci.bus_id,uuid,temperature.gpu,utilization.gpu,clocks.sm --format=csv > "$d/gpu-identity.csv" 2>&1
31 nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv > "$d/gpu-processes.csv" 2>&1
32 ps -eo pid,user,pcpu,pmem,etime,comm --sort=-pcpu | head -30 > "$d/top-cpu.txt"
33 uptime > "$d/uptime.txt"; uname -a > "$d/uname.txt"
34 { echo "omega $(git -C "$O" rev-parse HEAD) dirty=[$(git -C "$O" status --porcelain | head -3 | tr '\n' ' ')]";
35 echo "physics $(git -C "$P" rev-parse HEAD) dirty=[$(git -C "$P" status --porcelain | head -3 | tr '\n' ' ')]";
36 echo "physics.lock $(head -1 "$O/physics.lock")"; } > "$d/heads.txt"
37 dmesg 2>/dev/null | grep -ci 'xid' > "$d/xid-count.txt" || true
38}
39guard() {
40 [ "$(git -C "$O" rev-parse HEAD)" = "$OMEGA_SHA" ] || { echo "omega HEAD is not $OMEGA_SHA"; exit 2; }
41 [ "$(git -C "$P" rev-parse HEAD)" = "$PHYS_SHA" ] || { echo "physics HEAD is not $PHYS_SHA"; exit 2; }
42 [ -z "$(git -C "$O" status --porcelain)" ] || { echo "omega tree dirty"; exit 2; }
43 git -C "$O" diff --quiet $CODE_SHA HEAD -- . ":(exclude)spec/r16-orchestrator-retirement-map.md" ":(glob,exclude)**/.crumb" ":(exclude).crumb" || { echo "omega HEAD differs from CAND-3 code $CODE_SHA beyond the R16 map and crumbs"; exit 2; }
44}
45step() { # $1 gate dir name, rest = command
46 local g=$1; shift; local d=$OUT/$g
47 mkdir -p "$d"; snap "$d" before
48 echo "$*" > "$d/command.txt"
49 local s=$(date -u +%s)
50 "$@" > "$d/stdout.log" 2> "$d/stderr.log" < /dev/null
51 local rc=$?
52 echo "$rc" > "$d/exit.txt"; echo "$(( $(date -u +%s) - s ))" > "$d/seconds.txt"
53 snap "$d" after
54 echo "$g rc=$rc secs=$(cat "$d/seconds.txt")" | tee -a "$OUT/LADDER-SUMMARY.txt"
55}
56hashbins() { # $1 gate dir name, rest = executables (paths relative to $O). Records sha256; compares with the double build (info only).
57 local g=$1; shift; local d=$OUT/$g; mkdir -p "$d"
58 sha256sum "$@" > "$d/executables.sha256" 2>&1
59 local f n k b
60 for f in "$@"; do n=$(basename "$f"); k=$(case $n in omegatool) echo omega-runtime;; *) echo "omega-$(echo "$n" | tr _ -)";; esac)
61 b=$(awk -v k="$k" '$1==k{print $2}' "$BUILD_DIGESTS" 2>/dev/null); a=$(sha256sum "$f" 2>/dev/null | cut -c1-64)
62 if [ -z "$b" ]; then echo "INFO $n has no double-build digest"; elif [ "$a" = "$b" ]; then echo "MATCH $n double-build digest"; else echo "DIFFER $n window=$a double-build=$b"; fi
63 done > "$d/executables-vs-double-build.txt"
64}
65mkdir -p "$OUT"; guard
66case "${1:-}" in
67ladder)
68 snap "$OUT/00-identity" start
69 # R16 harness: G1-G5 + G7 ladder (R1-R11 host, R12/R13/R14 host+silicon, R15 parity host+silicon,
70 # R15 G7 host, R15 receipt test) + G3 authpath host+silicon + G6 operator control (host, mutants, silicon, omega #309).
71 # Stops later silicon after one silicon FAIL.
72 step R16-ladder env R16_OUT_DIR="$OUT/R16-ladder/raw" R16_EXPECT_COMMIT=$OMEGA_SHA tools/r16_qualify.sh
73 hashbins R16-ladder build/rx_r13_living_host build/rx_r13_living_silicon build/rx_operator
74 cp -a build/qual-runs "$OUT/qual-runs-after-R16" 2>/dev/null
75 step R13-testbuild-silicon env OMEGA_CANDIDATE_COMMIT=$OMEGA_SHA make test-r13-testbuild-silicon
76 hashbins R13-testbuild-silicon build/rx_r13_living_testbuild_silicon
77 cp -a build/qual-runs "$OUT/qual-runs-after-R13" 2>/dev/null
78 step prod-hygiene-silicon make test-prod-hygiene-silicon
79 step COMPOSITION-2-GPU make test-composition-gate-gpu
80 hashbins COMPOSITION-2-GPU build/rx_composition_gate_gpu
81 [ -s build/composition_gate_gpu_receipt.json ] && cp build/composition_gate_gpu_receipt.json \
82 "$OUT/COMPOSITION-2-GPU/receipt-$(sha256sum build/composition_gate_gpu_receipt.json | cut -c1-64).json"
83 guard; echo "ladder done" >> "$OUT/LADDER-SUMMARY.txt" ;;
84chipwait)
85 # CHIPWAIT campaign: 3 x tools/m19r_qualify.sh full mode (M19R Gates 1/2 incl. the LONG_SOAK
86 # >= 100000-cycle endurance criterion), predeclared 3/3 rule from tools/m19r_campaign.sh. No --record.
87 # m19r_qualify runs `make clean` in this worktree and removes build/: no later lane may use a build made before it.
88 step CHIPWAIT tools/chipwait_campaign.sh --omega-candidate $OMEGA_SHA --physics-candidate $PHYS_SHA \
89 --physics-dir "$P" --campaign-dir "$OUT/CHIPWAIT/campaign" --runs 3
90 guard; echo "chipwait done" >> "$OUT/LADDER-SUMMARY.txt" ;;
91m18)
92 # M18 matmul gates (src/omega_blackwell_gates.c, --run-m18-gates). Builds omegatool itself.
93 step M18-build make build/omegatool
94 hashbins M18-build build/omegatool
95 step M18 ./build/omegatool --run-m18-gates
96 guard; echo "m18 done" >> "$OUT/LADDER-SUMMARY.txt" ;;
97r11)
98 # R11 living under load (tests/runtime/rx_r11_aien.c). Runs only inside its own quietlock hold:
99 # quietlock exports QUIETLOCK_HOLD and the flag line carries hold=<id> (quiet_flag_is_mine); under any
100 # other quiet flag it prints "living run not exercised", which is a refusal, never a pass.
101 step R11-build make build/rx_r11_aien_test
102 hashbins R11-build build/rx_r11_aien_test
103 sleep 60 # let the 1-minute load average settle after the build
104 step R11-living ./build/rx_r11_aien_test
105 guard; echo "r11 done" >> "$OUT/LADDER-SUMMARY.txt" ;;
106r15)
107 # R15 silicon on its own. NOT RUN IN THE 2026-10-06 WINDOW (declared NOT ATTEMPTED: the SPBM energy reader is not
108 # loaded; the preflight would refuse). A7 fix (CAND-2): this lane BUILDS its own programs first, because the
109 # chipwait lane's `make clean` removes build/ and r15_qualify.sh needs build/rx_r15_perf_silicon. It is a separate,
110 # later, separately declared attempt: set ALLOW_R15=1 only after that attempt is declared.
111 [ "${ALLOW_R15:-0}" = 1 ] || { echo "r15 lane refused: R15 is not part of this window (set ALLOW_R15=1 for its own declared attempt)"; exit 2; }
112 step R15-build make r15-perf-silicon
113 hashbins R15-build build/rx_r15_perf_silicon build/rx_r15_perf_silicon_nodigest build/r15_reduce
114 for x in rx_r15_perf_silicon rx_r15_perf_silicon_nodigest r15_reduce; do
115 [ -x build/$x ] || { echo "R15-build did not produce build/$x: R15 NOT_RUN (harness defect, not an instrument refusal)" | tee -a "$OUT/LADDER-SUMMARY.txt"; exit 2; }
116 done
117 step R15-silicon tools/r15_qualify.sh silicon
118 guard; echo "r15 done" >> "$OUT/LADDER-SUMMARY.txt" ;;
119*) echo "usage: $0 <sha> ladder|r11|chipwait|m18|r15"; exit 2 ;;
120esac