mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #2155] rdna2spirv: --max-mesh-shared-memory checks a mesh shader's Workgroup memory (SHADER-MESH-SHARED-LIMIT) #2160
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2160
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2155
Author: @vinceychu
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:shader-mesh-shared-limit📝 Commits (1)
d94d97frdna2spirv: --max-mesh-shared-memory checks a mesh shader's Workgroup memory (SHADER-MESH-SHARED-LIMIT)📊 Changes
5 files changed (+230 additions, -4 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+3 -1)📝
docs/design.md(+1 -1)➕
tests/semantic/fixtures/ms_shared_limit.asm(+6 -0)➕
tests/semantic/test_ms_shared_memory_limit.py(+189 -0)📝
tools/rdna2spirv.py(+31 -2)📄 Description
Claimed in the coordination issue as: SHADER-MESH-SHARED-LIMIT (#1608)
What and why
docs/design.mdlisted "mesh shaders againstmaxMeshSharedMemorySize" as not covered. The translator already caps acompute shader's Workgroup memory (
--max-shared-memory); a MeshEXT module had no equivalent.--max-mesh-shared-memory BYTES(MAX_MESH_SHARED_BYTES): a MeshEXT module whose Workgroup memory (the LDSarray, the 4-byte
%ms_countsand, under--wave64-emulate,%x_buf, the same totallds_bytesrecords) is overit is refused (
Unsupported) with the needed and allowed byte counts, e.g.MS workgroup memory 32772 B (LDS 32768 B + %ms_counts 4 B) over maxMeshSharedMemorySize 28672 B.%ms_countsis already 65,540 B, so any non-zerodefault would refuse mesh shaders that translate today. Pass a device's limit (28,672 is the
VK_EXT_mesh_shaderminimum) to refuse at translation what that device can't run; the runtime keeps checkinglds_bytesagainst the device it runs on either way.--mesh-computemodule is GLCompute, so it keeps the compute cap.Tested
tests/semantic/test_ms_shared_memory_limit.py(new, 7 tests, hand-written fixturems_shared_limit.asm, PSV0written in the test): under the cap; over it with the byte counts; the exact boundary (32,772 passes, 32,771
refuses);
%x_bufcounted under--wave64-emulate;--mesh-computeuses the compute cap; the default refusesnothing (65,540 B translates and
lds_bytescarries it); the CLI flag end to end.python -I scripts/run_semantic_tests.py tests/semantic: 494 files, 6,325 tests, 0 failed.pytest tests/test_translate.py: 712 passed; the 2 failures arecs_dpp_cmp.asmwith LLVM 21, which fail on maintoo (#1375 fixes the helper).
python -m compileall -q tools tests: clean.GPUs tested: n/a (translator-side check; no GPU path changes)
AI-assisted: yes (Claude Code, with a Devin draft reviewed and changed: the default went from 28,672 to 0 after
the existing
test_ms_lds_need.pyshowed real mesh LDS sizes over the spec minimum)Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
https://claude.ai/code/session_01RAL8MMXUuNpQAVa1iiyAMP
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.