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 / seed / sm121 / chip6.sh

39 lines · 1903 bytes Raw Blame History
1#!/bin/sh
2# chip6.sh OUTDIR -- rung 6 on the chip: the vector add that asm2 made (seed/sm121/vecadd.bin) runs on the
3# GB10 through the bytes tool (tools/omega_bytes, ledger L098; no CUDA library). Run from the repo root,
4# after gate6.sh and `make omega-bytes`, ONLY under the GPU lock:
5# quiet-measure flock /tmp/aien-gb10.lock spark-receipt seed-sm121-run -- sh seed/sm121/chip6.sh evidence/SEED-0/sm121/chip
6# The words file is a plain rewrite of vecadd.bin (od: two 64-bit halves per 128-bit instruction, low half
7# first, the bytes tool's format). Correctness only: one launch, the bytes tool checks out[i] = a[i] + b[i].
8# Control: the bytes tool's mutant vector add (one word changed) must fail the same check.
9set -u
10OUT=$1
11B=build/omega_bytes/omega_bytes
12V=seed/sm121/vecadd.bin
13N=1048576
14mkdir -p "$OUT"
15words() { od -An -v -tx8 -w16 "$1" | awk '{ print "0x" $1 " 0x" $2 }'; }
16words $V > "$OUT/vecadd.words"
17{
18 echo "omega_commit $(git rev-parse HEAD) dirty=$(git status --porcelain | wc -l)"
19 echo "vecadd_sha256 $(sha256sum $V | cut -d' ' -f1)"
20 echo "tool_sha256 $(sha256sum $B | cut -d' ' -f1)"
21 echo "uptime_start $(uptime)"
22} > "$OUT/window.txt"
23fail=0
24step() { # name expected_exit cmd...
25 name=$1; want=$2; shift 2
26 "$@" > "$OUT/$name.json" 2> "$OUT/$name.log"
27 rc=$?
28 if [ "$rc" -eq "$want" ]; then r=ok; else r=UNEXPECTED; fail=1; fi
29 echo "$name exit=$rc want=$want $r" >> "$OUT/steps.txt"
30}
31: > "$OUT/steps.txt"
32step check_words 0 $B check gb10 "$OUT/vecadd.words"
33step run_seed 0 $B gb10 "$OUT/vecadd.words" --n $N --reps 1
34# control: the bytes tool's mutant (one word changed) must fail the same check
35step control_mutant 1 $B gb10 tools/omega_bytes/kernels/gb10_vadd_mutant.words --n $N --reps 1
36echo "uptime_end $(uptime)" >> "$OUT/window.txt"
37echo "session $([ $fail -eq 0 ] && echo PASS || echo FAIL)" >> "$OUT/steps.txt"
38cat "$OUT/steps.txt"
39exit $fail