Skip to content

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
vinceychu wants to merge 2 commits into
ProjectLeonida:mainfrom
vinceychu:fix/run-gpu-tests-versioned-llvm-mc
Open

vinceychu wants to merge 2 commits into
ProjectLeonida:mainfrom
vinceychu:fix/run-gpu-tests-versioned-llvm-mc

Conversation

@vinceychu

@vinceychu vinceychu commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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)

@wavehs

wavehs commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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

vinceychu and others added 2 commits November 26, 2026 14:31
…e unset (TEST-RUN-GPU-TESTS-VERSIONED-LLVM-MC)

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAL8MMXUuNpQAVa1iiyAMP
…nd LLVM_MC are unset

The script, added in ubiquitarianism#2350 after this PR was opened, also defaulted --llvm-mc
to os.environ.get("LLVM_MC", "llvm-mc") and checked that name with
shutil.which, so with only Ubuntu's llvm-21 it skipped (exit 77). It now asks
mc_command.mc_command() like run_gpu_tests.py, and the guard test added here
passes on main again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAL8MMXUuNpQAVa1iiyAMP
@vinceychu

Copy link
Copy Markdown
Contributor Author

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
vinceychu force-pushed the fix/run-gpu-tests-versioned-llvm-mc branch from 9211d47 to b1c1ae9 Compare November 26, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants