test_lds_src2: feed llvm-mc through stdin, so a WSL LLVM_MC can read it (TEST-LDS-SRC2-MC-STDIN) #1733

Open
github-bot wants to merge 3 commits from github-bot/gh-1733 into main AGit
Owner

@⁠MoonEyes on GitHub · 2026-11-25 10:10 UTC · original
MoonEyes:tests/lds-src2-mc-stdin → main · +7 −8 · 1 files · 3 commits · open

Claimed in the coordination issue as: TEST-LDS-SRC2-MC-STDIN

What and why

tests/semantic/test_lds_src2.py's assemble() wrote the listing to a temporary file and passed its path to llvm-mc. With LLVM_MC set to the WSL command that tools/mc_command.py and the build's error message document (wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc), llvm-mc runs inside WSL and cannot open the Windows temp path, so every EncodingTests subtest failed (llvm-mc: error: C:\...\in.s: No such file or directory) instead of checking the encodings. It now feeds llvm-mc through stdin, as tools/shader_disasm.py does, and the now unused tempfile import goes. Same class of problem as TEST-CUBE-WINPATH (#419) in another test.

Tested

Windows 11, Python 3.14, python -I scripts/run_semantic_tests.py tests/semantic -p test_lds_src2.py:

LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc (llvm 21) no llvm-mc
main 1 file failed (63 subtest failures) -
this PR 5 tests OK OK, 3 skipped (the llvm-mc tests, as before)

The rest of the suite is unchanged by this PR (one test file touched).

GPUs tested: n/a

AI-assisted: yes (Claude Code made the change and ran the tests; I checked them)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

**@⁠MoonEyes** on GitHub · 2026-11-25 10:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1733) `MoonEyes:tests/lds-src2-mc-stdin` → `main` · +7 −8 · 1 files · 3 commits · open Claimed in the coordination issue as: TEST-LDS-SRC2-MC-STDIN ### What and why `tests/semantic/test_lds_src2.py`'s `assemble()` wrote the listing to a temporary file and passed its path to llvm-mc. With `LLVM_MC` set to the WSL command that `tools/mc_command.py` and the build's error message document (`wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc`), llvm-mc runs inside WSL and cannot open the Windows temp path, so every `EncodingTests` subtest failed (`llvm-mc: error: C:\...\in.s: No such file or directory`) instead of checking the encodings. It now feeds llvm-mc through stdin, as `tools/shader_disasm.py` does, and the now unused `tempfile` import goes. Same class of problem as TEST-CUBE-WINPATH (#419) in another test. ### Tested Windows 11, Python 3.14, `python -I scripts/run_semantic_tests.py tests/semantic -p test_lds_src2.py`: | | `LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc` (llvm 21) | no llvm-mc | |---|---|---| | main | 1 file failed (63 subtest failures) | - | | this PR | 5 tests OK | OK, 3 skipped (the llvm-mc tests, as before) | The rest of the suite is unchanged by this PR (one test file touched). GPUs tested: n/a AI-assisted: yes (Claude Code made the change and ran the tests; I checked them) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
assemble() wrote the listing to a temporary file and passed its path to
llvm-mc. With LLVM_MC set to the WSL form tools/mc_command.py documents
(wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc), llvm-mc runs inside WSL
and cannot open the Windows path, so every EncodingTests subtest failed
("No such file or directory") instead of checking the encodings. It now
reads stdin, as tools/shader_disasm.py does; the text is ASCII either way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:02 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-25 10:24 UTC · original · reviewed

Independent A/B at 3d910f1f against 57ba40bd. I ran the Windows CPython 3.12.1 semantic runner with LLVM_MC invoking real LLVM 21.1.8 under Ubuntu/WSL. The base failed 63 subtests because llvm-mc received a Windows temporary path. All five tests passed on the PR with the same tool command. With llvm-mc intentionally unavailable, the two CPU cases passed and the three encoding tests skipped as expected.

AI-assisted testing. Synthetic assembly only, no GPU or game data.

**@⁠lixonik** on GitHub · 2026-11-25 10:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1733#pullrequestreview-6055790712) · **reviewed** Independent A/B at `3d910f1f` against `57ba40bd`. I ran the Windows CPython 3.12.1 semantic runner with `LLVM_MC` invoking real LLVM 21.1.8 under Ubuntu/WSL. The base failed 63 subtests because llvm-mc received a Windows temporary path. All five tests passed on the PR with the same tool command. With llvm-mc intentionally unavailable, the two CPU cases passed and the three encoding tests skipped as expected. AI-assisted testing. Synthetic assembly only, no GPU or game data.
Author
Owner

@⁠Tyrannys on GitHub · 2026-11-25 14:20 UTC · original

Independent verification of head 3d910f1f6 (Windows 11 Pro 26300, Python 3.14.4, native llvm-mc 21.1.8 with the AMDGPU target).

  • python -m unittest discover -s tests/semantic -p test_lds_src2.py with the native llvm-mc: 5/5 OK at this head, and also 5/5 OK with main's version of the file (as expected, a native llvm-mc reads the temp file fine).
  • WSL on this machine can't start, so I stood in for a WSL llvm-mc with an LLVM_MC wrapper command that refuses any argument that is an existing host file (the error llvm-mc gives for an unreadable input) and otherwise runs the real llvm-mc:
    • this head: 5/5 OK
    • main's test_lds_src2.py: 3 of 5 tests fail (63 failed subtests): test_gfx1013_has_every_form_with_a_16_bit_offset, test_gfx1030_has_none_of_them and test_offset0_offset1_is_not_their_operand_form. So the stdin path is what makes the file work with a command that can't see Windows paths.
  • Diff read: the change only swaps the temp file for input=; the probe in _llvm_mc() already used stdin, so both now go the same way. No problem found.

No game files. AI-assisted (Claude Code).

**@⁠Tyrannys** on GitHub · 2026-11-25 14:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1733#issuecomment-7165130862) **Independent verification** of head `3d910f1f6` (Windows 11 Pro 26300, Python 3.14.4, native llvm-mc 21.1.8 with the AMDGPU target). - `python -m unittest discover -s tests/semantic -p test_lds_src2.py` with the native llvm-mc: **5/5 OK** at this head, and also 5/5 OK with `main`'s version of the file (as expected, a native llvm-mc reads the temp file fine). - WSL on this machine can't start, so I stood in for a WSL llvm-mc with an `LLVM_MC` wrapper command that refuses any argument that is an existing host file (the error llvm-mc gives for an unreadable input) and otherwise runs the real llvm-mc: - this head: **5/5 OK** - `main`'s `test_lds_src2.py`: **3 of 5 tests fail (63 failed subtests)**: `test_gfx1013_has_every_form_with_a_16_bit_offset`, `test_gfx1030_has_none_of_them` and `test_offset0_offset1_is_not_their_operand_form`. So the stdin path is what makes the file work with a command that can't see Windows paths. - Diff read: the change only swaps the temp file for `input=`; the probe in `_llvm_mc()` already used stdin, so both now go the same way. No problem found. No game files. AI-assisted (Claude Code).
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-26 07:26 UTC · original

Merged current main (a73a57e13) into this branch, no conflicts; the PR still changes only tests/semantic/test_lds_src2.py.

Re-ran locally on Windows with LLVM_MC = WSL llvm-mc 21.1.8: test_lds_src2 is 5/5 OK here, and 63 subtests fail on main alone.

About the four red jobs of the earlier CI run (it ran on a base 512 commits old):

  • translator-tests (cs_dpp_cmp, "dpp variant ... not supported"): fails on main too with llvm-mc 21.1.8. It comes from the Shader helper in tests/conftest.py, which already used stdin, not from this PR.
  • stdlib-tests-linux (test_every_stdlib_runner_calls_its_test_functions): fixed on main by #1561, passes on the merge.
  • check (test_unreadable_mount_directory_preserves_the_report): fails on main too on Windows here (the path is printed with repr, see #128).
  • test_alias_preflight_precedes_output_truncation: passes locally on the merge; CI will tell.

AI-assisted: yes (Claude Code, Claude Opus 5.5, ran the tests and drafted this)

**@⁠MoonEyes** on GitHub · 2026-11-26 07:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1733#issuecomment-7185463956) Merged current main (`a73a57e13`) into this branch, no conflicts; the PR still changes only `tests/semantic/test_lds_src2.py`. Re-ran locally on Windows with `LLVM_MC` = WSL llvm-mc 21.1.8: `test_lds_src2` is 5/5 OK here, and 63 subtests fail on main alone. About the four red jobs of the earlier CI run (it ran on a base 512 commits old): - translator-tests (`cs_dpp_cmp`, "dpp variant ... not supported"): fails on main too with llvm-mc 21.1.8. It comes from the `Shader` helper in `tests/conftest.py`, which already used stdin, not from this PR. - stdlib-tests-linux (`test_every_stdlib_runner_calls_its_test_functions`): fixed on main by #1561, passes on the merge. - check (`test_unreadable_mount_directory_preserves_the_report`): fails on main too on Windows here (the path is printed with repr, see #128). - `test_alias_preflight_precedes_output_truncation`: passes locally on the merge; CI will tell. AI-assisted: yes (Claude Code, Claude Opus 5.5, ran the tests and drafted this)
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/1733/head:github-bot/gh-1733'
git switch 'github-bot/gh-1733'

Merge

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