Tests: check producer metadata in direct DXIL shaders #1461

Closed
philip-roy-jones wants to merge 1 commit from upstream-pr/1471 into main
philip-roy-jones commented 2026-11-24 16:37:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by philip-roy-jones on 2026-11-24T16:37:39Z.


This PR is closed. The runtime fix for producer metadata in direct-DXIL shaders shipped in upstream main at c160d86. That commit can be used for driver verification. Merged PR #1426

Stacked on #1426. Only the top commit, 3c64cae, belongs to this PR. Review the 20-line patch

Part of #1269. Direct compute shaders without LLVM producer metadata validated on the Radeon RX 580, then the driver exited during pipeline creation. #1426 now emits the metadata separately for compute and graphics. I verified its clean head bc93a3a runs the compute kernel and draws the VS/PS triangle. Parent's driver fix

What is in it

  • Disassemble compute, vertex, pixel and mesh shaders and verify that !llvm.ident references a nonempty producer string.
  • Document the compute and graphics XCL_DIRECT_DXIL switches in the README.

Tested

  • 3c64cae02baadbf6d42ec654fbc118426926bfdb, Radeon RX 580 (31.0.21925.1001, native wave64), Ryzen 7 7700X, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, DXC 1.9.2609.5. Debug tests and release smoke builds.
  • cargo test -p xcl --lib direct_shaders_identify_their_producer -- --nocapture failed on 065aef3 with CS has no llvm.ident and passed on this head with both DXC 1.9 and Windows SDK DXC 1.8.2502.11.
  • cargo test -p xcl --lib gpu::dxil:: -- --test-threads=4 --nocapture reported 74 passed, 0 failed and 2 ignored, including 15 wave32 and 2 mesh hardware skips. With XCL_DIRECT_DXIL=1, the EXEC-divergence and scalar-loop tests both passed without skips.
  • cargo build --workspace succeeded. cargo test --workspace --no-fail-fast -- --test-threads=4 lost its library process. Running its 514 unreported cases separately completed the suite. 805 reported passing, 21 failed, 1 crashed and 43 were ignored. 19 passes were hardware skips (15 wave32, 4 mesh). All 22 unsuccessful cases had the same outcomes individually on clean bc93a3a.
  • The Windows CI command .\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouched passed locally with hardware adapter selection disabled. It reported 826 passed, 0 failed, 43 ignored and 1 filtered. 231 passes were explicit skips.
  • Four small retail compute shaders produced signed DXIL in 29.5–30.0 ms total through direct translation and 275.6–320.9 ms through HLSL + DXC. Each pair used cold caches, timed pso::console_to_dxil_in and selected the first four distinct native-wave64 programs with 64–4096 input bytes. The RX 580 created every pipeline. Direct output totalled 361,960 bytes, HLSL-derived output 62,208 bytes. Pipeline creation was outside the timer.

Regression run

scripts/smoke.ps1 -Game <retail folder> -Xcl <release exe> -Seconds 60 on the RX 580 with XCL_ASYNC_PSO=0 (synchronous pipeline creation), no input and fresh writable game data each time. For each revision and backend, the first run started with an empty shader cache and the second reused it. All eight runs completed without crashes or device removal.

Translation Cache Frames, main / PR Peak commit in MB, main / PR
Default HLSL cold 341 / 419 12,388 / 12,427
Default HLSL warm 1,669 / 1,673 18,216 / 17,596
Direct DXIL enabled cold 363 / 234 12,312 / 14,550
Direct DXIL enabled warm 1,661 / 1,665 15,974 / 49,696

The default HLSL runs cleared the project's frame and memory thresholds. With XCL_DIRECT_DXIL=1, cold-cache frames fell below 80% of main. Warm-cache frames were comparable while peak commit exceeded the 125% limit. The two blocks below are the warm default HLSL comparison.

Upstream main

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1669 (PresentX 1669)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18216 MB

PR head

xcl-smoke v1
commit: 3c64cae02baadbf6d42ec654fbc118426926bfdb
gpu: Radeon RX 580 Series
title: Retail
seconds: 60
exit: 0x0
frames shown: 1673 (PresentX 1673)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17596 MB

Not tested

  • Gameplay, hardware mesh execution and wave32-only kernels. The default HLSL blocks exercise the default runtime path. The direct runs and focused shader tests above exercise the opt-in backend.
  • The hosted Windows run is waiting for a repository writer to approve it. Hosted CI

AI use

  • Codex (GPT-6) diagnosed the RX 580 issue, wrote the regression test and README update, and ran the comparisons.
<!-- greyfinch-sync:ivall/xcl:issue:6586687593 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1471). Originally posted by [philip-roy-jones](https://github.com/philip-roy-jones) on 2026-11-24T16:37:39Z. --- This PR is closed. The runtime fix for producer metadata in direct-DXIL shaders shipped in upstream `main` at `c160d86`. That commit can be used for driver verification. [Merged PR #1426](https://github.com/xcl-dev/xcl/pull/1426) Stacked on #1426. Only the top commit, `3c64cae`, belongs to this PR. [Review the 20-line patch](https://github.com/ivall/xcl/compare/bc93a3a6f1d5ce2f5836135b231bd5e09e8d1658...3c64cae02baadbf6d42ec654fbc118426926bfdb) Part of #1269. Direct compute shaders without LLVM producer metadata validated on the Radeon RX 580, then the driver exited during pipeline creation. #1426 now emits the metadata separately for compute and graphics. I verified its clean head `bc93a3a` runs the compute kernel and draws the VS/PS triangle. [Parent's driver fix](https://github.com/ivall/xcl/commit/ac9328fc7b502b0044e8cacc563c3ad79137b80d) **What is in it** - Disassemble compute, vertex, pixel and mesh shaders and verify that `!llvm.ident` references a nonempty producer string. - Document the compute and graphics `XCL_DIRECT_DXIL` switches in the README. **Tested** - `3c64cae02baadbf6d42ec654fbc118426926bfdb`, Radeon RX 580 (31.0.21925.1001, native wave64), Ryzen 7 7700X, Windows 11 Pro 26200.9974, Rust 1.100.0 MSVC, DXC 1.9.2609.5. Debug tests and release smoke builds. - `cargo test -p xcl --lib direct_shaders_identify_their_producer -- --nocapture` failed on `065aef3` with `CS has no llvm.ident` and passed on this head with both DXC 1.9 and Windows SDK DXC 1.8.2502.11. - `cargo test -p xcl --lib gpu::dxil:: -- --test-threads=4 --nocapture` reported 74 passed, 0 failed and 2 ignored, including 15 wave32 and 2 mesh hardware skips. With `XCL_DIRECT_DXIL=1`, the EXEC-divergence and scalar-loop tests both passed without skips. - `cargo build --workspace` succeeded. `cargo test --workspace --no-fail-fast -- --test-threads=4` lost its library process. Running its 514 unreported cases separately completed the suite. 805 reported passing, 21 failed, 1 crashed and 43 were ignored. 19 passes were hardware skips (15 wave32, 4 mesh). All 22 unsuccessful cases had the same outcomes individually on clean `bc93a3a`. - The Windows CI command `.\scripts\test.ps1 --skip test_title_runs_and_game_folder_is_untouched` passed locally with hardware adapter selection disabled. It reported 826 passed, 0 failed, 43 ignored and 1 filtered. 231 passes were explicit skips. - Four small retail compute shaders produced signed DXIL in 29.5–30.0 ms total through direct translation and 275.6–320.9 ms through HLSL + DXC. Each pair used cold caches, timed `pso::console_to_dxil_in` and selected the first four distinct native-wave64 programs with 64–4096 input bytes. The RX 580 created every pipeline. Direct output totalled 361,960 bytes, HLSL-derived output 62,208 bytes. Pipeline creation was outside the timer. **Regression run** `scripts/smoke.ps1 -Game <retail folder> -Xcl <release exe> -Seconds 60` on the RX 580 with `XCL_ASYNC_PSO=0` (synchronous pipeline creation), no input and fresh writable game data each time. For each revision and backend, the first run started with an empty shader cache and the second reused it. All eight runs completed without crashes or device removal. | Translation | Cache | Frames, main / PR | Peak commit in MB, main / PR | |---|---|---:|---:| | Default HLSL | cold | 341 / 419 | 12,388 / 12,427 | | Default HLSL | warm | 1,669 / 1,673 | 18,216 / 17,596 | | Direct DXIL enabled | cold | 363 / 234 | 12,312 / 14,550 | | Direct DXIL enabled | warm | 1,661 / 1,665 | 15,974 / 49,696 | The default HLSL runs cleared the project's frame and memory thresholds. With `XCL_DIRECT_DXIL=1`, cold-cache frames fell below 80% of main. Warm-cache frames were comparable while peak commit exceeded the 125% limit. The two blocks below are the warm default HLSL comparison. Upstream main ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: Radeon RX 580 Series title: Retail seconds: 60 exit: 0x0 frames shown: 1669 (PresentX 1669) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18216 MB ``` PR head ``` xcl-smoke v1 commit: 3c64cae02baadbf6d42ec654fbc118426926bfdb gpu: Radeon RX 580 Series title: Retail seconds: 60 exit: 0x0 frames shown: 1673 (PresentX 1673) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17596 MB ``` **Not tested** - Gameplay, hardware mesh execution and wave32-only kernels. The default HLSL blocks exercise the default runtime path. The direct runs and focused shader tests above exercise the opt-in backend. - The hosted Windows run is waiting for a repository writer to approve it. [Hosted CI](https://github.com/ivall/xcl/actions/runs/45440942717) **AI use** - Codex (GPT-6) diagnosed the RX 580 issue, wrote the regression test and README update, and ran the comparisons.
upstream-sync closed this pull request 2026-11-24 18:07:46 +00:00
DavidM1911 commented 2026-11-24 19:07:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:54:16Z.


Verification on RTX 3060 Ti (Windows 11): merge conflict with current main in crates/xcl/src/gpu/recomp/tests.rs — needs a rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7141314632 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1471#issuecomment-7141314632). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:54:16Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** in `crates/xcl/src/gpu/recomp/tests.rs` — needs a rebase before it can be tested.

Pull request closed

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!1461
No description provided.