CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
Isolate API shell mutation tests during parallel builds
During a parallel CUDApp host run, test-om-units reported 17 mismatches while api_shells_mutants.py was rewriting tracked Omega sources. The unmodified base passed regeneration in isolation. Write each mutation to a temporary file and require an actual differential mismatch before counting it as killed. On AArch64 in a device-isolated environment, make -j2 test-om-units test-api-shells-mutants returned 0. The portable units regenerated byte for byte and all eight mutants produced differential failures. Supplying an unavailable compiler returned 1 from the mutation harness with “expected a differential mismatch, got rc=3”.
Apply it
git checkout -b patch-fe287c89a7d0446a a4ffab1d55b4019b4349e03a23b55844122a20f1 curl -fsSL https://interplane.io/drakestapleton/CUDApp/patches/fe287c89a7d0446a.patch | git am
Signature
interplane-patch 1 drakestapleton/CUDApp a4ffab1d55b4019b4349e03a23b55844122a20f1 83dd52c9a5f410839e1b8dd6e49e15a8125f2465834ee4b41c2549f594a04e53 af97f27cb4f8be3caf13f47b2036a2bb97165dcc95e56fdd6ea9bd7f21403d2f
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAg1vQ1KtWtuW5PISxEahQt4AgcBw syuwQ4l2Qd7RBTSZ4AAAAQaW50ZXJwbGFuZS1wYXRjaAAAAAAAAAAGc2hhNTEyAAAAUwAA AAtzc2gtZWQyNTUxOQAAAECKDGQ6fcxuzk8BiRsRULZ9/BfWY5g1c55f6TZ4SJ1JKWl+WH 4WeHR26tRG2ut+6a3GXJYawS5sfInOHmWm0LEP -----END SSH SIGNATURE-----
Changes
diff --git a/tests/api_shells_mutants.py b/tests/api_shells_mutants.py index 4c05e98788e9ecd861cea635d77cb6e0cf3b8f87..dcb4bfa8508f1c5e2688afced56c9e8993b1852c 100755 --- a/tests/api_shells_mutants.py +++ b/tests/api_shells_mutants.py @@ -54,25 +54,18 @@ def main() -> int: if count != 1: print(f"FAIL mutant {name}: site count {count}") return 1 - with open(full, "w") as fh: - fh.write(src.replace(old, new, 1)) - try: - with tempfile.TemporaryDirectory(prefix="api-shells-mutant-") as out: - env = dict(os.environ, OUT_DIR=out) - r = subprocess.run( - ["bash", script, "regen"], - cwd=ROOT, - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - ) - finally: - with open(full, "w") as fh: - fh.write(src) - if r.returncode == 0: - tail = r.stdout[-400:] - print(f"FAIL mutant {name} survived\n{tail}") + with tempfile.TemporaryDirectory(prefix="api-shells-mutant-") as out: + mutant = os.path.join(out, os.path.basename(path)) + with open(mutant, "w") as fh: + fh.write(src.replace(old, new, 1)) + env = dict(os.environ, OUT_DIR=out, API_SHELLS_MUTANT=mutant) + r = subprocess.run( + ["bash", script, "regen"], cwd=ROOT, env=env, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, + ) + if r.returncode != 1 or "FAIL api-shells checks=" not in r.stdout: + print(f"FAIL mutant {name}: expected a differential mismatch, " + f"got rc={r.returncode}\n{r.stdout[-400:]}") return 1 print(f"KILLED {name} rc={r.returncode}") killed += 1 diff --git a/tests/api_shells_run.sh b/tests/api_shells_run.sh index f57ad1df012fae45deb607fe67ec5a83d9a69241..60977ef0c460ebb713d11142adbfe4416261ce86 100755 --- a/tests/api_shells_run.sh +++ b/tests/api_shells_run.sh @@ -10,7 +10,15 @@ mkdir -p "$OUT" if [[ "${1:-}" == "regen" ]]; then export OMEGA_OMC="${OMEGA_OMC:-$HOME/work/cudastack/omega-mv/seed/out/omc}" export OMEGA_BRIDGE="${OMEGA_BRIDGE:-$HOME/work/cudastack/omega-bridge}" - export OMEGA_UNITS="om/api/apish_shp.om om/api/apish_pack.om om/api/apish_slot.om om/api/apish_blk.om om/api/apish_trit.om" + units=() + for name in shp pack slot blk trit; do + source_file="om/api/apish_$name.om" + if [[ "${API_SHELLS_MUTANT:-}" == */"apish_$name.om" ]]; then + source_file="$API_SHELLS_MUTANT" + fi + units+=("$source_file") + done + export OMEGA_UNITS="${units[*]}" export OMEGA_UNITS_DEST="$OUT/gen" mkdir -p "$OMEGA_UNITS_DEST" bash om/units.sh