Translator: gather a lane mask's bits where a merge takes it as data (SHADER-WAVE-LOOP-EXEC-VOTE) #2501
Closed
github-bot
wants to merge 6 commits from
github-bot/gh-2501 into main
AGit
pull from: github-bot/gh-2501
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
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 in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
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!2501
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2501"
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?
@Tyrannys on GitHub · 2026-11-27 20:11 UTC · original
Tyrannys:claude/wave-loop-exec-vote→main· +472 −0 · 6 files · 6 commits · closed without mergingClaimed in the coordination issue as: SHADER-WAVE-LOOP-EXEC-VOTE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7227253773). It follows up SHADER-LIB-LOOP-AT-GUARD and @quartz-heron-58's readback and per-loop limits (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7226518463). Thanks to quartz-heron-58 for narrowing it to one loop.
What and why
The translator runs one invocation per lane. It keeps a lane mask as that lane's own bit (0 or ~0), and data as the same number in every lane.
tools/lane_masks.pyworks out which registers hold a mask. A register that is a mask on one path into a merge and a number on another path is taken as data from the merge on. But nothing gathered the mask's real bits on the mask path. So after the merge, each lane's 0 or ~0 was read as if it were the number.The compiler makes exactly this merge when it walks the lanes of a ballot with a scalar loop:
On the first pass each lane found its own first bit and took its own number of passes, where the wave takes one:
--wave64-emulate: the work inside the loop ran a wrong number of times for every lane. The exchange rounds also run per lane there.quartz-heron-58's limits per loop point at the loop that holds two such bit loops (one per half of a ballot), in a library compute program. With the guard at its default, that program took about 258 ms per dispatch; capped at 64 passes, 0.24 ms. With this branch quartz-heron-58 measured 0.075 ms per dispatch and 1.44 → about 2.2 frames per second, with no device loss (#2501).
Fix.
lane_masks.insert_data_mergesadds a new translator-only instruction,s_mask_to_data_b32 sN, sN. It goes before a block's branch when:s_ff0/s_ff1/s_bcnt0/s_bcnt1/s_flbit, also through scalar copies and bitwise ops of it (thes_xor_b32into a register moved back on the back edge).For it,
rdna2spirvstores the wave's bits (lane_mask_word): the same number in every lane, as on hardware.wave64_emulate_optcounts the new instruction as a mask word reader. So it never ends up inside a folded lane-local region, where its cross-lane gather would run with only some lanes.Why only bit scans. A merged register that is only read as a mask again (written back to EXEC, ANDed with it, a
v_cndmaskmask) is already exact without the gather: the translator takes bit L of a data register for lane L (mask_src), and each lane's 0 or ~0 gives the same bit. The first version of this PR gathered for every read and changed about half the pipeline library (quartz-heron-58 counted 1,396 of 2,635) for no gain. Other number reads of such a merge (an add, a compare) would need the gather too. None is known in a shader, so they are left as before. That keeps the change to the lane loops.Reach. On a local
--wave64-emulatetranslation of the title's shaders, this changes 31 of 2,684 pipeline-library programs and none of the other shader folders (about 47,000 programs in all). The wider first version changed about 8,000.Tested
tests/semantic/test_ballot_bit_loop.py. It is a hand-written wave64 program in the shape above: an outer loop over each lane's work items, 64 apart, that ends whenv_cmpx_le+s_andn2_b64 saved, saved, execleaves no lane. Inside it are one bit loop over each half of a ballot, each with a lane-locals_cbranch_execzregion.--wave64-emulateon 32-wide subgroups (structured), and--wave64-emulatewith the round scheduler.main, all 3 native runs fail withSubgroupDivergenceError, and the emulated runs give wrong per-lane counts (for example 64 visits where 32 are expected).tests/test_lane_masks.py(new cases): checks where the instruction goes (before the branch, only for the register that is scanned, also through a copy). Nothing is inserted where the merge is only read as a mask, where a successor still reads a mask, where both paths carry one, or for an add.scripts/run_semantic_tests.py tests/semantic: 503 files, 6389 tests, 0 failed.GPUs tested: n/a (CPU interpreter).
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (Not a new instruction rule: a fix to how an existing mask-vs-data merge is lowered. I can add a row if reviewers want one.)🤖 Generated with Claude Code
@quartz-heron-58 on GitHub · 2026-11-27 20:36 UTC · original
The game run you asked for, at head
80894fcf1. It ends the runaway loop. Two things to look at: the picture differs from a narrower variant of the same fix, and the change reaches about half of the compute library. AI-assisted (Claude Code).Setup. RTX 4080 16 GB, NVIDIA 621.24, Windows 11, 32 GB. My earlier recipe: nothing skipped, loop guard at its default for every loop, 600 s, one run each. My library is built with the one-lane-fold branch's tools, so I applied this PR's
tools/diff to that copy (it applies cleanly) and retranslated onlylib_cs_03010with--wave64-emulate; everything else in the run is unchanged.lib_cs_03010translated withSo yes: this is what kept loop 2 at the guard, and the run survives.
Picture (by eye, screenshots every 60 s, one run each, so weak). No fix and the narrower prototype look alike: a lit scene in every shot from 300 s on. With this PR the scene is much darker with banding on some surfaces, and the shots at 361 s and 481 s are entirely black (420 s is not). It does not wash out to white. I cannot say which of the two is right, only that the two variants of the fix do not give the same picture. A repeat of each would be the next check.
Reach. Whole pipeline library,
--wave64-emulate --no-asm --no-validate, this branch against main43a9d562d: 2,635 programs translate both ways and 1,396 of them come out different. In a random sample of 40 of those, 5 gained barriers (642 to 700 in the sample) and 35 have the same number; the differing programs grow 0.9% in bytes. The narrower prototype differs in 2 programs (lib_cs_03010,lib_cs_03012). Its condition is the one in my comment on #1608: gather only when the dropped value reachess_ff1/ff0/bcnt/flbitbefore it is overwritten. None of the 1,394 others has been run in a game by me with this change.Correction to my #1608 comment 7227273277: with plain liveness my own copy does not make "9 sites" in this program. It makes 23 insertions over the rounds, on seven registers besides the two ballot words, and the module has 73 barriers. I miscounted from a cut-off log.
I can run any variant you want on the same recipe: this branch with the narrower condition, or a repeat of either for the picture.
@quartz-heron-58 on GitHub · 2026-11-27 20:57 UTC · original
Correction to the picture paragraph above: withdraw it. I repeated both variants once (same recipe, same machine), and the picture is not stable from run to run, so it says nothing about either variant. AI-assisted (Claude Code).
lib_cs_03010translated withNo device loss or exception in any of the four. So the two variants cannot be told apart by the picture on my setup, and my earlier remarks about loop limits changing the picture (near white at 2,048, black at 64) were single runs too and should be read the same way. What makes the exposure swing between runs is a separate question I have not looked into.
What stands from the comment above: the pass's time and the frame rate (now two runs each), the barrier counts, and the reach of 1,396 of 2,635 library programs against 2.
@Tyrannys on GitHub · 2026-11-27 21:41 UTC · original
@quartz-heron-58 thank you for both runs, the reach count and the correction. That settled it: the loop ends, and the first head reached far too wide.
The head is now
660f609d9and uses your narrower condition. It gathers only where the merged register can reachs_ff0/s_ff1/s_bcnt0/s_bcnt1/s_flbitbefore it is overwritten. The one difference: it also follows scalar copies and bitwise ops of the register (thes_xor_b32into a register that the back edge moves back). Where a merged register is only read as a mask again (EXEC, an AND with it, av_cndmaskmask), each lane's 0 / ~0 already gives the right bit. A new test shows that case exact with no gather.On my local
--wave64-emulatetranslation this changes 31 of 2,684 library programs and nothing outside the library. Inlib_cs_03010the gather goes in exactly twice, at the entries of the two bit loops. My 31 are more than your 2, probably because I follow copies and count all five scans.Could you run the new head once with the same recipe? Just the time per dispatch and the frame rate. Since the picture varies run to run, it does not need judging. If you can, also tell me how many programs change on your side. AI-assisted (Claude Code).
@quartz-heron-58 on GitHub · 2026-11-27 22:10 UTC · original
Run of head
660f609d9, same machine and recipe (RTX 4080 16 GB, NVIDIA 621.24, nothing skipped, default loop guard, 600 s). It holds. AI-assisted (Claude Code).Reach on my side: the same as yours. Library with
--wave64-emulate --no-asm --no-validate, this head against its merge base with main (39f52f39c): 2,635 programs translate both ways, 31 differ.lib_cs_03010andlib_cs_03012: with this PR'stools/diff applied to the tools copy my library is built with (it applies cleanly), both modules come out byte-identical to the ones from my narrower prototype (52 barriers inlib_cs_03010). So my two earlier runs of that prototype are runs of this head's modules: the pass under the profiler's 120-row cut in all windows, 2.13 frames/s in both.The other 29: my earlier game runs request 9 of them. I retranslated those 9 the same way (all 9 differ from what I had), precompiled them with the runtime's
--precompile-pipelines(9 compiled, 0 failed, 250 s), and ran once with all 11 in place:lib_cs_03010in the profiler's rowsNone of the 9 was a hot program before or after; each is dispatched about once a frame and costs hundredths of a millisecond either way, so nothing here says whether their results changed, only that they build, run and do not hang. One run; the frame-rate difference is within what I see between repeats. The other 20 changed programs are not requested in my runs. Picture not judged, as agreed.
@Tyrannys on GitHub · 2026-11-28 00:09 UTC · original
@quartz-heron-58 thank you, that closes the loop: the same 31 programs on both sides,
lib_cs_03010andlib_cs_03012byte-identical to your prototype's, and the other 9 the game asks for build and run with no hang or device loss. I have nothing further to change here unless a reviewer asks. AI-assisted (Claude Code).@timbot103 on GitHub · 2026-11-28 00:53 UTC · original
Independently checked head
660f609d9on Windows 11 Pro 26200, Vulkan SDK1.4.363.0, WSLllvm-mc 21.1.8, across both NVIDIA GeForce RTX 5080 (616.64) and AMD Radeon(TM) Graphics (25.10.30.02), no game files.Local semantic & dual-GPU verification:
tests/semantic/test_ballot_bit_loop.py: 2/2 OK.scripts/run_gpu_tests.py --filter cs_w64(LEONIDA_W64_EMULATE=1,LEONIDA_VK_VALIDATION=1): 25/25spirv-valclean; 24/24 PASS on RTX 5080 and 24/24 PASS on AMD Radeon, 0 validation errors.Static code review notes:
tools/lane_masks.py(converting only when every successor consumes the mask as data and some successor numerically scans it vias_ff0/ff1,s_bcnt0/1,s_flbit, with conservatives_movrelshandling and SCC-preserving placement before the terminator) is cleanly structured and guaranteed to terminate.step()treatss_mask_to_data_b32as producing data (not a mask copy) so repeated passes cannot insert duplicates; a unit test asserting a secondinsert_data_mergescall returns0would pin idempotence.s[26:27]), add a wave64 test verifying the high half (s27/s_bcnt1_i32_b64ors_ff1_i32_b64) gathers lanes 32–63 properly.--wave64-emulategather barrier round relies on blocks being reached via wave-uniform scalar branches.Overall looks clean and well-tested. AI-assisted.
@Tyrannys on GitHub · 2026-11-28 01:34 UTC · original
@timbot103 thank you for the dual-GPU run and the review. All three items are in
4adc6815a:step()now namess_mask_to_data_b32explicitly as writing data. It already took the default data path, so nothing changes in what it produces.tests/test_lane_masks.pyasserts that a secondinsert_data_mergescall returns 0, for the bit loop and for each diamond case.s_bcnt1_i32_b64ands_ff1_i32_b64ofs[6:7]) gathers boths6ands7, so lanes 32-63 come from the high half.tests/semantic/test_ballot_bit_loop.pyalready runs the high half end to end (lanes 32-63 throughs27), natively and emulated.--wave64-emulatethe gather is an exchange round that relies on its block being reached by the whole wave through scalar branches, and thatwave64_emulate_optkeeps it out of lane-local regions.tests/test_lane_masks.pyandtest_ballot_bit_loop.pypass; the full semantic suite is still running here, and I will note the result. AI-assisted (Claude Code).@Tyrannys on GitHub · 2026-11-28 01:36 UTC · original
Full translator semantic suite on
4adc6815a: 503 files, 6389 tests, 0 failed. AI-assisted (Claude Code).@kirigayakazima on GitHub · 2026-11-28 03:40 UTC · original
#2501 | head
4adc6815af| python -I -m unittest discover -s tests/semantic -p test_ballot_bit_loop.py & python -I tests/test_lane_masks.py | red: test_ballot_bit_loop Ran 2 tests - FAILED (failures=6, errors=3); test_lane_masks AttributeError: module 'lane_masks' has no attribute 'insert_data_merges' | green: test_ballot_bit_loop Ran 2 tests in 4.253s - OK; test_lane_masks ok | full suite: 506 files, 6399 tests, 0 files failed in 415 s (vs main02f71ccfe7: 505 files, 6397 tests, 0 failed); stdlib 514/521 passed (0 new failures); compileall=0; node viewer_streaming=0 | Windows 11, Python 3.14.7, no game files | AI-assisted: yes, Antigravity (Gemini)main02f71ccfe7;scripts/check_no_game_data.pypassed (0).4adc6815afc3.@DadaCap on GitHub · 2026-11-28 07:21 UTC · original
Thanks for this! Gathering a lane mask's bits into the wave's mask word where a merge uses it as data fixes ballot bit loops that diverged per lane.
During maintainer testing (local, 2026-11-28) (head
4adc6815a, merged on mainb1619e0a3/6dfca6428, Windows 11, Python tests via pytest/unittest) we found:lane_masks.py(the same step/analyse areas,Gen.insnand thewave64_emulate_opttable), reimplements theanalyse()fixpoint, and thedocs/design.mdcontract row is missing.To get this merged:
analyse()instead of a second fixpoint.docs/design.mdcontract row with how it was confirmed.AI-assisted (Claude Code), posted for DadaCap (maintainer).
@Tyrannys on GitHub · 2026-11-28 08:35 UTC · original
@DadaCap thank you for the review. Both points:
docs/design.mdcontract row: in19f6f8e1bon this branch ("Lane masks merged as data"). It says whats_mask_to_data_b32does and whereinsert_data_mergesputs it, why only bit scans get the gather, and how it was confirmed: the synthetic repro intests/semantic/test_ballot_bit_loop.py, quartz-heron-58's game timing, the full semantic suite and timbot103's dual-GPU run. It goes after the "Whole-wave masks" row, away from #1043's new row, so the two do not clash.On top of #1043, with one fixpoint: ready on a separate branch, https://github.com/Tyrannys/leonida/tree/claude/wave-loop-on-1043 (tip e01d1988f). It is #1043's head
4d58a05d6with this branch merged in.analyse()'s entry-state loop is nowlane_masks.entry_states(blocks, succ, wave64=, moves=).analyse()calls it, and so doesinsert_data_merges, so_fixpointand_mergeare gone. Thestep()andwave64_emulate_optchanges sit next to #1043's:s_mask_to_data_b32writes data instep()before #1043'smoveshandling, and it stays a_MASK_WORD_READERSentry beside #1043'smask_wordschecks.insert_data_mergesruns beforeGenworks out #1043'smoves. Those only change VGPR kinds, so the SGPRs it converts are the same.tests/test_lane_masks.pyok,test_ballot_bit_loop2/2, #1043's five semantic files ok, and the full suite (scripts/run_semantic_tests.py tests/semantic): 504 files, 6402 tests, 0 failed.Which do you prefer? I can move this PR onto that branch now and you review it against #1043's head, but the diff then shows #1043's commits until it merges. Or I keep the PR as it is and push the reworked version here as soon as #1043 merges. I'll go with your choice.
AI-assisted (Claude Code).
@lixonik on GitHub · 2026-11-28 10:11 UTC · original · approved these changes
Reviewed and verified at head
19f6f8e1b(Windows 11, Python 3.12, LLVM 21.1.8llvm-mc, Vulkan SDK1.4.363.1spirv-as/spirv-val).Verification
python -I tests/test_lane_masks.py -v: passed (ok).python -I tests/semantic/test_ballot_bit_loop.py -v: passed (2/2 tests, includingtest_a_merged_mask_used_as_a_mask_needs_no_gatherandtest_every_lane_walks_the_wave_ballotacrossnative64,emulate_sg32, andemulate_sg32_roundsfor counts 100, 200, and 7).python -I scripts/check_no_game_data.py: clean.Review notes
lane_masks.insert_data_mergescleanly restrictss_mask_to_data_b32insertion to blocks where every successor drops the SGPR from mask to data and at least one successor has a live word-scan read (_numeric_live_in), leaving mask-only merges untouched.wave64_emulate_opt._MASK_WORD_READERSincludess_mask_to_data_b32so emulated wave64 exchange rounds stay out of lane-local regions, and thedocs/design.mdcontract row matches the implementation.AI-assisted (Antigravity, Gemini).
@Tyrannys on GitHub · 2026-11-28 10:34 UTC · original
@lixonik thank you for the review and for checking
19f6f8e1b, the contract row against the code included. A note for later: if DadaCap wants this moved onto #1043 (see the comment above), the head will change to the merged branch, whose only change in logic is the sharedlane_masks.entry_states()fixpoint. I'll say so here when that happens.AI-assisted (Claude Code).
@azsekazvamdimitar on GitHub · 2026-11-28 17:31 UTC · original
In-game check of this branch on NVIDIA, for the record:
493867366plus #2566, #2391 and #1086 (with a local fallback that makes #2566's arena one allocation on this card), shaders translated with--wave64-emulateand--mesh-serial-waves. #2501 was merged onto that base (onlytools/lane_masks.pyconflicted, both sides kept) and onlylib_cs_03010was retranslated with it.lib_cs_03010costs 368-401 ms per dispatch (one 5x5x30 dispatch a frame). Swapping the loop guard limit per loop showed loop 4 (thes_ff1_i32_b32 s32, s26bit loop over the coarse-test mask) running into the 65536-iteration guard every frame: with a 1024 limit the dispatch took 4.9-5.5 ms, and with a limit of 1024 x loop number it took 18.8-19.3 ms.On reach: a separate scan over the 2684 library programs that taints registers dropped at a mask-to-data merge and follows them through copies and bitwise ops still flags 23 programs after
insert_data_merges(mostlys_bcnt1_i32_b64ofs_and_b64 x, execchains, e.g.lib_cs_01175at 0xc00/0xc34,lib_cs_020200x5d94,lib_cs_025870x14cfc). That scan is cruder than yours and may over-count; I haven't checked those cases by hand.AI-assisted.
@ammonium231 on GitHub · 2026-11-28 19:28 UTC · original
Heads-up: this and #1043 conflict in
tools/lane_masks.pyanalyse()on current main (6b3d76df2), and this one also conflicts with main indocs/design.md. crosslane_fuzz, 2000 programs, seed 250100, RTX 3090: this PR gives 59/26 mismatches (wave32 native/wave64 emulate), same as main; #1043 +github.com/ammonium231/leonida@31fefc41egives 0/0.@azsekazvamdimitar on GitHub · 2026-11-28 21:42 UTC · original
Follow-up to my comment above: those boots ran with all native PSOs failing (a mistake in my shader folder layout, unrelated to this PR), so the frame rates there are not reliable. Re-measured with every native PSO created (RTX 3090, NVIDIA 590.48.01, Linux, GE-Proton, Series X).
In a set without this PR, lib_cs_03010 still costs 386-389 ms per dispatch (once a frame). In the set with this PR's translation of the library, it is gone from the top-20 GPU profile, and compute is 0.53-0.59 s per frame. With the library translated with this PR (together with
--mesh-serial-wavesand--compute-serial-waves), the game reaches 1.17-1.58 frames/s in world, with no device loss in two 10-minute boots and the same picture. The conclusion stands: this PR removes a loop that ran into the 65,536-iteration guard every frame. AI-assisted.@TheGeogeo on GitHub · 2026-11-29 04:50 UTC · original
Checked
19f6f8e1bagainstmainef3299584on Windows 11 10.0.26300: it does not merge (git merge-tree --write-tree), so I ran no tests.docs/design.md:mainreworded the "Whole-wave masks" row, and this PR adds its "Lane masks merged as data" row right after it.tests/test_lane_masks.py:mainaddedtest_wave32_parked_lane_wraps_mod_32(87fde5c8d, 2026-11-25) where this PR addstest_mask_meets_data_at_a_merge, and both are added to the same__main__list.mainhas noinsert_data_merges/s_mask_to_data_b32. The rebase looks mechanical: keep both rows and both tests.AI-assisted (Claude Code).
@aslan2142 on GitHub · 2026-12-01 11:56 UTC · original · requested changes
Reviewed against current
main: gathering a lane mask's bits where a merge takes it as data (tools/lane_masks.py,tools/rdna2spirv.py) looks well-tested, but this branch conflicts withmainintools/lane_masks.pyand has failing CI. Please rebase onto currentmainso CI runs cleanly.(AI-assisted review.)
@aslan2142 on GitHub · 2026-12-01 16:45 UTC · original
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.Pull request closed