Shaders: lane masks keep their bool form unless a read may see an integer #26
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/ThatRecompDev--five-star-recomp!26
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/26/head"
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?
@Sr-0w on GitHub · 2026-11-25 10:46 UTC · original
Sr-0w:shaders/mask-forms→main· +280 −5 · 14 files · 2 commits · merged 2026-11-25 11:02 UTCStacked on #25 (its decoder fix is the first commit here: the new case's assembled code comes from llvm-mc 23). Review only the second commit; I'll rebase once #25 is in.
Mask tracking follows emission order, so a register that is a lane mask on one path and an integer on another is kept in its integer variables: a ballot for each mask write, and
lane_bitfor each mask read. The rule that picks those registers was global: any register ever used both ways. On wave64 programs that is nearly every mask, since the translated code also uses the same SGPR pairs as integers elsewhere.The first translation now records, per block, the form each read assumed and each write left (
MaskForms/BlockForms).MaskFormAnalysiscarries the forms each register may hold along the branches (registers not written yet are integers) and keeps only those a read may reach in the other form. The second translation is unchanged.CS_ScreenProbes_ActivateProbes(wave64, 122k dwords of code):s_getpc/s_setpcaddress)vw_ballotin the HLSLlane_bitin the HLSLwaveActiveBallotin the DXIL, with #24cs_mask_after_integer(w32/w64, every form the compute cases run in). As a mutation check,Mixedreturning nothing fails 14 of the 26 mask cases (cs_mask_on_taken_path,cs_integer_on_taken_pathand the others).🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-25 11:01 UTC · original
this one's great, 33 of 34 masks down to 1 on ActivateProbes and 11k → 925 ballots with #24 is a huge cut. merging both #25 and this now.
one small nit: it adds two
cs_mask_after_integer_w64binaries with different hashes (582c2aa9…andfc484ed9…), one of them is probably a leftover from an earlier assemble. harmless, but if you're touching it again feel free to drop the stale one.also, the windows failure on the first run wasn't you: it was our profiler test (
ManagedProfileSummaryTests) being timing-sensitive on busy runners. we've made it deterministic on main now, so it shouldn't bite your next PRs.thanks again!