[PR #1514] vk_pipeline_check: check --mesh-compute entries as compute pipelines #1543

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1514
Author: @robot00f
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: feat/vk-pipeline-check-mesh-compute


📝 Commits (1)

  • abb81b0 vk_pipeline_check: check --mesh-compute entries as compute pipelines

📊 Changes

5 files changed (+453 additions, -16 deletions)

View changed files

📝 docs/pipeline_check.md (+5 -3)
📝 runtime/CMakeLists.txt (+6 -0)
📝 runtime/test/check_vk_pipeline_cli.cmake (+19 -0)
➕ runtime/test/check_vk_pipeline_mesh_compute.py (+385 -0)
📝 runtime/test/vk_pipeline_check.cpp (+38 -13)

📄 Description

Claimed in the coordination issue as: VK-PIPELINE-CHECK-MESH-COMPUTE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151127845)

What and why

When tools/rdna2spirv.py --mesh-compute translates a mesh shader, the emitted SPIR-V module is a GLCompute compute shader (VK_SHADER_STAGE_COMPUTE_BIT), while its index.json entry preserves "stage": "ms" and records "mesh_compute": {...}.

Previously, runtime/test/vk_pipeline_check.cpp treated every "stage": "ms" entry as a native VK_EXT_mesh_shader graphics stage:

  • On GPUs without VK_EXT_mesh_shader (such as NVIDIA Pascal, AMD RDNA1/Vega/Polaris, Intel Gen9, and MoltenVK), all --mesh-compute entries were skipped with SKIPPED <name> (no VK_EXT_mesh_shader), their lds_bytes check read mesh_props.maxMeshSharedMemorySize (0) instead of props.limits.maxComputeSharedMemorySize, their required subgroup size was checked against VK_SHADER_STAGE_MESH_BIT_EXT instead of VK_SHADER_STAGE_COMPUTE_BIT, and --stage cs (--compute-only) left them out.
  • On GPUs with VK_EXT_mesh_shader where --mesh-compute is enabled (for example Intel's Windows Vulkan driver, where make_game.py turns --mesh-compute on automatically), vk_pipeline_check passed the GLCompute module as VK_SHADER_STAGE_MESH_BIT_EXT to vkCreateGraphicsPipelines.

Changes

  • runtime/test/vk_pipeline_check.cpp:
    • Parse "mesh_compute" on ShaderMeta (accepting {...} or null, and failing malformed index parsing before Vulkan loads if "mesh_compute" is neither an object nor null or appears on a stage other than "ms").
    • Route --mesh-compute entries through vkCreateComputePipelines (VK_SHADER_STAGE_COMPUTE_BIT), maxComputeSharedMemorySize, VK_SHADER_STAGE_COMPUTE_BIT subgroup-size checks, and --stage cs (--compute-only), while keeping their summary and --isolate counts under "ms" and leaving native "ms" entries on the VK_EXT_mesh_shader graphics path.
  • runtime/test/check_vk_pipeline_cli.cmake: add CPU-only malformed-index checks for non-object "mesh_compute" values and "mesh_compute" on non-"ms" stages.
  • runtime/test/check_vk_pipeline_mesh_compute.py & runtime/CMakeLists.txt: add end-to-end vk_pipeline_check coverage (registered in CTest as vk_pipeline_check_mesh_compute with SKIP_RETURN_CODE 77) for 152-byte (PhysicalStorageBufferAddresses 2x32-bit pointer without shaderInt64) and --pc-tail-ubo (128-byte + set-1 UBO) --mesh-compute modules, --compute-only / --graphics-only filtering, native "ms" control entries, maxComputeSharedMemorySize rejection, --isolate aggregation, and spirv-val validation.
  • docs/pipeline_check.md: document --mesh-compute handling in vk_pipeline_check.

Tested

  • Pre-fix reproduction (3/3 runs on ms_tri translated with LEONIDA_MESH_COMPUTE=1): vk_pipeline_check skipped ms_tri with SKIPPED ms_tri (no VK_EXT_mesh_shader) (ms pipelines: 0 ok, 0 failed, 1 skipped) under --stage all and checked 0 shaders under --compute-only.
  • Post-fix verification (3/3 runs on ms_tri with LEONIDA_MESH_COMPUTE=1): ms: 1 modules ok, 0 failed and ms pipelines: 1 ok, 0 failed, 0 skipped under both --stage all and --compute-only.
  • CTest (3/3 runs): ctest --test-dir runtime/build -R "^(vk_pipeline_check_cli|vk_pipeline_check_mesh_compute)$" — 2/2 passed across all 3 runs (spirv-val --target-env vulkan1.2 included).
  • Neighbor suites: vk_pipeline_check_stack, pipeline_cache_seed, runtime/test/check_vk_pipeline_mesh_compute.py, tests/test_vk_pipeline_check_index.py, tests/test_vk_pipeline_check_isolate.py, tests/test_ctest_registration.py, tests/test_docs_links.py, tests/test_docs_table_rows.py — all passed.
  • Policy check: python -I scripts/check_no_game_data.py -> exit 0.

GPUs tested: NVIDIA GeForce GTX 1050 Ti (Pascal, 4 GB), driver 582.28, Vulkan 1.4.312, Windows 10 Pro 10.0.19045 (VK_LOADER_LAYERS_DISABLE=~implicit~; VK_LAYER_KHRONOS_validation is not installed on this host; GPU without VK_EXT_mesh_shader, native mesh-shader GPU path exercised via stage-filter control).

AI-assisted: yes (Antigravity)

Checklist

  • Based on current main and merges cleanly.
  • 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. (Not applicable: no translator rule changed; docs/pipeline_check.md updated.)

🔄 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/1514 **Author:** [@robot00f](https://github.com/robot00f) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/vk-pipeline-check-mesh-compute` --- ### 📝 Commits (1) - [`abb81b0`](https://github.com/ubiquitarianism/leonida/commit/abb81b0ae9690ff686df1aa493b25ebeb4dcb42d) vk_pipeline_check: check --mesh-compute entries as compute pipelines ### 📊 Changes **5 files changed** (+453 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/pipeline_check.md` (+5 -3) 📝 `runtime/CMakeLists.txt` (+6 -0) 📝 `runtime/test/check_vk_pipeline_cli.cmake` (+19 -0) ➕ `runtime/test/check_vk_pipeline_mesh_compute.py` (+385 -0) 📝 `runtime/test/vk_pipeline_check.cpp` (+38 -13) </details> ### 📄 Description Claimed in the coordination issue as: `VK-PIPELINE-CHECK-MESH-COMPUTE` (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7151127845) ### What and why When `tools/rdna2spirv.py --mesh-compute` translates a mesh shader, the emitted SPIR-V module is a `GLCompute` compute shader (`VK_SHADER_STAGE_COMPUTE_BIT`), while its `index.json` entry preserves `"stage": "ms"` and records `"mesh_compute": {...}`. Previously, `runtime/test/vk_pipeline_check.cpp` treated every `"stage": "ms"` entry as a native `VK_EXT_mesh_shader` graphics stage: - On GPUs without `VK_EXT_mesh_shader` (such as NVIDIA Pascal, AMD RDNA1/Vega/Polaris, Intel Gen9, and MoltenVK), all `--mesh-compute` entries were skipped with `SKIPPED <name> (no VK_EXT_mesh_shader)`, their `lds_bytes` check read `mesh_props.maxMeshSharedMemorySize` (`0`) instead of `props.limits.maxComputeSharedMemorySize`, their required subgroup size was checked against `VK_SHADER_STAGE_MESH_BIT_EXT` instead of `VK_SHADER_STAGE_COMPUTE_BIT`, and `--stage cs` (`--compute-only`) left them out. - On GPUs *with* `VK_EXT_mesh_shader` where `--mesh-compute` is enabled (for example Intel's Windows Vulkan driver, where `make_game.py` turns `--mesh-compute` on automatically), `vk_pipeline_check` passed the `GLCompute` module as `VK_SHADER_STAGE_MESH_BIT_EXT` to `vkCreateGraphicsPipelines`. ### Changes - `runtime/test/vk_pipeline_check.cpp`: - Parse `"mesh_compute"` on `ShaderMeta` (accepting `{...}` or `null`, and failing malformed index parsing before Vulkan loads if `"mesh_compute"` is neither an object nor `null` or appears on a stage other than `"ms"`). - Route `--mesh-compute` entries through `vkCreateComputePipelines` (`VK_SHADER_STAGE_COMPUTE_BIT`), `maxComputeSharedMemorySize`, `VK_SHADER_STAGE_COMPUTE_BIT` subgroup-size checks, and `--stage cs` (`--compute-only`), while keeping their summary and `--isolate` counts under `"ms"` and leaving native `"ms"` entries on the `VK_EXT_mesh_shader` graphics path. - `runtime/test/check_vk_pipeline_cli.cmake`: add CPU-only malformed-index checks for non-object `"mesh_compute"` values and `"mesh_compute"` on non-`"ms"` stages. - `runtime/test/check_vk_pipeline_mesh_compute.py` & `runtime/CMakeLists.txt`: add end-to-end `vk_pipeline_check` coverage (registered in CTest as `vk_pipeline_check_mesh_compute` with `SKIP_RETURN_CODE 77`) for 152-byte (`PhysicalStorageBufferAddresses` 2x32-bit pointer without `shaderInt64`) and `--pc-tail-ubo` (128-byte + set-1 UBO) `--mesh-compute` modules, `--compute-only` / `--graphics-only` filtering, native `"ms"` control entries, `maxComputeSharedMemorySize` rejection, `--isolate` aggregation, and `spirv-val` validation. - `docs/pipeline_check.md`: document `--mesh-compute` handling in `vk_pipeline_check`. ### Tested - Pre-fix reproduction (3/3 runs on `ms_tri` translated with `LEONIDA_MESH_COMPUTE=1`): `vk_pipeline_check` skipped `ms_tri` with `SKIPPED ms_tri (no VK_EXT_mesh_shader)` (`ms pipelines: 0 ok, 0 failed, 1 skipped`) under `--stage all` and checked `0 shaders` under `--compute-only`. - Post-fix verification (3/3 runs on `ms_tri` with `LEONIDA_MESH_COMPUTE=1`): `ms: 1 modules ok, 0 failed` and `ms pipelines: 1 ok, 0 failed, 0 skipped` under both `--stage all` and `--compute-only`. - CTest (3/3 runs): `ctest --test-dir runtime/build -R "^(vk_pipeline_check_cli|vk_pipeline_check_mesh_compute)$"` — 2/2 passed across all 3 runs (`spirv-val --target-env vulkan1.2` included). - Neighbor suites: `vk_pipeline_check_stack`, `pipeline_cache_seed`, `runtime/test/check_vk_pipeline_mesh_compute.py`, `tests/test_vk_pipeline_check_index.py`, `tests/test_vk_pipeline_check_isolate.py`, `tests/test_ctest_registration.py`, `tests/test_docs_links.py`, `tests/test_docs_table_rows.py` — all passed. - Policy check: `python -I scripts/check_no_game_data.py` -> exit 0. GPUs tested: NVIDIA GeForce GTX 1050 Ti (Pascal, 4 GB), driver 582.28, Vulkan 1.4.312, Windows 10 Pro 10.0.19045 (`VK_LOADER_LAYERS_DISABLE=~implicit~`; `VK_LAYER_KHRONOS_validation` is not installed on this host; GPU without `VK_EXT_mesh_shader`, native mesh-shader GPU path exercised via stage-filter control). AI-assisted: yes (Antigravity) ### Checklist - [x] Based on current `main` and merges cleanly. - [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. (Not applicable: no translator rule changed; `docs/pipeline_check.md` updated.) --- <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#1543
No description provided.