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/tools/sm121dis/corpus_selftest.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 / tools / sm121dis / corpus_selftest.sh` 29 lines ยท 1670 bytes Raw Blame History 1 #!/bin/sh 2 # A missing or failing producer, or one that exits 0 after a kernel could not be dumped whole, must invalidate the 3 # disassembler corpus. 4 set -eu 5 HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 6 WORK=$(mktemp -d "${TMPDIR:-/tmp}/sm121dis-corpus-control.XXXXXX") 7 trap 'rm -rf "$WORK"' EXIT HUP INT TERM 8 mkdir "$WORK/bin" "$WORK/missing" "$WORK/failing" "$WORK/partial" 9 rc=0 10 sh "$HERE/corpus.sh" "$WORK/bin" "$WORK/missing" > "$WORK/missing.log" 2>&1 || rc=$? 11 [ "$rc" -eq 127 ] && grep -q 'VERDICT FAIL: corpus producer failed:' "$WORK/missing.log" || { 12 echo 'FAIL: a missing producer did not invalidate the corpus'; exit 1; 13 } 14 printf '#!/bin/sh\necho deliberate-producer-failure\nexit 42\n' > "$WORK/bin/gpu_matmul_api_test" 15 chmod +x "$WORK/bin/gpu_matmul_api_test" 16 rc=0 17 sh "$HERE/corpus.sh" "$WORK/bin" "$WORK/failing" > "$WORK/failing.log" 2>&1 || rc=$? 18 [ "$rc" -eq 42 ] && grep -q 'deliberate-producer-failure' "$WORK/failing.log" && 19 grep -q 'VERDICT FAIL: corpus producer failed:' "$WORK/failing.log" || { 20 echo 'FAIL: a failing producer did not invalidate the corpus'; exit 1; 21 } 22 # exit 0, but omega_kernel_dump reported a kernel it could not write whole (src/omega_blackwell_codegen.c) 23 printf '#!/bin/sh\necho "omega_kernel_dump: write failed, removed /x/k.bin" >&2\nexit 0\n' > "$WORK/bin/gpu_matmul_api_test" 24 rc=0 25 sh "$HERE/corpus.sh" "$WORK/bin" "$WORK/partial" > "$WORK/partial.log" 2>&1 || rc=$? 26 [ "$rc" -eq 1 ] && grep -q 'VERDICT FAIL: kernels not captured whole:' "$WORK/partial.log" || { 27 echo 'FAIL: a kernel not captured whole did not invalidate the corpus'; exit 1; 28 } 29 echo 'PASS: missing and failing corpus producers are refused'