Repository navigation
shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5) - #7529
Conversation
…e executable creates with slot 67 (RT-5) The retail executable calls Xbox device slot 67 (DeserializeComputePipelineStateX) itself during boot, and every call fails with "no translated compute shader": the build only translates the FidelityFX DLL's 29 FSPX programs. The programs come from the pipeline library in shaders.rpf (docs/shader_library.md), which the title reads through DirectStorage zlib requests: a compute record's state blob, blob, program and layout blob are FSPX kinds 0, 1, 6 and 7, the four pairs of the slot-67 description. - tools/shader_library.py writes each compute program's record state blob as fspx/<name>.state, so the index gets fspx_state_sha256 (slot 67 always passes kind 0). In 1.0.2.1 each of the 2,684 compute programs has one. - make_game.py's shaders stage gets library_shaders(): shader_library.py --stages cs --disasm --carve into <work>/shaders/library, rdna2spirv.py into <work>/shaders/spirv/library, with the stage's wave64 and fallback flags, the FSPX step's key-clash check and its own library_build.json for reuse. - ShaderLibrary::load also reads <dir>/library/index.json; its entries are found by the same two keys. Tests: test_library_shaders_stage.py (tool calls, reuse, invalidation, empty index, key clash), test_shader_library.py (.state contents and both keys), shader_library_test (library entries found by code and state key, a broken or missing index leaves the others).
|
Independent Windows + MSVC/Python review and test of Setup: Windows 11 Pro ( Tests run (synthetic only):
Code notes:
AI-assisted review and test. |
|
Confirmed the earlier stale-output note with a synthetic reproducer on b93ffa5, Windows x64 CPython 3.12.10. I used the existing LibraryStage mocks to build a translated index, then reused the same work directory with a separate empty game directory. library_shaders ran no tools and left both library/index.json and library_build.json byte-identical. The stock 6 stage tests and 10 shader-library tests pass; the existing missing-archive test starts with an empty work directory, so it does not cover this reuse case. A follow-up regression can seed the old output before invoking the stage without the archive. AI-assisted testing; no game files. |
|
I confirmed the minimal fix locally on b93ffa5: call drop(translated, settings_file) in the missing-archive branch of library_shaders, matching bvh_shaders. The new synthetic regression populates a work directory, switches to an empty game directory, and asserts no tool calls and no old index or build marker. It failed on the unmodified PR, then passed with the one-line fix. Windows CPython 3.12.10: library stage 7/7, shader library 10/10, FSPX stage 22/22. AI-assisted testing; no game data. |
|
Hit counts from a retail boot integration run, as you asked. Linux, Wine 11.21, clang-cl + xwin, GTX 1650 Mobile, own 1.0.2.1 copy. The tree is
So the lookup works with both keys on the retail payloads. What's left at slot 67 here is translator coverage, mostly AI-assisted (Claude Code). Counts and tool reason names only; no game files, hashes or addresses. |
|
Tested b93ffa5 with my own 1.0.2.1 copy on Arch Linux (kernel 6.18), Python 3.14.10, llvm-mc 23.1.5, SPIRV-Tools v2026.4, NVIDIA GeForce GTX 1660 (Turing, subgroups 32..32, driver 620.73.04): the step works end to end, with full-corpus counts and a retail hit count below.
Retail run (Wine 11.22, Not run: the PR's unit tests and AI-assisted run (Claude). Counts only; nothing from the game leaves this machine. |
Adapt the translator change from ItsNotRexed#7165 to ItsNotRexed#7529 while preserving the FSSM/FSPX dispatch metadata lookup. AI-assisted integration and verification.
|
Tested b93ffa5 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
|
Independent retail check, Windows 11 x64 / MSVC 19.44 / RTX 5070 Ti (621.24). Ran the library-only stage at |
Claimed in the coordination issue as: #7049 (comment) (the open half of @Pipodi's slot 67 finding)
Depends on: none.
What and why
The retail executable calls Xbox device slot 67 (
DeserializeComputePipelineStateX) itself during boot. Every call fails withno translated compute shader(@Pipodi's finding, #6982), because the build only translates the FidelityFX DLL's 29 FSPX programs.The programs come from the pipeline library in
shaders.rpf(docs/shader_library.md). It's stored as 64 KiB zlib streams at 16-byte-aligned offsets, the form a DirectStorage zlib request reads (#7180). A compute record's state blob, blob, program and layout blob are FSPX kinds 0, 1, 6 and 7. Those are the four pointer/size pairs of the slot-67 description, and the runtime already looks such programs up byfspx_code_sha256andfspx_state_sha256(docs/fspx.md). Nothing in the build produced them:tools/shader_library.pywrites each compute program's record state blob asfspx/<name>.state, so the translated index getsfspx_state_sha256. Slot 67 always passes kind 0, and without that key the lookup refuses the call. Measured on my 1.0.2.1 copy: 2,693 compute records over 2,684 programs, and every program has exactly one state blob, so one.stateper program is complete and unambiguous.make_game.py: theshadersstage getslibrary_shaders(), after the FSPX and BVH steps. It runsshader_library.py --stages cs --disasm --carveinto<work>/shaders/library, thenrdna2spirv.pyinto<work>/shaders/spirv/librarywith the stage's--wave64-emulateand fallback flags. It reuses the FSPX step's key-clash check, and has its ownlibrary_build.jsonfor reuse (shaders.rpf, the tools, the translator,llvm-mc, the wave64 mode and the flags). It runs whole, like the FSPX step.ShaderLibrary::loadalso reads<dir>/library/index.json(in the folder loop withfspxandbvh). Its entries, namedlibrary/<name>, are found by the same two keys and counted with the FSPX ones infspx_size().docs/shader_library.md(the.stateoutput and the build step),docs/fspx.md(build and run-time lookup).Graphics pipelines (device slot 57, the current stop) are not touched.
Tested
Windows 11 (26300), MSVC 14.52 (VS 2026), RelWithDebInfo, NVIDIA RTX 3060 (driver 610.88), Vulkan SDK 1.4.363, llvm-mc 21.1.8 (AMDGPU).
tests/test_library_shaders_stage.py(new, 6 tests): the tool calls and their arguments, reuse, re-translation when the archive,llvm-mc, the wave64 mode, the flags or the translator change, an empty index re-translated with stale modules dropped, a key clash failing with no index left, and no archive skipping the step.tests/test_shader_library.py(10): plus the compute.statecontents, no.statefor a graphics program, and both keys fromshader_meta.shader_library_test: library entries found by code and state key next tofspx/andbvh/, another state refused, a broken or missinglibrary/index.jsonleaving the others loaded.tests/test_fspx_shaders_stage.pyandtests/test_bvh_shaders_stage.pyunchanged and passing;compileallclean.shader_library.py --stages cswrote 2,684.code, 2,684.jsonand 2,684.state. A 200-program slice throughrdna2spirv.py --wave64-emulategave 158 translated modules, allcs, all with bothfspx_code_sha256andfspx_state_sha256. That's about the 68.7% CS rate indocs/shader_library.md§5.--runto slot 67. My local chain stops earlier, atXMemAllocatePhysicalPages. @Pipodi, @KkelebekK, your boot-integration runs reach slot 67, if you can check the hit count with this step's output.tests/test_docs_links.pyis red onmainalready (docs/dev-tools.md's anchor, claimed by @Unix-Epoch); this PR adds no failure.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)