Recompiler: translate s_quadmask_b32/b64 and s_bitreplicate_b64_b32 #814
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!814
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-814"
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?
@mastrr9 on GitHub · 2026-11-24 05:48 UTC · original
mastrr9:feat/recomp-quadmask-bitreplicate→main· +51 −0 · 2 files · 1 commits · opens_quadmask_b32,s_quadmask_b64, ands_bitreplicate_b64_b32were previously reported unsupported (SALU/SALU64), causing shaders using them to fail translation.What is in it
crates/xcl/src/gpu/recomp/emit.rs:quadmask(uint m)andbitrep16(uint x)alongsidewqm.s_quadmask_b32ands_quadmask_b64(one bit per non-zero nibble, updatingSCCwhen non-zero).s_bitreplicate_b64_b32handled before the wide/narrow split (32-bit source, 64-bit destination, leavingSCCunchanged).crates/xcl/src/gpu/recomp/tests.rs: HLSL + DXC compile check (scalar_quadmask_and_bitreplicate) and GPU execution check (gpu_scalar_quadmask_and_bitreplicate).Tested
617.42/32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), D3D12 debug layer installed (d3d12SDKLayers.dll),rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC from Windows SDK10.0.26100.0, debug build.38f5173df16e9fea1707e851c7c47a79af79aa10):cargo build --workspace && cargo test --workspace -- --test-threads=4gpu::recomp::tests::scalar_quadmask_and_bitreplicate—okgpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate—ok(executed on RTX 5080, not skipped)gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
Smoke run by @Toons29 in comment below: #814
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.
main:
PR:
Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; the tester checked the blocks before posting.Not tested
AI use
@SlopTart on GitHub · 2026-11-24 06:41 UTC · original
2|
3|AMD/wave64 + release-build datapoint - the two axes your row lists as not tested.
4|
5|Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross
x86_64-pc-windows-gnu, release profile,XCL_NETWORK=0, native wave64. Same rig as my Linux rows in #42 / #718.6|
7|Merged state: head
38f5173onto mainbeaa245, clean merge.8|
9|Full suite,
cargo test --workspace --release --no-fail-fast -- --test-threads=4: 705 passed, 10 failed, 41 ignored (17 suites). The 10 = this rig's 7 stable Wine-lane failures (my #42 row) + the #718 flaky trio firing that run (~2/5 rate, PR-independent). Nothing new fails. Your tests pass on RDNA3:gpu_scalar_quadmask_and_bitreplicateok,scalar_quadmask_and_bitreplicateok.10|
11|Not tested: retail titles (none here), Windows, RDNA4.
12|Counts only, no game data.
13|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@4usphs on GitHub · 2026-11-24 09:41 UTC · original
Measured on RDNA2 hardware:
s_quadmask_b32,s_quadmask_b64ands_bitreplicate_b64_b32match this translation, results and SCC.Method. The Radeon iGPU of a Ryzen 7 9800X3D (
gfx1036, RDNA2), Windows 11 Pro 26200, display driver 32.0.21045.29003, AMD OpenCL3652.0 (PAL,LC). Each case is one inline-assembly block in an OpenCL C kernel (the #518 / #772 method):s_cmp_eq_u32sets SCC, the instruction runs on SGPR operands with the destination preset to0xCAFEBABE…, ands_cselect_b32 1, 0reads SCC back. The model is a Python port of this PR'squadmask/bitrep16helpers, which also agree with the ISA's bit-by-bit description on every input.Inputs. 157 64-bit values: 0, all ones, this PR's test values (
0x80F00301,0x00001000,0x80010005),0x1111…,0x8888…,0x8000000000000001, and 150 random ones (half of them sparse). Each value goes throughs_quadmask_b32(low half),s_quadmask_b64, ands_bitreplicate_b64_b32with SCC 1 and 0 before. All of it runs 3 times (wave32, wave64, wave32) with identical output.Result: all 628 cases match:
s_quadmask_b32/_b64: the result, and SCC = (result != 0).s_bitreplicate_b64_b32: the 64-bit result. SCC is left as it was (1 stays 1, 0 stays 0), as the translation does by not writing it.For comparison, an RX 9070 XT (
gfx1201, RDNA4, OpenCL3686.0) gives the same results.Not tested: the console itself (
gfx1036is a desktop RDNA2 APU of the same generation), RDNA1, this PR's D3D12 tests on this GPU, smoke or a title.AI use: Claude Code (Claude Opus 5.5) wrote the OpenCL probes and the port of the helpers, ran them on my PC and wrote this comment. I have not reviewed the code.
@Toons29 on GitHub · 2026-11-25 03:01 UTC · original
Regression run of
343bd2f3on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.@JJAutoCompare on GitHub · 2026-11-25 04:03 UTC · original
Intel Arc A770 verification for xcl-dev/xcl PR #814
#814
Tested
The PR was open at
343bd2f37cbefore and after the run. The assigned checkout was clean and detached at that SHA both times. The live PR description and discussion contained no equivalent Arc A770 report. Read current upstream AGENTS.md and CONTRIBUTING.md.STOR-WINLAB ran Windows 11 Enterprise Evaluation x64 build 26200.9974 on an AMD Ryzen 7 3800X and Intel Arc A770 (driver 32.0.101.9175). Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0, unoptimized test profile. Both fixtures logged DXC and DXIL 1.9.2609.5 from %LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64.
Prebuild outside the Arc mutex
cargo test --locked -p xcl --lib --no-run
Exit 0 in 31.52 s.
Settings
CARGO_TARGET_DIR=L:/XclTooling/pr1778-2e2ee55-20261125-020159/target
CARGO_BUILD_JOBS=2
CARGO_INCREMENTAL=0
CARGO_PROFILE_DEV_DEBUG=0
CARGO_PROFILE_TEST_DEBUG=0
TEMP=TMP=L:/XclTooling/pr814/20261125-045803-885/temp
XCL_ADAPTER=A770
XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64
Exact fixture commands
$binary = 'L:\XclTooling\pr1778-2e2ee55-20261125-020159\target\debug\build\xcl\77aca8ccb20e299f\out\xcl-77aca8ccb20e299f.exe'
CPU, outside the Arc mutex
& $binary 'gpu::recomp::tests::scalar_quadmask_and_bitreplicate' --exact --nocapture --test-threads=1
GPU, under the Arc mutex
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $binary 'gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate' --exact --nocapture --test-threads=1
}
The GPU wrapper ran in its own PowerShell process with -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -OutputFormat Text -EncodedCommand, and logged mutex acquisition and release. Separate stdout, stderr, exact command, and exit code files are in L:/XclTooling/pr814/20261125-045803-885. The GPU child and wrapper both returned exit 0.
CPU: 1 passed, 0 failed, 0 ignored, 0 explicit SKIPPED, 685 filtered out, exit 0, 0.04 s test time.
GPU: 1 passed, 0 failed, 0 ignored, 0 explicit SKIPPED, 685 filtered out, exit 0, 0.21 s test time.
The CPU fixture checked HLSL emission and compiled it as cs_6_6. The GPU fixture used HLSL/DXC and D3D12, checking B32 quadmask 0xA5, B64 quadmask (0x08A5, 0), and bitreplication (0x33, 0xC0000003). It also checked that a zero B32 quadmask produces zero and clears SCC. The runner selects split wave64 on this Arc A770. An earlier same-host capability probe reported WaveLaneCountMax=32 in L:/XclTooling/pr1577/wave-capability-20261125-033726.log.
Not tested
Native wave64, direct DXIL, other adapters, release builds, the full suite, and retail-title smoke.
AI use
T3 Code / Codex (gpt-6.2-sol) verified the revision, ran the stock fixtures, and wrote the report from the captured output.
@DavidM1911 on GitHub · 2026-11-25 10:48 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
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.