Skip to content

shaders stage: a truncated disassembly listing makes 1 of 26,503 shaders fail translation #2539

Backlog

Description

@LGlong1

Summary

On a fresh full build (--stages shaders,runtime), the shaders stage stops with:

ERROR: shaders: the translation index holds 26502 of the 26503 carved shaders (1 were refused or failed spirv-val, listed in this stage's output): a port built from it would lack them. Fix the translator for that class and translate again

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 passes spirv-val.

Environment

  • Windows 10 22H2 (10.0.19045)
  • AMD RX 6750 GRE 12 GB, Vulkan through the current Adrenalin driver
  • Python 3.12, Visual Studio 2022 + Windows SDK 10.0.26100, Vulkan SDK for spirv-as/spirv-val, ffmpeg
  • LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc (Ubuntu LLVM 21.1.8, AMDGPU target present; tested with s_endpgm)
  • commit d442851 (the build was run on this; main has moved since)
  • command: python -I make_game.py --game <copy> --out <out> --work <work> --stages shaders,runtime --jobs 8 --no-tui

What happened

  1. The missing shader is @ped_standard_eye_emissive_CS_RaytracingResolve_f21e9178_Wrapped (compute).
  2. Its listing under <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 no s_endpgm. The repaired listing for the same FSSM is much longer (2,432 lines vs 2,266) and ends with s_endpgm.
  3. Re-running tools/shader_disasm.py on that single .fssm, with the same LLVM_MC, writes a complete listing, and tools/rdna2spirv.py on it translates the shader and passes spirv-val (1/1).
  4. After replacing that one listing, re-disassembling and adding the entry to the translation index, the shaders stage completes (26,503/26,503) and the rest of the build continues.

Notes

  • tools/shader_disasm.py writes to a temporary file and os.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.
  • The shard that produced it reported only the reason count (1 branch without encoding); the affected shader's name was not printed anywhere I could find, so I located it by comparing the carved .dxbc names against the translated index.
  • The build's disassembly validation accepted the truncated listing, which is why the failure surfaced only later, in translation.

Possible fixes

  • When validating disassembly (disassembly_status/disassembly_listings), also check that each listing ends with a complete final line and s_endpgm; re-run shader_disasm.py for the listings that fail the check.
  • Print the failing shader's name with the reason in the shard summary (it would make this class much faster to find).
  • If the truncation can come from a race (two jobs writing the same listing, or a short read of 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/.fssm are kept locally; I did not attach any game files or generated shader text here).

Activity

  1. LGlong1 commented on Nov 28, 2026

    @LGlong1
    Author

    Two notes from retesting, in case they save someone time:

    I can rerun the same build with llvm-mc 23.1.5 if it would help narrow it down.

  2. KoabraFang commented on Nov 28, 2026

    @KoabraFang

    IDK what's going on just wanted to say keep up the work ;) we believe in you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions