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/rpc_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 / rpc_diff.sh` 26 lines ยท 1618 bytes Raw Blame History 1 #!/bin/sh 2 # Host verification only. Never invokes build/w0, firmware loading, map or VFIO calls. 3 set -eu 4 R=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) 5 OMC=${OMC:-$R/build/omc} 6 AIENUX=${AIENUX:?set AIENUX to aienux `a108b1144a064aa7b824374a622d627c6ba91fd1`} 7 RPC_OM=${RPC_OM:-$R/gsp/rpc.om} 8 BOOT_OM=${BOOT_OM:-$R/gsp/boot.om} 9 expected=`bcfa582892afca8f65e551fe56867d918d86e84540c7381be8fa9ef18d0cf0f6` 10 actual=$(sha256sum "$OMC"); actual=${actual%% *} 11 [ "$actual" = "$expected" ] || { echo 'rpc_diff: compiler pin mismatch' >&2; exit 2; } 12 [ "$(git -C "$AIENUX" rev-parse HEAD)" = `a108b1144a064aa7b824374a622d627c6ba91fd1` ] || exit 2 13 git -C "$AIENUX" diff --quiet HEAD -- native/kernel/dev/gb10_gsp_boot.c native/kernel/dev/gb10_gsp_boot.h || { echo 'rpc_diff: INVALID modified oracle'; exit 2; } 14 t=$(mktemp -d /tmp/rpc-replay.XXXXXX) 15 trap 'rm -rf "$t"' EXIT HUP INT TERM 16 cc -std=c11 -O1 -Wall -Wextra -I"$AIENUX/native/kernel/dev" "$R/tests/rpc_ref.c" "$AIENUX/native/kernel/dev/gb10_gsp_boot.c" -o "$t/ref" 17 "$t/ref" > "$t/ref.frames" 18 cat "$RPC_OM" "$R/gsp/replay.om" "$R/gsp/sysinfo.om" "$R/chan/params.om" "$BOOT_OM" "$R/tests/rpc_trace.om" > "$t/trace.om" 19 if ! "$OMC" < "$t/trace.om" > "$t/replay"; then echo 'rpc_diff: INVALID compile'; exit 3; fi 20 chmod +x "$t/replay" 21 if "$t/replay" > "$t/om.frames"; then :; else 22 rc=$?; echo "rpc_diff: FAIL replay exit $rc"; exit 1 23 fi 24 if ! cmp "$t/ref.frames" "$t/om.frames"; then echo 'rpc_diff: FAIL exact frames'; exit 1; fi 25 echo 'rpc_diff: PASS exact command frames and boot/RPC transition controls; hardware NOT_RUN' 26 sha256sum "$t/trace.om" "$t/replay" "$t/ref" "$t/om.frames"