run_gpu_tests: find a versioned llvm-mc when --llvm-mc and LLVM_MC are unset (TEST-RUN-GPU-TESTS-VERSIONED-LLVM-MC) #1978

Open
github-bot wants to merge 2 commits from github-bot/gh-1978 into main AGit
Owner

@⁠vinceychu on GitHub · 2026-11-25 17:18 UTC · original
vinceychu:fix/run-gpu-tests-versioned-llvm-mc → main · +30 −7 · 4 files · 2 commits · open

Claimed in the coordination issue as: TEST-RUN-GPU-TESTS-VERSIONED-LLVM-MC (#1608)

What and why

run_gpu_tests.py and bench_wave64.py defaulted --llvm-mc to os.environ.get("LLVM_MC", "llvm-mc"), so mc_command.mc_command() never reached versioned_llvm_mc(). With only Ubuntu's llvm-21 installed (llvm-mc-21 and /usr/lib/llvm-21/bin/llvm-mc, no plain llvm-mc) the suite stops with the message that says that install "is found without further setup". The default is now left to mc_command(); bench_wave64.py passes an empty LLVM_MC, which mc_command() treats as unset. tests/test_mc_command.py gains a check that no tool pins the plain name (it fails on main for both scripts).

Tested

  • python -I tests/test_mc_command.py, test_run_gpu_tests.py, test_run_gpu_tests_paths.py, test_run_gpu_tests_python_assembler.py, test_bench_wave64.py: OK.
  • Ubuntu 26.04 with only llvm-21 from apt, LLVM_MC unset: run_gpu_tests.py --filter cs_imgatomic3d fails with the not-found message on main and passes (1/1) with this change.

GPUs tested: NVIDIA GeForce RTX 5090, driver 595.99.02, Ubuntu 26.04.1

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md (n/a)
**@⁠vinceychu** on GitHub · 2026-11-25 17:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1978) `vinceychu:fix/run-gpu-tests-versioned-llvm-mc` → `main` · +30 −7 · 4 files · 2 commits · open Claimed in the coordination issue as: TEST-RUN-GPU-TESTS-VERSIONED-LLVM-MC (#1608) ### What and why `run_gpu_tests.py` and `bench_wave64.py` defaulted `--llvm-mc` to `os.environ.get("LLVM_MC", "llvm-mc")`, so `mc_command.mc_command()` never reached `versioned_llvm_mc()`. With only Ubuntu's `llvm-21` installed (`llvm-mc-21` and `/usr/lib/llvm-21/bin/llvm-mc`, no plain `llvm-mc`) the suite stops with the message that says that install "is found without further setup". The default is now left to `mc_command()`; `bench_wave64.py` passes an empty `LLVM_MC`, which `mc_command()` treats as unset. `tests/test_mc_command.py` gains a check that no tool pins the plain name (it fails on main for both scripts). ### Tested - `python -I tests/test_mc_command.py`, `test_run_gpu_tests.py`, `test_run_gpu_tests_paths.py`, `test_run_gpu_tests_python_assembler.py`, `test_bench_wave64.py`: OK. - Ubuntu 26.04 with only `llvm-21` from apt, `LLVM_MC` unset: `run_gpu_tests.py --filter cs_imgatomic3d` fails with the not-found message on main and passes (1/1) with this change. GPUs tested: NVIDIA GeForce RTX 5090, driver 595.99.02, Ubuntu 26.04.1 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption, including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md` (n/a)
run_gpu_tests.py and bench_wave64.py defaulted --llvm-mc to
os.environ.get("LLVM_MC", "llvm-mc"), so mc_command() never reached
versioned_llvm_mc(). With only Ubuntu's llvm-21 installed (llvm-mc-21 and
/usr/lib/llvm-21/bin/llvm-mc, no plain llvm-mc) the suite stopped with the
message that says that install is found without further setup. Leave the
default to mc_command(), and add a test that no tool pins the plain name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RAL8MMXUuNpQAVa1iiyAMP
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:13:27 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-26 18:18 UTC · original

One stale spot: the new guard test in this PR fails on current main (bd6ba97ab) because a third script now pins the plain name.

FAIL: test_no_tool_pins_the_plain_name_as_its_default
AssertionError: Lists differ: ['scripts/run_address_guard_gpu_test.py'] != []

scripts/run_address_guard_gpu_test.py arrived with the address-guard work (commit 115667294, merged in #2350 after this PR was opened) and still has, at line 71:

ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc"))

and then shutil.which(a.llvm_mc.split()[0]) at line 78. On a machine with only /usr/lib/llvm-21/bin/llvm-mc, that tool would print SKIP: llvm-mc not found and return 77 before reaching assemble_to_s, even though mc_command() knows where it is — the same bug this PR fixes for the other two scripts.

Two things to fold in when rebasing:

  1. The default should be unset, and the shutil.which check should go through mc_command.mc_command(a.llvm_mc) (then look at cmd[0]) or be dropped, since assemble_to_s reports a missing llvm-mc with the proper message itself. a.llvm_mc.split() cannot handle None/"".
  2. The guard test is right as written and is doing its job; no need to change it.

python -I tests/test_mc_command.py on unmodified main is Ran 29 tests ... OK, and with this diff applied to current main it is Ran 30 tests ... FAILED (failures=1) for that one file, so the PR will be red until the third script is updated.

AI-assisted (verification only).

**@⁠wavehs** on GitHub · 2026-11-26 18:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1978#issuecomment-7200298663) One stale spot: the new guard test in this PR fails on current `main` (`bd6ba97ab`) because a third script now pins the plain name. ``` FAIL: test_no_tool_pins_the_plain_name_as_its_default AssertionError: Lists differ: ['scripts/run_address_guard_gpu_test.py'] != [] ``` `scripts/run_address_guard_gpu_test.py` arrived with the address-guard work (commit `115667294`, merged in #2350 after this PR was opened) and still has, at line 71: ```python ap.add_argument("--llvm-mc", default=os.environ.get("LLVM_MC", "llvm-mc")) ``` and then `shutil.which(a.llvm_mc.split()[0])` at line 78. On a machine with only `/usr/lib/llvm-21/bin/llvm-mc`, that tool would print `SKIP: llvm-mc not found` and return 77 before reaching `assemble_to_s`, even though `mc_command()` knows where it is — the same bug this PR fixes for the other two scripts. Two things to fold in when rebasing: 1. The default should be unset, and the `shutil.which` check should go through `mc_command.mc_command(a.llvm_mc)` (then look at `cmd[0]`) or be dropped, since `assemble_to_s` reports a missing llvm-mc with the proper message itself. `a.llvm_mc.split()` cannot handle `None`/`""`. 2. The guard test is right as written and is doing its job; no need to change it. `python -I tests/test_mc_command.py` on unmodified main is `Ran 29 tests ... OK`, and with this diff applied to current main it is `Ran 30 tests ... FAILED (failures=1)` for that one file, so the PR will be red until the third script is updated. AI-assisted (verification only).
github-bot force-pushed github-bot/gh-1978 from 9211d47eba to b1c1ae97b0 2026-11-26 19:36:21 +00:00 Compare
Author
Owner

@⁠vinceychu on GitHub · 2026-11-26 19:32 UTC · original

Thanks, @⁠wavehs. Fixed in the new head: rebased onto current main and scripts/run_address_guard_gpu_test.py now asks mc_command.mc_command() too, instead of os.environ.get("LLVM_MC", "llvm-mc") plus shutil.which on the plain name.

Checked on Ubuntu 26.04 with only llvm-21 from apt and LLVM_MC unset, RTX 5090 (NVIDIA 595.99.02):

  • scripts/run_address_guard_gpu_test.py on main: SKIP: llvm-mc not found (exit 77).
  • With this PR: PASS (guard on) and PASS (guard off).
  • tests/test_mc_command.py: OK, including test_no_tool_pins_the_plain_name_as_its_default, which no longer finds any script that pins the plain name.

Generated by Claude Code

**@⁠vinceychu** on GitHub · 2026-11-26 19:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1978#issuecomment-7201700976) Thanks, @⁠wavehs. Fixed in the new head: rebased onto current `main` and `scripts/run_address_guard_gpu_test.py` now asks `mc_command.mc_command()` too, instead of `os.environ.get("LLVM_MC", "llvm-mc")` plus `shutil.which` on the plain name. Checked on Ubuntu 26.04 with only `llvm-21` from apt and `LLVM_MC` unset, RTX 5090 (NVIDIA 595.99.02): - `scripts/run_address_guard_gpu_test.py` on `main`: `SKIP: llvm-mc not found` (exit 77). - With this PR: `PASS (guard on)` and `PASS (guard off)`. - `tests/test_mc_command.py`: OK, including `test_no_tool_pins_the_plain_name_as_its_default`, which no longer finds any script that pins the plain name. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1978/head:github-bot/gh-1978'
git switch 'github-bot/gh-1978'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1978'
git switch 'github-bot/gh-1978'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1978'
git switch 'github-bot/gh-1978'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1978'
git switch 'main'
git merge --squash 'github-bot/gh-1978'
git switch 'main'
git merge --ff-only 'github-bot/gh-1978'
git switch 'main'
git merge 'github-bot/gh-1978'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.