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

Merged
MoonEyes merged 5 commits from upstream-pr/1733 into main 2026-12-01 11:29:08 +00:00
MoonEyes commented 2026-11-25 10:10:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-25T10:10:08Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5489264280 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-25T10:10:08Z. --- 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)
lixonik commented 2026-11-25 10:24:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T10:24:29Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6055790712 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733#pullrequestreview-6055790712). Originally posted by [lixonik](https://github.com/lixonik) on 2026-11-25T10:24:29Z. **Review:** COMMENTED --- 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.
Tyrannys commented 2026-11-25 14:20:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tyrannys on 2026-11-25T14:20:38Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165130862 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1733#issuecomment-7165130862). Originally posted by [Tyrannys](https://github.com/Tyrannys) on 2026-11-25T14:20:38Z. --- **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).
MoonEyes commented 2026-11-26 07:26:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-26T07:26:41Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7185463956 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1733#issuecomment-7185463956). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-26T07:26:41Z. --- 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)
OreoFR commented 2026-11-28 21:53:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:53:52Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 65f0730e5
  • Test: python -I tests/semantic/test_lds_src2.py
  • Red on main: 5 OK
  • Green with the PR: 5 OK
  • Verdict: NO RED (the targeted case, an LLVM_MC under WSL, is not exercised)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246352543 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733#issuecomment-7246352543). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:53:52Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `65f0730e5` - Test: `python -I tests/semantic/test_lds_src2.py` - Red on main: 5 OK - Green with the PR: 5 OK - Verdict: NO RED (the targeted case, an LLVM_MC under WSL, is not exercised) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 02:00:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:00:23Z.


Verification Report (65f0730e55 merged into main 59e65849b0)

  • Environment: Windows 11, Python 3.12.10, llvm-mc 21.x (amdgcn target), NVIDIA GeForce RTX 3090 (driver 610.88). No game data used (check_no_game_data.py rc=0).
  • Diff & Merge Audit: Merged 65f0730e55 cleanly into origin/main (59e65849b0, 0 conflicts; 1 file changed: tests/semantic/test_lds_src2.py). Replacing the tempfile.TemporaryDirectory() file path argument with input=text (encoding="ascii", errors="replace") matches _llvm_mc()'s stdin probe in the same module and tools/shader_disasm.py.

Red -> Green Results

Configuration LLVM_MC Mode Result
Base main (59e65849b0) Stdin-only WSL-style wrapper rejecting Windows host file arguments RED (rc=1, FAILED (failures=63) across the 3 EncodingTests methods)
main + #1733 (65f0730e55) Stdin-only WSL-style wrapper rejecting Windows host file arguments GREEN (Ran 5 tests in 10.038s — OK)
main + #1733 (65f0730e55) Native Windows llvm-mc.exe GREEN (Ran 5 tests in 3.906s — OK)
  • Verdict: PASS (clean merge with current main, reproduces the 63-subtest Windows-path failure when LLVM_MC cannot open host paths, and passes 5/5 in both modes).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7249150206 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733#issuecomment-7249150206). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T02:00:23Z. --- ### Verification Report (`65f0730e55` merged into `main` `59e65849b0`) - **Environment**: Windows 11, Python 3.12.10, `llvm-mc` 21.x (`amdgcn` target), NVIDIA GeForce RTX 3090 (driver `610.88`). No game data used (`check_no_game_data.py` `rc=0`). - **Diff & Merge Audit**: Merged `65f0730e55` cleanly into `origin/main` (`59e65849b0`, 0 conflicts; 1 file changed: `tests/semantic/test_lds_src2.py`). Replacing the `tempfile.TemporaryDirectory()` file path argument with `input=text` (`encoding="ascii"`, `errors="replace"`) matches `_llvm_mc()`'s stdin probe in the same module and `tools/shader_disasm.py`. #### Red -> Green Results | Configuration | `LLVM_MC` Mode | Result | |---|---|---| | Base `main` (`59e65849b0`) | Stdin-only WSL-style wrapper rejecting Windows host file arguments | **RED** (`rc=1`, `FAILED (failures=63)` across the 3 `EncodingTests` methods) | | `main` + `#1733` (`65f0730e55`) | Stdin-only WSL-style wrapper rejecting Windows host file arguments | **GREEN** (`Ran 5 tests in 10.038s` — `OK`) | | `main` + `#1733` (`65f0730e55`) | Native Windows `llvm-mc.exe` | **GREEN** (`Ran 5 tests in 3.906s` — `OK`) | - **Verdict**: **PASS** (clean merge with current `main`, reproduces the 63-subtest Windows-path failure when `LLVM_MC` cannot open host paths, and passes 5/5 in both modes). AI-assisted.
enlight3d commented 2026-11-30 19:18:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-30T19:18:18Z.


RUN (independent run on Windows, #1733 head 1271b2433, tested as it is; it merges cleanly into main 8f41d7d01 per git merge-tree --write-tree. CI on 1271b2433: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.)

Commands, from the repository root: python -I scripts/run_semantic_tests.py tests/semantic -p test_lds_src2.py, with LLVM_MC set four ways:

  • A native Windows llvm-mc with the AMDGPU target: main df151972c 5 tests OK; head 5 tests OK. Feeding stdin changes nothing for a native llvm-mc.
  • WSL, simulated. This machine's WSL Ubuntu has no llvm-mc, so I could not run the PR's real case. Instead, LLVM_MC pointed at a small local wrapper that behaves like llvm-mc inside WSL: it reads stdin, but cannot open a Windows file path (it prints "No such file or directory"); otherwise it runs the native llvm-mc. With it, main fails 1 file with 63 subtest failures, all "No such file or directory": the same 63 the PR reports with the real WSL llvm-mc. The head passes, 5 tests OK.
  • No llvm-mc (LLVM_MC pointing at nothing): the head is OK, with 3 tests skipped (the llvm-mc ones, as before) and 2 passed (python -I tests/semantic/test_lds_src2.py -v).
  • Not covered: a real llvm-mc inside WSL.

Python 3.13.12 (python -I), run at low priority.
Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB (not used), NVIDIA 621.40.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7289173581 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733#issuecomment-7289173581). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-30T19:18:18Z. --- RUN (independent run on Windows, #1733 head 1271b2433, tested as it is; it merges cleanly into main 8f41d7d01 per `git merge-tree --write-tree`. CI on 1271b2433: change-scope, check, linux-python-and-viewer, no-game-data and semantic-tests all pass.) Commands, from the repository root: `python -I scripts/run_semantic_tests.py tests/semantic -p test_lds_src2.py`, with `LLVM_MC` set four ways: - A native Windows llvm-mc with the AMDGPU target: main df151972c 5 tests OK; head 5 tests OK. Feeding stdin changes nothing for a native llvm-mc. - WSL, simulated. This machine's WSL Ubuntu has no llvm-mc, so I could not run the PR's real case. Instead, `LLVM_MC` pointed at a small local wrapper that behaves like llvm-mc inside WSL: it reads stdin, but cannot open a Windows file path (it prints "No such file or directory"); otherwise it runs the native llvm-mc. With it, main fails 1 file with 63 subtest failures, all "No such file or directory": the same 63 the PR reports with the real WSL llvm-mc. The head passes, 5 tests OK. - No llvm-mc (`LLVM_MC` pointing at nothing): the head is OK, with 3 tests skipped (the llvm-mc ones, as before) and 2 passed (`python -I tests/semantic/test_lds_src2.py -v`). - Not covered: a real llvm-mc inside WSL. Python 3.13.12 (`python -I`), run at low priority. Machine: Windows 11 Pro 26300, i9-13900K, 64 GB, RTX 3090 24 GB (not used), NVIDIA 621.40.
aslan2142 commented 2026-12-01 11:29:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:29:05Z.

Review: APPROVED


LGTM. Feeding llvm-mc via input=text on stdin in tests/semantic/test_lds_src2.py (matching tools/shader_disasm.py) cleanly fixes WSL LLVM_MC execution and drops the unused tempfile import. Clean-room verified, 5/5 CI green, and independently verified on both native and WSL llvm-mc. Merging.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130319821 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1733#pullrequestreview-6130319821). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:29:05Z. **Review:** APPROVED --- LGTM. Feeding `llvm-mc` via `input=text` on stdin in `tests/semantic/test_lds_src2.py` (matching `tools/shader_disasm.py`) cleanly fixes WSL `LLVM_MC` execution and drops the unused `tempfile` import. Clean-room verified, 5/5 CI green, and independently verified on both native and WSL `llvm-mc`. Merging. *(AI-assisted review.)*
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!1733
No description provided.