shaders: index the DXBC identities used by Xbox native graphics pipelines #497

Manually merged
github merged 3 commits from gh-pr/497/head into gh-pr/497/base 2026-11-26 09:04:11 +00:00
Owner

@⁠Rain156 on GitHub · 2026-11-24 06:27 UTC · original
Rain156:feat/native-graphics-shader-index → main · +324 −15 · 11 files · 3 commits · merged 2026-11-24 13:36 UTC

Claimed in the coordination issue as: RT-SLOT57-NATIVE-GRAPHICS-PSO-INDEX (claim). This is the shader-index prerequisite of RT-SLOT57-NATIVE-GRAPHICS-PSO.

What and why

Xbox native graphics pipeline descriptors refer to a stage by its DXBC HASH digest. The translation index names shaders by carved filename and FSSM hash. The shaders stage now writes a local, versioned native_hashes.txt joining those identities. This lets a renderer recover the stage and original container for a native pipeline request.

The writer validates the stage and FSSM hash, detects conflicting uses of a digest and atomically publishes the sorted catalog. An existing translation can add or refresh the catalog without rebuilding SPIR-V. The guest device dispatch is being tested separately.

Adapted from enx's GPL implementation using the format measurements by LooperSalty and KkelebekK. Original implementation

Tested

  • Independently read the HASH part of all 26,503 local retail 1.0.2.1 primary containers. Every row resolves to the expected stage and FSSM program. There are 25,321 distinct identities and zero missing or conflicting entries. The 26,503 translated primary modules passed spirv-val.
  • Regenerated the catalog in the translated workspace. The output was byte-identical. A second invocation kept its timestamp and reused it.
  • 216 Python tests covering the catalog, shader-stage resumption, translation settings and shader dependencies passed. The translator semantic suite passed all 6,104 tests in 465 files.
  • Python compilation, the build help command and the repository-wide game-data check passed.

GPUs tested: The catalog is CPU-only. Corpus verification ran on Windows 11 x64 on the RTX 5070 Ti / NVIDIA 617.42 test machine.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption in this change or its report.
  • No translator rule changed.
**@⁠Rain156** on GitHub · 2026-11-24 06:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497) `Rain156:feat/native-graphics-shader-index` → `main` · +324 −15 · 11 files · 3 commits · merged 2026-11-24 13:36 UTC Claimed in the coordination issue as: RT-SLOT57-NATIVE-GRAPHICS-PSO-INDEX ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)). This is the shader-index prerequisite of RT-SLOT57-NATIVE-GRAPHICS-PSO. ### What and why Xbox native graphics pipeline descriptors refer to a stage by its DXBC HASH digest. The translation index names shaders by carved filename and FSSM hash. The shaders stage now writes a local, versioned `native_hashes.txt` joining those identities. This lets a renderer recover the stage and original container for a native pipeline request. The writer validates the stage and FSSM hash, detects conflicting uses of a digest and atomically publishes the sorted catalog. An existing translation can add or refresh the catalog without rebuilding SPIR-V. The guest device dispatch is being tested separately. Adapted from enx's GPL implementation using the format measurements by LooperSalty and KkelebekK. [Original implementation](https://git.notrexed.dev/enx/leonida/commit/5c175db901f8486bcdefd03746b578b657e3151f) ### Tested - Independently read the HASH part of all 26,503 local retail 1.0.2.1 primary containers. Every row resolves to the expected stage and FSSM program. There are 25,321 distinct identities and zero missing or conflicting entries. The 26,503 translated primary modules passed `spirv-val`. - Regenerated the catalog in the translated workspace. The output was byte-identical. A second invocation kept its timestamp and reused it. - 216 Python tests covering the catalog, shader-stage resumption, translation settings and shader dependencies passed. The translator semantic suite passed all 6,104 tests in 465 files. - Python compilation, the build help command and the repository-wide game-data check passed. GPUs tested: The catalog is CPU-only. Corpus verification ran on Windows 11 x64 on the RTX 5070 Ti / NVIDIA 617.42 test machine. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption in this change or its report. - [x] No translator rule changed.
Generate a deterministic hash-to-stage catalog alongside the translated shaders. Backfill an existing translation without disassembling it again, reject conflicting identities, and atomically replace a complete catalog.

Adapted from the GPL native stage index by enx, with the Xbox layout measurements by LooperSalty and KkelebekK.

Adapted-from: 5c175db901
Track the catalog writer and its local imports in the shader-stage fingerprint
and CMake fixture dependencies. Cover the same files in both Runtime event
filters, including the optional native scanner reached by the carver.
Check both import graphs and document the standalone catalog refresh for
existing translations.

On Windows x64, touching the writer rebuilt the three bindless fixtures once.
All three passed spirv-val and both Vulkan bindless tests passed on an RTX
5070 Ti with driver 617.42. The semantic suite ran 6,108 tests with no failed
files. The regenerated 25,321-row catalog matched the local reference byte
for byte.

AI-assisted: OpenAI Codex
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:04:09 +00:00
github manually merged commit 62a95883b6 into gh-pr/497/base 2026-11-26 09:04:11 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 09:27 UTC · original

Looks useful, and its 8 new tests pass on Windows (main 7430f59). One thing before it can merge: make_game.py now imports the new tools/native_pso_hashes.py, which needs listing in runtime/cmake/translator_deps.cmake, in make_game.py's translation_sources_digest inputs and in the .github/workflows/runtime.yml paths. Without that, an edit to it doesn't re-trigger CI or invalidate the stage. Happy to re-test after a push.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 09:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7127438844) Looks useful, and its 8 new tests pass on Windows (main 7430f59). One thing before it can merge: make_game.py now imports the new tools/native_pso_hashes.py, which needs listing in runtime/cmake/translator_deps.cmake, in make_game.py's translation_sources_digest inputs and in the .github/workflows/runtime.yml paths. Without that, an edit to it doesn't re-trigger CI or invalidate the stage. Happy to re-test after a push. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 13:36 UTC · original

Merging.

Why merged: Indexes the DXBC identities the Xbox native graphics pipelines use, which the native-PSO path needs. The earlier hold (new tool not listed as a translator input) is fixed in 62a95883b: native_pso_hashes is now in translator_deps.cmake, make_game.py's translation sources and runtime.yml.

Why it's good: Security read of the three-dot diff: tools and tests only, no binaries, downloads or network calls. The PR's own tests: 129 passed. The consistency set, which caught the missing input registration last time, is clean now.

Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones).

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 13:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7133076756) Merging. **Why merged:** Indexes the DXBC identities the Xbox native graphics pipelines use, which the native-PSO path needs. The earlier hold (new tool not listed as a translator input) is fixed in 62a95883b: native_pso_hashes is now in translator_deps.cmake, make_game.py's translation sources and runtime.yml. **Why it's good:** Security read of the three-dot diff: tools and tests only, no binaries, downloads or network calls. The PR's own tests: 129 passed. The consistency set, which caught the missing input registration last time, is clean now. Tested on Windows 11, RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, alone on main (21625bca8 or 51f316092) and in a cumulative merge of #497, #278, #310, #334, #346, #340, #355, #361, #363, #620 and #577 (which carries #540) on main 2d73c242f (git merge-tree: 0 conflicts against current main). Repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests): 566 passed / 5 skipped / 0 failed on main and on main + batch. compileall OK. Full ctest: 302/304 on main and on main + batch (the same two pre-existing failures, d3d12_execute_indirect_validation and d3d12_depth_resolve, no new ones). AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 19:43 UTC · original

Follow-up validation of the #497 catalog against measured Xbox device slot 57 requests. Windows 10 22H2, Core i7-7700K, RTX 5070 / NVIDIA 610.88. DadaCap prototype 9173e790, Vulkan, with local Intel CLZERO and shader fixes from the preceding checks.

All 1,669 console calls requested the pipeline-state IID and matched distinct graphics records in the local library by the state, input layout, and PS/VS program identities. The existing catalog resolved every required stage link to a present SPIR-V module: 714 PS, 296 VS, and 16 MS, with zero missing digests, stage mismatches, or missing modules. The nine stock native catalog tests in this tree also passed.

The slot was still forwarded to the PC lifetime tracker in this run, so the measurement verifies catalog coverage for the slot-57 work. It does not validate native graphics pipeline creation. The captured startup frames were black and the run reproduced the prior title stop.

No game data, hashes, binaries, captures, or raw logs attached. AI-assisted (Codex).

**@⁠Dezmonius** on GitHub · 2026-11-24 19:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7142508031) Follow-up validation of the #497 catalog against measured Xbox device slot 57 requests. Windows 10 22H2, Core i7-7700K, RTX 5070 / NVIDIA 610.88. DadaCap prototype `9173e790`, Vulkan, with local Intel CLZERO and shader fixes from the preceding checks. All 1,669 console calls requested the pipeline-state IID and matched distinct graphics records in the local library by the state, input layout, and PS/VS program identities. The existing catalog resolved every required stage link to a present SPIR-V module: 714 PS, 296 VS, and 16 MS, with zero missing digests, stage mismatches, or missing modules. The nine stock native catalog tests in this tree also passed. The slot was still forwarded to the PC lifetime tracker in this run, so the measurement verifies catalog coverage for the slot-57 work. It does not validate native graphics pipeline creation. The captured startup frames were black and the run reproduced the prior title stop. No game data, hashes, binaries, captures, or raw logs attached. AI-assisted (Codex).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 04:14 UTC · original

@⁠Rain156 a question about the rest of your claim RT-SLOT57-NATIVE-GRAPHICS-PSO (this PR was its index part). Asking here because #14 has reached GitHub's 2,500-comment limit.

  • Where it stands on main now: with #984, #968 and #939 merged and the complete make_game.py shader set (main translation plus fspx, bvh, library and exe), a retail boot on an RDNA2 iGPU gets about 112k D3D12 calls in. Every device slot-57 graphics PSO is refused, because nothing builds <shaders>/fspx_gfx/index.json (the pipeline library's 25,471 graphics records). That is now the largest gap between the boot and anything drawn.
  • Are you still on it, and is there a branch to look at? The owner's finding in #14 (comment 7148008268) points at a GPL-3.0 implementation, which would need a licence check before anything is adapted from it.
  • If you'd rather hand it over, say so and the maintainers will pick it up with credit.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 04:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7152662192) @⁠Rain156 a question about the rest of your claim `RT-SLOT57-NATIVE-GRAPHICS-PSO` (this PR was its index part). Asking here because #14 has reached GitHub's 2,500-comment limit. - **Where it stands on `main` now:** with #984, #968 and #939 merged and the complete `make_game.py` shader set (main translation plus `fspx`, `bvh`, `library` and `exe`), a retail boot on an RDNA2 iGPU gets about 112k D3D12 calls in. Every device slot-57 graphics PSO is refused, because nothing builds `<shaders>/fspx_gfx/index.json` (the pipeline library's 25,471 graphics records). That is now the largest gap between the boot and anything drawn. - **Are you still on it,** and is there a branch to look at? The owner's finding in #14 (comment 7148008268) points at a GPL-3.0 implementation, which would need a licence check before anything is adapted from it. - If you'd rather hand it over, say so and the maintainers will pick it up with credit. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠Rain156 on GitHub · 2026-11-25 05:27 UTC · original · edited 2026-11-25 05:57 UTC

@⁠aslan2142 I'm continuing RT-SLOT57-NATIVE-GRAPHICS-PSO. The fix is ready for review in #1592. It builds fspx_gfx/index.json and resolves exact pipeline-program hashes through the Vulkan factory from #939. It uses the reader and runtime already in Leonida.

On Windows with an RTX 5070 Ti (617.42), the normal retail startup trace recorded 25,450 / 25,450 successful slot-57 returns on unmodified c7e82e26e and 25,450 / 25,450 on the candidate. I also isolated the failure by withholding native_hashes.txt from a private copy. Main returned 0 / 25,450 successes. The candidate returned 9,958 / 9,958 using kind-6 only before its run hit a title breakpoint. These are observed calls in runs of different lengths. Separate vertex and mesh readback tests passed in both eager and on-demand modes.

Re-run make_game.py --stages shaders with your existing game, work and output paths and the original adapter options. The command backfills graphics while reusing the prior shader groups. Both wave64 settings validated 18,493 of 18,837 identified graphics programs. I haven't run the RDNA2 iGPU locally. If it still refuses requests, aggregate catalog / kind6 counts and HRESULTs from --trace-d3d12 will distinguish lookup from backend rejection.

**@⁠Rain156** on GitHub · 2026-11-25 05:27 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7153790687) · edited 2026-11-25 05:57 UTC @⁠aslan2142 I'm continuing RT-SLOT57-NATIVE-GRAPHICS-PSO. The fix is ready for review in #1592. It builds `fspx_gfx/index.json` and resolves exact pipeline-program hashes through the Vulkan factory from #939. It uses the reader and runtime already in Leonida. On Windows with an RTX 5070 Ti (617.42), the normal retail startup trace recorded 25,450 / 25,450 successful slot-57 returns on unmodified `c7e82e26e` and 25,450 / 25,450 on the candidate. I also isolated the failure by withholding `native_hashes.txt` from a private copy. Main returned 0 / 25,450 successes. The candidate returned 9,958 / 9,958 using kind-6 only before its run hit a title breakpoint. These are observed calls in runs of different lengths. Separate vertex and mesh readback tests passed in both eager and on-demand modes. Re-run `make_game.py --stages shaders` with your existing game, work and output paths and the original adapter options. The command backfills graphics while reusing the prior shader groups. Both wave64 settings validated 18,493 of 18,837 identified graphics programs. I haven't run the RDNA2 iGPU locally. If it still refuses requests, aggregate `catalog` / `kind6` counts and HRESULTs from `--trace-d3d12` will distinguish lookup from backend rejection.
This discussion has been locked. Commenting is limited to contributors.
No description provided.