rdna2spirv: --mesh-serial-waves, an emulated mesh program's waves one after the other (SHADER-W64-MESH-SERIAL-WAVES) #2435
Open
github-bot
wants to merge 6 commits from
github-bot/gh-2435 into main
AGit
pull from: github-bot/gh-2435
merge into: github:main
github:main
github:docs/animation-merge-remnants
github:docs/story-dedup-and-cli
github:docs/restofworld-merge-remnants
github:docs/gamedata-dedup-tables
github:docs/textures-bcpack-tables-and-cli
github:docs/exe-fail-fast-shims-sync
github:fix/address-guard-wraparound-parity
github:fix/cvt-f16-denorm-and-clamp
github:docs/pso-cache-scope-note
github:docs/viewer-readme
github:docs/textures-arrays-dds-preview
github:docs/conformance-readme-status
github:fix/docs-validators-fences-urls
github:claude/loop-total
github:claude/pops-collision-seed
github:claude/dstorage-hold-page-reads
github:claude/host-image-copy-switch
github:feat/gdk-lifecycle-window-hook
github:claude/d16s8-uav-nvidia-fallback
github:feat/mfplat-offline-shim
github:claude/gameinput-slow-reader
github:fix/rt-null-barrier-clear
github:claude/depth-resolve-sample-positions
github:integration/palmetto-parity
github:claude/valu-literal-sext
github:claude/slot74-pool-handle
github:claude/rgb9e5-uint-alias-view
github:claude/fssm-root-layout-tables
github:feat/gdk-speech-display-lifecycle
github:asset-audio-skip-current
github:qemmhd/old-9940-rectangle-quad-lists
github:feat/ws2-offline-shim
github:qemmhd/rt-d16-unorm-uav
github:feat/xs-device-stops-7-9
github:qemmhd/rt-depth-same-base-shapes
github:qemmhd/rt-lazy-attachment-variant
github:feat/acphal-xma2-decoder
github:asset-audio-skip
github:codex/coord-claim-check-20261124-7e48
github:feat/xs-frame-pacing-presentx
github:feat/xs-device-vm-options
github:old-pr/9844
github:old-pr/9978
github:old-pr/9815
github:old-pr/10057
github:old-pr/9874
github:old-pr/9965
github:old-pr/9863
github:old-pr/10068
github:old-pr/10066
github:old-pr/10067
github:old-pr/10007
github:old-pr/10061
github:old-pr/10065
github:old-pr/10059
github:old-pr/10063
github:old-pr/10055
github:old-pr/10062
github:old-pr/10042
github:old-pr/10041
github:old-pr/10049
github:old-pr/10047
github:old-pr/10046
github:old-pr/10045
github:old-pr/10056
github:old-pr/10043
github:old-pr/10036
github:old-pr/10034
github:old-pr/9984
github:old-pr/10052
github:old-pr/10038
github:old-pr/10033
github:old-pr/10028
github:old-pr/10050
github:old-pr/9891
github:old-pr/9889
github:old-pr/10051
github:old-pr/10019
github:old-pr/10027
github:old-pr/10029
github:old-pr/10031
github:old-pr/10026
github:old-pr/9941
github:old-pr/10030
github:old-pr/10040
github:old-pr/9990
github:old-pr/10021
github:old-pr/9962
github:old-pr/10022
github:old-pr/10020
github:old-pr/10015
github:old-pr/10025
github:old-pr/9886
github:old-pr/10048
github:old-pr/10014
github:old-pr/10011
github:old-pr/9861
github:old-pr/10010
github:old-pr/10008
github:old-pr/9860
github:old-pr/10006
github:old-pr/9920
github:old-pr/9995
github:old-pr/10000
github:old-pr/10016
github:old-pr/10004
github:old-pr/10023
github:old-pr/9982
github:old-pr/9981
github:old-pr/9983
github:old-pr/9970
github:old-pr/9969
github:old-pr/9968
github:old-pr/9971
github:old-pr/9972
github:old-pr/9942
github:old-pr/9963
github:old-pr/9960
github:old-pr/9964
github:old-pr/9985
github:old-pr/9973
github:old-pr/9862
github:old-pr/9953
github:old-pr/10017
github:old-pr/9952
github:old-pr/9955
github:old-pr/9946
github:old-pr/9954
github:old-pr/9938
github:old-pr/9956
github:old-pr/9856
github:old-pr/9947
github:old-pr/9924
github:old-pr/9961
github:old-pr/9927
github:old-pr/9979
github:old-pr/10032
github:old-pr/9926
github:old-pr/5237
github:old-pr/9951
github:old-pr/9931
github:old-pr/9902
github:old-pr/9921
github:old-pr/9994
github:old-pr/9775
github:old-pr/9768
github:old-pr/9905
github:old-pr/9936
github:old-pr/9901
github:old-pr/9904
github:old-pr/9906
github:old-pr/9988
github:old-pr/9908
github:old-pr/9909
github:old-pr/9911
github:old-pr/9912
github:old-pr/9913
github:old-pr/9887
github:old-pr/9916
github:old-pr/9919
github:old-pr/9925
github:old-pr/9933
github:old-pr/9935
github:old-pr/9918
github:old-pr/9879
github:old-pr/9880
github:old-pr/9881
github:old-pr/9996
github:old-pr/9876
github:old-pr/9892
github:old-pr/9899
github:old-pr/9915
github:old-pr/9914
github:old-pr/9872
github:old-pr/9869
github:old-pr/9866
github:old-pr/9819
github:old-pr/10012
github:old-pr/9857
github:old-pr/9893
github:old-pr/9897
github:old-pr/9928
github:old-pr/9868
github:old-pr/9917
github:old-pr/9940
github:old-pr/9873
github:old-pr/9816
github:old-pr/10009
github:old-pr/9900
github:old-pr/9966
github:old-pr/9859
github:old-pr/9843
github:old-pr/9991
github:old-pr/10058
github:old-pr/9883
github:old-pr/9838
github:old-pr/9835
github:old-pr/9959
github:old-pr/9895
github:old-pr/9837
github:old-pr/9858
github:old-pr/9865
github:old-pr/9864
github:old-pr/9840
github:old-pr/9820
github:old-pr/4669
github:old-pr/9848
github:old-pr/9850
github:old-pr/9810
github:old-pr/9799
github:old-pr/9853
github:old-pr/9875
github:old-pr/9831
github:old-pr/9796
github:old-pr/9801
github:old-pr/9813
github:old-pr/9794
github:old-pr/7417
github:old-pr/9781
github:old-pr/9806
github:old-pr/9958
github:old-pr/9809
github:old-pr/9791
github:old-pr/9792
github:old-pr/10053
github:old-pr/9784
github:old-pr/9789
github:old-pr/9849
github:old-pr/9846
github:old-pr/9773
github:old-pr/9785
github:old-pr/9803
github:old-pr/9826
github:old-pr/9839
github:old-pr/9922
github:old-pr/9948
github:old-pr/7189
github:old-pr/9957
github:old-pr/9823
github:old-pr/9807
github:old-pr/9851
github:old-pr/9774
github:old-pr/9830
github:old-pr/9836
github:old-pr/9822
github:old-pr/9783
github:old-pr/9833
github:old-pr/9890
github:old-pr/9770
github:old-pr/9769
github:old-pr/9772
github:old-pr/9787
github:old-pr/9852
github:old-pr/9834
github:old-pr/9845
github:old-pr/9871
github:old-pr/9771
github:old-pr/9776
github:old-pr/10005
github:old-pr/9949
github:old-pr/9923
github:old-pr/9805
github:old-pr/9829
github:old-pr/9790
github:old-pr/9827
github:old-pr/9929
github:old-pr/9855
github:old-pr/9934
github:old-pr/9907
github:old-pr/9910
github:old-pr/9779
github:old-pr/9780
github:old-pr/9885
github:old-pr/9882
github:old-pr/9877
github:old-pr/9998
github:old-pr/4251
github:old-pr/9987
github:old-pr/9989
github:old-pr/9950
github:old-pr/9777
github:old-pr/10044
github:old-pr/9884
github:old-pr/2906
github:old-pr/5076
github:old-pr/9937
github:old-pr/9986
github:old-pr/3014
github:old-pr/9943
github:old-pr/9939
github:old-pr/4682
github:old-pr/4765
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
question
Further information is requested
wontfix
This will not be worked on
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
github/ubiquitarianism--leonida!2435
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@quartz-heron-58 on GitHub · 2026-11-27 04:54 UTC · original
quartz-heron-58:mesh-serial-waves→main· +383 −4 · 8 files · 6 commits · openClaimed in the coordination issue as: SHADER-W64-MESH-SERIAL-WAVES (#1608)
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
@quartz-heron-58 on GitHub · 2026-11-27 05:11 UTC · original
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: #1608. So llvmpipe moves out of the "not checked" list above; AMD and Intel hardware and in-game picture correctness stay in it. Thank you.@ecox982745 on GitHub · 2026-11-27 05:16 UTC · original · edited 2026-11-27 06:47 UTC
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.@tiguan26 on GitHub · 2026-11-27 05:18 UTC · original · approved these changes
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.@quartz-heron-58 on GitHub · 2026-11-27 05:27 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 05:42 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 07:12 UTC · original
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.@quartz-heron-58 on GitHub · 2026-11-27 08:27 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 08:41 UTC · original
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: #1608. 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.@quartz-heron-58 on GitHub · 2026-11-27 09:27 UTC · original
Open problem, please do not merge yet. @HasiKe's second series on the RTX 2070 SUPER (NVIDIA 616.56) with this branch: #1608. 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.@quartz-heron-58 on GitHub · 2026-11-27 09:30 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 09:41 UTC · original
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): #1608. 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.
@quartz-heron-58 on GitHub · 2026-11-27 10:56 UTC · original
Update on the open problem (the stalls on the RTX 2070 SUPER). Two measurements since my "do not merge yet":
maind1dff7949(#1608): 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.
@zmasi on GitHub · 2026-11-27 11:10 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 11:26 UTC · original
Correction to the evidence listed above: the RTX 4060 entry does not hold. @MoonEyes has corrected their report (#1608): 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.
@GrahamboJangles on GitHub · 2026-11-27 11:28 UTC · original
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.
@quartz-heron-58 on GitHub · 2026-11-27 12:56 UTC · original
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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.