interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / tests / omegese45 / core / build.sh

37 lines · 2222 bytes Raw Blame History
1#!/bin/sh
2# SPDX-License-Identifier: AGPL-3.0-only
3# Build the omegese45 pipeline binaries (aien-train #45, pipeline lane).
4# OMC=<omc bf54b19f> OMEGA=<omega-mv checkout with bf54b19f> OUT=<dir> sh tests/omegese45/core/build.sh [MODEL.om]
5# Writes $OUT/oe45gen (generator), $OUT/oe45core (CLI), $OUT/oe45test (test driver) and
6# $OUT/oe45mut (fault injector). MODEL.om (default native/omegese45/core/model.om) lets the
7# suite build mutants. Host glue only: the pinned SHA unit comes from its exact Git object
8# (native/omegese45/core/dependencies.json, sha256 checked); its `export fn` lines become
9# `fn` (program mode refuses export), and OM-2 requires it first in the unit.
10set -u
11ROOT=$(cd "$(dirname "$0")/../../.." && pwd)
12: "${OMC:?}" "${OMEGA:?}" "${OUT:?}"
13mkdir -p "$OUT"
14N=$ROOT/native/omegese45
15MODEL=${1:-$N/core/model.om}
16DEPS=$N/core/dependencies.json
17[ "$(sha256sum "$OMC" | cut -d' ' -f1)" = "$(jq -r .compiler.binary_sha256 "$DEPS")" ] || { echo "BUILD_FAIL omc-sha256"; exit 1; }
18commit=$(jq -r '.dependencies[0].commit' "$DEPS")
19path=$(jq -r '.dependencies[0].path' "$DEPS")
20sum=$(jq -r '.dependencies[0].sha256' "$DEPS")
21git -C "$OMEGA" show "$commit:$path" > "$OUT/sha256-om2.om" || { echo "BUILD_FAIL sha-unit-missing"; exit 1; }
22echo "$sum $OUT/sha256-om2.om" | sha256sum -c --status || { echo "BUILD_FAIL sha-unit-sha256"; exit 1; }
23sed 's/^export fn /fn /' "$OUT/sha256-om2.om" > "$OUT/sha-prog.om"
24cat "$N/vocab.om" "$N/msg.om" "$N/data/gen.om" > "$OUT/gen.unit.om"
25cat "$OUT/sha-prog.om" "$N/vocab.om" "$N/msg.om" "$MODEL" "$N/core/ckpt.om" \
26 "$N/core/run.om" "$N/core/cli.om" > "$OUT/core.unit.om"
27cat "$OUT/sha-prog.om" "$N/vocab.om" "$N/msg.om" "$MODEL" "$N/core/ckpt.om" \
28 "$N/core/run.om" "$ROOT/tests/omegese45/core/main.om" > "$OUT/test.unit.om"
29cp "$ROOT/tests/omegese45/core/mutate.om" "$OUT/mut.unit.om"
30for u in gen core test mut; do
31 "$OMC" < "$OUT/$u.unit.om" > "$OUT/oe45$u" 2> "$OUT/$u.compile.stderr"
32 rc=$?
33 [ "$rc" = 0 ] || { echo "BUILD_FAIL $u rc=$rc $(cat "$OUT/$u.compile.stderr")"; exit 1; }
34 [ "$(od -An -tx1 -N4 "$OUT/oe45$u" | tr -d ' ')" = 7f454c46 ] || { echo "BUILD_FAIL $u not-elf"; exit 1; }
35 chmod 700 "$OUT/oe45$u"
36done
37echo BUILD_OK