* scripts, tools: build llvm-mc 23.1.5 by default, so the pipeline library translates
LLVM 21.1.8's gfx1013 decoder cannot decode 840 of the 2,684 compute
programs in the pipeline library of 1.0.2.1: their listings carry 79,490
undecodable words and 8,310 exp invalid_target_N lines, the translator
refuses all of them as "fall-through into undecodable words", and the
shaders stage keeps 1,844 of 2,684. LLVM 21 does translate all 26,503
shaders of shaders.rpf; the library is what it loses.
The same bytes under llvm-mc 23.1.5 have no rejected word in those 840,
and 839 of them translate and pass spirv-val (the last wants s_sethalt,
which the translator does not implement, under either version). The 1,844
that already translated were re-disassembled too: 1,674 listings change
and all 1,674 still translate, the other 170 are byte-identical, so the
stage goes from 1,844/2,684 to 2,683/2,684.
The build helper now builds 23.1.5 by default. The docs that name the
minimum version (README, docs/design.md, docs/testing.md, docs/linux.md)
and the three user-facing messages that still said 21+ (make_game.py's
preflight, shader_disasm.py's probe error, mc_command.py's install hint)
now say 23+, with the tests that assert those texts updated.
AI-assisted (DeepSeek Harness).
Written with an AI assistant.
* docs: LLVM 23 is what the shaders stage needs, and a test pins the script's default
cmd.exe expands %...% on every line of the generated _build.cmd (twice on a CALL line), and cl.exe rejects a % in the
path-valued /D definitions of the runtime's test targets (D8038) however it is quoted, so a checkout with % in its path
failed in configure, or a few hundred Ninja steps in once the batch was escaped (@ezbyDev's measurements in the original repository).
build_runtime.ps1 now stops before looking for Visual Studio when the checkout path has a %, and build_llvm_mc.ps1 when
-Temp has one, each naming the folder; docs/testing.md gets a Known-problems row. tests/test_build_percent_path.py runs
both scripts with such a path, with git, python and vswhere hidden so that a missing check can't start a real build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When cleaning up temporary build and clone directories on Windows, files with
the ReadOnly attribute (such as git objects in the sparse clone) cause
PowerShell's Remove-Item to fail with an UnauthorizedAccessException or
IOException, leaving gigabytes of files behind in $Temp.
Implement Remove-DirectoryRobust:
1. Recursively strip ReadOnly attributes across all nested files and directories.
2. Retry Remove-Item with backoff for brief file handle locks.
3. Fall back to Windows cmd rmdir /s /q which handles read-only attribute trees natively.
4. Add unit test in tests/test_build_llvm_mc_cleanup.py verifying teardown of read-only hierarchies.
build_runtime.ps1 and build_llvm_mc.ps1 started the generated batch with
`cmd.exe /c "path"`. cmd.exe drops those quotes when the path holds a
special character such as & or ^, then runs only the part before it, so a
checkout (build_runtime) or -Temp/%TEMP% (build_llvm_mc) in a folder like
`a & b` failed at once with "C:\...\a is not recognized". With /s and a
second pair of quotes, cmd.exe strips only the outer pair.
tests/test_build_batch_launch.py takes each script's launch line as written
and runs it on a stub batch in folders named plain, `a & b`, `a&b`, `x^y`,
`sp (x)` and `東京 & co`: the stub must run and its exit code (0 and 7) must
come back. It also checks that the old form fails there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LLVM 23's llvm/CMakeLists.txt stops with "LLVM libc is not found" when the
sparse checkout leaves out libc. Add it to the checkout, and to a source a
failed LLVM 23 run of the old script left in -Temp, so the same -Temp works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Some llvm/docs paths are about 150 characters. With a -Temp of about 100
characters the sparse checkout failed with "Filename too long" (Windows'
260-character limit) and the script stopped at "git sparse-checkout
failed.". The clone now sets core.longpaths=true in its own config only;
the user's global git config is untouched.
python from the Python install manager (the WindowsApps alias) doesn't see folders other programs create under %LOCALAPPDATA% or %APPDATA%, so the old default made make_game.py report llvm-mc missing and the fuzzers stop with WinError 2 although LLVM_MC named the file. The default -Dest is now %USERPROFILE%\.leonida\llvm-mc, and the preflight explains an LLVM_MC that points into AppData.
scripts/build_llvm_mc.ps1 sparse-clones the LLVM sources llvm-mc needs,
builds it alone with LLVM_TARGETS_TO_BUILD=AMDGPU, static CRT and the DIA
SDK off (its headers need ATL, which the C++ build tools don't always
include), checks it disassembles an s_endpgm for gfx1013, keeps only
llvm-mc.exe and sets LLVM_MC for the user. README, docs/design.md and the
make_game.py / shader_disasm.py hints mention it next to the WSL route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>