Run the GPU tests on any adapter: XCL_ADAPTER, mesh-shader check, the test title's device from d3d12_xs #40

Merged
grahamster2 merged 5 commits from upstream-pr/41 into main 2026-11-22 21:37:55 +00:00
grahamster2 commented 2026-11-22 19:48:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-22T19:48:46Z.


Summary

Running the test suite on each GPU of a two-GPU machine (NVIDIA RTX 3080 + the AMD Radeon iGPU of a Ryzen 5 7600X) turned up three things, one commit each:

  1. XCL_ADAPTER: pick the D3D12 adapter. The title's device took the first hardware adapter in high-performance order and the GPU test bench always took adapter 0, so the second GPU could not be tested. d3d12_adapter in xcl.toml now also takes a number (that hardware adapter in high-performance order) or a part of the adapter's name (radeon, rtx 3080). XCL_ADAPTER overrides it, the same way XCL_RAYTRACING overrides raytracing. The new gpu::adapter module holds the choice, and hle::d3d12x::real and gpu::recomp::runner both use it. If the name matches no adapter, the title logs the adapters it found and falls back to auto. The test bench gives the same message as its skip reason. auto / warp behave as before.

  2. Mesh draws are skipped on adapters without mesh shaders. gpu_mesh_mode_two_passes and gpu_geometry_mode_es_gs_strip failed with E_INVALIDARG at mesh PSO creation on the RDNA2 iGPU. That adapter has wave 32–64 but reports MeshShaderTier NOT_SUPPORTED. The runner now reads D3D12_OPTIONS7, and the two tests skip with a note, as the wave64 tests do.

  3. The test title takes its device from d3d12_xs.dll. The title declares D3D12CreateDevice / D3D12SerializeRootSignature as raw-dylib imports from d3d12_xs. The windows crate imports the same two symbols from d3d12.dll, and the linker keeps that one: xcl inspect on the built title shows d3d12.dll: 2 Windows and no d3d12_xs import. So the title called the system's D3D12CreateDevice(NULL). D3D12 hands out one device per adapter, so the title still got XCL's device as long as XCL's adapter was the default adapter, and the e2e checks passed. On another adapter the title got a device XCL had never adopted. 5 D3D12.X checks then failed (no fallback PSO, no IDXGIDevice1, CreatePlacedResourceX E_INVALIDARG) and the run ended in an access violation in D3D12Core.dll. This also hits any machine where the high-performance GPU is not the display adapter, e.g. a laptop. The title now looks both functions up in d3d12_xs.dll with LoadLibraryW / GetProcAddress, which XCL serves from its HLE module.

  4. gpu_pso_e2e: the same mesh-shader check for the retail-pack tests. Console GS and NGG programs are drawn through a mesh pass. On the iGPU, four XCL_SAMPLE_RPF tests failed with E_INVALIDARG at mesh pipeline creation: retail_es_gs_voxelize_geometry_mode, retail_gs_pipeline_through_the_hook, retail_mesh_pipelines_through_the_hook, and the mesh half of retail_pipelines_built_in_the_background_behind_a_stand_in. They now check D3D12_OPTIONS7 on the backend's device and skip that part with a note. The VS / PS parts still run.

Plus one line in the README's Tests section.

Verification

Windows 11 Pro 26200, Rust stable MSVC, DXC 1.8.2502 from SDK 10.0.26100. cargo test --workspace --release --no-fail-fast -- --test-threads=4, once per adapter, no XCL_SAMPLE_* set:

XCL_ADAPTER adapter passed failed ignored GPU tests skipped (reason)
nvidia GeForce RTX 3080 (wave 32, mesh tier 1) 354 0 34 39 (no wave64)
radeon Radeon iGPU, RDNA2 (wave 32–64, no mesh shaders) 354 0 34 2 (no mesh shaders)

Before this branch, the default (RTX 3080) run passed too (352 passed, 2 fewer because the new unit tests were not there yet). Forcing the iGPU, which needs commit 1, gave 2 failed recompiler tests (commit 2) and a failed e2e test title with 5 D3D12.X checks failing (commit 3). New unit tests: gpu::adapter::tests::selector_parsing, selector_matching.

With XCL_SAMPLE_RPF set to a retail shaders.rpf (26 503 records), gpu_pso_e2e gives 6 / 6 on the iGPU. On the RTX 3080 it gives 4 / 6. The 2 failures there are retail_mesh_pipelines_through_the_hook (7 / 7 mesh pipelines fail) and the mesh half of the background-build test. That is the wave64-MS-on-wave32 limit discussed in #39, and this branch does not change it.

Not covered: a few probes and tests still create their own device with D3D12CreateDevice(None, …) (the default adapter): heap_probe.rs, two ignored experiments in recomp/tests.rs, texture.rs, list_x.rs, mfplat.rs. I left them alone.

The full per-adapter results are in #42.

<!-- greyfinch-sync:ivall/xcl:issue:6546939787 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/41). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-22T19:48:46Z. --- ### Summary Running the test suite on each GPU of a two-GPU machine (NVIDIA RTX 3080 + the AMD Radeon iGPU of a Ryzen 5 7600X) turned up three things, one commit each: 1. **`XCL_ADAPTER`: pick the D3D12 adapter.** The title's device took the first hardware adapter in high-performance order and the GPU test bench always took adapter 0, so the second GPU could not be tested. `d3d12_adapter` in `xcl.toml` now also takes a number (that hardware adapter in high-performance order) or a part of the adapter's name (`radeon`, `rtx 3080`). `XCL_ADAPTER` overrides it, the same way `XCL_RAYTRACING` overrides `raytracing`. The new `gpu::adapter` module holds the choice, and `hle::d3d12x::real` and `gpu::recomp::runner` both use it. If the name matches no adapter, the title logs the adapters it found and falls back to auto. The test bench gives the same message as its skip reason. `auto` / `warp` behave as before. 2. **Mesh draws are skipped on adapters without mesh shaders.** `gpu_mesh_mode_two_passes` and `gpu_geometry_mode_es_gs_strip` failed with `E_INVALIDARG` at mesh PSO creation on the RDNA2 iGPU. That adapter has wave 32–64 but reports `MeshShaderTier` NOT_SUPPORTED. The runner now reads `D3D12_OPTIONS7`, and the two tests skip with a note, as the wave64 tests do. 3. **The test title takes its device from `d3d12_xs.dll`.** The title declares `D3D12CreateDevice` / `D3D12SerializeRootSignature` as raw-dylib imports from `d3d12_xs`. The `windows` crate imports the same two symbols from `d3d12.dll`, and the linker keeps that one: `xcl inspect` on the built title shows `d3d12.dll: 2 Windows` and no `d3d12_xs` import. So the title called the system's `D3D12CreateDevice(NULL)`. D3D12 hands out one device per adapter, so the title still got XCL's device as long as XCL's adapter was the default adapter, and the e2e checks passed. On another adapter the title got a device XCL had never adopted. 5 D3D12.X checks then failed (no fallback PSO, no `IDXGIDevice1`, `CreatePlacedResourceX` E_INVALIDARG) and the run ended in an access violation in `D3D12Core.dll`. This also hits any machine where the high-performance GPU is not the display adapter, e.g. a laptop. The title now looks both functions up in `d3d12_xs.dll` with `LoadLibraryW` / `GetProcAddress`, which XCL serves from its HLE module. 4. **`gpu_pso_e2e`: the same mesh-shader check for the retail-pack tests.** Console GS and NGG programs are drawn through a mesh pass. On the iGPU, four `XCL_SAMPLE_RPF` tests failed with `E_INVALIDARG` at mesh pipeline creation: `retail_es_gs_voxelize_geometry_mode`, `retail_gs_pipeline_through_the_hook`, `retail_mesh_pipelines_through_the_hook`, and the mesh half of `retail_pipelines_built_in_the_background_behind_a_stand_in`. They now check `D3D12_OPTIONS7` on the backend's device and skip that part with a note. The VS / PS parts still run. Plus one line in the README's Tests section. ### Verification Windows 11 Pro 26200, Rust stable MSVC, DXC 1.8.2502 from SDK 10.0.26100. `cargo test --workspace --release --no-fail-fast -- --test-threads=4`, once per adapter, no `XCL_SAMPLE_*` set: | `XCL_ADAPTER` | adapter | passed | failed | ignored | GPU tests skipped (reason) | |---|---|---|---|---|---| | `nvidia` | GeForce RTX 3080 (wave 32, mesh tier 1) | 354 | 0 | 34 | 39 (no wave64) | | `radeon` | Radeon iGPU, RDNA2 (wave 32–64, no mesh shaders) | 354 | 0 | 34 | 2 (no mesh shaders) | Before this branch, the default (RTX 3080) run passed too (352 passed, 2 fewer because the new unit tests were not there yet). Forcing the iGPU, which needs commit 1, gave 2 failed recompiler tests (commit 2) and a failed e2e test title with 5 D3D12.X checks failing (commit 3). New unit tests: `gpu::adapter::tests::selector_parsing`, `selector_matching`. With `XCL_SAMPLE_RPF` set to a retail `shaders.rpf` (26 503 records), `gpu_pso_e2e` gives 6 / 6 on the iGPU. On the RTX 3080 it gives 4 / 6. The 2 failures there are `retail_mesh_pipelines_through_the_hook` (7 / 7 mesh pipelines fail) and the mesh half of the background-build test. That is the wave64-MS-on-wave32 limit discussed in #39, and this branch does not change it. Not covered: a few probes and tests still create their own device with `D3D12CreateDevice(None, …)` (the default adapter): `heap_probe.rs`, two ignored experiments in `recomp/tests.rs`, `texture.rs`, `list_x.rs`, `mfplat.rs`. I left them alone. The full per-adapter results are in #42.
upstream-sync closed this pull request 2026-11-24 06:56:52 +00:00
ivall commented 2026-11-24 07:00:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-22T21:38:06Z.


Thanks, merged! I tested it on top of current main, after #39 / #44 / #45 and the test title's new checks:

  • All tests pass on an RX 9070: 335 lib tests with the two adapter tests, the test title, and gpu_pso_e2e 6 / 6 with a retail shaders.rpf.
  • The test title now has no d3d12*.dll import at all. Its D3D12.X checks really run on XCL's device, including the three added today (descriptor heaps after a large graphics reservation, committed textures past the coherent room, the hidden title window). I had run into the same linker binding with CreateWindowExW there.
  • With auto, a game still picks the same adapter ("AMD Radeon RX 9070 (16191 MiB VRAM)") and runs as before.
<!-- greyfinch-sync:ivall/xcl:comment:7086198748 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/41#issuecomment-7086198748). Originally posted by [ivall](https://github.com/ivall) on 2026-11-22T21:38:06Z. --- Thanks, merged! I tested it on top of current `main`, after #39 / #44 / #45 and the test title's new checks: - All tests pass on an RX 9070: 335 lib tests with the two adapter tests, the test title, and `gpu_pso_e2e` 6 / 6 with a retail `shaders.rpf`. - The test title now has no `d3d12*.dll` import at all. Its D3D12.X checks really run on XCL's device, including the three added today (descriptor heaps after a large graphics reservation, committed textures past the coherent room, the hidden title window). I had run into the same linker binding with `CreateWindowExW` there. - With `auto`, a game still picks the same adapter ("AMD Radeon RX 9070 (16191 MiB VRAM)") and runs as before.
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!40
No description provided.