Files
reims-vgpu/conformance/run-native.sh
T
Anees Iqbal 3c019bf8b2 conformance: add the macOS 15 Metal compatibility battery
Component: conformance; x86 macOS guest on the Linux Vulkan PCI pathway, rail macos-15.

Add a 290-case Metal battery, native Apple M4 oracle, split driver and translation ownership inventories, focused modes, boot manifests, artifact hashing, typed failure scoring, and catastrophic-run gates. This is test-only and changes no device behavior.

The API invariant is monotonic, oracle-backed compatibility: native results establish each Metal relation, while guest failures remain explicit debt owned by either translation or the device. Missing, duplicate, unexplained, and uncovered results fail the scorer.

Verification:
- Apple M4, macOS 15.6.1 build 24G90: full native oracle 290/290 PASS, zero skips.
- verdict unit tests: 5/5 PASS.
- run-native.sh and run-guest.sh: bash syntax clean.
- baseline file matches the final full native result byte-for-byte.
- current focused VM runs: integer clear and topology repeated clean; RGBA32Float clean with guest import on and off; indexed draw repeated with three classified driver failures and zero unexplained results.
- focused candidate boots loaded QEMU SHA-256 0b4ed961deaac18886b4e1ca8eb1db2a34c7e7f06e46b53652167e6dba61951d and static library SHA-256 512fa87458223053e3ca1a58e49501d28705f26b95984c211581d74ee91d195c from source fa29b2e527.

Not verified: there is no single complete 290-case guest run. The earlier 276-case full candidate emitted four stamp-wait timeouts and is not a passing validation. The consolidated macos-15 ledger is 184 pass, 77 classified driver failure, and 29 capability skip. Other guest rails and Apple-host backends were not run.
2026-08-29 18:20:50 +03:00

63 lines
2.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build and run the battery on a native macOS host -- the oracle arm.
#
# run-native.sh [outdir]
#
# The oracle is what makes a guest failure a finding. A case that fails here is
# a wrong expectation in the suite, not a device defect, and the only way to
# tell those apart is to run the same source on both sides. `ORACLE` names the
# ssh host; it needs Xcode's command line tools and nothing else.
set -uo pipefail
export LC_ALL=C
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT="${1:-$HERE/build}"
ORACLE="${ORACLE:-scaleway-m4-macos15}"
CONFORMANCE_MODE="${CONFORMANCE_MODE:-full}"
case "$CONFORMANCE_MODE" in
full) CONFORMANCE_ARG="" ;;
integer-clear) CONFORMANCE_ARG="--integer-clear-only" ;;
topology) CONFORMANCE_ARG="--topology-only" ;;
float-sampling) CONFORMANCE_ARG="--float-sampling-only" ;;
indexed-draw) CONFORMANCE_ARG="--indexed-draw-only" ;;
*) echo "conformance: CONFORMANCE_MODE must be full, integer-clear, topology, float-sampling, or indexed-draw" >&2; exit 2 ;;
esac
mkdir -p "$OUT"
{
echo "kind=native-oracle"
echo "oracle=$ORACLE"
echo "conformance_mode=$CONFORMANCE_MODE"
echo "started=$(date --iso-8601=seconds)"
find "$HERE/suite" -type f -print0 | sort -z | xargs -0 sha256sum
} >"$OUT/manifest.txt"
REMOTE="$(ssh "$ORACLE" 'mktemp -d /tmp/reims-vgpu-conformance.XXXXXX')" || exit 1
case "$REMOTE" in
/tmp/reims-vgpu-conformance.*) ;;
*) echo "oracle returned an unsafe staging path: $REMOTE"; exit 1 ;;
esac
cleanup() { ssh "$ORACLE" "rm -rf -- '$REMOTE'" >/dev/null 2>&1 || true; }
trap cleanup EXIT
tar cf - -C "$HERE" suite | ssh "$ORACLE" "cd '$REMOTE' && tar xf -" || exit 1
# Also cross-compile for the x86 rails, whose guests may have no compiler. The
# deployment target is the oldest rail this project boots.
ssh "$ORACLE" "cd '$REMOTE' && \
swiftc -O suite/*.swift suite/cases/*.swift -o conf-native && \
swiftc -O -target x86_64-apple-macos11.0 suite/*.swift suite/cases/*.swift \
-o conformance-x86_64" 2>&1 | tee "$OUT/build-native.log"
[ "${PIPESTATUS[0]}" -eq 0 ] || { echo "native build failed"; exit 1; }
ssh "$ORACLE" "cd '$REMOTE' && sw_vers && uname -a && \
shasum -a 256 conf-native conformance-x86_64" >>"$OUT/manifest.txt" || exit 1
ssh "$ORACLE" "cd '$REMOTE' && ./conf-native $CONFORMANCE_ARG" >"$OUT/native.txt" 2>&1
rc=$?
scp -q "$ORACLE:$REMOTE/conformance-x86_64" "$OUT/conformance-x86_64" || exit 1
chmod +x "$OUT/conformance-x86_64"
echo "native rc=$rc"
tail -2 "$OUT/native.txt"
echo "completed=$(date --iso-8601=seconds)" >>"$OUT/manifest.txt"
echo "result_rc=$rc" >>"$OUT/manifest.txt"
exit $rc