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

Merged
gefydev merged 1 commit from upstream-pr/78 into main 2026-11-23 10:29:16 +00:00
gefydev commented 2026-11-23 01:34:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gefydev on 2026-11-23T01:34:37Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6550465339 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/78). Originally posted by [gefydev](https://github.com/gefydev) on 2026-11-23T01:34:37Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:57:03 +00:00
certified-retart commented 2026-11-24 07:00:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-23T02:15:44Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7089794715 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/78#issuecomment-7089794715). Originally posted by [certified-retart](https://github.com/certified-retart) on 2026-11-23T02:15:44Z. --- 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.
ivall commented 2026-11-24 07:00:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:29:32Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7098055276 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/78#issuecomment-7098055276). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T10:29:32Z. --- 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!
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!77
No description provided.