Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-train/blob/main/tests/omegallm/efi-ref.sh # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-train / tests / omegallm / efi-ref.sh` 29 lines ยท 1484 bytes Raw Blame History 1 #!/bin/sh 2 # Run an ollm JOB.TXT (the UEFI job format, CONTRACT section 9) with a Linux ollm build, to give the 3 # reference the UEFI run's OUT.TXT is compared with. 4 # Usage: sh tests/omegallm/efi-ref.sh BIN JOB DIR 5 # Prints, per job, `> line` and the command's output (with a line feed added when it does not end in 6 # one), like OUT.TXT without its `OLLM efi`, `ID` (identity), `J` and `OLLM DONE` lines; stops at the 7 # first command that exits nonzero (as the UEFI app does) and then prints `rc=N`. As in eio.om main: 8 # empty lines and lines starting with # are skipped; a line of only spaces and tabs has no tokens, so 9 # it is echoed as `> line` and runs nothing (no output, no J line in OUT.TXT, not counted as a job). 10 # Env: CORE (taskset core, default 6). The job lines are trusted (shell-split). 11 set -u 12 [ $# -eq 3 ] || { echo "usage: efi-ref.sh BIN JOB DIR" >&2; exit 2; } 13 BIN=$1 JOB=$2 DIR=$3 14 CORE=${CORE:-6} 15 ws=$(printf ' \t') 16 o=$(mktemp) 17 trap 'rm -f "$o"' EXIT HUP INT TERM 18 tr -d '\r' < "$JOB" | while IFS= read -r line; do 19 case "$line" in '' | '#'*) continue ;; esac 20 printf '> %s\n' "$line" 21 case "$line" in *[!"$ws"]*) ;; *) continue ;; esac 22 args=$(printf '%s\n' "$line" | sed 's/\\OLLM\\/'"$(printf '%s' "$DIR/" | sed 's/[\/&]/\\&/g')"'/g') 23 eval "set -- $args" 24 taskset -c "$CORE" nice -n 19 "$BIN" "$@" > "$o" 25 rc=$? 26 cat "$o" 27 [ ! -s "$o" ] || [ "$(tail -c 1 "$o" | od -An -tu1 | tr -d ' ')" = 10 ] || echo 28 [ "$rc" = 0 ] || { echo "rc=$rc"; exit 1; } 29 done