Recompiler: translate s_quadmask_b32/b64 and s_bitreplicate_b64_b32 #808

Open
mastrr9 wants to merge 1 commit from upstream-pr/814 into main
mastrr9 commented 2026-11-24 05:48:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T05:48:49Z.


s_quadmask_b32, s_quadmask_b64, and s_bitreplicate_b64_b32 were previously reported unsupported (SALU / SALU64), causing shaders using them to fail translation.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs:
    • Prelude helpers quadmask(uint m) and bitrep16(uint x) alongside wqm.
    • s_quadmask_b32 and s_quadmask_b64 (one bit per non-zero nibble, updating SCC when non-zero).
    • s_bitreplicate_b64_b32 handled before the wide/narrow split (32-bit source, 64-bit destination, leaving SCC unchanged).
  • 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

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 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 SDK 10.0.26100.0, debug build.
  • Command (at head 38f5173df16e9fea1707e851c7c47a79af79aa10): cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result: 706 passed, 0 failed, 41 ignored (0 new warnings).
    • gpu::recomp::tests::scalar_quadmask_and_bitreplicate — ok
    • gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate — ok (executed on RTX 5080, not skipped)
  • SKIPPED (2): 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: https://github.com/xcl-dev/xcl/pull/814#issuecomment-7151516153
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: 343bd2f37c7c30f138372fbc58c637062f55a269
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1617 (PresentX 1617)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14817 MB

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

  • By the author: AMD/wave64 hardware, and release build.
  • Whether the community regression run above reaches the code this PR changes.

AI use

  • Claude Opus 5.5 (via Claude Duet / Claude Code) wrote the instruction translations and unit/GPU tests.
  • Antigravity (Gemini 4 Neon & Gemini 4 Hydrogen) audited the RDNA2 ISA semantics, ran the full Windows RTX 5080 MSVC + D3D12 debug-layer workspace suite, and drafted this PR description.
  • Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
<!-- greyfinch-sync:ivall/xcl:issue:5466862432 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T05:48:49Z. --- `s_quadmask_b32`, `s_quadmask_b64`, and `s_bitreplicate_b64_b32` were previously reported unsupported (`SALU` / `SALU64`), causing shaders using them to fail translation. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: - Prelude helpers `quadmask(uint m)` and `bitrep16(uint x)` alongside `wqm`. - `s_quadmask_b32` and `s_quadmask_b64` (one bit per non-zero nibble, updating `SCC` when non-zero). - `s_bitreplicate_b64_b32` handled before the wide/narrow split (32-bit source, 64-bit destination, leaving `SCC` unchanged). - `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** - **Environment:** NVIDIA GeForce RTX 5080 (16 GB, wave32, driver `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 SDK `10.0.26100.0`, debug build. - **Command (at head `38f5173df16e9fea1707e851c7c47a79af79aa10`):** `cargo build --workspace && cargo test --workspace -- --test-threads=4` - **Result:** **706 passed, 0 failed, 41 ignored** (0 new warnings). - `gpu::recomp::tests::scalar_quadmask_and_bitreplicate` — `ok` - `gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate` — `ok` (executed on RTX 5080, not skipped) - **SKIPPED (2):** `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: https://github.com/xcl-dev/xcl/pull/814#issuecomment-7151516153 Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: 343bd2f37c7c30f138372fbc58c637062f55a269 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1617 (PresentX 1617) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14817 MB ``` 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** - By the author: AMD/wave64 hardware, and release build. - Whether the community regression run above reaches the code this PR changes. **AI use** - Claude Opus 5.5 (via Claude Duet / Claude Code) wrote the instruction translations and unit/GPU tests. - Antigravity (Gemini 4 Neon & Gemini 4 Hydrogen) audited the RDNA2 ISA semantics, ran the full Windows RTX 5080 MSVC + D3D12 debug-layer workspace suite, and drafted this PR description. - Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
SlopTart commented 2026-11-24 07:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T06:41:27Z.


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 38f5173 onto main beaa245, 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_bitreplicate ok, scalar_quadmask_and_bitreplicate ok.
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.

<!-- greyfinch-sync:ivall/xcl:comment:7124191986 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/814#issuecomment-7124191986). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T06:41:27Z. --- 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 `38f5173` onto main `beaa245`, 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_bitreplicate` ok, `scalar_quadmask_and_bitreplicate` ok. 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 commented 2026-11-24 10:04:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by 4usphs on 2026-11-24T09:41:45Z.


Measured on RDNA2 hardware: s_quadmask_b32, s_quadmask_b64 and s_bitreplicate_b64_b32 match 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 OpenCL 3652.0 (PAL,LC). Each case is one inline-assembly block in an OpenCL C kernel (the #518 / #772 method): s_cmp_eq_u32 sets SCC, the instruction runs on SGPR operands with the destination preset to 0xCAFEBABE…, and s_cselect_b32 1, 0 reads SCC back. The model is a Python port of this PR's quadmask / bitrep16 helpers, 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 through s_quadmask_b32 (low half), s_quadmask_b64, and s_bitreplicate_b64_b32 with 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, OpenCL 3686.0) gives the same results.

Not tested: the console itself (gfx1036 is 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.

<!-- greyfinch-sync:ivall/xcl:comment:7127761682 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/814#issuecomment-7127761682). Originally posted by [4usphs](https://github.com/4usphs) on 2026-11-24T09:41:45Z. --- Measured on RDNA2 hardware: `s_quadmask_b32`, `s_quadmask_b64` and `s_bitreplicate_b64_b32` match 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 OpenCL `3652.0 (PAL,LC)`. Each case is one inline-assembly block in an OpenCL C kernel (the #518 / #772 method): `s_cmp_eq_u32` sets SCC, the instruction runs on SGPR operands with the destination preset to `0xCAFEBABE…`, and `s_cselect_b32 1, 0` reads SCC back. The model is a Python port of this PR's `quadmask` / `bitrep16` helpers, 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 through `s_quadmask_b32` (low half), `s_quadmask_b64`, and `s_bitreplicate_b64_b32` with 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, OpenCL `3686.0`) gives the same results. **Not tested:** the console itself (`gfx1036` is 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 commented 2026-11-25 03:05:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:01:36Z.


Regression run of 343bd2f3 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 343bd2f37c7c30f138372fbc58c637062f55a269
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1617 (PresentX 1617)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14817 MB

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.

<!-- greyfinch-sync:ivall/xcl:comment:7151516153 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7151516153). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:01:36Z. --- Regression run of `343bd2f3` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 343bd2f37c7c30f138372fbc58c637062f55a269 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1617 (PresentX 1617) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14817 MB ``` 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 commented 2026-11-25 04:10:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:03:01Z.


Intel Arc A770 verification for xcl-dev/xcl PR #814
https://github.com/xcl-dev/xcl/pull/814

Tested

The PR was open at 343bd2f37c before 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.

<!-- greyfinch-sync:ivall/xcl:comment:7152481904 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7152481904). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:03:01Z. --- Intel Arc A770 verification for xcl-dev/xcl PR #814 https://github.com/xcl-dev/xcl/pull/814 Tested The PR was open at 343bd2f37c7c30f138372fbc58c637062f55a269 before 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 commented 2026-11-25 11:09:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:48:20Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7160196222 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7160196222). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:48:20Z. --- 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!
github-actions[bot] commented 2026-11-29 20:41:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:15Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262278160 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7262278160). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:41:15Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:11:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:11:25Z.


Triage (#1607) – head 343bd2f

#1473 adds the same quadmask() helper and the same s_quadmask_b32 / s_quadmask_b64 lowering in recomp/emit.rs. This PR was opened first and also translates s_bitreplicate_b64_b32. Neither is on main yet.
The GPU test values (0xA5, 0x08A5, 0x33 / 0xC0000003) are correct for the ISA semantics, and SCC is left alone for bitreplicate as it should be.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300471126 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7300471126). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:11:25Z. --- **Triage (#1607)** – head 343bd2f #1473 adds the same `quadmask()` helper and the same `s_quadmask_b32` / `s_quadmask_b64` lowering in recomp/emit.rs. This PR was opened first and also translates `s_bitreplicate_b64_b32`. Neither is on main yet. The GPU test values (0xA5, 0x08A5, 0x33 / 0xC0000003) are correct for the ISA semantics, and SCC is left alone for bitreplicate as it should be. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
BBareth commented 2026-12-01 07:30:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T07:30:36Z.


merge-check claim
head: 343bd2f37c

<!-- greyfinch-sync:ivall/xcl:comment:7304141663 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7304141663). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-01T07:30:36Z. --- merge-check claim head: 343bd2f37c7c30f138372fbc58c637062f55a269
BBareth commented 2026-12-01 07:47:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by BBareth on 2026-12-01T07:47:14Z.


merge-check
base: 493dbd3dd0
head: 343bd2f37c
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 1 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate, a test this PR adds (tests.rs:339, runner::run_code returned Err("s_quadmask_b32 s0, s4: SALU")); it does not exist on the base. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The other new test, scalar_quadmask_and_bitreplicate (HLSL text and a DXC compile), passed.
review: one blocking finding; two files (+51/-0), every line read. (1) The PR's own GPU test fails on a GPU: runner::run_code translates through the direct DXIL lowering, which has no s_quadmask_b32 (the error above), so the HLSL added in emit.rs is never run by it. CI has no GPU, where gpu_ready() returns early and the test passes without running. Either the DXIL lowering gets the three instructions too, or the GPU test has to run the HLSL path. (2) Not blocking: the HLSL itself reads right to me (quadmask folds one bit per nibble into 8 bits, bitrep16 doubles each bit, the expected values in the test match by hand), and SCC is set for the two quadmask forms only. (3) #1473 is open for S_QUADMASK_B32 / B64 as well; the two overlap.
performance: none: three more cases in the translator.
verdict: not yet: the GPU test added by this PR fails on an NVIDIA GPU (s_quadmask_b32 ...: SALU from the direct DXIL path)
hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7304478420 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7304478420). Originally posted by [BBareth](https://github.com/BBareth) on 2026-12-01T07:47:14Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: 343bd2f37c7c30f138372fbc58c637062f55a269 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2901 passed, 1 failed, 51 ignored; 28 SKIPPED lines, as on the base; failing: `gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate`, a test this PR adds (tests.rs:339, `runner::run_code` returned `Err("s_quadmask_b32 s0, s4: SALU")`); it does not exist on the base. The base alone, same machine, same commit: 2900 passed, 0 failed, 51 ignored, 28 SKIPPED lines (22 no wave64, 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 cannot disable the driver cache). The other new test, `scalar_quadmask_and_bitreplicate` (HLSL text and a DXC compile), passed. review: one blocking finding; two files (+51/-0), every line read. (1) The PR's own GPU test fails on a GPU: `runner::run_code` translates through the direct DXIL lowering, which has no `s_quadmask_b32` (the error above), so the HLSL added in `emit.rs` is never run by it. CI has no GPU, where `gpu_ready()` returns early and the test passes without running. Either the DXIL lowering gets the three instructions too, or the GPU test has to run the HLSL path. (2) Not blocking: the HLSL itself reads right to me (`quadmask` folds one bit per nibble into 8 bits, `bitrep16` doubles each bit, the expected values in the test match by hand), and SCC is set for the two quadmask forms only. (3) #1473 is open for `S_QUADMASK_B32` / `B64` as well; the two overlap. performance: none: three more cases in the translator. verdict: not yet: the GPU test added by this PR fails on an NVIDIA GPU (`s_quadmask_b32 ...: SALU` from the direct DXIL path) hardware / tool and model: RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124); i7-12700K; Windows 11 26200. Claude Code, Claude Fable 5.2 read the diff, ran the build and the suite and wrote this check.
sandivd commented 2026-12-02 00:25:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by sandivd on 2026-12-02T00:25:06Z.


merge-check claim
head: 343bd2f37c

<!-- greyfinch-sync:ivall/xcl:comment:7330523278 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7330523278). Originally posted by [sandivd](https://github.com/sandivd) on 2026-12-02T00:25:06Z. --- merge-check claim head: 343bd2f37c7c30f138372fbc58c637062f55a269
Pipodi commented 2026-12-02 10:27:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-12-02T10:27:57Z.


merge-check
base: 1c8b551475
head: 343bd2f37c
merge: clean
build: cargo build --workspace -> ok (and cargo build --release -p xcl -> ok)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 1 failed, 51 ignored; 25 SKIPPED lines (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate, added by this PR, so it does not exist on the base: tests.rs:339 runner::run_code returns Err("s_quadmask_b32 s0, s4: SALU"). This reproduces the failure in the check above on a second NVIDIA GPU. The same two tests rerun with XCL_DIRECT_DXIL=0 (HLSL path): 2 passed, 0 failed, the GPU test ran on the GPU (DXC compile, no skip).
review: two files (+51/-0), every line read. (1) Blocking: with XCL_DIRECT_DXIL unset, the default, runner::run_code and compute kernels go through the direct DXIL lowering (gpu/dxil/lower.rs), which has no case for s_quadmask_b32 / _b64 / s_bitreplicate_b64_b32 (it falls to err(d, "SALU")). So the PR's own GPU test fails on any GPU that runs it, and the HLSL added in emit.rs only takes effect where a shader falls back to the HLSL path. The DXIL lowering needs the three instructions too, or the test has to target the HLSL path explicitly. (2) The HLSL is correct against the RDNA2 ISA: quadmask sets result bit i when nibble i of the source has any bit set (8 bits from 32, 16 from 64, upper bits 0), bitrep16 puts every source bit into two adjacent result bits; SCC = result != 0 for both quadmask forms, and bitreplicate leaves SCC alone, matching rdna2_spec.rs (implicit SCC output on S_QUADMASK_B32/B64, none on S_BITREPLICATE_B64_B32). The expected values in the test (0xA5; 0x08A5, 0; 0x33, 0xC0000003; 0 with SCC 0) check out by hand. (3) Test placement is fine: the GPU test returns through gpu_ready() (which calls skip_test), no #[ignore], no weakened asserts, no change outside the scope. (4) Overlap: #1473 adds the same quadmask lowering.
performance: none by default: three more match arms in the HLSL translator; nothing runs unless a shader uses these instructions. Smoke pair not run, because the suite fails because of the PR.
verdict: not yet: the GPU test added by this PR fails on NVIDIA through the default direct DXIL path (s_quadmask_b32 ...: SALU); the direct DXIL lowering needs the three instructions as well
hardware / tool and model: NVIDIA GeForce RTX 4090, driver 621.40 (32.0.16.2140); i9-13900K; Windows 11 build 26300; rustc 1.100.0 (0ef1bc386 2026-11-09), debug test profile. Claude Code, Claude Opus 5.5 read the diff, ran the build and the suite and wrote this check.

<!-- greyfinch-sync:ivall/xcl:comment:7342509188 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/814#issuecomment-7342509188). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-12-02T10:27:57Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 343bd2f37c7c30f138372fbc58c637062f55a269 merge: clean build: cargo build --workspace -> ok (and cargo build --release -p xcl -> ok) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 1 failed, 51 ignored; 25 SKIPPED lines (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: `gpu::recomp::tests::gpu_scalar_quadmask_and_bitreplicate`, added by this PR, so it does not exist on the base: tests.rs:339 `runner::run_code` returns `Err("s_quadmask_b32 s0, s4: SALU")`. This reproduces the failure in the check above on a second NVIDIA GPU. The same two tests rerun with `XCL_DIRECT_DXIL=0` (HLSL path): 2 passed, 0 failed, the GPU test ran on the GPU (DXC compile, no skip). review: two files (+51/-0), every line read. (1) Blocking: with `XCL_DIRECT_DXIL` unset, the default, `runner::run_code` and compute kernels go through the direct DXIL lowering (`gpu/dxil/lower.rs`), which has no case for `s_quadmask_b32` / `_b64` / `s_bitreplicate_b64_b32` (it falls to `err(d, "SALU")`). So the PR's own GPU test fails on any GPU that runs it, and the HLSL added in `emit.rs` only takes effect where a shader falls back to the HLSL path. The DXIL lowering needs the three instructions too, or the test has to target the HLSL path explicitly. (2) The HLSL is correct against the RDNA2 ISA: `quadmask` sets result bit i when nibble i of the source has any bit set (8 bits from 32, 16 from 64, upper bits 0), `bitrep16` puts every source bit into two adjacent result bits; SCC = result != 0 for both quadmask forms, and bitreplicate leaves SCC alone, matching `rdna2_spec.rs` (implicit SCC output on S_QUADMASK_B32/B64, none on S_BITREPLICATE_B64_B32). The expected values in the test (0xA5; 0x08A5, 0; 0x33, 0xC0000003; 0 with SCC 0) check out by hand. (3) Test placement is fine: the GPU test returns through `gpu_ready()` (which calls `skip_test`), no `#[ignore]`, no weakened asserts, no change outside the scope. (4) Overlap: #1473 adds the same quadmask lowering. performance: none by default: three more match arms in the HLSL translator; nothing runs unless a shader uses these instructions. Smoke pair not run, because the suite fails because of the PR. verdict: not yet: the GPU test added by this PR fails on NVIDIA through the default direct DXIL path (`s_quadmask_b32 ...: SALU`); the direct DXIL lowering needs the three instructions as well hardware / tool and model: NVIDIA GeForce RTX 4090, driver 621.40 (32.0.16.2140); i9-13900K; Windows 11 build 26300; rustc 1.100.0 (0ef1bc386 2026-11-09), debug test profile. Claude Code, Claude Opus 5.5 read the diff, ran the build and the suite and wrote this check.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/814:upstream-pr/814'
git switch 'upstream-pr/814'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/814'
git switch 'upstream-pr/814'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/814'
git switch 'upstream-pr/814'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/814'
git switch 'main'
git merge --squash 'upstream-pr/814'
git switch 'main'
git merge --ff-only 'upstream-pr/814'
git switch 'main'
git merge 'upstream-pr/814'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!808
No description provided.