Tests: a console compute shader through the D3D12.X PSO hook, dispatched and read back #78

Manually merged
github merged 1 commit from gh-pr/78/head into gh-pr/78/base 2026-11-26 04:08:25 +00:00
Owner

@⁠gefydev on GitHub · 2026-11-23 01:34 UTC · original
gefydev:compute-e2e → main · +208 −15 · 2 files · 1 commits · merged 2026-11-23 10:29 UTC

A test with no synthetic shortcut between the title and the GPU: crates/xcl/tests/gpu_compute_e2e.rs builds a console compute shader in the retail container layout (DXBC with a DXIL part, XDAT, XBCH/zlib, FSSM with the CS stage descriptor and COMPUTE_PGM_RSRC2) and gives it to CreateComputePipelineState on the backend device, as a title would. Then it dispatches the PSO the hook built and checks the memory.

The program is wave64, 128 threads per group (two waves). Each thread writes its global (x, y) from TGID and the thread ids, then reads the value of the mirrored thread through LDS after s_barrier, which is in the other wave. The test waits for the background build (pso_async::resolve_wait) and requires translated_pipelines to go up by one, so it cannot pass on a stand-in or a fallback.

runner::dispatch is split so that its body is reusable: dispatch_on(dev, pso, rs, ...) runs a pipeline and root signature built elsewhere. dispatch itself is unchanged.

On a 32-lane GPU this test needs #70. Without it, the driver rejects the pipeline:

PSO was not built from the translated shader: ["the driver rejected the compute PSO with the translated CS (0x80070057)"]

Validation on Windows 11, GTX 1650 (driver 32.0.16.2124), full workspace with --no-fail-fast:

  • this branch on main: 372 passed, only this test fails, with the error above
  • with #70/#71/#72: 377 passed, 0 failed, this test included

I don't have an RDNA card, so it is not run on a native wave64 GPU yet.

It merges cleanly with #70, #71 and #72 in either order.

**@⁠gefydev** on GitHub · 2026-11-23 01:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/78) `gefydev:compute-e2e` → `main` · +208 −15 · 2 files · 1 commits · merged 2026-11-23 10:29 UTC A test with no synthetic shortcut between the title and the GPU: `crates/xcl/tests/gpu_compute_e2e.rs` builds a console compute shader in the retail container layout (DXBC with a DXIL part, XDAT, XBCH/zlib, FSSM with the CS stage descriptor and COMPUTE_PGM_RSRC2) and gives it to `CreateComputePipelineState` on the backend device, as a title would. Then it dispatches the PSO the hook built and checks the memory. The program is wave64, 128 threads per group (two waves). Each thread writes its global (x, y) from TGID and the thread ids, then reads the value of the mirrored thread through LDS after `s_barrier`, which is in the other wave. The test waits for the background build (`pso_async::resolve_wait`) and requires `translated_pipelines` to go up by one, so it cannot pass on a stand-in or a fallback. `runner::dispatch` is split so that its body is reusable: `dispatch_on(dev, pso, rs, ...)` runs a pipeline and root signature built elsewhere. `dispatch` itself is unchanged. On a 32-lane GPU this test needs #70. Without it, the driver rejects the pipeline: ``` PSO was not built from the translated shader: ["the driver rejected the compute PSO with the translated CS (0x80070057)"] ``` Validation on Windows 11, GTX 1650 (driver 32.0.16.2124), full workspace with `--no-fail-fast`: - this branch on main: 372 passed, only this test fails, with the error above - with #70/#71/#72: 377 passed, 0 failed, this test included I don't have an RDNA card, so it is not run on a native wave64 GPU yet. It merges cleanly with #70, #71 and #72 in either order.
A wave64 compute program in the retail container layout (DXBC/DXIL part,
XDAT, XBCH, FSSM with a CS stage descriptor) goes through the backend's
CreateComputePipelineState hook, then is dispatched with runner::dispatch_on
and its memory is checked: per-thread ids, TGID, LDS and s_barrier across the
two waves of a group. The translated-pipeline counter is checked, so a
fallback path cannot pass.

runner::dispatch now shares its body with dispatch_on, which takes a
pipeline and root signature built elsewhere.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:08:24 +00:00
github manually merged commit 31a400195b into gh-pr/78/base 2026-11-26 04:08:25 +00:00
Author
Owner

@⁠certified-retart on GitHub · 2026-11-23 02:15 UTC · original

Tested 31a4001 on Windows 10 (D3D12 Agility SDK 1.620.2 / DXC 10.0.26100.0) across both wave64 AMD and wave32 NVIDIA GPUs:

  • AMD Radeon Graphics (Ryzen 7 9800X3D iGPU, wave64, XCL_ADAPTER=1, XCL_REQUIRE_GPU=wave64): PASS (1 passed; 0 failed, 0.38s, 4260 B DXIL).
  • NVIDIA GeForce RTX 5070 (wave32, XCL_ADAPTER=0):
    • PR #78 standalone: FAIL (0x80070057 — driver rejects the [WaveSize(64)] compute PSO and gpu_compute_e2e does not skip on wave32-only adapters).
    • PR #78 + PR #70 (recomp-compute-wave32) merged: PASS (1 passed; 0 failed, 0.53s, 4376 B DXIL).

Head's up on merge order: either merging PR #70 before #78, or skipping when the adapter lacks wave64 without wave32 compute translation, will keep cargo test green on NVIDIA GPUs.

**@⁠certified-retart** on GitHub · 2026-11-23 02:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/78#issuecomment-7089794715) Tested `31a4001` on Windows 10 (D3D12 Agility SDK 1.620.2 / DXC 10.0.26100.0) across both wave64 AMD and wave32 NVIDIA GPUs: - **AMD Radeon Graphics (Ryzen 7 9800X3D iGPU, wave64, `XCL_ADAPTER=1`, `XCL_REQUIRE_GPU=wave64`)**: **PASS** (`1 passed; 0 failed`, 0.38s, `4260 B DXIL`). - **NVIDIA GeForce RTX 5070 (wave32, `XCL_ADAPTER=0`)**: - **PR #78 standalone**: **FAIL** (`0x80070057` — driver rejects the `[WaveSize(64)]` compute PSO and `gpu_compute_e2e` does not skip on wave32-only adapters). - **PR #78 + PR #70 (`recomp-compute-wave32`) merged**: **PASS** (`1 passed; 0 failed`, 0.53s, `4376 B DXIL`). Head's up on merge order: either merging PR #70 before #78, or skipping when the adapter lacks wave64 without wave32 compute translation, will keep `cargo test` green on NVIDIA GPUs.
Author
Owner

@⁠ivall on GitHub · 2026-11-23 10:29 UTC · original

Merged. On a native wave64 GPU (RX 9070) it passes, and also with XCL_SPLIT_WAVE64=1: #67 (merged instead of #70) runs wave64 compute on 32-lane GPUs, so it should pass on NVIDIA now too. Your 16×8 group also exercises a fix found on AMD: the driver lays 2-D groups out in 2×2 quads, so the native form now hands console thread ids to waves in arrival order (46a1c3f). Tested on Windows 11 with an RX 9070 (RDNA4): cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), also with XCL_SPLIT_WAVE64=1 (the 32-lane split path forced on RDNA). Unicorn Overlord and XDefiant run with this round merged. Thanks!

**@⁠ivall** on GitHub · 2026-11-23 10:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/78#issuecomment-7098055276) Merged. On a native wave64 GPU (RX 9070) it passes, and also with `XCL_SPLIT_WAVE64=1`: #67 (merged instead of #70) runs wave64 compute on 32-lane GPUs, so it should pass on NVIDIA now too. Your 16×8 group also exercises a fix found on AMD: the driver lays 2-D groups out in 2×2 quads, so the native form now hands console thread ids to waves in arrival order (46a1c3f). Tested on Windows 11 with an RX 9070 (RDNA4): `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), also with `XCL_SPLIT_WAVE64=1` (the 32-lane split path forced on RDNA). Unicorn Overlord and XDefiant run with this round merged. Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.