test_lds_src2: feed llvm-mc through stdin, so a WSL LLVM_MC can read it (TEST-LDS-SRC2-MC-STDIN) #1733
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1733"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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'sassemble()wrote the listing to a temporary file and passed its path to llvm-mc. WithLLVM_MCset to the WSL command thattools/mc_command.pyand 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 everyEncodingTestssubtest failed (llvm-mc: error: C:\...\in.s: No such file or directory) instead of checking the encodings. It now feeds llvm-mc through stdin, astools/shader_disasm.pydoes, and the now unusedtempfileimport 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)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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-25T10:24:29Z.
Review: COMMENTED
Independent A/B at
3d910f1fagainst57ba40bd. I ran the Windows CPython 3.12.1 semantic runner withLLVM_MCinvoking 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.
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.pywith the native llvm-mc: 5/5 OK at this head, and also 5/5 OK withmain's version of the file (as expected, a native llvm-mc reads the temp file fine).LLVM_MCwrapper 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:main'stest_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_themandtest_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.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).
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 onlytests/semantic/test_lds_src2.py.Re-ran locally on Windows with
LLVM_MC= WSL llvm-mc 21.1.8:test_lds_src2is 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):
cs_dpp_cmp, "dpp variant ... not supported"): fails on main too with llvm-mc 21.1.8. It comes from theShaderhelper intests/conftest.py, which already used stdin, not from this PR.test_every_stdlib_runner_calls_its_test_functions): fixed on main by #1561, passes on the merge.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)
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:53:52Z.
Verified by OreoFR
3408969a7+ PR head65f0730e5python -I tests/semantic/test_lds_src2.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T02:00:23Z.
Verification Report (
65f0730e55merged intomain59e65849b0)llvm-mc21.x (amdgcntarget), NVIDIA GeForce RTX 3090 (driver610.88). No game data used (check_no_game_data.pyrc=0).65f0730e55cleanly intoorigin/main(59e65849b0, 0 conflicts; 1 file changed:tests/semantic/test_lds_src2.py). Replacing thetempfile.TemporaryDirectory()file path argument withinput=text(encoding="ascii",errors="replace") matches_llvm_mc()'s stdin probe in the same module andtools/shader_disasm.py.Red -> Green Results
LLVM_MCModemain(59e65849b0)rc=1,FAILED (failures=63)across the 3EncodingTestsmethods)main+#1733(65f0730e55)Ran 5 tests in 10.038s—OK)main+#1733(65f0730e55)llvm-mc.exeRan 5 tests in 3.906s—OK)main, reproduces the 63-subtest Windows-path failure whenLLVM_MCcannot open host paths, and passes 5/5 in both modes).AI-assisted.
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 main8f41d7d01pergit merge-tree --write-tree. CI on1271b2433: 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, withLLVM_MCset four ways:df151972c5 tests OK; head 5 tests OK. Feeding stdin changes nothing for a native llvm-mc.LLVM_MCpointed 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.LLVM_MCpointing 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).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.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:29:05Z.
Review: APPROVED
LGTM. Feeding
llvm-mcviainput=texton stdin intests/semantic/test_lds_src2.py(matchingtools/shader_disasm.py) cleanly fixes WSLLLVM_MCexecution and drops the unusedtempfileimport. Clean-room verified, 5/5 CI green, and independently verified on both native and WSLllvm-mc. Merging.(AI-assisted review.)