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/omega-mv/blob/main/seed/omc/gate12.sh # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / omc / gate12.sh` 71 lines ยท 3844 bytes Raw Blame History 1 #!/bin/sh 2 # gate12.sh -- documented capacities (OMEGESE 9.6, decision 23 as amended 2026-11-11). omc's tables live in 3 # one arena, which itself grows at run time (a run-time pool, landing 2 of docs/RUNTIME-POOLS.md); what is 4 # left are the host's refusal of that growth, the depth omc's own stack can hold, and the program's own pool limits (OMEGESE 9.4, error 23). Each case is generated, compiled by seed/out/omc, and 5 # checked for the documented accept/refuse boundary. The units one past each old table size (8192 names, 6 # 4096 functions, 512 blocks, 8 MiB input) are accepted; seed/omc/gate-nocaps.sh takes them far past. 7 # RC=0 only when all pass. 8 set -eu 9 R=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) 10 cd "$R" 11 S=seed/out/omc 12 [ -x "$S" ] || { printf 'FAIL: %s missing; run sh seed/omega-from-seed.sh first\n' "$S" >&2; exit 1; } 13 mkdir -p build/seed/r12 14 T=$(mktemp -d build/seed/r12/cap.XXXXXX) 15 trap 'rm -rf "$T"' EXIT HUP INT TERM 16 bad() { printf 'FAIL: %s\n' "$*" >&2; exit 1; } 17 say() { printf '%s\n' "$*"; } 18 19 accept() { # name file 20 set +e 21 "$S" < "$2" > "$T/$1.out" 2> "$T/$1.err" 22 rc=$? 23 set -e 24 [ "$rc" = 0 ] || bad "$1: exit $rc ($(head -1 "$T/$1.err"))" 25 [ -s "$T/$1.out" ] || bad "$1: empty output" 26 say "PASS $1 accepted" 27 } 28 refuse() { # name file code 29 set +e 30 "$S" < "$2" > "$T/$1.out" 2> "$T/$1.err" 31 rc=$? 32 set -e 33 [ "$rc" = "$3" ] || bad "$1: exit $rc, wanted $3 ($(head -1 "$T/$1.err"))" 34 grep -q "error $3" "$T/$1.err" || bad "$1: diagnostic does not name error $3" 35 say "PASS $1 error $3" 36 } 37 38 awk 'BEGIN{for(i=0;i<8193;i++)printf "global g%d uchar 1\n",i; print "fn main to int"; print "ret 0"; print "end"}' > "$T/g8193.om" 39 awk 'BEGIN{for(i=0;i<4096;i++)printf "fn q%d to int\nret 0\nend\n",i; print "fn main to int"; print "ret 0"; print "end"}' > "$T/f4096.om" 40 awk 'BEGIN{print "fn main to int"; print "x = ulong 1"; for(i=0;i<513;i++)print "if eq x 1"; print "ret 0"; for(i=0;i<513;i++)print "end"; print "ret 0"; print "end"}' > "$T/b513.om" 41 printf 'fn main to int\na = new uchar `4194305` 0\nret 0\nend\n' > "$T/local.om" 42 printf 'fn main to int\na = new uchar `16777217` 0\nret 0\nend\n' > "$T/arr.om" 43 awk 'BEGIN{for(i=0;i<64;i++)printf "global h%d uchar `16777216`\n",i; print "global k uchar 1"; print "fn main to int"; print "ret 0"; print "end"}' > "$T/pools.om" 44 # a value nested 32768 deep: past what omc's own 8 MiB stack holds (32767 is accepted) 45 for d in 32767 32768; do 46 { printf 'fn main to int\ny = ulong 7\nx = '; awk -v d=$d 'BEGIN { for (i = 0; i < d; i++) printf "ulong " }'; printf 'y\nret int rem x 256\nend\n'; } > "$T/v$d.om" 47 done 48 # an input one byte over the old 8 MiB buffer: a program after note lines 49 { yes 'note padding' | head -c `8388609` | sed '$d'; printf 'fn main to int\nret 0\nend\n'; } > "$T/big.om" 50 # an input past the old static arena (`16777216` words, `134217728` bytes), a program after note lines 51 { yes 'note padding' | head -c `134217729` | sed '$d'; printf 'fn main to int\nret 0\nend\n'; } > "$T/arena.om" 52 53 accept g8193 "$T/g8193.om" 54 accept f4096 "$T/f4096.om" 55 accept b513 "$T/b513.om" 56 refuse local "$T/local.om" 23 57 refuse arr "$T/arr.om" 23 58 refuse pools "$T/pools.om" 23 59 accept v32767 "$T/v32767.om" 60 refuse v32768 "$T/v32768.om" 14 61 accept big "$T/big.om" 62 accept arena "$T/arena.om" 63 # the same input when the host refuses the arena's growth (prlimit --as=`67108864`): error 14, full=1 64 set +e; prlimit --as=`67108864` "$S" < "$T/arena.om" > "$T/arenah.out" 2> "$T/arenah.err"; rc=$?; set -e 65 [ "$rc" = 14 ] || bad "arena under prlimit --as=`67108864`: exit $rc, wanted 14 ($(head -1 "$T/arenah.err"))" 66 grep -q '^omc-use 1 arena=[0-9]* .* full=1 ' "$T/arenah.err" || bad "arena under prlimit: no omc-use record with full=1" 67 say "PASS arena under prlimit --as=`67108864` error 14 full=1" 68 rm -f "$T/arena.om" "$T/big.om" 69 70 say "PASS gate12 11 cases" 71 exit 0