Files
betterxen/scripts/audit/native.sh
T
Ranveer Soni 96cff7c66e feat: establish native RDNA-to-Metal recompilation foundation
Add gfx1030 decoding, semantic validation, Metal shader generation, and an independent CPU interpreter for three reproducible compute fixtures. Include native Metal tests, LLVM fixture verification, and the existing CI and Phase 01 handoff.

Verified formatting, all-features Clippy and tests, LLVM decoding, native ARM64 linkage, and all three demo fixtures with Metal API and shader validation enabled.

Signed-off-by: Ranveer Soni <git@ranveersoni.me>
2026-11-22 13:41:55 +05:30

45 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
set -eu
cd "$(dirname "$0")/../.."
uname -m
arch
test "$(uname -m)" = arm64
test "$(arch)" = arm64
test "$(sysctl -n sysctl.proc_translated)" = 0
rustc -vV
mkdir -p artifacts
cargo build --locked --workspace --message-format=json > artifacts/native-build.jsonl
cargo test --locked --workspace --all-features --no-run --message-format=json > artifacts/native-tests.jsonl
python3 - <<'PY'
import json
from pathlib import Path
import subprocess
executables = set()
for filename in ("native-build.jsonl", "native-tests.jsonl"):
for line in (Path("artifacts") / filename).read_text().splitlines():
entry = json.loads(line)
if entry.get("executable"):
executables.add(entry["executable"])
for output in entry.get("filenames", ()):
if output.endswith((".dylib", ".so")):
executables.add(output)
if not executables:
raise SystemExit("No Cargo executable or loadable dependency artifacts found.")
for path in sorted(executables):
subprocess.run(["file", path], check=True)
archs = subprocess.check_output(["lipo", "-archs", path], text=True).strip()
print(archs, flush=True)
if archs != "arm64":
raise SystemExit(f"Non-ARM64 build artifact: {path}")
linkage = subprocess.check_output(["otool", "-L", path], text=True)
print(linkage, end="", flush=True)
if any(name in linkage.casefold() for name in ("vulkan", "moltenvk")):
raise SystemExit(f"Unexpected graphics linkage: {path}")
print(f"Checked {len(executables)} native executables and loadable dependencies.")
PY