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-gpu-driver/blob/main/tests/arena_diff.sh # omega-gpu-driver aien-dev/omega-gpu-driver 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 `omega-gpu-driver / tests / arena_diff.sh` 39 lines ยท 2567 bytes Raw Blame History 1 #!/bin/sh 2 # Unprivileged synthetic host gate only. Does not load firmware or touch a device. 3 set -eu 4 R=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) 5 OMC=${OMC:-$R/build/omc} 6 AIENUX=${AIENUX:?set AIENUX to pinned reference checkout} 7 ARENA_OM=${ARENA_OM:-$R/gsp/arena.om} 8 actual=$(sha256sum "$OMC"); actual=${actual%% *} 9 [ "$actual" = `bcfa582892afca8f65e551fe56867d918d86e84540c7381be8fa9ef18d0cf0f6` ] || { echo 'arena_diff: INVALID compiler pin'; exit 2; } 10 # Deliberate oracle refresh: aienux #463 corrects GB10B MCTP to the vendor HAL constant 1. 11 # `c5bb3a4b` shared the old SOM|EOM defect with Omega and could not detect it. 12 [ "$(git -C "$AIENUX" rev-parse HEAD)" = `a108b1144a064aa7b824374a622d627c6ba91fd1` ] || { echo 'arena_diff: INVALID oracle pin'; exit 2; } 13 git -C "$AIENUX" diff --quiet HEAD -- native/kernel/dev/gb10_gsp_boot.c native/kernel/dev/gb10_gsp_boot.h || { echo 'arena_diff: INVALID modified oracle'; exit 2; } 14 t=$(mktemp -d /tmp/arena-parity.XXXXXX) 15 trap 'rm -rf "$t"' EXIT HUP INT TERM 16 cc -std=c11 -O1 -Wall -Wextra -I"$AIENUX/native/kernel/dev" "$R/tests/arena_ref.c" "$AIENUX/native/kernel/dev/gb10_gsp_boot.c" -o "$t/ref" 17 cat "$R/gsp/rpc.om" "$R/gsp/replay.om" "$R/gsp/sysinfo.om" "$R/chan/params.om" "$R/gsp/boot.om" "$ARENA_OM" "$R/gsp/connect.om" "$R/tests/arena_trace.om" > "$t/trace.om" 18 if ! "$OMC" < "$t/trace.om" > "$t/replay"; then echo 'arena_diff: INVALID compile'; exit 2; fi 19 chmod +x "$t/replay" 20 python3 - "$t" <<'PY' 21 import pathlib, subprocess, sys 22 p=pathlib.Path(sys.argv[1]) 23 def run(name, mode): 24 return subprocess.run([str(p/name)], input=bytes([mode]), stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=60) 25 for mode in range(5): 26 ref=run('ref',mode) 27 if ref.returncode: sys.exit('arena_diff: INVALID oracle positive '+str(mode)) 28 om=run('replay',mode) 29 if om.returncode: sys.exit('arena_diff: FAIL replay exit '+str(om.returncode)+' case '+str(mode)) 30 if om.stdout!=ref.stdout: sys.exit('arena_diff: FAIL exact arena/COT case '+str(mode)) 31 for mode in range(10,41): 32 ref=run('ref',mode) 33 if ref.returncode!=3 or ref.stdout: sys.exit('arena_diff: INVALID oracle negative '+str(mode)) 34 om=run('replay',mode) 35 if om.returncode==0: sys.exit('arena_diff: FAIL negative accepted case '+str(mode)) 36 if om.returncode!=3 or om.stdout: sys.exit('arena_diff: INVALID negative trap/status '+str(om.returncode)+' case '+str(mode)) 37 print('arena_diff: PASS exact arena bytes, plan, COT, preboot attach/INIT_DONE seam and negative refusals; hardware NOT_RUN') 38 PY 39 sha256sum "$t/trace.om" "$t/replay" "$t/ref"