Repository navigation
Conversation
… other in 64 invocations (work in progress) Under --wave64-emulate a mesh program of more than 64 threads (a multiple of 64, no LDS instruction, not --mesh-compute) declares 64 invocations and runs one pass per wave: the invocation's index is the built-in plus 64 x pass, every initialised Function variable is set again per pass, the exports of a pass are copied to per-pass twins, and the epilogue sets the counts once and writes each pass's outputs. Each pass is one wave, so the plan is the single-wave one and the exchange buffer is one wave's. Off by default; with the flag off the output is unchanged. Work in progress for SHADER-W64-MESH-SERIAL-WAVES: no test or docs row yet. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ory writes in a serial program (work in progress) ms_w64x_wave_votes: two waves take different branches, each with its own ballot count (and a v_readfirstlane in the second), and the triangle's vertices come from threads 0 and 1 of the first wave and thread 64 of the second, so ms_tri's picture needs both waves to have run their own branch with their own votes. It passes in the side-by-side form and with --mesh-serial-waves on an RTX 4080 (NVIDIA 621.24). A program with a store or an atomic to memory keeps the side-by-side form, as one with LDS does: its waves could pass each other something. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tests/test_mesh_serial_waves.py: the module shape of a program that qualifies (64 invocations, the pass loop, the index from the built-in, the exchange's own place, per-pass copies of the exports, one OpSetMeshOutputsEXT), that every initialised Function variable is set again per pass, and that ms_wave_info_s3 (LDS), a 32-thread program, native wave64 and --mesh-compute are unchanged by the flag. LEONIDA_MESH_SERIAL_WAVES=1 is read by scripts/run_gpu_tests.py, like the other translation switches, and no longer by rdna2spirv.py itself. docs/design.md and docs/testing.md say what the flag does and how it is tested; conftest gives ms_w64x_wave_votes its 128-vertex PSV0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A variant of ms_w64x_wave_votes with an s_endpgm behind a branch in the middle of the program: the module still qualifies, validates, and main keeps one return, after the loop over the passes and the output writes. Suggested in review by tiguan26. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nt length ms_w64x_wave_loops: each wave loops while a wave-wide count is not 0, 5 iterations in wave 0 and 9 in wave 1, so under --wave64-emulate the waves reach different numbers of workgroup barriers. Written after stalls were reported with the serial form on an RTX 2070 SUPER (issue 1608). On an RTX 4080 (NVIDIA 621.24) it draws 4096/4096 pixels exact side by side and in series; that does not explain the stalls. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs/design.md: keep the new row and take main's text of the row below it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…MESH-SERIAL-COMPUTE) GPUs without VK_EXT_mesh_shader (NVIDIA Pascal) translate mesh programs with --mesh-compute and are the ones that need wave64 emulation most, but the switch was off there. The compute program now runs the same passes, and mesh_compute_epilogue's slot writes go through ms_serial_epilogue: the header from index 0, which only pass 0's lane 0 has, and each pass's vertices and primitives at the built-in index + 64 * pass, from that pass's copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as SHADER-W64-MESH-SERIAL-COMPUTE: #1608 (comment)
Depends on: #2435 (this branch is its head
ad1789d7eplus one commit).What and why
#2435's
--mesh-serial-wavesruns an emulated mesh program's waves one after the other, one single-wave pass each, instead of side by side under mini-schedulers. It was off under--mesh-compute, the path for GPUs withoutVK_EXT_mesh_shader(NVIDIA Pascal and older). Those are also 32-wide GPUs, where every mesh program is wave64-emulated, so they are the ones that pay most for the side-by-side form.With this change the compute program takes the same passes. Its slot writes (
mesh_compute_epilogue) go throughms_serial_epiloguelike the mesh epilogue:%ms_counts, after the passes;mesh_compute_epiloguenow returns its lines, andassembleindents them, as it already does for the mesh epilogue. Without the flag the output is unchanged.The metadata keeps the program's thread count in
local_size, as #2435 does for mesh. The runtime reads it only for the whole-subgroup and invocation-limit checks (READ IN CODE:runtime/src/subgroup_size.h:135and:142), and 64 passes both. Thedocs/design.mdrow of #2435 now covers this case, anddocs/testing.mdsays how to run it.Tested
GPUs tested: NVIDIA GeForce GTX 1050 Ti 4 GB desktop (profile S), driver 582.66, Windows 10 19045. Every number below is MEASURED on that machine (n=1 per run unless given); no game files were used.
GTX 1050 Ti 4 GB, NVIDIA 582.66, Windows 10 19045; llvm-mc 21.1.8, Vulkan SDK 1.4.363:
python -m pytest tests/test_mesh_serial_waves.py: 31 passed. The same file against rdna2spirv: --mesh-serial-waves, an emulated mesh program's waves one after the other (SHADER-W64-MESH-SERIAL-WAVES) #2435's translator: 6 failed (the new mesh-compute module checks), so the tests check the change.runtime/test/shaders/ms_*.asm, translated with--mesh-computewith and without--wave64-emulate, gives byte-for-byte the same SPIR-V as rdna2spirv: --mesh-serial-waves, an emulated mesh program's waves one after the other (SHADER-W64-MESH-SERIAL-WAVES) #2435's head (16 of 16 modules).scripts/run_gpu_tests.py --filter ms_withLEONIDA_MESH_COMPUTE=1 LEONIDA_W64_EMULATE=1: 8/8 pass withoutLEONIDA_MESH_SERIAL_WAVESand 8/8 with it (6 modules translated withmesh_serial_waves: 2).ms_w64x_wave_loopsandms_w64x_wave_votesfail, the two tests whose waves export different data.test_docs_links.py, the docs line checks,check_no_game_data.pyon the changed files,git diff --check: clean.Not measured: the frame time in game (no game files on this machine yet), and other vendors on this path.
AI-assisted: yes (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code