cmake: the d3d12_subgroup_test shader rule names the spirv tools folder (BUILD-SUBGROUP-SPIRV-TOOLS) #1129

Open
github-bot wants to merge 1 commit from github-bot/gh-1129 into main AGit
Owner

@⁠MalexAson on GitHub · 2026-11-24 18:58 UTC · original
MalexAson:fix/subgroup-shaders-spirv-tools → main · +61 −5 · 2 files · 1 commits · open

Claimed in the coordination issue as: BUILD-SUBGROUP-SPIRV-TOOLS

What and why

The rule that translates the four shader sets of d3d12_subgroup_test ran test/shaders/build.py with only LLVM_MC in its environment, and the block was enabled by LEONIDA_LLVM_MC AND Vulkan_GLSLANG_VALIDATOR_EXECUTABLE. The seven other rules that run build.py pass "LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE}" and are gated on LEONIDA_SPIRV_AS and LEONIDA_SPIRV_VAL.

So when CMake finds spirv-as through VULKAN_SDK or -DLEONIDA_SPIRV_AS but the tools are not on PATH, the configure enables the test and the build stops at its four rules:

ERROR: spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it on PATH

The block now looks for the two tools as well, requires them, passes their folder to build.py, and names them in its "is not built" message.

Tested

  • Windows 11, MSVC 19.50 + Ninja, with llvm-mc 23.1.6, SPIRV-Tools 2026.4 and glslang 16.6.0 from a conda environment that is not on PATH (named with -D only). On main the build stops at the four "Translating ... for the subgroup size test" rules. With the change the four generated/subgroup_shaders/*/spirv/index.json outputs build: 1 shader each, translated and spirv-val clean.
  • New tests/test_cmake_spirv_tools_env.py (2 tests, reads runtime/CMakeLists.txt, no compiler): both fail on main, both pass with the change.
  • python -I on tests/test_cmake_translator_deps.py, tests/test_cmake_vulkan_missing.py and tests/test_ctest_registration.py: OK. scripts/check_no_game_data.py on the two changed files: clean.
  • The full d3d12_subgroup_test executable was not rebuilt with this change. Built from 3aa975421 with the tools appended to PATH, ctest -R d3d12_subgroup passed on the GPU below.

GPUs tested: Intel Iris Xe (8086:a7a0), Intel 32.0.101.7092, Windows 11 (for the d3d12_subgroup run above; the change itself needs no GPU)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (no translator rule)

🤖 Generated with Claude Code

**@⁠MalexAson** on GitHub · 2026-11-24 18:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1129) `MalexAson:fix/subgroup-shaders-spirv-tools` → `main` · +61 −5 · 2 files · 1 commits · open Claimed in the coordination issue as: BUILD-SUBGROUP-SPIRV-TOOLS ### What and why The rule that translates the four shader sets of `d3d12_subgroup_test` ran `test/shaders/build.py` with only `LLVM_MC` in its environment, and the block was enabled by `LEONIDA_LLVM_MC AND Vulkan_GLSLANG_VALIDATOR_EXECUTABLE`. The seven other rules that run `build.py` pass `"LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE}"` and are gated on `LEONIDA_SPIRV_AS` and `LEONIDA_SPIRV_VAL`. So when CMake finds `spirv-as` through `VULKAN_SDK` or `-DLEONIDA_SPIRV_AS` but the tools are not on `PATH`, the configure enables the test and the build stops at its four rules: ERROR: spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it on PATH The block now looks for the two tools as well, requires them, passes their folder to `build.py`, and names them in its "is not built" message. ### Tested - Windows 11, MSVC 19.50 + Ninja, with llvm-mc 23.1.6, SPIRV-Tools 2026.4 and glslang 16.6.0 from a conda environment that is not on `PATH` (named with `-D` only). On `main` the build stops at the four "Translating ... for the subgroup size test" rules. With the change the four `generated/subgroup_shaders/*/spirv/index.json` outputs build: 1 shader each, translated and spirv-val clean. - New `tests/test_cmake_spirv_tools_env.py` (2 tests, reads `runtime/CMakeLists.txt`, no compiler): both fail on `main`, both pass with the change. - `python -I` on `tests/test_cmake_translator_deps.py`, `tests/test_cmake_vulkan_missing.py` and `tests/test_ctest_registration.py`: OK. `scripts/check_no_game_data.py` on the two changed files: clean. - The full `d3d12_subgroup_test` executable was not rebuilt with this change. Built from `3aa975421` with the tools appended to `PATH`, `ctest -R d3d12_subgroup` passed on the GPU below. GPUs tested: Intel Iris Xe (8086:a7a0), Intel 32.0.101.7092, Windows 11 (for the d3d12_subgroup run above; the change itself needs no GPU) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (no translator rule) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The rule ran build.py with only LLVM_MC in its environment and was enabled by llvm-mc and glslangValidator alone,
so a build with spirv-as found by CMake but not on PATH stopped with "spirv-as not found". It now finds the tools,
requires them, and passes LEONIDA_SPIRV_TOOLS like the other shader rules.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:39:36 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:16 UTC · original · approved these changes

Reviewed and verified. Fixes build failure for d3d12_subgroup_test when SPIRV tools are located via CMake -D or VULKAN_SDK but not in system PATH, by passing LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE} to build.py consistently with the other shader build rules. Tested with tests/test_cmake_spirv_tools_env.py. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1129#pullrequestreview-6045736135) · **approved these changes** Reviewed and verified. Fixes build failure for `d3d12_subgroup_test` when SPIRV tools are located via CMake `-D` or `VULKAN_SDK` but not in system `PATH`, by passing `LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE}` to `build.py` consistently with the other shader build rules. Tested with `tests/test_cmake_spirv_tools_env.py`. 100% clean-room.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:15 UTC · original

Recommendation: [MERGE]

Reasoning: The d3d12_subgroup_test shader rule now passes LEONIDA_SPIRV_TOOLS and is gated on spirv-as/spirv-val like the other seven build.py rules, fixing builds where the tools are found via VULKAN_SDK but not on PATH. Small CMake fix with a regression test. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 3/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1129#issuecomment-7143254919) **Recommendation:** [MERGE] **Reasoning:** The `d3d12_subgroup_test` shader rule now passes `LEONIDA_SPIRV_TOOLS` and is gated on `spirv-as`/`spirv-val` like the other seven `build.py` rules, fixing builds where the tools are found via `VULKAN_SDK` but not on PATH. Small CMake fix with a regression test. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 3/10
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1129/head:github-bot/gh-1129'
git switch 'github-bot/gh-1129'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1129'
git switch 'github-bot/gh-1129'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1129'
git switch 'github-bot/gh-1129'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1129'
git switch 'main'
git merge --squash 'github-bot/gh-1129'
git switch 'main'
git merge --ff-only 'github-bot/gh-1129'
git switch 'main'
git merge 'github-bot/gh-1129'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.