rdna2spirv: --mesh-serial-waves, an emulated mesh program's waves one after the other (SHADER-W64-MESH-SERIAL-WAVES) #2435
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2435"
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?
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T04:54:24Z.
Claimed in the coordination issue as: SHADER-W64-MESH-SERIAL-WAVES (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7207845492)
What and why
Under
--wave64-emulatea mesh program of 128 threads is two waves of 64 lanes run side by side, and the planner gives it mini-schedulers: each exchange between lanes becomes rounds over the whole workgroup. On an RTX 4080 that form measured 11 to 15 times the GPU time of the same programs' native form, and mesh draws were about 60 % of a frame in the 3D world (measurements in #1608).--mesh-serial-waves(off by default, no environment variable) changes the shape for a mesh program thatds_instruction, no store and no atomic instruction,--mesh-compute.Such a program declares LocalSize 64 and runs its body once per wave: pass
wseeslocal_index = real index + 64*w, every initialised function variable is stored again at the start of a pass, and the values the epilogue needs are copied to a per-pass twin at the end of the pass. The epilogue keeps one barrier, one count and oneOpSetMeshOutputsEXT, then writes each pass's vertices and primitives. Each pass is a single wave, so the planner gives it the existinginline_allplan. Nothing in the planner changes.A program outside those conditions, and every program when the switch is off, is translated as before. The index records
mesh_serial_waves(the number of passes);local_sizestays the program's own.New fixture
ms_w64x_wave_votes: the two waves take different branches and vote differently (ballot count 8 in wave 0, 3 plusv_readfirstlanein wave 1), and the triangle's vertices come from threads 0, 1 and 64, so a pass that saw the wrong wave's lanes or the wrong index draws something else.Tested
All on Windows 11, RTX 4080, NVIDIA 621.24, branch on main
d1dff7949.scripts/run_gpu_tests.py: the 7 mesh fixtures pass in the side-by-side form and withLEONIDA_MESH_SERIAL_WAVES=1(which adds the switch).pytest tests/test_mesh_serial_waves.py: 19 passed.pytest tests/test_translate.py: 722 passed.pytest testswithtests/test_run_game_wine.py(importsfcntl, not on Windows) andtests/test_run_semantic_tests.py(its tests send an interrupt that ends the whole run here) left out: 10,069 passed, 288 skipped, 7 failed. The 7 are intest_bink_names,test_opus_tags,test_world_names(unreadable-directory cases),test_translate_pipeline_compute(Windows job limits) andtest_run_wine_tests(two--jobscases). Run alone on maind1dff7949on this machine the same 7 fail; on this branch 5 of them failed and the two--jobscases passed in that rerun.Not checked: whether the in-game picture is correct (frames on this machine alternate with white-outs in both forms); AMD, Intel, llvmpipe; a second game run; a negative control that shows the new fixture failing on a deliberately wrong translation; thread counts that are not a multiple of 64 (they keep the old form). Thanks to @HasiKe and @tiguan26 for offering runs on their setups.
GPUs tested: NVIDIA RTX 4080, driver 621.24, Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T05:11:16Z.
Added coverage, not mine: @tiguan26 ran this branch (
fbceecf04) on llvmpipe under Wine (Mesa, 8-wide subgroups, emulated path) and reports the 7 mesh GPU fixtures pass withLEONIDA_MESH_SERIAL_WAVES=0and with=1, withms_w64x_wave_votes.spvat LocalSize 128 without the switch and 64 with it: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7210226080. So llvmpipe moves out of the "not checked" list above; AMD and Intel hardware and in-game picture correctness stay in it. Thank you.Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-11-27T05:16:01Z.
I tested the negative control requested in the PR description at
fbceecf042on a Windows 11 RTX 4090 (NVIDIA 616.64). The stockms_w64x_wave_votesfixture passed the runner'scheck_gradat all 4,096 pixels with both LocalSize 64 and LocalSize 128. Two deliberate translation errors made that same checker fail in both forms.I kept the fixture unchanged and varied only the addition that combines the two 32-bit population counts for each
s_bcnt1_i32_b64 s10, s[6:7]in its emitted SPIR-V.Each error picked out a different wave. I checked the full image independently: for normalized pixel-center height
y, blue was exactlyy/4when only wave 0 was wrong and0.5 - y/4when only wave 1 was wrong. Red, green, alpha, and coverage matched at every pixel. All six modules passed Vulkan 1.2 SPIR-V validation, and all six draws ran with Khronos validation without errors. This check measured image correctness only.Taken early exit on
cd25a5c95. The new unit test checks the emitted control flow with a branch on wave 7, which a two-wave workgroup never takes. I ran a synthetic draw that takes the earlys_endpgmon wave 0 or wave 1, selected at draw time via meshs24(push dword 16). Both waves first emit the triangle geometry. The selected wave exports blue 0 and ends; the surviving wave exports its checked ballot value, blue 0.5. Selector 7 is the control. The same shader binary handled all three selectors in each mode.All six 64×64 RTX 4090 draws matched their expected RGBA at every pixel. Ending wave 0 yielded blue
y/4, ending wave 1 yielded0.5 - y/4, and selector 7 yielded constant 0.5 (yis the normalized pixel-center height). The side-by-side and serial outputs were byte-identical in each pair. Both SPIR-V modules validated and the draws reported no Vulkan validation errors. This checks that ending the first wave still lets the later wave export its vertices' color.Partial final wave on
cd25a5c95. I checked the thread-count case listed in the PR description on the same RTX 4090. Using synthetic PSV0 workgroups of 65, 96 and 127 threads, enabling the serial flag produced byte-identical SPIR-V and equal shader metadata in each case. The modules kept their declared workgroup sizes. A 128-thread control switched from 128 invocations to 64 and recorded two serial waves.In each fixture, threads 0 and 1 exported two triangle vertices. The last thread in the workgroup exported the third vertex with blue 0.5. This made the pixel result depend on the last active lane of the final wave. Across all eight 64×64 draws, every pixel matched the expected RGBA
(x, y, y/4, 1)for normalized pixel centers. Both flag settings returned identical images for each size. All eight modules passed Vulkan 1.2 SPIR-V validation and the draws reported no Khronos validation errors.Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-27T05:18:52Z.
Review: APPROVED
Approving. Checked on
fbceecf04, which fast-forwards onto main (d1dff7949).Translator suite: same as main (only the known
test_fspx_dot4_op_sel_disasmandtest_int32_to_f64failures).tests/test_mesh_serial_waves.pyplustests/test_translate.py: 740 passed, the one failure is main'sps_sdwa_f16_const.asm. GPU fixtures on llvmpipe under Wine withLEONIDA_W64_EMULATE=1: all 7ms_fixtures pass with and withoutLEONIDA_MESH_SERIAL_WAVES=1, and the switch really changes the module (LocalSize 128 vs 64).Read the diff. Things I checked rather than took on trust:
%ms_countsis a Workgroup variable, so the allocation count survives the per-pass re-initialisation even when only wave 0 sends GS_ALLOC_REQ (your fixture covers that case);%doneand the other initialised Function variables are stored again at the top of each pass; the exchange's%x_bufindex comes from the real index. I also tried a variant ofms_w64x_wave_voteswith ans_endpgmreachable mid-program (a branch on wave id 7, so never taken): it still qualifies, passes spirv-val, andmainkeeps one OpReturn after the pass loop and the output writes, so an early-ending wave cannot skip later passes. If you want, that variant would make a cheap extra case in the unit tests, but it is not a blocker.One small note, not a blocker: the qualifying check matches
storeandatomicas substrings of the opcode, which is conservative (it also catchess_store/s_buffer_store), so it errs on the side of keeping the side-by-side form. Fine as it is.Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T05:27:04Z.
Thank you both.
@ecox982745: that is the negative control I listed as missing, so it comes off the "not checked" list: with the fixture unchanged, a wrong count in either wave fails the runner's check in both forms, and each error shows in a different wave.
@tiguan26: agreed on both notes. The substring match on
storeandatomicis meant to be conservative; a program it catches only keeps the side-by-side form. The mid-programs_endpgmvariant is a good extra case and I will add it totests/test_mesh_serial_waves.pyin a follow-up commit on this branch.Still not checked: AMD and Intel hardware, and whether the in-game picture is correct.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T05:42:05Z.
Second game run with the mesh programs in the serial form (same RTX 4080, NVIDIA 621.24, Windows 11; the unit case suggested above is pushed as
cd25a5c95, 20 passed): the 3D world ran to the run's time cap without a device loss or a fault. The GPU profile agrees with the first run: 32,768 profiled mesh draws at 0.074 ms each, and 0.75 frames/s on average between 330 s and 480 s (0.45 before, side by side). In the profiled windows compute is now most of the GPU time (about 31 s of 48 s, against 2.4 s for mesh draws).One thing I have not explained: frames stopped being presented at about 726 s while submissions went on at the same rate until the cap; that is when the run's scripted pad presses end, and I have not checked whether the two are related or whether it also happens side by side. Picture correctness is still not checked.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T07:12:05Z.
CI note:
linux-gpu-toolsfailed in its Build step, before any test ran, onruntime/test/vk_null_descriptor_test.cpp:97(LEONIDA_TEST_NULL_DESCRIPTORS_SPVnot declared).runtime/CMakeLists.txtonly defines that macro when it finds glslangValidator, and line 97 uses it outside the test's#ifndefguard. This pull request does not touch either file (it changestools/rdna2spirv.py,scripts/run_gpu_tests.py, tests, docs and one.asmfixture), and the same lines are in maind1dff7949. #2055 is the open pull request for that build failure. The other checks are still queued;change-scopeandno-game-datapassed.Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T08:27:06Z.
CI on
cd25a5c95has finished. Passed:translator-tests,semantic-tests,stdlib-tests-linux,viewer-tests,change-scope,no-game-data. Not passed, with what each log shows:linux-gpu-tools: Build step,vk_null_descriptor_test.cpp:97(noted above; #2055).macos(runtime): one GPU fixture fails,ps_ssharp("point bias +1"), a pixel-shader sampler case; 194/270 passed, 73 skipped. #1774 is the open pull request about that fixture on MoltenVK.windows(runtime): one CTest fails,vk_xdxr_postbuild_readback.macos-python:tests/test_calibrated_texture_extra.py,test_export_file_replacement_failure_cleans_temporary_file("OSError not raised").check: cancelled at 15 minutes while still in the standard-library test list (attests/test_text_write_line_endings.py); no test before that point failed.None of these is in a file this pull request changes, and the pull request has no runtime (C++) change. I have not checked whether each of them also fails on main's own latest run, so I am only saying what the logs show, not that main is red. If a maintainer wants the branch re-run after those are fixed, an empty merge of main will do it.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T08:41:24Z.
Added coverage, not mine: @HasiKe ran this branch (
cd25a5c95) on an RTX 2070 SUPER (NVIDIA 616.56, Windows 11), the card on which the world lost the device at mesh draws: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7213695859. Their report: the whole main corpus (26,503 programs) translates with--wave64-emulate --mesh-serial-wavesand passesspirv-val; the four mesh programs that were at their loss sites declare LocalSize 64 with noOpSwitch; in 3 boots no mesh draw is at a loss site (before: 6 of 9 boots lost the device at such a draw). Those 3 boots were not clean for other reasons (one earlyint3, one boot that stopped presenting, one loss at a compute dispatch), and they say three compile-heavy boots do not settle whether those are new. So this is evidence about the mesh draws only.Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T09:27:16Z.
Open problem, please do not merge yet. @HasiKe's second series on the RTX 2070 SUPER (NVIDIA 616.56) with this branch: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7214377470. Across their six boots with the serial form: no mesh draw at a loss site and one device loss, but three stalls in which GPU work never completes and the device is not reset (at 209 s, 407 s and 419 s), plus one CPU fault at 90 s. Their stock shader set had no failure before the world in 11 boots on that card. Whatever the cause, 3 stalls in 6 against 0 in 11 is a signal against this change on that card, and it outweighs my four clean runs on the RTX 4080.
What I have checked so far is only by reading the emitted module of
ms_w64x_wave_votes: every pass starts by zeroing the exchange's mask slots and ends that with a workgroup barrier, the round counter is one of the function variables stored again at the top of a pass, and all 64 invocations run every pass, so I do not see how a barrier could be reached a different number of times by the invocations of one pass. Reading is not proof, and no fixture here has a loop whose trip count differs between the passes. I will add one (two waves, voted loops of different lengths, a barrier in the loop) and report whether it terminates and matches in both forms. Until the stalls are explained this should stay unmerged.Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T09:30:11Z.
The loop fixture is pushed as
dbdef2efd:ms_w64x_wave_loops. Each wave loops while a wave-wide count (s_bcnt1of a 64-lane compare) is not 0; wave 0 leaves after 5 iterations and wave 1 after 9, and a wave only gets its blue channel if its sum over the iterations is right (160 and 288). Under emulation every count is an exchange with a workgroup barrier inside the loop, so side by side the two waves reach different numbers of barriers.On the RTX 4080 (NVIDIA 621.24, Windows 11) it terminates and draws 4096/4096 pixels exact in both forms; the other seven mesh fixtures still pass in both forms (8/8 and 8/8).
tests/test_translate.pywithtests/test_mesh_serial_waves.py: 766 passed.This does not explain the stalls @HasiKe reported on the RTX 2070 SUPER, and it does not clear the change: it only shows that this shape (loops of different length per pass, barriers in the loop) is not by itself the fault on this card and driver. Not checked: the same fixture on their card and driver (616.56), which is the test that would count; and whether their stalls have the GPU busy or idle. The "do not merge yet" above stands.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T09:41:16Z.
For the record beside the open problem above, a third card, not mine: @MoonEyes on an RTX 4060 8 GB (NVIDIA 610.88, Windows 11, GPU timeout at the Windows default of 2 s): https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7214788506. Before: 9 of 13 runs lost the device, 7 of those with one mesh draw started and not finished. With the mesh programs retranslated from this branch (
cd25a5c95; 9,235 of 9,282 change form,spirv-valclean on 301 sampled): one run, reached its 910 s limit with no device loss and no driver fault line. They list as not checked: picture correctness, a second run (queued), a raised timeout.So the cards stand like this, serial form: RTX 4080 four runs of 630 to 872 s without loss or stall; RTX 4060 one run without loss; RTX 2070 SUPER six boots with no mesh draw at a loss site but three stalls. The stalls are unexplained and the "do not merge yet" stands.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T10:56:14Z.
Update on the open problem (the stalls on the RTX 2070 SUPER). Two measurements since my "do not merge yet":
maind1dff7949(https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7215729620): the same stall lines, with the direct queue 0.4 % and 8.1 % busy, with the serial form and with the stock side-by-side form alike.What this settles: the hypothesis that the serial form hangs a workgroup is not supported; the stalls are not GPU work. What it does not settle: on HasiKe's card the stock set had no failure before the world in 11 boots on
e5a7c8942, and the serial form had stalls in 4 of 9, so the serial form may still make that CPU-side wait more likely there, for instance by changing timing. They report one pre-world loss in three stock boots on a newer main and plan to bisect the wait on stock shaders.So I withdraw "do not merge yet" as a statement that this change is known to be wrong, and leave the above as the known risk for whoever reviews it. The switch is off by default either way.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-27T11:10:43Z.
On fixed-wave64 gfx906 (RADV 26.0.8) at
dbdef2efd, I could verify the compute exclusion, not native serial mesh execution. This device has noVK_EXT_mesh_shader; the native harness exits 77 before pipeline creation.For both hand-written fixtures,
ms_w64x_wave_votesandms_w64x_wave_loops, the emulated serial mesh module validated withLocalSize 64, versus 128 without serial. With--mesh-compute, toggling the serial flag produced byte-identical compute modules and companion vertex modules. On this adapter, both fixtures matched the expected values at all 4,096 pixels in each compute configuration, including native wave64 without emulation. Making only one wave's expected result wrong made the pixel check fail for either wave.This confirms the non-mesh path is unchanged; it does not test serial-path performance, hangs, or the outstanding merge concern.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T11:26:15Z.
Correction to the evidence listed above: the RTX 4060 entry does not hold. @MoonEyes has corrected their report (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7216968027): in the run I cited as "reached its 910 s limit with no device loss", the game stopped presenting before the foliage mesh pipeline was built, so that pipeline was never drawn while frames were shown; four more runs with the same shaders stopped presenting at 299 to 380 s. Their runs without this change stop presenting at the same point and then lose the device. Their reading: the common event is the game ceasing to present on that 8 GB card, possibly from memory; whether this change removes the long mesh draws there is still open.
So the cards now stand: RTX 4080, measured mesh draw time 1.04 ms to 0.074 ms and five runs without loss; RTX 2070 SUPER, no mesh draw at a loss site in nine boots, with the other failures described above; RTX 4090, synthetic fixtures only; RTX 4060, no evidence either way. Please disregard my earlier line that counted the RTX 4060 as a clean run.
Imported from ubiquitarianism/leonida. Originally posted by GrahamboJangles on 2026-11-27T11:28:27Z.
Reviewed the translation work at
dbdef2efd(pure Python on Windows, no llvm-mc/spirv-as on PATH, so the repo's own new tests skip locally; CI already shows them green).Verified locally:
2 > v0, OR v0 == 64) covers threads 0, 1 and 64 as the header comment claims._translate:"store" in opcatches every global write the translator implements, image writes included — its only image-write mnemonic isimage_store(emitsOpImageWrite); atomics andds_are covered by the other two terms. No mnemonic escapes the check.%local_indexscoping: only (hdr, dec, gvars) are renamed to%real_local_index, so every other load of%local_index(the mesh prologue's%lidx,Gen.local_index()) is inside%mainand reads the per-pass Function variable, whichms_serial_passesstores at the loop head before those loads run.v5 = wbase + lidxand the wave idlidx >> 6then see pass w's lanes, 64w..64w+63.gen.eager_varsandgen.x_spillsdeclare Function variables with no initialiser, so they are not set again per pass — a value written in pass 0 can still be there when pass 1 reads it. That only matters for a read-before-write, which is already undefined in the side-by-side form, so it cannot diverge for any defined program; noting it because it is the one state serialisation shares between waves.ms_serial_epiloguerenames every id the write block defines per pass (exports to their__wtwins,%mlito%mli_w{w}), keeps ids defined earlier intact; ids reserved up front (g.cu(k),g.cu(64*k)) keep the loop's constants from colliding withinsert_late_constants.Nothing here speaks to the open problem above — the RTX 2070 SUPER stalls are a runtime-side investigation still in flight, and my findings say nothing about it.
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T12:56:54Z.
Merged main (
3d6050b96) into the branch asad1789d7eto clear a conflict indocs/design.md(one table row beside ours; I kept our row and took main's text of the other). Locally after the merge:tests/test_translate.pywithtests/test_mesh_serial_waves.py768 passed, and the 8 mesh GPU fixtures pass side by side and in series on the RTX 4080.CI on
ad1789d7e:translator-tests,semantic-tests,viewer-tests,change-scope,no-game-datapassed;stdlib-tests-linuxstill running. Not passed, the same places as oncd25a5c95:linux-gpu-tools(build,vk_null_descriptor_test.cpp:97),windows(vk_xdxr_postbuild_readback),macos-python(test_calibrated_texture_extra.py, one test),check(cancelled at 15 minutes), andmacos(ps_ssharp, plus nowcs_imgatomic_ext, a compute fixture that came in with main). None is in a file this pull request changes.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T16:24:39Z.
In-game A/B on an 8 GB laptop (profile M) for this PR. Both arms use the same executable, recipe, caches and input script; only the mesh programs differ, retranslated with this PR's
--mesh-serial-waves(headad1789d7e) in arm B. A second agent on the same machine recomputed the numbers from the raw logs. AI-assisted (Claude Code, Claude Opus 5.5).Not fixed by this PR, in either arm: the display drops to ~0.2 frames/s right after world entry. Without the PR the GPU sits at 100 % during that stop; with it, the long submissions are gone and the stop stays, so the stop has another cause. Another 8 GB machine (RTX 4060, 610.88) with this PR sees the same stop with an idle GPU. n=1 per arm.
Imported from ubiquitarianism/leonida. Originally posted by HasiKe on 2026-11-27T17:32:05Z.
RTX 2070 SUPER (8 GB), NVIDIA 616.56, TdrDelay 30 s, n=3 each, same exe, Enter at 55 s: stock shaders ran 1 of 3 to the 600 s limit; this PR's retranslation 0 of 3. One lost the device at ~540 s, two stopped presenting at ~290/320 s. The stop looks like the 8 GB one on the 4060/4070 Laptop (CPU submit cost, GPU mostly idle), not something this PR causes or fixes. Details and memory numbers: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7224509859. AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T18:23:35Z.
Addendum to the RUN above (7223228320), for the merge test: this PR's own tests at the current head
ad1789d7epass locally on Windows 11 (python -m pytest tests/test_mesh_serial_waves.pywith the pins oftests/requirements.txt: 23/23). The game A/B above used the mesh pack retranslated withad1789d7e, the current head. AI-assisted (Claude Code, Claude Opus 5.5).Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-27T19:01:09Z.
Review: APPROVED
Approving again at the current head,
ad1789d7e, merged onto current main (43a9d562d) with no conflicts. Thanks for adding the early-ending wave test.tests/test_mesh_serial_waves.py: 23 passed, includingcd25a5c95's wave that ends early. GPU fixtures on llvmpipe under Wine (8-wide subgroups, so the emulated path) withLEONIDA_W64_EMULATE=1: all 8ms_fixtures pass side by side, and withLEONIDA_MESH_SERIAL_WAVES=1the threems_w64x_ones (ballot, the newwave_loops,wave_votes) pass at 4096/4096 exact. The new loops fixture is a good addition: two waves running loops of different length is the case where a mistake in the per-pass re-initialisation would show.I'm only approving the code and the tests here. The merge decision belongs with the open question about the RTX 2070 SUPER stalls you listed.
Imported from ubiquitarianism/leonida. Originally posted by qhukz13 on 2026-11-27T20:16:02Z.
Code read of
ad1789d7e(no llvm-mc / SPIR-V tools on this machine, so the new tests skip here; CI and the RTX 4080 runs above cover them). I checked the two places where running the waves one after the other could lose state between passes:s_sendmsg MSG_GS_ALLOC_REQstores into%ms_counts, a Workgroup variable (tools/rdna2spirv.py:7953).ms_serial_passesre-initializes only Function variables that have an initializer, so a program where only wave 0 sends the request keeps pass 0's counts through pass 1, and the epilogue's singleOpSetMeshOutputsEXTreads them.%ms_*:%ms_pos,%ms_param{n},%ms_clip,%ms_cull_dist,%ms_prim,%ms_has_vtxand%ms_has_prim. Each one gets a per-pass twin, and the%ms_out_*targets are Output variables that are not copied. No export can skip the twins.One scope note, not a finding: the switch is off with
--mesh-compute, which is the path for every GPU withoutVK_EXT_mesh_shader(Pascal, and the other cards that need wave64 emulation the most). I'd like to extend it to--mesh-computein a follow-up built on this PR, unless you plan to.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by quartz-heron-58 on 2026-11-27T20:37:48Z.
@qhukz13 thanks for the read; both points match how I understand the pass loop. On
--mesh-compute: I do not plan to do it, so the follow-up is yours. One thing that may help: I only ever ran the switch on a card withVK_EXT_mesh_shader, so nothing here says how the serial form behaves through the compute path; it would need its own fixture run. AI-assisted (Claude Code).Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T22:49:52Z.
Merge-tested
ad1789d7e+ main43a9d562d(clean; also merges cleanly onto current main34e33d3dd, which does not touch this PR's files):tests/test_mesh_serial_waves.py23/23, all 23 fail with the code reverted to main; full pytest + semantic suites show no new failure vs main;check_no_game_dataclean. CPU-only tests on Windows 11 / Ryzen 5 3600. In game: OreoFR's A/B on an RTX 4070 Laptop 8 GB at this head, 0 gpu-stall lines vs 10, 0 device lost (https://github.com/ProjectLeonida/mandy/pull/2435#issuecomment-7223228320, https://github.com/ProjectLeonida/mandy/pull/2435#issuecomment-7225440645). Off by default; the RTX 2070 SUPER stall risk noted by HasiKe stays open.AI-assisted (Claude Code, Claude Opus 5.5)