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

Merged
Rain156 merged 3 commits from upstream-pr/497 into main 2026-11-24 13:36:40 +00:00
Rain156 commented 2026-11-24 06:27:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Rain156 on 2026-11-24T06:27:35Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467274358 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497). Originally posted by [Rain156](https://github.com/Rain156) on 2026-11-24T06:27:35Z. --- Claimed in the coordination issue as: RT-SLOT57-NATIVE-GRAPHICS-PSO-INDEX ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123853830)). 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.
QemmHD commented 2026-11-24 09:27:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T09:27:28Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7127438844 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7127438844). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T09:27:28Z. --- 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 commented 2026-11-24 13:36:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T13:36:37Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7133076756 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7133076756). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T13:36:37Z. --- 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).
Dezmonius commented 2026-11-24 19:43:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Dezmonius on 2026-11-24T19:43:51Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142508031 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7142508031). Originally posted by [Dezmonius](https://github.com/Dezmonius) on 2026-11-24T19:43:51Z. --- 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).
aslan2142 commented 2026-11-25 04:14:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T04:14:32Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7152662192 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7152662192). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T04:14:32Z. --- @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).
Rain156 commented 2026-11-25 05:27:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Rain156 on 2026-11-25T05:27:17Z.


@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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7153790687 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/497#issuecomment-7153790687). Originally posted by [Rain156](https://github.com/Rain156) on 2026-11-25T05:27:17Z. --- @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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!497
No description provided.