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
omega-mv / train / omega-llm / tools / controller / build.sh
| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | cd "$(dirname "$0")" |
| 4 | root=$(cd ../../../.. && pwd) |
| 5 | out=${OUT:-$root/build/omega-controller} |
| 6 | omc=${OMC:-$root/seed/out/omc} |
| 7 | mkdir -p "$out" |
| 8 | driver=$out/driver.om |
| 9 | grader=$out/grader.om |
| 10 | sed 's/^fn main to int$/fn wbmain to int/' ../wdrive/wbuild.om >"$driver" |
| 11 | sed 's/^fn main to int$/fn priorgrade to int/' ../contrast/grade.om >"$grader" |
| 12 | compile() { |
| 13 | local name=$1 |
| 14 | shift |
| 15 | cat "$@" | "$omc" >"$out/$name.tmp" |
| 16 | chmod +x "$out/$name.tmp" |
| 17 | mv "$out/$name.tmp" "$out/$name" |
| 18 | } |
| 19 | compile normalize "$driver" normalize.om |
| 20 | compile train "$driver" policy.om policy-train.om |
| 21 | compile train-second "$driver" policy.om second.om train-second.om |
| 22 | compile controller "$driver" "$root/seed/json/json.om" "$grader" ../contrast/read.om policy.om second.om controller.om |
| 23 | compile resident "$driver" "$root/seed/net/http.om" "$root/seed/net/notls.om" "$root/seed/json/json.om" resident.om |
| 24 | compile grade "$driver" "$root/seed/json/json.om" ../contrast/grade.om |
| 25 | for data in training second-training second-augmented-training; do |
| 26 | xxd -r -p "calibration/$data.hex" >"$out/$data.bin" |
| 27 | done |
| 28 | "$out/train" "$out/training.bin" >"$out/controller.ck" |
| 29 | "$out/train-second" "$out/second-training.bin" >"$out/second.ck" |
| 30 | "$out/train-second" "$out/second-augmented-training.bin" >"$out/second-augmented.ck" |
| 31 | (cd "$out" && sha256sum -c "$root/train/omega-llm/tools/controller/calibration/checkpoints.sha256") |