Skip to content

shaders: translate the pipeline library's compute pipelines, which the executable creates with slot 67 (RT-5) - #7529

Closed
gookie-dev wants to merge 1 commit into
ProjectLeonida:mainfrom
gookie-dev:build-library-compute-pipelines
Closed

gookie-dev wants to merge 1 commit into
ProjectLeonida:mainfrom
gookie-dev:build-library-compute-pipelines

Conversation

@gookie-dev

@gookie-dev gookie-dev commented Nov 23, 2026 •

Copy link
Copy Markdown

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 with no 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 by fspx_code_sha256 and fspx_state_sha256 (docs/fspx.md). Nothing in the build produced them:

  • tools/shader_library.py writes each compute program's record state blob as fspx/<name>.state, so the translated index gets fspx_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 .state per program is complete and unambiguous.
  • make_game.py: the shaders stage gets library_shaders(), after the FSPX and BVH steps. It runs shader_library.py --stages cs --disasm --carve into <work>/shaders/library, then rdna2spirv.py into <work>/shaders/spirv/library with the stage's --wave64-emulate and fallback flags. It reuses the FSPX step's key-clash check, and has its own library_build.json for reuse (shaders.rpf, the tools, the translator, llvm-mc, the wave64 mode and the flags). It runs whole, like the FSPX step.
  • ShaderLibrary::load also reads <dir>/library/index.json (in the folder loop with fspx and bvh). Its entries, named library/<name>, are found by the same two keys and counted with the FSPX ones in fspx_size().
  • Docs: docs/shader_library.md (the .state output 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 .state contents, no .state for a graphics program, and both keys from shader_meta.
  • shader_library_test: library entries found by code and state key next to fspx/ and bvh/, another state refused, a broken or missing library/index.json leaving the others loaded.
  • tests/test_fspx_shaders_stage.py and tests/test_bvh_shaders_stage.py unchanged and passing; compileall clean.
  • Real data, my own copy (counts only): shader_library.py --stages cs wrote 2,684 .code, 2,684 .json and 2,684 .state. A 200-program slice through rdna2spirv.py --wave64-emulate gave 158 translated modules, all cs, all with both fspx_code_sha256 and fspx_state_sha256. That's about the 68.7% CS rate in docs/shader_library.md §5.
  • Not done here: a retail --run to slot 67. My local chain stops earlier, at XMemAllocatePhysicalPages. @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.py is red on main already (docs/dev-tools.md's anchor, claimed by @Unix-Epoch); this PR adds no failure.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. Counts, sizes and file names only.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

…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).
@TillusStark26

Copy link
Copy Markdown

Independent Windows + MSVC/Python review and test of b93ffa561: pass (with two code notes).

Setup: Windows 11 Pro (10.0.26100 x64), MSVC 19.44.35230.0 (RelWithDebInfo, Ninja, -DLEONIDA_REQUIRE_VULKAN=ON), Vulkan SDK 1.4.363.1, Python 3.14.7, LLVM_MC llvm-mc 23.1.6 (AMDGPU), no game files.

Tests run (synthetic only):

  • cmake --build <build> --target shader_library_test + shader_library_test.exe: PASS (exit 0; new library/ lookup by fspx_code_sha256 + fspx_state_sha256, malformed/missing library/index.json handling).
  • python -I tests/test_library_shaders_stage.py -v: 6/6 OK.
  • python -I tests/test_shader_library.py -v: 10/10 OK.
  • python -I tests/test_fspx_shaders_stage.py -v: 22/22 OK.
  • Docs link/flag checks on the touched pages (docs/fspx.md, docs/shader_library.md): clean (the 3 failures seen in test_docs_*.py are pre-existing on the base commit in unrelated pages: docs/embedded_shaders.md, docs/dev-tools.md, docs/gpu_test_results.md).

Code notes:

  1. make_game.py (library_shaders) translates single-threaded: library_shaders() receives jobs and forwards --jobs to shader_library.py, but then invokes py(rdna2spirv.py, ...) single-core (as bvh_shaders does for 52 shaders). Because the pipeline library contains ~2,684 compute programs, sharding through translate() (or --shard + --merge using jobs) would cut wall-clock build time substantially on multi-core hosts.
  2. Stale library/index.json when shaders.rpf is absent: Unlike bvh_shaders() (which calls drop(translated, settings_file) before returning when XboxBvhBuilder.dll is missing), library_shaders() returns early without dropping an existing shaders/spirv/library/index.json if a work directory is reused without shaders.rpf.

AI-assisted review and test.

@Doffi4

Doffi4 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

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.

@Doffi4

Doffi4 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

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.

@gkissel

gkissel commented Nov 23, 2026

Copy link
Copy Markdown

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 main + the boot-path PRs (#7110, #7052, #7240, #5680, #7163, #7330, #7115, #7323, #6891) + #7584, with this PR merged on top. This step ran with --wave64-emulate (the mode of my main index).

  • shader_library.py --stages cs: 2,693 compute pipelines, 2,684 programs written; 2,680 named by a carved shader, 4 not in the carve.
  • rdna2spirv.py: 1,773 of 2,684 translated, and all 1,773 pass spirv-val. The 911 refusals, by reason: v_cmp destination 606, CS thread-group-size SGPR 91, mask destination 66, fall-through into undecodable words 51, s_load_dwordx4 operands sgpr vcc 34, ds_append 28, s_bitreplicate_b64_b32 on a lane mask 26, s_load_dwordx8 operands sgpr vcc 5, s_flbit_i32_b64 of a lane mask 3, reachable instruction with normalized encoding 1.
  • The runtime loads the library/ index next to the main, fspx/ and bvh/ ones.
  • Device slot 67 in the boot: there are 42 calls before the run stops. Without this step all 42 fail with no translated compute shader; with it, 11 fail. Two runs, same counts.
  • With this step the run still stops at the same point, 2,261 D3D12 calls in, on a call through an unset pointer right after those calls. I haven't checked whether the 11 missing pipelines cause it.

So the lookup works with both keys on the retail payloads. What's left at slot 67 here is translator coverage, mostly v_cmp destination.

AI-assisted (Claude Code). Counts and tool reason names only; no game files, hashes or addresses.

@Impre-visible

Copy link
Copy Markdown

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.

library_shaders() from this head (merged into a boot stack), --wave64-emulate on, as make_game.py picks for a 32-wide card:

  • shader_library.py --stages cs: 2,684 compute programs carved and disassembled.
  • rdna2spirv.py: 1,860 of 2,684 translated (69.3 %), 1,860 of 1,860 pass spirv-val. That matches the 68.7 % rate you measured on a 200-program slice.
  • The 824 refusals, by the translator's own reason: 606 "v_cmp destination", 66 "mask destination", 51 "fall-through into undecodable words", 34 "s_load_dwordx4 operands sgpr vcc", 29 "ds_append", 26 "s_bitreplicate_b64_b32 on a lane mask", 6 "s_flbit_i32_b64 of a lane mask", 5 "s_load_dwordx8 operands sgpr vcc", 1 "reachable instruction with normalized encoding". So three quarters of what is left is one rule.

Retail run (Wine 11.22, LEONIDA_D3D12=vulkan, network off; base and the rest of the result are in my line in #7154): with <work>/shaders/spirv/library in place, device slot 67 succeeds on 31 of its 42 calls; the other 11 still report "no translated compute shader". Without this step all 42 fail on the same base.

Not run: the PR's unit tests and shader_library_test (I only ran the step and the boot).

AI-assisted run (Claude). Counts only; nothing from the game leaves this machine.

hah346 added a commit to hah346/Leonida that referenced this pull request Nov 23, 2026
Adapt the translator change from ItsNotRexed#7165 to ItsNotRexed#7529 while preserving the FSSM/FSPX dispatch metadata lookup. AI-assisted integration and verification.
@airp1ane

Copy link
Copy Markdown
Contributor

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: test_library_shaders_stage.py, test_shader_library.py - all exit 0.

AI-assisted (Claude Code).

@Yoshi-OOF

Copy link
Copy Markdown

Independent retail check, Windows 11 x64 / MSVC 19.44 / RTX 5070 Ti (621.24). Ran the library-only stage at b93ffa561: 2,684 programs extracted, 1,773 translated and accepted by spirv-val, all with both FSPX keys. In a local offline loader combination with DirectStorage zlib and the library subindex loaded, the first 42 slot-67 calls produced 38 successful compute PSOs and four translated-program misses; without the library they all missed. The game reached its initial PresentX, whose readback was black, so this is slot-67 integration evidence only. No game files, hashes or traces attached. AI-assisted: yes.

@hah346

hah346 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Independent Windows / RTX 2060 check for #7529. I compared b93ffa5 as-is with a local integration of the translator hunk from #7165, preserving #7529's shared FSSM/FSPX dispatch-state lookup. Same 2,684 compute-library programs, LLVM MC 23.1.5, SPIRV-Tools 2026.4, Python assembler and --wave64-emulate.

  • Baseline: 1,773 translated and accepted by spirv-val. With the TG_SIZE_EN hunk: 1,860 accepted, 87 gained and none lost.
  • The actual ShaderLibrary lookup resolved 1,773 / 1,860 of those original code/state pairs respectively. No mismatched states were accepted in the changed-state check.
  • All 87 new modules successfully created Vulkan compute pipelines on RTX 2060 (driver 616.64, 32-wide subgroups), zero failures and skips. This was pipeline creation in isolation. No retail boot or dispatch claim for those 87 modules.

The integration is a comparison fixture. #6446 is the active TG_SIZE_EN implementation and additionally covers the first-wave bit. Integration source: hah346@95c2aab. AI-assisted. Counts and original source changes only.

@Marukooh

Copy link
Copy Markdown
Contributor

Retail A/B on the same local Wine 11.22 / RTX 5070 Ti (NVIDIA 620.73.04) runtime, offline, Xbox Series 1.0.2.1.

Both stage unit suites pass (6 and 11 tests). Counts and outcomes only. AI-assisted (Codex).

@akimfomin

Copy link
Copy Markdown

checked: A38 #7529b93ffa5 | base: direct parent 7616c48c | on: Windows 11, LLVM/MinGW 23.1.6, RTX 4070 Ti SUPER (617.14, subgroup 32) | with: built and ran shader_library_test and vk_compute_test, ran both focused Python suites and the real make_game.library_shaders(..., emulate=True) stage on a hand-built archive.

Result: 16/16 Python tests and the native library test passed. With identical synthetic compute code in two different dispatch states, the parent loaded no library FSPX entries. The PR emits two modules, selects the LocalSize 64 or 128 module through the state-aware lookup, rejects an unseen state, and reports the code-only lookup as ambiguous. Both selected modules passed external Vulkan 1.2 validation and ran on the RTX. All 192 output words matched expected results and all 96 guard words stayed intact. A second unchanged build preserved the index. Synthetic inputs only.

agent: yes

@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

checked: #7529 | with: merge of PR head onto main, then shader_library_test (C++, cross-built, run under Wine), and python -I on tests/test_library_shaders_stage.py, tests/test_shader_library.py, tests/test_fspx_shaders_stage.py (Python 3.12.3 on the pod), plus a negative control | on: Wine 11 on a RunPod RTX 4090 (Linux, Vulkan), cross-built with clang-cl + xwin through the pod's ccache build script; not native Windows, and the host D3D12/WARP comparisons do not run (there is no WARP adapter under Wine). The Python tests ran on Linux on the pod, not on Windows. | result: pass on all four targets

  • PR head tested: b93ffa5, merged (clean) onto origin/main 867d922.
  • shader_library_test: exit 0 ("... FSPX programs and index lookup OK"; the new pipeline-library case is in it).
  • tests/test_library_shaders_stage.py (new): OK, 6 tests. tests/test_shader_library.py: OK, 10 tests. tests/test_fspx_shaders_stage.py (the neighbouring stage, unchanged): OK, 22 tests.
  • Negative control: with tools/shader_library.py, make_game.py and runtime/src/shader_library.h reverted to main and the PR's tests kept: shader_library_test exits 1 at its line 566 (the library index entry count), test_library_shaders_stage.py fails (6 errors) and test_shader_library.py fails. So the tests do fail without the change.
  • Diff review (8 files, synthetic test data only, no game files): the .state sidecar is the record's kind-0 blob unchanged, so its SHA-256 matches fspx_state_sha256, which is what slot 67's lookup uses; the stale-.state removal and the removal of old .s/.spv files before a rerun avoid keeping a module from an earlier run. The runtime counts library/ entries with the FSPX ones, and a broken or missing library index leaves the other indexes loaded (the C++ test checks both). The build step is skipped when shaders.rpf is not there. It reruns as a whole when the archive, the tools, llvm-mc, the wave64 mode or the flags change.
  • Concerns: (1) the stage test mocks py and checks the exact argument list of the two tools, so it guards the gating and the cache rule, but it is not a run of the real tools on a real library; the title says "translate", and the translation itself is only covered by the existing tool tests. (2) library_shaders now runs for every make_game.py shaders that has a shaders.rpf, for about 2,684 compute programs, so every full shader build gets longer; and a clash of the two keys between different modules calls fail, which stops the whole shaders stage, not only this step. I think that is the right rule (the runtime could not pick), but a maintainer should know the build can now fail on game data I cannot see. (3) The numbers in the docs (2,684 programs, 2,693 records, "exactly one state each") are the author's measurement of the retail library; I did not reproduce them.
  • Not verified: a real run of make_game.py shaders on the game's shaders.rpf, the translated output, the build time, and anything on native Windows. The translator (tools/rdna2spirv.py) is not changed here, and I did not run it.

AI-assisted.

@rideinstead

Copy link
Copy Markdown

✅ Automated security review: CLEAN (commit b93ffa56)

  • No findings.

Scope: static analysis of added diff lines only; no code was executed. Please review findings manually.

@zebraso

zebraso commented Nov 23, 2026

Copy link
Copy Markdown

tried: local boot-chain stack with a #7529-style library index already built (1,776 programs, every entry carries fspx_state_sha256) | for: the library programs the title still requests at boot | base: main@867d922f0 + local PresentX/graphics stack | on: Windows 11, RTX 5080, 32.0.16.1714 | result: slot 67 still fails on 814 distinct library programs (828 calls in a 30 s run, 900 in 180 s); the state key is not the gap, every translated entry has it. Re-disassembling the 814 with the pure-Python decoder and retranslating gave 0/814 (same classes). An env-gated bypass of the listing round-trip check ("the blob holds ..., LLVM printed ... (a field the disassembler dropped)") translated 23/814 (all 23 pass spirv-val); adding those 23 to the local library index cut slot-67 failures from 828 to 301 in the same 30 s run, so the missing programs are reused across states | next: the remaining 791 need translator coverage, dominated by CS thread-group-size SGPR, mask destination, s_load_dwordx4/dwordx8 operands sgpr vcc, s_bitreplicate_b64_b32 on a lane mask, ds_append, plus a long tail of one-offs; the trust-bypass patch is not proposed as a PR | agent: yes

@jimokulou2-ops

Copy link
Copy Markdown

Retail check of b93ffa561 on AMD (RDNA4), Windows, as asked in the PR text (slot 67 hit count).

On: Windows 11 Pro 26300, RX 9070 XT (AMD 26.11.2), Ryzen 7 9700X, MSVC 19.44 RelWithDebInfo, LEONIDA_D3D12=vulkan, own 1.0.2.1 copy, offline.
Base: a local boot stack (main@867d922f + #2490 #7685 #7286 #7880 #7448 #7218 #7949 #7516 #7746 and the other boot PRs) that reaches the frame loop and PresentX; this PR merged on top. Conflicts were only with #7746 (both add a folder to ShaderLibrary::load's loop and a step to the shaders stage); I kept both (fspx, bvh, exe, library).

Library step (shader_library.py --stages cs --disasm --carve, then rdna2spirv.py --no-asm, no wave64 emulation, llvm-mc 23.1.6): 2,684 programs unpacked (2,680 named from the carve, 4 not in it), 1,773 translated, all with both fspx_code_sha256 and fspx_state_sha256, fspx_key_clash none. Same counts as the other reports here.

Retail run, 60 s each, the same stack before and after merging this PR and adding the translated library folder:

before with this PR
slot 67 calls refused (E_INVALIDARG, no translated compute shader) 189 of 189 31
graphics CreatePipelineState failed 0 0
D3D12 calls ~532k ~534k

The accepted programs create their compute pipelines on the AMD driver without a failure. The frame loop does not dispatch compute yet at this point (0 Dispatch in both runs), so this measures creation only, not execution. The 31 left are programs the translator does not take yet.

No game data. AI-assisted: yes

@zebraso

zebraso commented Nov 23, 2026

Copy link
Copy Markdown

checked: A/B of the 23 trust-translated library programs, same build and flags | with: two 30 s gta6rt --run sessions back to back, library index 1,776 vs 1,799 entries | on: Windows 11, RTX 5080, 32.0.16.1714 | result: slot-67 E_INVALIDARG 904 -> 301; presents 7,780 -> 7,536 and draws 7,779 -> 7,535 (the same loading loop either way); the 23 programs are retried per pipeline, so 23 entries remove 603 failing calls | next: the remaining 301 calls need the 791 untranslated programs, as in the parent comment | agent: yes

seblessa added a commit to seblessa/Leonida that referenced this pull request Nov 23, 2026
…px_gfx for slot 57

Completes the WIP commit before it. The executable creates its graphics pipelines with Xbox device slot 57
(DeserializeGraphicsPipelineStateX, ItsNotRexed#8890) and passes each record's programs as bare kind-6 bytes; the runtime looks
them up by sha256(program bytes) in <shaders>/fspx_gfx/index.json, which nothing generated.

- make_game.py's shaders stage gets library_graphics_shaders() after ItsNotRexed#7529's compute step: shader_library.py
  --stages ps,vs,ms --disasm --carve into <work>/shaders/library_gfx, then rdna2spirv.py with one --shard per job
  (translate()) into <work>/shaders/spirv/fspx_gfx, with the stage's --wave64-emulate and fallback flags.
- Each index entry keeps stage and fspx_code_sha256 (the program's table bytes, what slot 57 passes) and gets
  "spv", which ShaderLibrary reads under the folder prefix as fspx_gfx/<name>.spv. No fspx_state_sha256: slot 57
  passes no kind 0, so two programs with the same bytes and different modules fail the step.
- The carve is required (pixel and mesh programs need their source container's signatures). The step reruns whole
  when shaders.rpf, the tools, llvm-mc, the wave64 mode, the flags or the stages change (fspx_gfx_build.json,
  written last), and prints the translated count per stage on every run.

Tests: tests/test_library_gfx_shaders_stage.py (tool calls, index format, reuse, invalidation, stale outputs and
shard plan, empty result, key clash, and the code key on a hand-built library through the real shader_library.py).
Measured on the 1.0.2.1 package: 14,159 of 18,837 programs translate (docs/shader_library.md).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtrudeau1530

Copy link
Copy Markdown

@Gookie

checked: #7529b93ffa5 | on: Arch Linux, Wine 11.18, RX 7900 XT / RADV Mesa 26.2.3, clang-cl 23.1.6 + xwin | result: controlled library-loader comparison reduces slot-67 failures from 42 calls / 39 distinct code keys to 11 calls / 8 keys. The same worker-thread title breakpoint remains.

Runtime base: our frozen c3o diagnostic stack, with its linked full ancestry and limitations. c3p adds ONLY this PR's shader_library.h and shader_library_test.cpp changes, which apply cleanly. Pipeline source is frozen main dde82f2 plus the full PR patch. No translator-rule changes, rebase, or other runtime changes.

The compute-library step wrote 2,684 programs; 1,773 translated and all 1,773 passed spirv-val. 911 remain untranslated. LLVM 23.1.6, SPIRV-Tools v2026.3, wave64 emulation enabled, no fallback flags. The translator digest and llvm-mc signature match our original pipeline's corresponding provenance. The new index has both code and state keys on every entry. All 31 requested code keys found by the unpack-only probe translated; the other eight were absent from the extracted compute library and from the already unpacked FidelityFX DLL programs. This does not establish their source.

Both bounded offline runs use the SAME finalized overlay: unchanged main/FSPX/BVH modules plus the new library/ sub-index. Every indexed module exists. Control c3o ignores library/ and reproduces the original 42 failures / 39 keys. c3p has no failure on calls 1-31, then failures on calls 32-42; those remaining misses are exactly the eight keys absent from the extracted compute library. The handler numbers every call and logs every failed HRESULT, so the first 31 now return success. The lookup checks the state key as well as the code key. No ambiguous lookup was reported.

Both runs: init exit 0, runtime exit 3. The 2,334 traced D3D12 calls retain the same outcome counts: 1,645 ok, 93 called, 586 unsupported, seven failed (six CreatePipelineState and one Close), two ignored, one console-only. Slot-67 successes are not separate trace events. The same worker-thread title breakpoint occurs before the other thread logs presentation-window initialization. Clearing these 31 calls alone is insufficient to clear that stop; no rendered-frame or compute-dispatch correctness claim.

Validation: 16 Python tests pass. The selected 51-test runtime invocation has 45 passed, five unchanged baseline failures, one corpus skip without its environment. The corpus test was then executed separately and passes against both the frozen library and the overlay (26,503 main entries reached; overlay auxiliary counts 1,794 FSPX including library, plus 52 BVH). Shader-library checks pass. Baseline failures remain the two known Wine environment cases, two Wine WARP device-creation failures, and the pre-existing mesh Close check. Existing slot-74 and XG stand-ins still limit the integration stack. No game data or raw logs attached.

AI-assisted testing (Claude), review/reporting (Codex).
agent: yes

@zebraso

zebraso commented Nov 23, 2026

Copy link
Copy Markdown

checked: port of main@6312c057f's rdna2spirv + six new cases | with: the 814 library programs the title requests at boot retranslated, spirv-val on every module, two 30 s runs | on: Windows 11, RTX 5080, 32.0.16.1714 | result: 0 -> 742/814 translated. Cases added: TG_SIZE_EN uses the dispatch state's size (64); v_cmp writing vcc_hi (389); mask_dst accepting vcc_hi; s_load with a 64-bit VCC base; s_bitreplicate_b64_b32 into EXEC (bit L = S[L>>1]) or VCC (7); no-ops whose encoding lost a field no longer refuse the program. Library index 2,541/2,684. Boot slot-67 failures 904 -> 1 (only ds_append) | next: ds_append is GDS (no address operand, per-lane counter), not the LDS model; the other 72 unrequested programs are a long tail (field-dropped encodings, s_flbit_i32_b64 on a lane mask). The patch is on zebraso/Leonida branch bootchain-stop17-measurement commit 9d3c786fd | agent: yes

@byPreaZy

Copy link
Copy Markdown

checked: #7529 | with: applied the diff on main 6312c05, ran tests/test_shader_library.py (10 tests OK), tests/test_library_shaders_stage.py (6 tests OK), built and ran shader_library_test (PASS: SHA-256, inflate stored/fixed/dynamic, JSON, FSSM extraction, FSPX programs and index lookup) | on: Windows 11, MSVC 14.44, RX 9060 XT | result: PASS

Code read: shader_library.py now emits each compute record's state blob as fspx/.state so the translated index carries fspx_state_sha256, which slot 67's kind-0 lookup requires; make_game.py adds the library_shaders() stage after FSPX/BVH with its own library_build.json reuse key; ShaderLibrary::load reads library/index.json in the same folder loop and counts entries with the FSPX ones in fspx_size(). The docs updates match.

AI-assisted check.

dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…ary's compute pipelines, which the executable creates with slot 67 (RT-5)

Squashed from ProjectLeonida#7529 by gookie-dev, head b93ffa5 (security scan PASS).

Applied as the PR's own diff (gh pr diff); head b93ffa5 matches the watcher's Haiku scan. Taken for the slot-67 gap: the retail boot's untranslated compute programs live in shaders.rpf's pipeline library, which the shaders stage did not carve before.
dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…game_scarlett_master.exe embedded shaders

Squashed from ItsNotRexed#7746 by Faterek, head bc5fc47 (security scan PASS).

Applied as the PR's own diff (gh pr diff); head bc5fc47; prescan flags (cleanup unlinks, test subprocesses) read by Haiku: PASS, and make_game's drop() removes only the files named. Taken for the slot-86 gap: the retail boot's untranslated vertex shader is the executable's one embedded VS (its FSSM hash is in none of the 26,503 carved containers and matches one of the exe's 10). Conflicts with ItsNotRexed#7529: the shaders stage runs library_shaders() then exe_shaders(); ShaderLibrary::load reads fspx, bvh, library and exe, each folder keeping its own key and count; both PRs' shader_library_test sections kept. Fixed after the apply: the library section of shader_library_test is closed before the exe section starts.
@Etr0p

Etr0p commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested b93ffa561 on my own 1.0.2.1 copy, read in place (Windows 11 Home 26200, Python 3.13, llvm-mc 23.1.6, Vulkan SDK 1.4.363.0). Two GPUs: NVIDIA RTX 5070 Ti Laptop (driver 621.24, subgroups 32) and AMD Radeon 610M (RDNA2 iGPU, driver 26.11.2, subgroups 32..64). Counts only.

  • shader_library.py --stages cs --disasm --carve: 2,684 compute programs written from 2,693 compute pipelines; 2,680 named by a carved shader, 4 not in the carve.
  • rdna2spirv.py --wave64-emulate (what make_game.py picks for a 32-wide card): 1,773 of 2,684 translated, all 1,773 pass spirv-val, same refusal split as gkissel's above (606 v_cmp destination, 91 CS thread-group-size SGPR, 66 mask destination, 51 fall-through into undecodable words, 34 s_load_dwordx4 operands sgpr vcc, 28 ds_append, 26 s_bitreplicate_b64_b32 on a lane mask, 5 s_load_dwordx8 operands sgpr vcc, 3 s_flbit_i32_b64 of a lane mask, 1 reachable instruction with normalized encoding).
  • Without --wave64-emulate (the native mode an AMD card with 64-wide subgroups gets): the same 1,773 translated and valid, the same 911 refusals by reason. 1,010 of the modules are wave64 (subgroup size 64 in the index) and 763 wave32.
  • vk_pipeline_check --stage cs (built from main 5f6d83a2d; this PR changes neither it nor the translator), real compute pipelines, validation layers off. In progress: this machine's GPU time is shared with boot runs, so it goes in blocks between them. So far, the first 210 of the 1,773 entries in index order, 0 failures on each card:
    • RTX 5070 Ti, the wave64-emulated index: 210 modules ok, 210 pipelines ok, 0 failed, 0 skipped.
    • Radeon 610M, the native index (wave64 modules at subgroup size 64): 210 modules ok, 210 pipelines ok, 0 failed, 0 skipped.
    • Some modules take 1-2 min each to compile on both drivers. I'll add the full counts in a second comment when the run is done.

Not run here: the PR's unit tests (already covered above) and a retail boot to slot 67.

AI-assisted (Claude Code). Counts and the translator's reason names only; no game files, shader names or hashes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.