Translator: wave64 programs no other form takes run in the paired form (from mandy) #543
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!543
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-543"
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?
@voiceovarian1-max on GitHub · 2026-12-03 08:54 UTC · original
voiceovarian1-max:paired-wave64→main· +2625 −39 · 7 files · 1 commits · openPorted from ProjectLeonida/mandy: its paired form of console wave64 compute programs, for 32-lane hosts (NVIDIA, Intel). On such a host, a wave64 program that every other form refuses ("no wave32 lowering for this wave64 program") is not translated now, and its dispatches are dropped. Issue #311 reports 17 such programs, and #258 two of them.
The paired form runs each console wave of 64 as one host wave of 32 threads, with each thread lowering two console lanes (n and n + 32) and the whole wave taking every per-lane branch. A reduction, ballot, first-lane read or wave-wide branch is then the host wave's own: no exchange between host waves through LDS and no group barrier, which the wave-wide form needs.
What is in it
emit/paired.rs,emit/lower.rs: the form (each instruction lowered for the lower lane, then the upper one; each lane's values kept apart).emit/mod.rs:VICTORY_PAIRED_LANESdecides when the form is tried:1: last of all, for a program every other form refused, and right before the wave-wide form where that form is asked for;exact: before the approximate forms;first: before every form;0: never.barriers_on_every_way: groups of several console waves that meet only at barriers each wave passes once.translation_fingerprint.shader_cache.rs: the switch is in the cache key's switches.emit/paired_tests.rs: 16 tests.Provenance: mandy 8d300d783 and 1411b6ca3 (NotRexed), e10e9d007 and 55c6dcbb2 (Zack), 0bc6e21a1 (NotRexed, after voidopcode/vilocity add4873) and 9899a9801 (NotRexed); mandy's form is itself after TaynanGT/Vice-Tay 5e588e8. All are GPL-3.0(-or-later), and the comments name each source.
Not taken from mandy:
partial_active): spilled programs are refused;It is about 2,600 lines, 1,044 of them tests. The form is one piece: the lowering needs both lanes' state, and the tests check its results.
Tested
cargo test --workspace --locked -- --test-threads=4: 1,374 passed, 0 failed, 50 ignored (29 binaries), noSKIPPED.victory-shaderalone: 345 passed, 0 failed, 4 ignored. The 16 paired tests ran on the card.cargo xtask policy: ok.-NoPrepare(cache filled byvictory shadersbeforehand):victory shaders: 17 programs refused with "no wave32 lowering" without the form, 4 with it. The form takes 24 programs: those 13, plus 11 that took the wave-wide form before.VICTORY_PAIRED_LANES=0and the default, with keys pressed by the layer alone (VICTORY_KEYS, no input from the PC). Same frame rate in the same scene: 33-37 fps without the form, 32-36 with it. The same scenes, no device removal, no crash.Not tested
exactandfirstin the game (unit tests only).AI use
Claude Code with Claude Opus 5.5 ported mandy's code onto this tree, dropped the parts above, ran the builds, tests and game runs on the hardware named, and wrote this description.
🤖 Generated with Claude Code
On a host of 32-lane waves, a console wave64 compute program that every form refuses ("no wave32 lowering for this wave64 program") is not translated, and its dispatches are dropped. The paired form runs each console wave of 64 as one host wave of 32 threads, each thread lowering two console lanes (lane n and lane n + 32), with every per-lane branch taken by the whole wave. Its wave-wide values (reductions, ballots, first-lane reads, wave-wide branches) are then the host wave's own: no exchange between host waves through LDS and no group barrier, which the wave-wide form needs. Refused for what it does not take: spilled programs, groups that do not fill their console waves, LDS operations other than dword reads, writes and order-free atomics, and groups of several console waves whose host waves would have to meet at a barrier after going their own ways (unless each barrier is one every wave passes once, `barriers_on_every_way`). VICTORY_PAIRED_LANES: - unset or 1: tried last, for a program every other form refused; and right before the wave-wide form where that form is asked for (VICTORY_WAVE_WIDE=1 or the profile's wave-wide roles); - exact: also before the approximate forms; - first: before every form; - 0: never (the translation as before). The switch is part of the translation (translation_fingerprint and the shader cache's switches). Ported from ProjectLeonida/mandy (GPL-3.0-or-later): 8d300d783 and 1411b6ca3 (NotRexed, the form and LEONIDA_PAIRED_LANES), e10e9d007 and 55c6dcbb2 (Zack: sub-dword, multi-dword and strided LDS, v_readlane of restored lanes), 0bc6e21a1 (NotRexed, after voidopcode/vilocity add4873: LDS compare-and-store and groups of several console waves), 9899a9801 (NotRexed: LDS subtracts). mandy's form is itself after TaynanGT/Vice-Tay 5e588e8 (GPL-3.0; Geckomacabre and fxceless, after ByFxbian's fxceless/victory-fork #1397, PiloteCode #854 and darkworldhm 840243e2). Not taken: mandy's counted dispatches (`partial_active`; spilled programs are refused) and its lists of programs by hash. Measured on an RTX 4070 Ti 12 GB with a retail title (Series S profile): of its 25,781 programs, `victory shaders` refuses 17 with "no wave32 lowering" without the form and 4 with it; the form takes 24 programs in all (13 of those refused, 11 that took the wave-wide form). In the game, four runs alternating VICTORY_PAIRED_LANES=0 and the default: the same frame rate in the same scene (33-35 fps both). In both runs with the form the game went on from a scene where the character stands at a window into a cutscene and the next tutorial step about 110 s in, with no input; in neither run without it, nor in six earlier runs of main, did it leave that scene. Tests (emit/paired_tests.rs, 16): the paired form's results against what the console computes, on the card (and on WARP where it has 32-lane waves): wave sums, ORs, counts, first lanes and ranks, ballots of masks, a backward permute, LDS written by one half and read by the other (dword, wide, strided and sub-dword), tile minimum and maximum atomics, and a group of several console waves at barriers each wave passes once; which form each VICTORY_PAIRED_LANES value takes. Co-Authored-By: Claude Opus 5.5 <[email protected]>9f500731c3to81c01edca8@voiceovarian1-max on GitHub · 2026-12-03 10:04 UTC · original
Combined test of this PR with #521, #543 and #544-#556, all merged onto
main7dbcdcb(branch fox-all of voiceovarian1-max/foxhound):cargo test --workspace --locked -- --test-threads=4: 1,415 passed, 0 failed, 50 ignored (29 binaries), noSKIPPED.VICTORY_KEYS, no input from the PC): window scene 38-42 fps against 34-37 formainon the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes.Tested by Claude Code with Claude Opus 5.5 on the hardware named.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.