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 / host / regression.sh

36 lines · 1913 bytes Raw Blame History
1#!/bin/sh
2# Compare the original native parent with the extended native compiler. No foreign compiler.
3set -eu
4cd "$(dirname "$0")/../.."
5mkdir -p build/seed/host
6stage=$(mktemp -d build/seed/host/regression.XXXXXX)
7trap 'rm -rf "$stage"' EXIT HUP INT TERM
8# Fixed baseline selected at ec07d25d5506d33567adbd4d9b518177b7933bad.
9# Adding/removing a case or changing its expected status requires explicit review;
10# content filters must never silently remove the original comparison obligation.
11manifest=seed/host/original-fixtures.tsv
12bad() { printf 'FAIL original fixtures: %s\n' "$*" >&2; exit 1; }
13git ls-files --error-unmatch -- "$manifest" > /dev/null || bad "untracked manifest"
14awk -F '\t' '
15 NF != 2 || $1 !~ /^[A-Za-z0-9_./-]+$/ || $2 !~ /^(0|5|7|9)$/ { exit 1 }
16 seen[$1]++ { exit 1 }
17 END { if (NR != 62) exit 1 }
18' "$manifest" || bad "invalid, duplicate or incomplete baseline (expected 62 cases)"
19count=0
20while IFS="$(printf '\t')" read -r source expected; do
21 [ -f "$source" ] || bad "missing baseline: $source"
22 git ls-files --error-unmatch -- "$source" > /dev/null || bad "untracked baseline: $source"
23 old=0
24 new=0
25 seed/rung4/om4.bin < "$source" > "$stage/old" 2> "$stage/old.err" || old=$?
26 seed/out/omc < "$source" > "$stage/new" 2> "$stage/new.err" || new=$?
27 test "$old" = "$expected" || bad "$source: parent status $old, expected $expected"
28 test "$old" = "$new" || { echo "Changed compiler status: $source" >&2; exit 1; }
29 cmp "$stage/old" "$stage/new"
30 sed 's/^om4:/compiler:/' "$stage/old.err" > "$stage/old.normal"
31 sed 's/^omc:/compiler:/' "$stage/new.err" > "$stage/new.normal"
32 cmp "$stage/old.normal" "$stage/new.normal"
33 count=$((count + 1))
34done < "$manifest"
35test "$count" -eq 62 || bad "incomplete read: $count of 62 cases"
36printf 'PASS %s original fixtures retain identical machine code, refusal status and diagnostics\n' "$count"