mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:25:52 +01:00
[PR #1923] scripts: build llvm-mc 23.1.5 by default, so the pipeline library translates #1931
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1931
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1923
Author: @fiestorra
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:carry/llvm-mc-23-default📝 Commits (2)
92cdd35scripts, tools: build llvm-mc 23.1.5 by default, so the pipeline library translates7362994docs: LLVM 23 is what the shaders stage needs, and a test pins the script's default📊 Changes
12 files changed (+73 additions, -32 deletions)
View changed files
📝
README.md(+11 -8)📝
docs/design.md(+16 -5)📝
docs/linux.md(+5 -2)📝
docs/testing.md(+8 -1)📝
make_game.py(+1 -1)📝
scripts/build_llvm_mc.ps1(+7 -1)📝
tests/test_llvm_source_version.py(+11 -0)📝
tests/test_make_game_pipeline_preflight.py(+1 -1)📝
tests/test_make_game_preflight.py(+2 -2)📝
tests/test_mc_command.py(+3 -3)📝
tools/mc_command.py(+7 -7)📝
tools/shader_disasm.py(+1 -1)📄 Description
Claimed in the coordination issue as: LIBRARY-TRANSLATION-GAP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7166696189)
What and why
scripts/build_llvm_mc.ps1built LLVM 21.1.8 by default. That version'sgfx1013decoder cannot decode 840 of the2,684 compute programs in the pipeline library of 1.0.2.1: their listings carry 79,490 rejected words (and 8,310
exp invalid_target_Nlines), the translator refuses all of them asfall-through into undecodable words, and theshadersstage keeps 1,844 of 2,684. LLVM 21 does translate all 26,503 shaders ofshaders.rpf; the pipeline libraryis the part it loses.
The same bytes disassembled with LLVM 23.1.5 (the release
docs/testing.mdand the corpus runs already name) have norejected word in those 840, and 839 of them translate and pass
spirv-val; the 840th wantss_sethalt, which thetranslator does not implement, under either version.
So this changes the helper's default
-Versionto 23.1.5, the docs that name the minimum version (README.md,docs/design.md,docs/testing.md,docs/linux.md), and the three user-facing messages that still said 21+:make_game.py'sshaderspreflight,shader_disasm.py's probe error andmc_command.py's install hint (the sametext is used when the fixture assembler is missing, but recommending 21+ there sends users to the version that loses
the library).
tests/test_make_game_pipeline_preflight.py,tests/test_make_game_preflight.pyandtests/test_mc_command.pyasserted those texts and are updated with them.It is not a decoder workaround: #998 and #1712 patch around LLVM 21 in
tools/and are untouched here; this removesthe cause for anyone who builds
llvm-mcwith the helper.Tested
All numbers on
main71a769d7d,-mcpu=gfx1013,--stages cs, 1.0.2.1, withllvm-mc21.1.8 at%USERPROFILE%\.leonida\llvm-mcand 23.1.5 at%USERPROFILE%\.leonida\llvm-mc-23(native Windows builds from thellvmorg-21.1.8andllvmorg-23.1.5tags).invalid instruction encodingwords and 8,310exp invalid_target_Nwith 21.1.8;0 and 0 with 23.1.5 (
library.jsontotals: 1,844 of 2,684).spirv-val(was 0/840). Therefusal is
s_sethalt, the same with the 21.1.8 listing, so it is not a decode difference.prints some operands differently; they still carry 1,317 known data words from 1,887) and 1,674 of 1,674 pass,
the other 170 are byte-identical. So the stage goes from 1,844/2,684 to 2,683/2,684, the last being
s_sethalt.tests/test_docs_*,tests/test_make_game_preflight.py,tests/test_make_game_pipeline_preflight.py,tests/test_mc_command.py,tests/test_shader_disasm.py,tests/test_llvm_source_version.py,tests/test_llvm_install_*.py,tests/test_build_llvm_mc_*.py,tests/test_build_percent_path.py: pass.python -m compileallandgit diff --check: clean. No unit test covers the default tag: it downloads and buildsLLVM, which CI cannot do.
What this does not prove: the helper itself was not rebuilt here; the 23.1.5 binary measured is a native Windows build
from the
llvmorg-23.1.5tag on this machine (build log endsrc=0). The 26,503-shader corpus was not re-measuredwith 23.1.5 in this run (the README's 23.1.5 rerun covers it). Whether
s_sethaltcan be expressed in SPIR-V is notinvestigated. Every module was checked with
spirv-val; none was run on a GPU.GPUs tested: n/a (no GPU test; translation and
spirv-valonly)AI-assisted: yes (DeepSeek Harness)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Written with an AI assistant.
Why the version matters beyond the pipeline library
Measured on the retail title afterwards, and it is stronger than the translate count the description uses:
E_INVALIDARGat device slot 67 (Xbox DeserializeComputePipelineStateX), 847 programs short.So without this change the
shadersstage silently produces a library that is 847 compute programs short, and every pipeline state that uses one of them fails at creation among ~25,000 that succeed. The failures are per-call log lines, which is why they read as noise.Details, with the counts and the method: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7184770128 and the like-for-like control in the next comment.
The three red jobs in the current run (
linux-gpu-tools,macos,windows) are analysed in the thread below and are not from this diff: thelinux-gpu-toolscompile error is in code identical onmain,cs_imgatomic_extis the fixture owned by #1518, andvk_xdxr_postbuild_readbackis a runtime test this branch does not touch.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.