startup: lower s_bitset0_b32 and s_bitset1_b32 in gfx2hlsl #2420
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2420
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2420/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?
@R0D4X on GitHub · 2026-11-25 16:08 UTC · original
R0D4X:feat/gfx2hlsl-bitset-b32→main· +623 −0 · 4 files · 1 commits · closed without mergingSummary
s_bitset0_b32ands_bitset1_b32) intools/startup/gfx2hlsl.py(Stage.scalar_bitset()), addressing #2023 Item J (s_bitset1_b32) and its exact 32-bit counterpart without alteringPipeline.common().0x1b/0x1d) and LLVM 15SOPInstructions.td: readDandS0before updatingD, mask bit index withS0 & 31u, fold constantD+ constantS0to('const', value), and leaveSCCunchanged (READ_MODIFY_WRITEalready coverss_bitset).masks,execcopy,vcc*,exec*), non-numeric symbols (desc,descnum,ptr,ptrhi,smpheap, unassigned constants),m0as destination, vector/pair/>105registers, float literals, modifiers, wrong operand counts, and 64-bit forms (s_bitset0_b64/s_bitset1_b64) before mutating scalar state.tests/startup_gfx2hlsl_bitset_check.pycovering CPU reference evaluation across SGPR/inline/literal/m0/D == S0aliasing,SCCpreservation (s_cmp_*->s_bitset*->s_cselect_b32), constant folding, uniformity, state-intact refusals, 8 mutation controls,binary <llvm-mc>assembly checks, and FXCps_5_1+ DXCps_6_0offscreen draw readbacks (including GPU mutation controls).startup_gfx2hlsl_bitset_{controls,warp,hardware}inCMakeLists.txtand wiretests/startup_gfx2hlsl_bitset_check.pyintopixel-binaryandpython-linuxin.github/workflows/windows.yml.Refs #2023
Verification
7092683a(upstream/main)4fc70315(feat/gfx2hlsl-bitset-b32)26300.9974), MSVC19.44.35230, Windows SDK10.0.26100.0, FXC + DXC1.9.2602.17Microsoft Basic Render Driver(1414:008c), driver10.0.26100.9818, D3D12 debug layer enabledNVIDIA GeForce RTX 5080(10de:2c02), driver32.0.16.2124, D3D12 debug layer enabledCommands and Observed Results
startup_gfx2hlsl_bitset_check.py: 13/13 checksok, 8/8 in-process mutations caught;docs_links_check.py: 19 files / 464 links;bidi_controls_check.py: 1723 files;git diff --check: clean).& 31uintools/startup/gfx2hlsl.py): caught (rc=1) and reverted cleanly.dev: 4 passed, 0 skipped, 0 failed (startup_tools_lint0.15 s,controls0.62 s,warp1.05 s,hardware2.26 s;debug_errors=0 debug_warnings=0on WARP and RTX 5080 for both FXCps_5_1and DXCps_6_0, including GPU mutation controls).release: 3 passed, 0 skipped, 0 failed (controls0.61 s,warp0.99 s,hardware2.13 s;debug_errors=0 debug_warnings=0).tests/startup_gfx2hlsl_bitset_check.py binary llvm-mc-15was not run locally (llvm-mcis not installed on this Windows host) and is covered by the Ubuntupixel-binaryCI job.s_bitset0_b32/s_bitset1_b32lowering and desktop GPU execution in isolation; they do not establish full-game startup.@KelboLive on GitHub · 2026-11-25 16:13 UTC · original
APPROVED. Lowers s_bitset0_b32 and s_bitset1_b32 in gfx2hlsl.
@tedin7 on GitHub · 2026-11-25 18:32 UTC · original · reviewed
Review of head
4fc70315(comment only, no approval).Code (tools/startup/gfx2hlsl.py):
scalar_bitsetlowerss_bitset0_b32ands_bitset1_b32as D = D & ~(1<<(S0&31)) and D = D | (1<<(S0&31)), with SCC unchanged. This matches the SOP1 definition. D is read before it is written, so the lane-mask, execcopy and descriptor/symbol refusals run before any state changes. Source forms (SGPR, m0, inline/literal constants) are range-checked. When both D and S0 are known constants the result is folded. Otherwise a runtime expression is emitted.self.masksandis_lane_maskare existing members.Test: tests/startup_gfx2hlsl_bitset_check.py has an evaluator check, refusals, built-in mutation controls (drop S0 lane-mask refusal, drop D symbol refusal, remove the bitset1 lowering; each caught), and WARP/hardware draw readbacks. It is registered in CMakeLists.txt (controls, warp, hardware) and in both lists in windows.yml. The PR's own CI run exercised the changed workflow: pixel-binary, python-linux and the Windows build are green.
Siblings and duplicates: a search for s_bitset found #574 (merged, pixel_aot, a different file) and #2028 (closed, a different author, covered bitset1 plus ff1). No open PR covers the same slice. No "depends on" in the body.
Windows results: the body lists runs on branch commit
4fc70315, which is this exact head. I did not run Windows and did not re-check those results. The body notes thebinary llvm-mc-15mode was not run on the author's host. It is covered by the green pixel-binary CI job. No startup claim is made. The PR is 30 commits behind main and I did not update it, to keep the head SHA.Commands run locally on this head:
No blocking findings. Merge is left to @R0Y00 / MasterDomino.
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 02:25 UTC · original
Closing this as already covered:
s_bitset0_b32ands_bitset1_b32are lowered intools/startup/gfx2hlsl.pyonmainthrough #2638, which merged first. All six forms this PR adds are present on currentmain, so landing it now would only conflict.Thank you for the work here. If this PR handles a case #2638 does not (an operand form or a stage it refuses), please reopen it or open a small follow-up on top of current
mainwith just that case and its WARP readback, and we will review it right away.Commands executed:
AI-assisted; commands listed were executed locally.
Pull request closed