[PR #900] vk_harness: a vertex shader with subgroup operations is unsupported where the vertex stage has none (TEST-W64G-VS-SUBGROUP-STAGE) #938

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

📋 Pull Request Information

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

Base: main ← Head: w64g-vs-subgroup-stage


📝 Commits (1)

  • d063e61 vk_harness: a vertex shader with subgroup operations is unsupported where the vertex stage has none (TEST-W64G-VS-SUBGROUP-STAGE)

📊 Changes

4 files changed (+51 additions, -1 deletions)

View changed files

📝 docs/testing.md (+6 -0)
📝 runtime/test/spirv_capability.h (+18 -0)
📝 runtime/test/spirv_capability_test.cpp (+14 -0)
📝 runtime/test/vk_harness.cpp (+13 -1)

📄 Description

Claimed in the coordination issue as: TEST-W64G-VS-SUBGROUP-STAGE (claim)

What and why

runtime/test/shaders/w64_graphics.py fails all seven vs_w64_* fixtures on a Mac. They read SubgroupLocalInvocationId, and MoltenVK cannot build the pipeline:

vs_w64_c_lane_id  C  64: exit 1: ... [mvk-error] SPIR-V to MSL conversion error: Subgroup builtins are not available in this type of function. | FAILED vkCreateGraphicsPipelines

The device says so itself: its subgroup supportedStages are compute, fragment and tessellation control ("supported_subgroup_stages": 50 from tools/vk_subgroup_info.py). A Metal vertex function has no SIMD-group built-ins. Using subgroup operations in a stage outside supportedStages is not valid Vulkan, so this is a device that cannot run the fixture, not a failure of it.

  • vk_harness.cpp reads VkPhysicalDeviceSubgroupProperties and exits 77 with unsupported: no subgroup operations in the vertex stage when the vertex module declares a GroupNonUniform capability and the vertex stage is not in supportedStages. Only for a plain draw: under VKH_MESH and VKH_MESH_COMPUTE the first module is a mesh shader.
  • spirv_capability.h gets uses_subgroup_operations() (any of the eight GroupNonUniform capabilities), with cases in spirv_capability_test.cpp.
  • w64_graphics.py is unchanged: it already turns a 77 into a SKIP, as it does for the geometry fixtures.
  • docs/testing.md: a paragraph in the w64_graphics.py section on what a Mac gives.

Of the 18 vertex fixtures build.py makes, only the seven vs_w64_* declare a GroupNonUniform capability, so nothing that runs today is skipped by this.

Tested

Apple M5, MoltenVK 1.4.2. w64_graphics.py on all 29 fixtures, before at main 3d3770c16 and after on this branch (vk_harness.cpp and w64_graphics.py did not change in between):

Skipped Failed Exit
Before 22 7 (the vs_w64_*) 1
After 29 0 0
  • The seven now print SKIP (unsupported: unsupported: no subgroup operations in the vertex stage); the doubled word is how the runner prints every 77, the geometry ones too.
  • spirv_capability_test: all checks pass. ctest: 72/72.
  • run_gpu_tests.py: 185/249 passed, 61 skipped, 3 failed in one run and 184 with 4 failed in another. The failures are cs_fma_fused, cs_imgload_tfe, cs_imgload_d16_tfe and the intermittent ps_imgatomic (#543), as on main; every plain vertex shader still draws.
  • tests/test_w64_graphics_*.py, tests/test_docs_*.py and tests/test_i18n_index.py pass.

Not tested: a device that has the vertex stage in supportedStages, where the new check is a no-op by construction, and the geometry stage, which this does not touch (a Mac has none).

GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131)

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.

🤖 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/900 **Author:** [@hugo0024](https://github.com/hugo0024) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `w64g-vs-subgroup-stage` --- ### 📝 Commits (1) - [`d063e61`](https://github.com/ubiquitarianism/leonida/commit/d063e61abf32f5304a69d87f7b90c3fcd3d601e2) vk_harness: a vertex shader with subgroup operations is unsupported where the vertex stage has none (TEST-W64G-VS-SUBGROUP-STAGE) ### 📊 Changes **4 files changed** (+51 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+6 -0) 📝 `runtime/test/spirv_capability.h` (+18 -0) 📝 `runtime/test/spirv_capability_test.cpp` (+14 -0) 📝 `runtime/test/vk_harness.cpp` (+13 -1) </details> ### 📄 Description Claimed in the coordination issue as: TEST-W64G-VS-SUBGROUP-STAGE ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135325373)) ### What and why `runtime/test/shaders/w64_graphics.py` fails all seven `vs_w64_*` fixtures on a Mac. They read `SubgroupLocalInvocationId`, and MoltenVK cannot build the pipeline: ```text vs_w64_c_lane_id C 64: exit 1: ... [mvk-error] SPIR-V to MSL conversion error: Subgroup builtins are not available in this type of function. | FAILED vkCreateGraphicsPipelines ``` The device says so itself: its subgroup `supportedStages` are compute, fragment and tessellation control (`"supported_subgroup_stages": 50` from `tools/vk_subgroup_info.py`). A Metal vertex function has no SIMD-group built-ins. Using subgroup operations in a stage outside `supportedStages` is not valid Vulkan, so this is a device that cannot run the fixture, not a failure of it. - `vk_harness.cpp` reads `VkPhysicalDeviceSubgroupProperties` and exits 77 with `unsupported: no subgroup operations in the vertex stage` when the vertex module declares a GroupNonUniform capability and the vertex stage is not in `supportedStages`. Only for a plain draw: under `VKH_MESH` and `VKH_MESH_COMPUTE` the first module is a mesh shader. - `spirv_capability.h` gets `uses_subgroup_operations()` (any of the eight GroupNonUniform capabilities), with cases in `spirv_capability_test.cpp`. - `w64_graphics.py` is unchanged: it already turns a 77 into a `SKIP`, as it does for the geometry fixtures. - `docs/testing.md`: a paragraph in the `w64_graphics.py` section on what a Mac gives. Of the 18 vertex fixtures `build.py` makes, only the seven `vs_w64_*` declare a GroupNonUniform capability, so nothing that runs today is skipped by this. ### Tested Apple M5, MoltenVK 1.4.2. `w64_graphics.py` on all 29 fixtures, before at `main` `3d3770c16` and after on this branch (`vk_harness.cpp` and `w64_graphics.py` did not change in between): | | Skipped | Failed | Exit | |---|---|---|---| | Before | 22 | 7 (the `vs_w64_*`) | 1 | | After | 29 | 0 | 0 | - The seven now print `SKIP (unsupported: unsupported: no subgroup operations in the vertex stage)`; the doubled word is how the runner prints every 77, the geometry ones too. - `spirv_capability_test`: all checks pass. `ctest`: 72/72. - `run_gpu_tests.py`: 185/249 passed, 61 skipped, 3 failed in one run and 184 with 4 failed in another. The failures are `cs_fma_fused`, `cs_imgload_tfe`, `cs_imgload_d16_tfe` and the intermittent `ps_imgatomic` (#543), as on `main`; every plain vertex shader still draws. - `tests/test_w64_graphics_*.py`, `tests/test_docs_*.py` and `tests/test_i18n_index.py` pass. Not tested: a device that has the vertex stage in `supportedStages`, where the new check is a no-op by construction, and the geometry stage, which this does not touch (a Mac has none). GPUs tested: Apple M5 (8-core GPU), MoltenVK 1.4.2, macOS 27.2.1 (26B131) 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. 🤖 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#938
No description provided.