shader: lower s_bitset1_b32 and s_ff1_i32_b32 in gfx2hlsl (Part of #1723) #2028
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!2028
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2028/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?
@tedin7 on GitHub · 2026-11-24 23:27 UTC · original
tedin7:x2w-r20-s-bitset-ff1→main· +149 −1 · 4 files · 2 commits · closed without mergingPart of #1723
What this unblocks: Run 20 census #18 (39/38 pairs).
Branch:
x2w-r20-s-bitset-ff1(commit 4daaa514, local, not pushed).Changes in
tools/startup/gfx2hlsl.py:s_bitset1_b32:D | (1u << (S0 & 31)), SCC unchanged.s_bitset0_b32(sibling, same path):D & ~(1u << (S0 & 31)), SCC unchanged.s_ff1_i32_b32:S0 == 0u ? 0xffffffffu : firstbitlow(S0), SCC unchanged.s_pack_hh_b32_b16.Verification:
python3 -I tests/startup_gfx2hlsl_s_bitset_ff1_check.py-> PASS (new test, registered in CMakeLists.txt asstartup_gfx2hlsl_s_bitset_ff1).origin/maintools -> fails withUnsupported: s_bitset1_b32.python3 -I tests/startup_gfx2hlsl_sop2_complement_check.py-> PASSpython3 -I tests/startup_gfx2hlsl_vcvt_omod_check.py-> PASSs_bitset*/s_ff1intools/startup/on main; open PR #1579 touches onlytools/compute_store_aot.py.AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:27 UTC · original · edited 2026-11-24 23:32 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
4daaa51ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@ -2376,0 +2382,4 @@# s_bitset0/1_b32 read-modify-write the destination: {0} is the old D, {1} is S0; SCC unchanged.'s_bitset0_b32': ('({0} & ~(1u << ({1} & 31)))', None), 's_bitset1_b32': ('({0} | (1u << ({1} & 31)))', None),# s_ff1_i32_b32: index of the lowest set bit, -1 when none; SCC unchanged.'s_ff1_i32_b32': ('({0} == 0u ? 0xffffffffu : firstbitlow({0}))', None),@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:31 UTC · original
This expands the startup translator's accepted instruction set, but neither
README.mdnordocs/experiments.mdis updated.AGENTS.mdexplicitly requires a documentation update when a public capability or reproduction command changes. The existing startup scalar documentation covers complement logic and high-halfword packing, but omits these new operations, their word-only restrictions, and thestartup_gfx2hlsl_s_bitset_ff1reproduction command. Update the capability and reproduction documentation, distinguishing the Python-only verification from the unrun Windows/GPU checks.AGENTS.md reference: AGENTS.md:L209-L210
Useful? React with 👍 / 👎.
@tedin7 on GitHub · 2026-11-25 01:13 UTC · original
Fixed and pushed in da2d757a (docs updated, tests pass).
@ -2376,0 +2382,4 @@# s_bitset0/1_b32 read-modify-write the destination: {0} is the old D, {1} is S0; SCC unchanged.'s_bitset0_b32': ('({0} & ~(1u << ({1} & 31)))', None), 's_bitset1_b32': ('({0} | (1u << ({1} & 31)))', None),# s_ff1_i32_b32: index of the lowest set bit, -1 when none; SCC unchanged.'s_ff1_i32_b32': ('({0} == 0u ? 0xffffffffu : firstbitlow({0}))', None),@tedin7 on GitHub · 2026-11-25 01:28 UTC · original
Fixed in da2d757a. docs/experiments.md now describes s_bitset0_b32, s_bitset1_b32 and s_ff1_i32_b32, the word-only restrictions, and the
startup_gfx2hlsl_s_bitset_ff1ctest command. It states that only Python verification was run, with no Windows/WARP/GPU run. Verification (Linux):python3 tests/startup_gfx2hlsl_s_bitset_ff1_check.py-> PASS.AI-assisted; commands listed were executed locally.
@RavenCurseBurg on GitHub · 2026-11-25 06:12 UTC · original
I verified
dfc97d6don Windows x64 with a separate device readback. LLVM 15.0.7 assembled fourteen source-built gfx1013 pixel programs. Each went through this PR'sPipeline.hlsl_ps(), DXC 1.9.2609 and a 4×4 draw. WARP and a physical D3D12 adapter each matched every output component for all fourteen programs. The probes cover indices 0, 31, 32, 37 and0xffffffff, SGPR source/destination aliasing, zero and high-bit FF1 inputs, and incoming SCC clear/set. Omitting the set or clear, returning zero for FF1 of zero, or inverting the SCC seed produced the expected mismatches on both backends. The existing Python controls also passed.The standalone reproduction script is one file on top of the reviewed commit. Run
python -B tests/startup_sop1_device_probe.py <LLVM-15-bin> <dxc> <offscreen_check> warp, then repeat withhardware. I used the renderer built from upstreamab9a020c.@tedin7 on GitHub · 2026-11-25 11:54 UTC · original
Thank you @RavenCurseBurg for the independent device readback at
dfc97d6d: fourteen programs matched on WARP and on a physical adapter, with the expected mismatches on the mutations. Recorded as extra evidence for this PR.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-25 13:51 UTC · original
Closing this PR for now to keep the Windows test queue short. Nothing is wrong with it and the branch stays as it is.
We will reopen it once the queue is clear, re-run the Win2025 WARP checks at its head, and post the result here.
AI-assisted; commands listed were executed locally.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:31 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
4daaa51474ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Pull request closed