shaders stage: a truncated disassembly listing makes 1 of 26,503 shaders fail translation #2539
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?
Imported from ubiquitarianism/leonida. Originally posted by LGlong1 on 2026-11-28T01:21:09Z.
Summary
On a fresh full build (
--stages shaders,runtime), theshadersstage stops with:The translating shard's summary shows the reason:
1 branch without encoding. The shader is one whose disassembly listing was truncated at the end of the file, so its last instruction has no encoding comment and the translator refuses it. Re-disassembling the same FSSM gives a complete listing, and translating that passesspirv-val.Environment
spirv-as/spirv-val, ffmpegLLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc(Ubuntu LLVM 21.1.8, AMDGPU target present; tested withs_endpgm)d442851(the build was run on this;mainhas moved since)python -I make_game.py --game <copy> --out <out> --work <work> --stages shaders,runtime --jobs 8 --no-tuiWhat happened
@ped_standard_eye_emissive_CS_RaytracingResolve_f21e9178_Wrapped(compute).<work>/shaders/dxbc/disasm/is cut short: the file ends in the middle of the final line's encoding comment (the text stops at; encod), and the listing has nos_endpgm. The repaired listing for the same FSSM is much longer (2,432 lines vs 2,266) and ends withs_endpgm.tools/shader_disasm.pyon that single.fssm, with the sameLLVM_MC, writes a complete listing, andtools/rdna2spirv.pyon it translates the shader and passesspirv-val(1/1).shadersstage completes (26,503/26,503) and the rest of the build continues.Notes
tools/shader_disasm.pywrites to a temporary file andos.replace()s it into place, so a partial file should not normally be published; this happened on a fresh full run (no--skip-existing), with--jobs 8.1 branch without encoding); the affected shader's name was not printed anywhere I could find, so I located it by comparing the carved.dxbcnames against the translated index.Possible fixes
disassembly_status/disassembly_listings), also check that each listing ends with a complete final line ands_endpgm; re-runshader_disasm.pyfor the listings that fail the check.llvm-mc's output), a retry for a listing that fails the completeness check would cover it.I can test a patch against this copy (the original
.dxbc/.fssmare kept locally; I did not attach any game files or generated shader text here).Imported from ubiquitarianism/leonida. Originally posted by LGlong1 on 2026-11-28T01:29:17Z.
Two notes from retesting, in case they save someone time:
v_fma_mixliteral cut in the text only, closed), but it is the same family of "the text is cut" problem, and the same LLVM version. #1923 (build llvm-mc 23.1.5 by default) may be relevant.tools/shader_disasm.pyon that single FSSM with the same LLVM 21.1.8 and got a complete listing (2,432 lines, ends withs_endpgm), while the build's run (8 jobs,--unpack-index) had left the truncated one. So the cut may be in the parallel disassembly path or its publish step (#861, #908) rather than in llvm-mc itself; the missings_endpgmcheck would catch either way.I can rerun the same build with llvm-mc 23.1.5 if it would help narrow it down.
Imported from ubiquitarianism/leonida. Originally posted by KoabraFang on 2026-11-28T02:10:58Z.
IDK what's going on just wanted to say keep up the work ;) we believe in you
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:06:37Z.
Closing this issue because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the report/contribution! If you believe this issue was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.