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

Open
opened 2026-11-26 20:20:18 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1129
Author: @MalexAson
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/subgroup-shaders-spirv-tools


📝 Commits (1)

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

📊 Changes

2 files changed (+61 additions, -5 deletions)

View changed files

📝 runtime/CMakeLists.txt (+10 -5)
➕ tests/test_cmake_spirv_tools_env.py (+51 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1129 **Author:** [@MalexAson](https://github.com/MalexAson) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/subgroup-shaders-spirv-tools` --- ### 📝 Commits (1) - [`c6b493c`](https://github.com/ubiquitarianism/leonida/commit/c6b493c519135871bcfe4c49463df1923ee7b1ee) cmake: the d3d12_subgroup_test shader rule names the spirv tools folder (BUILD-SUBGROUP-SPIRV-TOOLS) ### 📊 Changes **2 files changed** (+61 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+10 -5) ➕ `tests/test_cmake_spirv_tools_env.py` (+51 -0) </details> ### 📄 Description 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1163
No description provided.