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/aienux/blob/main/native/omega/allen/gate.sh # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. 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 `aienux / native / omega / allen / gate.sh` 164 lines ยท 12287 bytes Raw Blame History 1 #!/bin/sh 2 # External build/output comparison only. All behavioral tests execute Omega ELFs. 3 set -eu 4 root=$(CDPATH= cd -- "$(dirname "$0")/../../.." && pwd) 5 cd "$root" 6 out=$1 7 mkdir -p "$out" 8 [ -z "$(ls -A "$out")" ] || { echo 'gate requires fresh output directory' >&2; exit 73; } 9 compiler=${OMEGA_COMPILER:-"$root/build/allen-toolchain/seed/out/omc"} 10 sh native/omega/allen/test-build.sh "$compiler" "$out/build-checks" 11 core="$out/core.om" 12 cat native/omega/allen/base.om native/omega/allen/vendor/sha256-core.om \ 13 native/omega/allen/runtime.om native/omega/allen/code.om \ 14 native/omega/allen/courier.om native/omega/allen/scheduler.om native/omega/allen/memory.om \ 15 native/omega/allen/intent.om native/omega/allen/reply.om \ 16 native/omega/allen/view.om native/omega/allen/scene.om native/omega/allen/paint.om native/omega/allen/application.om native/omega/allen/scene-input.om native/omega/allen/context.om native/omega/allen/font-data.om native/omega/allen/font.om native/omega/allen/look-paint.om native/omega/allen/surface.om native/omega/allen/presentation.om native/omega/allen/provider-core.om > "$core" 17 for name in runtime code courier scheduler application provider-core presentation font surface memory context intent reply view scene scene-input paint edges fixture golden render font-output font-render surface-render; do 18 cat "$core" > "$out/$name.om" 19 case "$name" in golden|render|font-output|font-render|surface-render) ;; *) cat native/omega/allen/tests/check.om >> "$out/$name.om" ;; esac 20 cat "native/omega/allen/tests/$name.om" >> "$out/$name.om" 21 native/omega/allen/build-one.sh "$out/$name.om" "$out/$name" 22 case "$name" in 23 fixture) 24 "$out/$name" < evidence/allen-omega-L694/short.wire > "$out/short.log" 25 "$out/$name" < evidence/allen-omega-L694/long.wire > "$out/long.log" 26 ;; 27 golden) "$out/$name" > "$out/memory-native.bin" ;; 28 render) "$out/$name" > "$out/mind-component.ppm" ;; 29 font-output) "$out/$name" > "$out/font.bin" ;; 30 font-render) "$out/$name" > "$out/font-specimen.ppm" ;; 31 surface-render) "$out/$name" > "$out/provider-surface.ppm" ;; 32 *) "$out/$name" > "$out/$name.log" ;; 33 esac 34 printf '%s compile=0 native-exit=0\n' "$name" 35 done 36 cmp "$out/font.bin" evidence/allen-omega-L694/L758/legacy-font.bin 37 printf 'font native masks match frozen external legacy oracle\n' 38 native/omega/allen/golden.sh "$out/reference" 39 cmp "$out/memory-native.bin" "$out/reference/memory-golden.bin" 40 cat "$core" native/omega/allen/main.om > "$out/allen.om" 41 native/omega/allen/build-one.sh "$out/allen.om" "$out/allen" 42 "$out/allen" < evidence/allen-omega-L694/stdio-input.txt > "$out/stdio-job.txt" 2> "$out/stdio-display.txt" 43 cmp "$out/stdio-job.txt" evidence/allen-omega-L694/stdio-job.txt 44 cmp "$out/stdio-display.txt" evidence/allen-omega-L694/stdio-display.txt 45 printf 'stdio native-exit=0 golden-cmp=0\n' 46 # The fixture generator is Omega too. Refuse the oversized operation and 47 # never execute the valid ASK following it (L719/L722 regression). 48 native/omega/allen/build-one.sh native/omega/allen/tests/stdio-overflow.om "$out/stdio-overflow-input" 49 "$out/stdio-overflow-input" > "$out/stdio-overflow.input" 50 set +e 51 "$out/allen" < "$out/stdio-overflow.input" > "$out/stdio-overflow.stdout" 2> "$out/stdio-overflow.stderr" 52 rc=$? 53 set -e 54 [ "$rc" = 65 ] || { echo "stdio overflow was not refused: exit=$rc" >&2; exit 1; } 55 [ ! -s "$out/stdio-overflow.stdout" ] || { echo 'stdio overflow executed a later job' >&2; exit 1; } 56 [ ! -s "$out/stdio-overflow.stderr" ] || { echo 'stdio overflow displayed a later answer' >&2; exit 1; } 57 printf 'stdio overflow native-exit=65 no-later-command=PASS\n' 58 # Real native provider entry, independent native input/output fixtures. 59 cat "$core" native/omega/allen/provider.om > "$out/provider.om" 60 native/omega/allen/build-one.sh "$out/provider.om" "$out/provider" 61 for name in provider-input provider-output provider-process; do 62 cat "$core" native/omega/allen/tests/check.om "native/omega/allen/tests/$name.om" > "$out/$name.om" 63 native/omega/allen/build-one.sh "$out/$name.om" "$out/$name" 64 done 65 printf 0 | "$out/provider-input" > "$out/provider.input" 66 "$out/provider" < "$out/provider.input" > "$out/provider.output" 2> "$out/provider.stderr" 67 { printf '7\n0\n'; stat -c %s "$out/provider.output" "$out/provider.stderr"; cat "$out/provider.output" "$out/provider.stderr"; } > "$out/provider-process.receipt" 68 "$out/provider-process" < "$out/provider-process.receipt" > "$out/provider-process.log" 69 "$out/provider-output" < "$out/provider.output" > "$out/provider-stream.log" 70 # Byte-at-a-time native producer through a real pipe; collect both exits explicitly. 71 printf 7 > "$out/provider.mode" 72 mkfifo "$out/provider.pipe" 73 "$out/provider-input" < "$out/provider.mode" > "$out/provider.pipe" 2> "$out/provider-producer.stderr" & 74 producer=$! 75 set +e 76 "$out/provider" < "$out/provider.pipe" > "$out/provider-fragment.output" 2> "$out/provider-fragment.stderr" 77 consumer_rc=$? 78 wait "$producer" 79 producer_rc=$? 80 set -e 81 { printf '7\n%s\n' "$consumer_rc"; stat -c %s "$out/provider-fragment.output" "$out/provider-fragment.stderr"; cat "$out/provider-fragment.output" "$out/provider-fragment.stderr"; } > "$out/provider-consumer.receipt" 82 "$out/provider-process" < "$out/provider-consumer.receipt" > "$out/provider-consumer.log" 83 { printf '7\n%s\n0\n' "$producer_rc"; stat -c %s "$out/provider-producer.stderr"; cat "$out/provider-producer.stderr"; } > "$out/provider-producer.receipt" 84 "$out/provider-process" < "$out/provider-producer.receipt" > "$out/provider-producer.log" 85 cmp "$out/provider.output" "$out/provider-fragment.output" 86 "$out/provider-output" < "$out/provider-fragment.output" > "$out/provider-fragment.log" 87 printf 8 | "$out/provider-input" > "$out/provider-boot.expected" 88 for mode in 1 2 3 4 5 6; do 89 printf '%s' "$mode" | "$out/provider-input" > "$out/provider-bad-$mode.input" 90 set +e 91 "$out/provider" < "$out/provider-bad-$mode.input" > "$out/provider-bad-$mode.output" 2> "$out/provider-bad-$mode.stderr" 92 rc=$? 93 set -e 94 { printf '%s\n%s\n' "$mode" "$rc"; stat -c %s "$out/provider-bad-$mode.output" "$out/provider-bad-$mode.stderr"; cat "$out/provider-bad-$mode.output" "$out/provider-bad-$mode.stderr"; } > "$out/provider-bad-$mode.receipt" 95 "$out/provider-process" < "$out/provider-bad-$mode.receipt" > "$out/provider-bad-$mode.log" 96 printf 'provider malformed mode=%s exit=65 no-later-command=PASS\n' "$mode" 97 done 98 printf 'provider native-exit=0 fragmented-pipe=0 output-verifier=0\n' 99 # Compiled behavioral mutants must be valid ELFs and fail the original gates. 100 sed 's/if or eq get R 1 0 ne seq get R 0/if eq get R 1 0/' "$core" > "$out/stale-mutant.om" 101 cat native/omega/allen/tests/check.om native/omega/allen/tests/runtime.om >> "$out/stale-mutant.om" 102 sed 's/if ne ulong codecrc get C 3/if false/' "$core" > "$out/crc-mutant.om" 103 cat native/omega/allen/tests/check.om native/omega/allen/tests/code.om >> "$out/crc-mutant.om" 104 sed 's/ret eq d 0/ret true/' "$core" > "$out/hash-mutant.om" 105 cat native/omega/allen/tests/check.om native/omega/allen/tests/memory.om >> "$out/hash-mutant.om" 106 sed 's/if ne d 0/if false/' "$core" > "$out/readback-mutant.om" 107 cat native/omega/allen/tests/check.om native/omega/allen/tests/memory.om >> "$out/readback-mutant.om" 108 sed 's/if ne run get Q 0/if false/' "$core" > "$out/session-mutant.om" 109 cat native/omega/allen/tests/check.om native/omega/allen/tests/courier.om >> "$out/session-mutant.om" 110 sed 's/delay = ulong 10000/delay = ulong 2000/' "$core" > "$out/keepalive-mutant.om" 111 cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> "$out/keepalive-mutant.om" 112 sed 's/put T 6 1/put T 6 0/' "$core" > "$out/ackstop-mutant.om" 113 cat native/omega/allen/tests/check.om native/omega/allen/tests/scheduler.om >> "$out/ackstop-mutant.om" 114 sed 's/put Outb i get Appwire i/put Outb i get Outb i/' "$core" > "$out/pendingwire-mutant.om" 115 cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/pendingwire-mutant.om" 116 sed 's/if or le get R 2 1 ne get C 0 get R 0/if false/' "$core" > "$out/appcode-mutant.om" 117 cat native/omega/allen/tests/check.om native/omega/allen/tests/application.om >> "$out/appcode-mutant.om" 118 sed 's/if hide/if false/' "$core" > "$out/thinking-mutant.om" 119 cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/thinking-mutant.om" 120 sed 's/if lt get Nm 8 12/if true/' "$core" > "$out/scenecap-mutant.om" 121 cat native/omega/allen/tests/check.om native/omega/allen/tests/scene-input.om >> "$out/scenecap-mutant.om" 122 sed 's/if and eq get Ctxgone index 0 lt given limit/if lt given limit/' "$core" > "$out/contextnote-mutant.om" 123 cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextnote-mutant.om" 124 sed 's/if not ctxappend/if false/' "$core" > "$out/contextjob-mutant.om" 125 cat native/omega/allen/tests/check.om native/omega/allen/tests/context.om >> "$out/contextjob-mutant.om" 126 native/omega/allen/build-one.sh native/omega/allen/tests/provider-mutants.om "$out/provider-mutants" 127 { printf 0; cat "$core"; } | "$out/provider-mutants" > "$out/autosent-mutant.om" 128 cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/autosent-mutant.om" 129 { printf 1; cat "$core"; } | "$out/provider-mutants" > "$out/framecheck-mutant.om" 130 cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/framecheck-mutant.om" 131 native/omega/allen/build-one.sh native/omega/allen/tests/presentation-mutants.om "$out/presentation-mutants" 132 { printf 0; cat "$core"; } | "$out/presentation-mutants" > "$out/staleview-mutant.om" 133 cat native/omega/allen/tests/check.om native/omega/allen/tests/presentation.om >> "$out/staleview-mutant.om" 134 { printf 1; cat "$core"; } | "$out/presentation-mutants" > "$out/inputtail-mutant.om" 135 cat native/omega/allen/tests/check.om native/omega/allen/tests/presentation.om >> "$out/inputtail-mutant.om" 136 native/omega/allen/build-one.sh native/omega/allen/tests/font-mutants.om "$out/font-mutants" 137 { printf 0; cat "$core"; } | "$out/font-mutants" > "$out/fontroot-mutant.om" 138 cat native/omega/allen/tests/check.om native/omega/allen/tests/font.om >> "$out/fontroot-mutant.om" 139 { printf 1; cat "$core"; } | "$out/font-mutants" > "$out/fontalpha-mutant.om" 140 cat native/omega/allen/tests/check.om native/omega/allen/tests/font.om >> "$out/fontalpha-mutant.om" 141 native/omega/allen/build-one.sh native/omega/allen/tests/provider-display-mutants.om "$out/provider-display-mutants" 142 { printf 0; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawask-mutant.om" 143 cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawask-mutant.om" 144 { printf 1; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawrecv-mutant.om" 145 cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawrecv-mutant.om" 146 { printf 2; cat "$core"; } | "$out/provider-display-mutants" > "$out/rawreset-mutant.om" 147 cat native/omega/allen/tests/check.om native/omega/allen/tests/provider-core.om >> "$out/rawreset-mutant.om" 148 native/omega/allen/build-one.sh native/omega/allen/tests/surface-mutants.om "$out/surface-mutants" 149 { printf 0; cat "$core"; } | "$out/surface-mutants" > "$out/clipright-mutant.om" 150 cat native/omega/allen/tests/check.om native/omega/allen/tests/surface.om >> "$out/clipright-mutant.om" 151 { printf 1; cat "$core"; } | "$out/surface-mutants" > "$out/blendbg-mutant.om" 152 cat native/omega/allen/tests/check.om native/omega/allen/tests/surface.om >> "$out/blendbg-mutant.om" 153 for name in stale crc hash readback session keepalive ackstop pendingwire appcode thinking scenecap contextnote contextjob autosent framecheck staleview inputtail fontroot fontalpha rawask rawrecv rawreset clipright blendbg; do 154 native/omega/allen/build-one.sh "$out/$name-mutant.om" "$out/$name-mutant" 155 set +e 156 "$out/$name-mutant" > "$out/$name-mutant.log" 157 rc=$? 158 set -e 159 if [ "$rc" -le 0 ] || [ "$rc" -ge 100 ]; then echo "mutant did not fail behaviorally: $name exit=$rc" >&2; exit 1; fi 160 printf '%s mutant compile=0 rejected-exit=%s\n' "$name" "$rc" 161 done 162 find native/omega/allen -type f -print0 | sort -z | xargs -0 sha256sum > "$out/source.sha256" 163 find "$out" -maxdepth 1 -type f -perm -100 -exec sha256sum {} + > "$out/binaries.sha256" 164 printf 'ALLEN_OMEGA_HOST: PASS; target=NOT_RUN; live=NOT_RUN\n'