shader: translate for the host's subgroups and float controls #169

Manually merged
github merged 2 commits from github-bot/gh-169 into gh-pr/169/base 2026-12-02 19:57:01 +00:00 AGit
Owner

@⁠360900 on GitHub · 2026-12-01 23:12 UTC · original
360900:feat/shader-host → main · +208 −60 · 17 files · 2 commits · merged 2026-12-02 19:56 UTC

What

vkback tells the translators its device (shader::Host, read once at device creation):

  • translate-dir (--host LANES,RDNA) and victory-gpu (OP_INIT) get the widest subgroup and whether it is AMD hardware. A host of 32 lanes gets the console's 64-lane programs written for 32.
  • dxil-probe (--device MIN,MAX,D16,D64) gets the subgroup range and DenormPreserve for 16 and 64 bits. It was told RADV's whatever the device.
  • Compute stages ask for at most the device's lanes (pipejob::stage_size).
  • The host is in the cache's key (cache_folder): every host translates once more after this.

The reference

vkd3d-proton passes the device's float controls and subgroup sizes to dxil-spirv (vkd3d_shader_interface setup in d3d12_pipeline_state_init_compute and the graphics twin).

Evidence

  • Whole store, default host: the DXIL of 19,108 containers is byte for byte what it was (translate-dir before and after, 38,217 files). TRANSLATOR_VERSION is not bumped for that reason.
  • Host of 32 lanes: none fails. 127 of 2,734 compute programs keep lane branches per lane (64-lane host: 21); 16 of them are used at the world's start and report the rule-32 error "pipeline with a program whose lane branches stayed per lane". The follow-up pull request translates those.
  • RTX 5080, NVIDIA 620.73.04, Linux 7.3 (32 lanes, DenormPreserve for 16 bits only): in game, start, menus and the first minutes in the world. Validation run (layer 1.4.363, 480 s): VUID-RuntimeSpirv-shaderDenormPreserveFloat64-06298 before --device, gone with it; no other shader error.
  • Tests: cache_folder differs per host (shader/tests.rs), translator unit tests.
  • Not shown: RADV in game (no AMD card here), and the translator's on-card tests under Proton on this card (they hang there).
  • In-game and validation results are from the build with all nine NVIDIA pull requests: the title does not start on this driver without the umem one.

Checklist (docs/AGENTS.md)

  • One topic (rule 31); docs/TASKS.md not edited (rule 29)
  • "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen
  • No fallback or second path for a case that can't happen (rule 33); unexpected input fails loudly (rule 9)
  • Constants come from the console, the hardware or the title's data (rule 9b): the device's properties
  • Every switch is listed, read in one place, and a bad value stops the start (rule 2): no new switches
  • Queues and other externally synchronized Vulkan objects are used under their lock (rule 35)
  • Every unsafe block has a // SAFETY: comment (rule 36): no new unsafe
  • Clippy clean; tests call the production code; TRANSLATOR_VERSION: not bumped, the default host's output is unchanged (rule 27)
  • Comments say what is true now and name functions, not line numbers (rule 3)
  • Nothing from the title, and no pointers to where non-free data can be found
**@⁠360900** on GitHub · 2026-12-01 23:12 UTC · [original](https://github.com/vktory6/VKtory/pull/169) `360900:feat/shader-host` → `main` · +208 −60 · 17 files · 2 commits · merged 2026-12-02 19:56 UTC ## What vkback tells the translators its device (`shader::Host`, read once at device creation): - translate-dir (`--host LANES,RDNA`) and victory-gpu (`OP_INIT`) get the widest subgroup and whether it is AMD hardware. A host of 32 lanes gets the console's 64-lane programs written for 32. - dxil-probe (`--device MIN,MAX,D16,D64`) gets the subgroup range and DenormPreserve for 16 and 64 bits. It was told RADV's whatever the device. - Compute stages ask for at most the device's lanes (`pipejob::stage_size`). - The host is in the cache's key (`cache_folder`): every host translates once more after this. ## The reference vkd3d-proton passes the device's float controls and subgroup sizes to dxil-spirv (`vkd3d_shader_interface` setup in `d3d12_pipeline_state_init_compute` and the graphics twin). ## Evidence - Whole store, default host: the DXIL of 19,108 containers is byte for byte what it was (translate-dir before and after, 38,217 files). `TRANSLATOR_VERSION` is not bumped for that reason. - Host of 32 lanes: none fails. 127 of 2,734 compute programs keep lane branches per lane (64-lane host: 21); 16 of them are used at the world's start and report the rule-32 error "pipeline with a program whose lane branches stayed per lane". The follow-up pull request translates those. - RTX 5080, NVIDIA 620.73.04, Linux 7.3 (32 lanes, DenormPreserve for 16 bits only): in game, start, menus and the first minutes in the world. Validation run (layer 1.4.363, 480 s): `VUID-RuntimeSpirv-shaderDenormPreserveFloat64-06298` before `--device`, gone with it; no other shader error. - Tests: `cache_folder` differs per host (`shader/tests.rs`), translator unit tests. - Not shown: RADV in game (no AMD card here), and the translator's on-card tests under Proton on this card (they hang there). - In-game and validation results are from the build with all nine NVIDIA pull requests: the title does not start on this driver without the umem one. ## Checklist (docs/AGENTS.md) - [x] One topic (rule 31); `docs/TASKS.md` not edited (rule 29) - [x] "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen - [x] No fallback or second path for a case that can't happen (rule 33); unexpected input fails loudly (rule 9) - [x] Constants come from the console, the hardware or the title's data (rule 9b): the device's properties - [x] Every switch is listed, read in one place, and a bad value stops the start (rule 2): no new switches - [x] Queues and other externally synchronized Vulkan objects are used under their lock (rule 35) - [x] Every `unsafe` block has a `// SAFETY:` comment (rule 36): no new `unsafe` - [x] Clippy clean; tests call the production code; `TRANSLATOR_VERSION`: not bumped, the default host's output is unchanged (rule 27) - [x] Comments say what is true now and name functions, not line numbers (rule 3) - [x] Nothing from the title, and no pointers to where non-free data can be found
vkback tells translate-dir, victory-gpu and dxil-probe its device (shader::Host): the widest subgroup and whether it is AMD hardware, the subgroup range and DenormPreserve support. The default host's DXIL is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 23:16:45 +00:00
lower.rs is on the oversize debt list and may not grow (AGENTS.md rule 4).
github-bot changed target branch from main to gh-pr/169/base 2026-12-02 19:57:00 +00:00
github manually merged commit c176a9df02 into gh-pr/169/base 2026-12-02 19:57:01 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 19:56 UTC · original

Merged, thanks. We shortened one comment in lower.rs so the file stays at its listed size (it is on the oversize list and may not grow). On the reference card: the whole-store DXIL diff translates all 19,112 shaders with 0 failures and 0 changed (RDNA keeps its 64-lane programs as before), and the card tests pass (343). The translator now takes the host's subgroup size and float controls as an input, which is what the 32-lane work in #180 builds on.

Where the translator goes from here (the wave model on 32-lane hosts, DXIL/SPIR-V emission, card tests) is being discussed in https://github.com/vktory6/VKtory/discussions/270.

**@⁠vktory6** on GitHub · 2026-12-02 19:56 UTC · [original](https://github.com/vktory6/VKtory/pull/169#issuecomment-7356962494) Merged, thanks. We shortened one comment in lower.rs so the file stays at its listed size (it is on the oversize list and may not grow). On the reference card: the whole-store DXIL diff translates all 19,112 shaders with 0 failures and 0 changed (RDNA keeps its 64-lane programs as before), and the card tests pass (343). The translator now takes the host's subgroup size and float controls as an input, which is what the 32-lane work in https://git.gtahub.st/github/vktory6--VKtory/pulls/180 builds on. Where the translator goes from here (the wave model on 32-lane hosts, DXIL/SPIR-V emission, card tests) is being discussed in https://github.com/vktory6/VKtory/discussions/270.
This discussion has been locked. Commenting is limited to contributors.
No description provided.