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 / seed / host / check.sh
| 1 | #!/bin/sh |
| 2 | # Entire host-extension qualification uses the seed chain and Omega programs. |
| 3 | set -eu |
| 4 | cd "$(dirname "$0")/../.." |
| 5 | if [ ! -x build/omegese/omegese ] || [ ! -x build/omega_emit/omega_emit ] || [ ! -x build/checker2/checker2 ]; then |
| 6 | printf 'NOT_RUN gate-ir: required C oracles not built\n' >&2 |
| 7 | printf ' make build/omegese/omegese build/omega_emit/omega_emit build/checker2/checker2\n' >&2 |
| 8 | exit 3 |
| 9 | fi |
| 10 | sh seed/omega-from-seed.sh |
| 11 | # Required release checks are part of the host gate, not a caller-maintained list. |
| 12 | # Preserve each log and stop on either a failing command or missing final evidence. |
| 13 | printf 'SOURCE %s\n' "$(git rev-parse HEAD)" |
| 14 | source_state=$(git status --porcelain) |
| 15 | if [ -n "$source_state" ]; then |
| 16 | printf 'FAIL source checkout is dirty\n%s\n' "$source_state" >&2 |
| 17 | exit 1 |
| 18 | fi |
| 19 | printf 'SOURCE_CLEAN\n' |
| 20 | sha256sum -c seed/out/omc.sha256 |
| 21 | printf 'COMPILER %s\n' "$(sha256sum seed/out/omc)" |
| 22 | required=$(mktemp -d build/seed/required.XXXXXX) |
| 23 | ( |
| 24 | unset POOLS_ONLY POOLS_SKIP_EQUIV POOLS_EQUIV_MAX POOLS_FUZZ_SEEDS CTRL OMC |
| 25 | sh seed/omc/gate-pools.sh |
| 26 | ) > "$required/pools.log" 2>&1 || { cat "$required/pools.log"; exit 1; } |
| 27 | cat "$required/pools.log" |
| 28 | grep -qx 'PASS gate-pools' "$required/pools.log" |
| 29 | [ "$(tail -1 "$required/pools.log")" = 'RC=0' ] |
| 30 | sh seed/omc/tests/struct-bool/check.sh |
| 31 | sh seed/ng/front/cases/nom-wrap.sh check |
| 32 | seed/out/omc < seed/ng/front/gate-front.om > "$required/gate-front" |
| 33 | chmod +x "$required/gate-front" |
| 34 | set -- |
| 35 | while IFS= read -r cases; do |
| 36 | [ -n "$cases" ] || continue |
| 37 | [ -f "$cases" ] || { printf 'FAIL missing front case list: %s\n' "$cases" >&2; exit 1; } |
| 38 | set -- "$@" "$cases" |
| 39 | done < seed/ng/front/check-lists.txt |
| 40 | [ "$#" -gt 0 ] |
| 41 | "$required/gate-front" seed/out/omc "$(cut -d' ' -f1 seed/out/omc.sha256)" \ |
| 42 | units:seed/ng/ng.units+in:seed/ng/front/front-check.in \ |
| 43 | seed/ng/front/declared.txt seed/ng/front/mutants.txt "$required/front" "$@" \ |
| 44 | > "$required/front.log" 2>&1 || { cat "$required/front.log"; exit 1; } |
| 45 | cat "$required/front.log" |
| 46 | grep -q '^FRONTGATE PASS cases=[1-9][0-9]* .* fail=0 ' "$required/front.log" |
| 47 | sh seed/omc/gate-ir.sh |
| 48 | sh seed/omc/gate7.sh |
| 49 | sh seed/omc/gate8.sh |
| 50 | sh seed/omc/gate-fma.sh |
| 51 | sh seed/omc/gate9.sh |
| 52 | sh seed/omc/gate10.sh |
| 53 | sh seed/omc/gate11.sh |
| 54 | sh seed/omc/gate12.sh |
| 55 | sh seed/omc/gate13.sh |
| 56 | sh seed/omc/gate14.sh |
| 57 | sh seed/omc/gate15.sh |
| 58 | sh seed/explain/gate.sh |
| 59 | sh seed/omc/gate16.sh |
| 60 | sh seed/omc/gate17.sh |
| 61 | sh seed/omc/gate18.sh |
| 62 | sh seed/omc/gate-recursion.sh |
| 63 | # names of up to 63 bytes; status 3 (NOT_RUN) only for its x86 runs when qemu-x86_64 is absent, printed by the gate |
| 64 | sh seed/omc/gate-longnames.sh || { r=$?; [ $r = 3 ] || exit $r; } |
| 65 | # no table capacities in omc (OMEGESE 9.6): units far past the old ones, with omc f4fa7951 as control |
| 66 | sh seed/omc/gate-nocaps.sh |
| 67 | # the alarm in place of the capacities: arena, time and memory of the stack's largest units; status 3 |
| 68 | # (NOT_RUN) only when a sibling checkout (../omega-mcp, ../cortex, ../interplane-forge) is absent |
| 69 | sh seed/omc/gate-usage.sh || { r=$?; [ $r = 3 ] || exit $r; } |
| 70 | # Executable contracts use the existing fail-closed Omega conductor. |
| 71 | B=build/seed/contracts |
| 72 | mkdir -p "$B" |
| 73 | seed/out/omc < seed/qualification/om2/gate.om > "$B/gate" |
| 74 | chmod +x "$B/gate" |
| 75 | pin=$(sha256sum seed/out/omc | cut -d' ' -f1) |
| 76 | run=$(mktemp -d "$B/run.XXXXXX") |
| 77 | "$B/gate" seed/out/omc "$pin" seed/omc/contracts/contracts.cases "$run/cases" |
| 78 | # OM-2 for loops tested at the latch: exact pass counts and the pass on which trap 4 fires (seed/omc/cflow). |
| 79 | "$B/gate" seed/out/omc "$pin" seed/omc/cflow/cflow.cases "$run/cflow" |
| 80 | # OM-2 dit and scrub (OMEGESE 9.13.1): s5 cases, and every s5 omc.om mutant detected (ctl-* PASS, m-* FAIL). |
| 81 | "$B/gate" seed/out/omc "$pin" seed/omc/om2/s5/s5.cases "$run/s5" > "$run/s5.log" || { cat "$run/s5.log"; exit 1; } |
| 82 | grep -qx 'OM2GATE PASS cases=26 pass=26 fail=0 invalid=0 not_run=0' "$run/s5.log" |
| 83 | if "$B/gate" seed/out/omc "$pin" seed/omc/om2/s5/s5-mutants.cases "$run/s5mut" > "$run/s5mut.log"; then |
| 84 | echo 'FAIL dit/scrub mutant survived' >&2 |
| 85 | exit 1 |
| 86 | else |
| 87 | status=$? |
| 88 | [ "$status" = 1 ] || { cat "$run/s5mut.log"; exit 1; } |
| 89 | fi |
| 90 | grep -qx 'OM2GATE FAIL cases=20 pass=9 fail=11 invalid=0 not_run=0' "$run/s5mut.log" |
| 91 | [ "$(grep -c '^VERDICT ctl-[a-z-]* PASS ' "$run/s5mut.log")" = 9 ] |
| 92 | [ "$(grep -c '^VERDICT m-[a-z0-9]* FAIL ' "$run/s5mut.log")" = 11 ] |
| 93 | echo 'PASS dit/scrub (26 cases) and 11 omc.om mutants detected' |
| 94 | # Every OM-2 case and mutant file (s1..s5, bnd, fnhost, hex), with two negative controls (ROADMAP-1.0 RM1). |
| 95 | sh seed/qualification/om2/every.sh |
| 96 | # Error-site coverage (ROADMAP-1.0 RM8): reached omc error sites may not fall below seed/omc/sitecov.floor. |
| 97 | sh seed/omc/sitecov.sh check |
| 98 | if "$B/gate" seed/out/omc "$pin" seed/omc/contracts/mutant.cases "$run/mutant" > "$run/mutant.log"; then |
| 99 | echo 'FAIL contract-enforcement mutant survived' >&2 |
| 100 | exit 1 |
| 101 | else |
| 102 | status=$? |
| 103 | [ "$status" = 1 ] || { cat "$run/mutant.log"; exit 1; } |
| 104 | fi |
| 105 | grep -qx 'VERDICT mutant-requires FAIL run exit=0 expected=109 stdout=match stderr=match' "$run/mutant.log" |
| 106 | grep -qx 'VERDICT mutant-proof FAIL run exit=0 expected=109 stdout=match stderr=match' "$run/mutant.log" |
| 107 | grep -qx 'OM2GATE FAIL cases=2 pass=0 fail=2 invalid=0 not_run=0' "$run/mutant.log" |
| 108 | echo 'PASS contract-enforcement mutant detected by exact runtime-status mismatch' |
| 109 | # #1042: exact-cap refusal and missing-cap mutants must both be detected. |
| 110 | if "$B/gate" seed/out/omc "$pin" seed/host/devcall-mutants.cases "$run/devcall-mutants" > "$run/devcall-mutants.log"; then |
| 111 | echo 'FAIL devcall parameter-cap mutant survived' >&2 |
| 112 | exit 1 |
| 113 | else |
| 114 | status=$? |
| 115 | [ "$status" = 1 ] || { cat "$run/devcall-mutants.log"; exit 1; } |
| 116 | fi |
| 117 | grep -q '^VERDICT devcall-cap-offbyone FAIL run exit=103 expected=0 ' "$run/devcall-mutants.log" |
| 118 | grep -q '^VERDICT devcall-cap-removed FAIL run exit=80 expected=0 ' "$run/devcall-mutants.log" |
| 119 | grep -qx 'OM2GATE FAIL cases=2 pass=0 fail=2 invalid=0 not_run=0' "$run/devcall-mutants.log" |
| 120 | echo 'PASS devcall parameter cap: off-by-one and removed-check mutants killed' |
| 121 | # Packed-list hostile ingress (#671): generated packets reach execprog from stdin. |
| 122 | "$B/gate" seed/out/omc "$pin" seed/qualification/security673/packets.cases "$run/packets" |
| 123 | if "$B/gate" seed/out/omc "$pin" seed/qualification/security673/packets-mutant.cases "$run/packets-mutant" > "$run/packets-mutant.log"; then |
| 124 | echo 'FAIL packed-list bound mutant survived' >&2 |
| 125 | exit 1 |
| 126 | else |
| 127 | status=$? |
| 128 | [ "$status" = 1 ] || { cat "$run/packets-mutant.log"; exit 1; } |
| 129 | fi |
| 130 | grep -qx 'VERDICT mutant-size FAIL run exit=0 expected=103 stdout=match stderr=match' "$run/packets-mutant.log" |
| 131 | grep -qx 'VERDICT mutant-count FAIL run exit=0 expected=103 stdout=match stderr=match' "$run/packets-mutant.log" |
| 132 | grep -qx 'VERDICT mutant-exact FAIL run exit=0 expected=103 stdout=match stderr=match' "$run/packets-mutant.log" |
| 133 | grep -qx 'OM2GATE FAIL cases=3 pass=0 fail=3 invalid=0 not_run=0' "$run/packets-mutant.log" |
| 134 | echo 'PASS packed-list ingress: hostile packets refused; size, count and exact-length mutants detected' |
| 135 | # OM-2 hex literals (#745): every place, decimal twins byte-identical, refusals on the decimal codes. |
| 136 | "$B/gate" seed/out/omc "$pin" seed/omc/om2/hex/hex.cases "$run/hex" > "$run/hex.log" || { cat "$run/hex.log"; exit 1; } |
| 137 | grep -qx 'OM2GATE PASS cases=51 pass=51 fail=0 invalid=0 not_run=0' "$run/hex.log" |
| 138 | if "$B/gate" seed/out/omc "$pin" seed/omc/om2/hex/mutants.cases "$run/hexmut" > "$run/hexmut.log"; then |
| 139 | echo 'FAIL hex-literal mutant survived' >&2 |
| 140 | exit 1 |
| 141 | else |
| 142 | status=$? |
| 143 | [ "$status" = 1 ] || { cat "$run/hexmut.log"; exit 1; } |
| 144 | fi |
| 145 | grep -qx 'OM2GATE FAIL cases=8 pass=3 fail=5 invalid=0 not_run=0' "$run/hexmut.log" |
| 146 | [ "$(grep -c '^VERDICT ctl-hex-[a-z]*-pairs-dec-run PASS ' "$run/hexmut.log")" = 3 ] |
| 147 | [ "$(grep -c '^VERDICT hex-[a-z]*-[a-z0-9-]* FAIL ' "$run/hexmut.log")" = 5 ] |
| 148 | echo 'PASS hex literals (51 cases) and 3 tok_hex mutants killed' |
| 149 | # OM-2 expression boundaries (#745, spec section 2): missing/extra operand and grouping, both profiles. |
| 150 | "$B/gate" seed/out/omc "$pin" seed/omc/om2/bnd/bnd.cases "$run/bnd" > "$run/bnd.log" || { cat "$run/bnd.log"; exit 1; } |
| 151 | grep -qx 'OM2GATE PASS cases=47 pass=47 fail=0 invalid=0 not_run=0' "$run/bnd.log" |
| 152 | if "$B/gate" seed/out/omc "$pin" seed/omc/om2/bnd/mutants.cases "$run/bndmut" > "$run/bndmut.log"; then |
| 153 | echo 'FAIL operand-boundary mutant survived' >&2 |
| 154 | exit 1 |
| 155 | else |
| 156 | status=$? |
| 157 | [ "$status" = 1 ] || { cat "$run/bndmut.log"; exit 1; } |
| 158 | fi |
| 159 | grep -qx 'OM2GATE FAIL cases=10 pass=2 fail=8 invalid=0 not_run=0' "$run/bndmut.log" |
| 160 | [ "$(grep -c '^VERDICT ctl-bnd-[a-z]*-g0-run PASS ' "$run/bndmut.log")" = 2 ] |
| 161 | [ "$(grep -c '^VERDICT bnd-[a-z]*-[a-z0-9-]* FAIL ' "$run/bndmut.log")" = 8 ] |
| 162 | echo 'PASS expression boundaries (47 cases) and 2 operand mutants killed' |
| 163 | # OM-2 function-mode host words: admitted subset, context tables and x86 syscall/fence mutants. |
| 164 | "$B/gate" seed/out/omc "$pin" seed/omc/om2/fnhost/fnhost.cases "$run/fnhost" > "$run/fnhost.log" || { cat "$run/fnhost.log"; exit 1; } |
| 165 | grep -qx 'OM2GATE PASS cases=21 pass=21 fail=0 invalid=0 not_run=0' "$run/fnhost.log" |
| 166 | if "$B/gate" seed/out/omc "$pin" seed/omc/om2/fnhost/mutants.cases "$run/fnhostmut" > "$run/fnhostmut.log"; then |
| 167 | echo 'FAIL function-mode host-word mutant survived' >&2 |
| 168 | exit 1 |
| 169 | else |
| 170 | status=$? |
| 171 | [ "$status" = 1 ] || { cat "$run/fnhostmut.log"; exit 1; } |
| 172 | fi |
| 173 | grep -qx 'OM2GATE FAIL cases=24 pass=12 fail=12 invalid=0 not_run=0' "$run/fnhostmut.log" |
| 174 | [ "$(grep -c '^VERDICT ctl-fn-[a-z0-9]* PASS ' "$run/fnhostmut.log")" = 12 ] |
| 175 | [ "$(grep -c '^VERDICT fn-[a-z0-9]* FAIL ' "$run/fnhostmut.log")" = 12 ] |
| 176 | echo 'PASS function-mode host words (21 cases) and 12 omc.om mutants killed' |
| 177 | # execenv 233: exact child environment (AArch64 and x86linux), printenv ORACLE, execprog negative |
| 178 | # control, function-mode and contract refusals, and 4 omc.om mutants killed (seed/host/execenv/). |
| 179 | "$B/gate" seed/out/omc "$pin" seed/host/execenv/execenv.cases "$run/execenv" |
| 180 | # prlimit 235: rlimit read/set/effect against /proc/self/limits (AArch64 and x86linux), RLIMIT_AS kept |
| 181 | # across execprog, refusals, and 7 omc.om mutants killed (seed/host/prlimit/). |
| 182 | "$B/gate" seed/out/omc "$pin" seed/host/prlimit/prlimit.cases "$run/prlimit" |
| 183 | mkdir -p build/seed/sched-caller |
| 184 | seed/out/omc < seed/host/affinity/caller-conductor.om > build/seed/sched-caller/conductor |
| 185 | chmod +x build/seed/sched-caller/conductor |
| 186 | "$B/gate" seed/out/omc "$pin" seed/host/affinity/sched.cases "$run/sched" |
| 187 | # Contract behavior parity in pure seeded OM-2 (replaces the retired C runner.c / src/compiler/ check). |
| 188 | { cat seed/omc/contracts/parity.om; cat seed/omc/contracts/parity-check.om; } | seed/out/omc > "$run/parity-check" |
| 189 | chmod +x "$run/parity-check" |
| 190 | "$run/parity-check" |
| 191 | echo 'PASS contract parity: exact values and traps 9/10' |
| 192 | mkdir -p build/seed/host |
| 193 | seed/out/omc < seed/host/gate.om > build/seed/host/gate |
| 194 | chmod +x build/seed/host/gate |
| 195 | build/seed/host/gate |
| 196 | sh seed/host/negative.sh |
| 197 | sh seed/host/regression.sh |
| 198 | sh seed/host/cpufence.sh |
| 199 | sh seed/host/irq.sh |
| 200 | seed/out/omc < seed/host/aien-ioctl.om > "$run/aien-ioctl" |
| 201 | chmod +x "$run/aien-ioctl" |
| 202 | "$run/aien-ioctl" "$(pwd)/seed/out/omc" "$(command -v qemu-x86_64)" "$run/aien-ioctl-cases" |
| 203 | if readelf -l -d seed/out/omc | grep -Eq 'INTERP|NEEDED'; then |
| 204 | echo 'FAIL unexpected compiler runtime dependency' >&2 |
| 205 | exit 1 |
| 206 | fi |
| 207 | # OMEGA-CRYPTO-REUSE-1 (Refs #639). set -eu: a failing suite exits this script. |
| 208 | # A no-op tamper in om/tls/test/reuse/run.sh (replacement equal to the site) is not |
| 209 | # caught, so that suite, and therefore this script, exits nonzero. |
| 210 | sh om/tls/test/gcmsiv/run.sh seed/out/omc |
| 211 | sh om/tls/test/reuse/run.sh seed/out/omc |
| 212 | sh seed/omc/gate-objects.sh seed/out/omc |
| 213 | sh seed/omc/gate-objhost.sh seed/out/omc |
| 214 | sh seed/text/tests/gate.sh |
| 215 | # Diagnostic-v2 oracle and explicit uncovered-site inventory. |
| 216 | python3 seed/omc/diagnostics-v2.py seed/out/omc |
| 217 | python3 seed/modules/tests/check.py seed/out/omc "$(mktemp -d build/seed/modules.XXXXXX)" |
| 218 | printf 'PASS native-host qualification; seeded build, C tools are comparison oracles only\n' |