Recompiler: honour 32-bit SSRC0 in salu64 (s_bfm_b64) #1159
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1159
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1159"
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?
@b3IKK on GitHub · 2026-11-24 12:38 UTC · original
b3IKK:recomp/salu-bfm-b64-32bit-src0→main· +26 −14 · 2 files · 1 commits · opensalu64checkedo.size == 32forins[1](shift amounts ands_bfecontrols) but unconditionally calledread64onins[0]. Ins_bfm_b64,SSRC0is a 32-bit operand (rdna2_spec.rs), so passingm0(124),exec_hi(127), ors105failed translation withErr("op")becausecode64rejects them as 64-bit register pairs.This uses the same
o.size == 32check for bothsalu64source operands.What is in it
crates/xcl/src/gpu/recomp/emit.rs: read 32-bitins[0]operands withread()instead ofread64()insalu64.crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_s_bfm_b64_accepts_32bit_ssrc0testingS_BFM_B64withm0ands105across wave32 and split wave64 (verified failing translation before the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib gpu_s_bfm_b64_accepts_32bit_ssrc0: 1 passed, 0 failed across wave32 and split wave64 (failed withs_bfm_b64: opbefore the fix)Regression run
main:
PR:
Not tested
AI use
emit.rs, wrote the fix and GPU test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-24 12:42 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
cargo test -p xcl --lib bfm: 1 passed, 0 failed —gpu_s_bfm_b64_accepts_32bit_ssrc0covers the 32-bit SSRC0 operand on real hardware.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@bjarngard on GitHub · 2026-11-24 13:05 UTC · original
Test report for head
04ca7f8(AMD, native wave64)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_s_bfm_b64_accepts_32bit_ssrc0passedNot tested: retail titles, RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@JoaoPauluu on GitHub · 2026-11-24 13:57 UTC · original
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.04ca7f8as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).gpu::recomp::tests::gpu_s_bfm_b64_accepts_32bit_ssrc0: ok, no SKIPPED.Not tested
AI use
@milesah3ad on GitHub · 2026-11-25 01:01 UTC · original
The direct DXIL backend counterpart of this fix, from @regiumlepidi's parity sweep on #1269:
gpu_s_bfm_b64_accepts_32bit_ssrc0pass withXCL_DIRECT_DXIL=1with the patch below. Without it they fail on the direct path.salu64ingpu/dxil/lower.rsread the first operand as a 64-bit pair whatever its size, sos_bfm_b64with a 32-bit SSRC0 that is no valid pair (m0,s105) was refused at translation (op), not miscomputed. The patch reads a 32-bit operand as one dword with a zero high half, for the first operand as for the second, the same change your PR makes inemit.rs.How to take it: this PR predates the direct backend on
main, so rebase it ontomainfirst (your commit rebases cleanly onto7994cd1), thengit amthe patch below. Feel free to fold it into your PR with aCo-Authored-By: milesah3ad <[email protected]>line. I didn't open a separate PR, so this doesn't add another review.patch (1 commit, for
git am)Tested
main7994cd1plus this patch:gpu_s_bfm_b64_accepts_32bit_ssrc0pass with and withoutXCL_DIRECT_DXIL=1.cargo test -p xcl --lib --no-fail-fast -- --test-threads=4onmain7994cd1with #587, #686, #1159 and #1296 all merged and the four direct patches applied: 948 passed, 4 failed, 25 ignored, the same in both settings. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, which fail the same way on plainmainhere (944 passed, 4 failed). The +4 are the PRs' own tests.Not tested: wave64 hardware (the wave64 cases SKIP here), AMD, any title, the full workspace suite (lib only).
AI use: Claude Code (Claude Opus 5.5) wrote the fix and ran the tests on the machine above. I checked the results.
@luckyteagirl on GitHub · 2026-11-25 06:14 UTC · original
Independent RX 6800M GPU check on exact PR head
04ca7f808558acf8f595580bf0d941ac740479e1.Tested
30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M XCL_REQUIRE_GPU=wave64 XCL_DIRECT_DXIL=0 cargo test --locked -p xcl --lib -j 2 gpu_s_bfm_b64_accepts_32bit_ssrc0 -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored in 0.30 s. There was noSKIPPEDline. The regression tests the HLSL translator's 32-bitSSRC0handling forS_BFM_B64usingm0ands105on wave32 and split wave64.I did not run the full workspace suite, a pre-fix negative control on this machine, the direct DXIL counterpart proposed in the PR discussion, or a retail title smoke comparison. This is a focused GPU result on an older PR head, not current-main integration coverage. No game data was used or uploaded.
AI-assisted testing and report drafting with OpenAI Codex (GPT-6); I checked the exact revision and test log before posting.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.