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

Merged
vinceychu merged 2 commits from upstream-pr/1978 into main 2026-11-28 08:04:22 +00:00
vinceychu commented 2026-11-25 17:18:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by vinceychu on 2026-11-25T17:18:54Z.


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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5495888604 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1978). Originally posted by [vinceychu](https://github.com/vinceychu) on 2026-11-25T17:18:54Z. --- 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)
wavehs commented 2026-11-26 18:18:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:18:13Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200298663 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1978#issuecomment-7200298663). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-26T18:18:13Z. --- 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).
vinceychu commented 2026-11-26 19:32:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by vinceychu on 2026-11-26T19:32:29Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7201700976 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1978#issuecomment-7201700976). Originally posted by [vinceychu](https://github.com/vinceychu) on 2026-11-26T19:32:29Z. --- 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)_
DadaCap commented 2026-11-28 08:04:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:04:24Z.


Merged into main (merge commit 20264ffa0), approved by DadaCap (maintainer). Thanks!

Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (b1c1ae97b).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236344630 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1978#issuecomment-7236344630). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:04:24Z. --- Merged into `main` (merge commit 20264ffa0), approved by DadaCap (maintainer). Thanks! Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (b1c1ae97b). _AI-assisted (Claude Code), posted for DadaCap._
vinceychu commented 2026-11-28 16:35:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by vinceychu on 2026-11-28T16:35:14Z.


Discord: .fountainhead. (for the Contributor role check).


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7242356596 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1978#issuecomment-7242356596). Originally posted by [vinceychu](https://github.com/vinceychu) on 2026-11-28T16:35:14Z. --- Discord: `.fountainhead.` (for the Contributor role check). --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1978
No description provided.