Shaders: warm runtime-selected graphics DXIL variants in --precompile #2613

Open
github-bot wants to merge 1 commit from github-bot/gh-2613 into main AGit
Owner

@⁠Decodere on GitHub · 2026-11-26 01:58 UTC · original
Decodere:fix-precompile-runtime-graphics-variants-2600 → main · +290 −19 · 3 files · 1 commits · open

Routes console vertex (hw == 4) and pixel (hw == 5) FSSM variants in xcl shaders --precompile through recomp::pso::console_to_dxil_in_status, warming the exact translated/v2 runtime cache variants (including XCL_DIRECT_DXIL=all direct graphics variants), distinguishing cache hits from fresh compiles, and explicitly reporting standalone PS sampler_base=0 coverage alongside static-sampler shift counts. Part of #2600, Part of #2508, Part of #1833.

What is in it

  • crates/xcl/src/gpu/recomp/pso.rs: add console_to_dxil_in_status(blob, stage, sampler_base, split_wave64, windows) -> Result<(Compiled, bool), String> (with console_to_dxil_in delegating to it) returning whether the result came from the in-memory or translated/v2 disk cache (true) vs fresh translation/compilation (false).
  • crates/xcl/src/shaders.rs (precompile): warm at most one runtime Stage::Vertex (hw == 4) and one runtime Stage::Pixel (hw == 5) FSSM variant per container via recomp::pso::console_to_dxil_in_status(&blob, stage, 0, graphics_split, windows) (and use console_to_dxil_in_status for compute as well), incrementing cached on cache hits and compiled only on fresh compiles, while preserving ES/GS skipped counting and Mode::Mesh handling unchanged.
  • crates/xcl/src/shaders.rs (precompile): track ps_base0, ps_static_samplers, and vs_static_samplers from Compiled.samplers, print an explicit runtime-path coverage summary line when standalone PS or static-sampler VS records are warmed, and update the precompile doc comment.
  • crates/xcl/tests/shaders_e2e.rs: add two fresh-process end-to-end tests (precompile_warms_direct_vs_ps_and_hits_in_fresh_process under XCL_DIRECT_DXIL=all and precompile_warms_hlsl_static_samplers_and_reports_base_shift under XCL_DIRECT_DXIL=0) verifying cold compiled 2, already cached 0, errors 0 -> warm second-run compiled 0, already cached 2, errors 0 summaries, translated/v2 warming, zero-DXC fresh-process cache hits, paired PS(base=1) miss + distinct DXIL, and separate warm translation/DXC vs native CreateGraphicsPipelineState timings; time_native_graphics_pso now returns Result<Option<f64>, String> so root-signature and CreateGraphicsPipelineState errors fail with exact HRESULTs once a D3D12 device is available while genuine unavailable-GPU skips route through runner::skip_test.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: Windows 11 Home (build 26200), NVIDIA GeForce RTX 4060 8 GB (driver 621.14, 32-lane waves), Intel Core i5-11400F (6C/12T), 32 GB RAM, rustc 1.100.0, DXC 1.9.2609.5, --release.
  • Failing-first on unmodified b49be183: both new shaders_e2e tests failed (0 passed; 2 failed) because unmodified precompile neither wrote translated/v2 entries for VS/PS nor printed the sampler_base=0 coverage line.
  • Post-fix cargo test --release -p xcl --test shaders_e2e -- --nocapture: 10 passed, 0 failed, 0 ignored (0 skips on both RTX 4060 and WARP):
    • RTX 4060 fresh-process timings: direct VS+PS warm_translate_dxc_ms=5.136, native_pso_ms=7.185; HLSL static-sampler VS+PS warm_translate_dxc_ms=3.338, native_pso_ms=21.347.
    • WARP (XCL_ADAPTER=warp, XCL_WARP=1) fresh-process timings: direct VS+PS warm_translate_dxc_ms=5.067, native_pso_ms=1.874; HLSL static-sampler VS+PS warm_translate_dxc_ms=3.964, native_pso_ms=2.869.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 37 test binaries, 1437 passed, 0 failed, 47 ignored (SKIPPED GPU/host tests: 29 pre-existing on 32-lane RTX 4060 without D3D12 debug layer — 21 no wave64, 3 per-lane wave32 refused, 3 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped in shaders_e2e).

Regression run

main (origin/main ancestor 889ef3e8aa7f267323ab4879e735e65da6bcef10, ancestor of b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):

xcl-smoke v1
commit: 889ef3e8aa7f267323ab4879e735e65da6bcef10
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1550 (PresentX 1550)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13981 MB

PR:

xcl-smoke v1
commit: 2d229b9f76b605edffed09419328dc2245b97e8a
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1546 (PresentX 1546)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13980 MB

Not tested

  • 64-lane AMD hardware (wave64 GPU tests skipped on 32-lane RTX 4060), D3D12 debug-layer tests (SDK layers DLL not installed on host), and pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode disabled).
  • Offline --precompile over a full retail shader archive (covered via isolated synthetic console VS/PS containers in shaders_e2e).
  • The 47 #[ignore] tests.

AI use

  • Google Antigravity (Gemini 4 Neon) implemented console_to_dxil_in_status in pso.rs, the precompile runtime graphics warming, cache-hit accounting, and coverage reporting in shaders.rs, and the fresh-process direct and HLSL static-sampler tests in shaders_e2e.rs, ran the failing-first, post-fix, workspace, and paired 60 s smoke verifications, and drafted this PR description.
**@⁠Decodere** on GitHub · 2026-11-26 01:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613) `Decodere:fix-precompile-runtime-graphics-variants-2600` → `main` · +290 −19 · 3 files · 1 commits · open Routes console vertex (`hw == 4`) and pixel (`hw == 5`) FSSM variants in `xcl shaders --precompile` through `recomp::pso::console_to_dxil_in_status`, warming the exact `translated/v2` runtime cache variants (including `XCL_DIRECT_DXIL=all` direct graphics variants), distinguishing cache hits from fresh compiles, and explicitly reporting standalone PS `sampler_base=0` coverage alongside static-sampler shift counts. Part of #2600, Part of #2508, Part of #1833. **What is in it** - `crates/xcl/src/gpu/recomp/pso.rs`: add `console_to_dxil_in_status(blob, stage, sampler_base, split_wave64, windows) -> Result<(Compiled, bool), String>` (with `console_to_dxil_in` delegating to it) returning whether the result came from the in-memory or `translated/v2` disk cache (`true`) vs fresh translation/compilation (`false`). - `crates/xcl/src/shaders.rs` (`precompile`): warm at most one runtime `Stage::Vertex` (`hw == 4`) and one runtime `Stage::Pixel` (`hw == 5`) FSSM variant per container via `recomp::pso::console_to_dxil_in_status(&blob, stage, 0, graphics_split, windows)` (and use `console_to_dxil_in_status` for compute as well), incrementing `cached` on cache hits and `compiled` only on fresh compiles, while preserving `ES`/`GS` `skipped` counting and `Mode::Mesh` handling unchanged. - `crates/xcl/src/shaders.rs` (`precompile`): track `ps_base0`, `ps_static_samplers`, and `vs_static_samplers` from `Compiled.samplers`, print an explicit runtime-path coverage summary line when standalone PS or static-sampler VS records are warmed, and update the `precompile` doc comment. - `crates/xcl/tests/shaders_e2e.rs`: add two fresh-process end-to-end tests (`precompile_warms_direct_vs_ps_and_hits_in_fresh_process` under `XCL_DIRECT_DXIL=all` and `precompile_warms_hlsl_static_samplers_and_reports_base_shift` under `XCL_DIRECT_DXIL=0`) verifying cold `compiled 2, already cached 0, errors 0` -> warm second-run `compiled 0, already cached 2, errors 0` summaries, `translated/v2` warming, zero-DXC fresh-process cache hits, paired `PS(base=1)` miss + distinct DXIL, and separate warm translation/DXC vs native `CreateGraphicsPipelineState` timings; `time_native_graphics_pso` now returns `Result<Option<f64>, String>` so root-signature and `CreateGraphicsPipelineState` errors fail with exact HRESULTs once a D3D12 device is available while genuine unavailable-GPU skips route through `runner::skip_test`. **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: Windows 11 Home (build 26200), NVIDIA GeForce RTX 4060 8 GB (driver 621.14, 32-lane waves), Intel Core i5-11400F (6C/12T), 32 GB RAM, `rustc 1.100.0`, DXC `1.9.2609.5`, `--release`. - Failing-first on unmodified `b49be183`: both new `shaders_e2e` tests failed (`0 passed; 2 failed`) because unmodified `precompile` neither wrote `translated/v2` entries for VS/PS nor printed the `sampler_base=0` coverage line. - Post-fix `cargo test --release -p xcl --test shaders_e2e -- --nocapture`: `10 passed, 0 failed, 0 ignored` (`0` skips on both RTX 4060 and WARP): - RTX 4060 fresh-process timings: direct VS+PS `warm_translate_dxc_ms=5.136`, `native_pso_ms=7.185`; HLSL static-sampler VS+PS `warm_translate_dxc_ms=3.338`, `native_pso_ms=21.347`. - WARP (`XCL_ADAPTER=warp`, `XCL_WARP=1`) fresh-process timings: direct VS+PS `warm_translate_dxc_ms=5.067`, `native_pso_ms=1.874`; HLSL static-sampler VS+PS `warm_translate_dxc_ms=3.964`, `native_pso_ms=2.869`. - `cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture`: `37` test binaries, `1437 passed, 0 failed, 47 ignored` (SKIPPED GPU/host tests: 29 pre-existing on 32-lane RTX 4060 without D3D12 debug layer — 21 no wave64, 3 per-lane wave32 refused, 3 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped in `shaders_e2e`). **Regression run** main (`origin/main` ancestor `889ef3e8aa7f267323ab4879e735e65da6bcef10`, ancestor of `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`): ``` xcl-smoke v1 commit: 889ef3e8aa7f267323ab4879e735e65da6bcef10 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1550 (PresentX 1550) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13981 MB ``` PR: ``` xcl-smoke v1 commit: 2d229b9f76b605edffed09419328dc2245b97e8a gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1546 (PresentX 1546) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13980 MB ``` **Not tested** - 64-lane AMD hardware (wave64 GPU tests skipped on 32-lane RTX 4060), D3D12 debug-layer tests (SDK layers DLL not installed on host), and `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode disabled). - Offline `--precompile` over a full retail shader archive (covered via isolated synthetic console VS/PS containers in `shaders_e2e`). - The 47 `#[ignore]` tests. **AI use** - Google Antigravity (Gemini 4 Neon) implemented `console_to_dxil_in_status` in `pso.rs`, the `precompile` runtime graphics warming, cache-hit accounting, and coverage reporting in `shaders.rs`, and the fresh-process direct and HLSL static-sampler tests in `shaders_e2e.rs`, ran the failing-first, post-fix, workspace, and paired 60 s smoke verifications, and drafted this PR description.
Route console VS (hw == 4) and PS (hw == 5) FSSM variants in `xcl shaders
--precompile` through `recomp::pso::console_to_dxil_in` instead of the manual
HLSL-only translate + compile_cached loop:

- Warms the `translated/v2` cache used at runtime for both direct graphics
  (`XCL_DIRECT_DXIL=all`) and HLSL graphics (`XCL_DIRECT_DXIL=0`), warming at
  most one runtime VS and one runtime PS variant per container while keeping
  ES/GS skipped counting and Mode::Mesh handling unchanged.
- Reports explicit standalone PS `sampler_base=0` coverage alongside counts of
  PS and VS records carrying static samplers (which shift paired PS bases at
  pipeline creation).
- Adds fresh-process end-to-end tests in `crates/xcl/tests/shaders_e2e.rs`
  verifying direct VS/PS `translated/v2` warming + zero-DXC cache hits and
  HLSL VS+PS static-sampler `sampler_base=0` hit vs `sampler_base=1` miss,
  with separate warm translation/DXC and native graphics PSO timings.

Part of #2600
Part of #2508
Part of #1833

Assisted-by: Google Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:52 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-26 02:27 UTC · original · edited 2026-11-26 06:56 UTC

Update for head 2d229b9: rerun on main b49be18, same cards and --nocapture. shaders_e2e gives 10 passed, 0 failed, no SKIPPED, on both the RX 9070 XT and the RTX 3060. shaders:: gives 10 passed, 0 failed on both, with the same 1 SKIPPED as main (pso_measurement_compiles_an_exact_synthetic_record).

64-lane AMD run (listed as untested) on an RX 9070 XT, plus an RTX 3060: both new end-to-end tests pass on both cards, with no skips.

Head a3312c0 applied on main b49be18, debug, Windows 11 Pro 26200, card chosen with XCL_ADAPTER:

  • cargo test -p xcl --test shaders_e2e -- --nocapture: 10 passed, 0 failed, no SKIPPED on both cards, with precompile_warms_direct_vs_ps_and_hits_in_fresh_process and precompile_warms_hlsl_static_samplers_and_reports_base_shift among them.
  • cargo test -p xcl --lib -- shaders::: 10 passed, 0 failed on both cards. 1 SKIPPED, the same on main: pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache).

Not tested: the D3D12 debug-layer tests (no d3d12SDKLayers.dll here either), a retail pack, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-26 02:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7180827204) · edited 2026-11-26 06:56 UTC **Update for head `2d229b9`:** rerun on `main` `b49be18`, same cards and `--nocapture`. `shaders_e2e` gives 10 passed, 0 failed, no SKIPPED, on both the RX 9070 XT and the RTX 3060. `shaders::` gives 10 passed, 0 failed on both, with the same 1 SKIPPED as `main` (`pso_measurement_compiles_an_exact_synthetic_record`). 64-lane AMD run (listed as untested) on an RX 9070 XT, plus an RTX 3060: both new end-to-end tests pass on both cards, with no skips. Head `a3312c0` applied on `main` `b49be18`, debug, Windows 11 Pro 26200, card chosen with `XCL_ADAPTER`: - `cargo test -p xcl --test shaders_e2e -- --nocapture`: 10 passed, 0 failed, no SKIPPED on both cards, with `precompile_warms_direct_vs_ps_and_hits_in_fresh_process` and `precompile_warms_hlsl_static_samplers_and_reports_base_shift` among them. - `cargo test -p xcl --lib -- shaders::`: 10 passed, 0 failed on both cards. 1 SKIPPED, the same on `main`: `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache). Not tested: the D3D12 debug-layer tests (no `d3d12SDKLayers.dll` here either), a retail pack, Intel. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 02:30 UTC · original

Tested — AMD Radeon RX 6800M

  • Exact PR head: a3312c055cf3a31f77bcb7b1e278b7479d29dc41 (clean detached worktree). Windows 11 Home 10.0.26200, Ryzen 9 5980HX, RX 6800M driver 30.0.13002.13003, rustc 1.99.0, DXC 1.9.2609.5, debug build.
  • Set XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1, and XCL_DXC_DIR to the local DXC 1.9.2609 x64 directory. Ran cargo test --locked -p xcl --test shaders_e2e -j 1 precompile_warms_ -- --test-threads=1 --nocapture in an isolated target directory under a memory guard: 2 passed, 0 failed, 0 ignored, 8 filtered; no SKIPPED lines; guard did not trigger.
  • Direct VS+PS fresh-process cache hit: warm_translate_dxc_ms=5.452, native_pso_ms=5.909.
  • HLSL static-sampler/base-shift fresh-process case: warm_translate_dxc_ms=4.994, native_pso_ms=18.077.

The child tests assert warm translated/v2 hits and zero DXC compiles on those hits. The numeric native PSO timings show that both cases reached CreateGraphicsPipelineState. The child inherits XCL_ADAPTER=6800M; this machine's matching hardware adapter is the RX 6800M. The helper only falls back to WARP when no adapter matches, so this is RX 6800M native-driver evidence rather than a pass inferred from the outer test status alone.

Not tested: full workspace suite on this head, release profile, a retail shader archive or paired title smoke, other GPUs, and whether the changed path improves title behavior. Timings are single samples, not a performance comparison.

AI use: OpenAI Codex (GPT-6; exact serving variant unavailable) and a Luna subagent selected the focused test, ran it, checked the exact-head log and adapter-selection code, and drafted this report.

**@⁠luckyteagirl** on GitHub · 2026-11-26 02:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7180870498) **Tested — AMD Radeon RX 6800M** - Exact PR head: `a3312c055cf3a31f77bcb7b1e278b7479d29dc41` (clean detached worktree). Windows 11 Home 10.0.26200, Ryzen 9 5980HX, RX 6800M driver 30.0.13002.13003, rustc 1.99.0, DXC 1.9.2609.5, debug build. - Set `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=1`, and `XCL_DXC_DIR` to the local DXC 1.9.2609 x64 directory. Ran `cargo test --locked -p xcl --test shaders_e2e -j 1 precompile_warms_ -- --test-threads=1 --nocapture` in an isolated target directory under a memory guard: **2 passed, 0 failed, 0 ignored, 8 filtered; no `SKIPPED` lines; guard did not trigger**. - Direct VS+PS fresh-process cache hit: `warm_translate_dxc_ms=5.452`, `native_pso_ms=5.909`. - HLSL static-sampler/base-shift fresh-process case: `warm_translate_dxc_ms=4.994`, `native_pso_ms=18.077`. The child tests assert warm `translated/v2` hits and zero DXC compiles on those hits. The numeric native PSO timings show that both cases reached `CreateGraphicsPipelineState`. The child inherits `XCL_ADAPTER=6800M`; this machine's matching hardware adapter is the RX 6800M. The helper only falls back to WARP when no adapter matches, so this is RX 6800M native-driver evidence rather than a pass inferred from the outer test status alone. **Not tested:** full workspace suite on this head, release profile, a retail shader archive or paired title smoke, other GPUs, and whether the changed path improves title behavior. Timings are single samples, not a performance comparison. **AI use:** OpenAI Codex (GPT-6; exact serving variant unavailable) and a Luna subagent selected the focused test, ran it, checked the exact-head log and adapter-selection code, and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 02:33 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on --test-threads=1 rerun (1308 passed, 0 failed, 27 ignored, 79s). Intermittent single-test flake — tracked in #1978.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 02:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7180913355) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: 1 failure under parallel scheduling; clean on `--test-threads=1` rerun (**1308 passed, 0 failed, 27 ignored**, 79s). Intermittent single-test flake — tracked in #1978. Thanks! — Devin
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 05:36 UTC · original · reviewed

The new VS/PS path increments compiled after every successful console_to_dxil_in, including a hit from its in-memory or translated disk cache. That function returns only Compiled, so a second --precompile run can report compiled 2, already cached 0 for graphics variants even when both came from the cache. The HLSL loop below distinguishes hits. Could the graphics path expose/count the cache outcome (or use a separate warmed counter) and add a warm second-run assertion for the summary? Source review at a3312c055cf3a31f77bcb7b1e278b7479d29dc41; I did not run the precompile command. AI-assisted review with Codex.

**@⁠luckyteagirl** on GitHub · 2026-11-26 05:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#pullrequestreview-6069051963) · **reviewed** The new VS/PS path increments `compiled` after every successful `console_to_dxil_in`, including a hit from its in-memory or translated disk cache. That function returns only `Compiled`, so a second `--precompile` run can report `compiled 2, already cached 0` for graphics variants even when both came from the cache. The HLSL loop below distinguishes hits. Could the graphics path expose/count the cache outcome (or use a separate `warmed` counter) and add a warm second-run assertion for the summary? Source review at `a3312c055cf3a31f77bcb7b1e278b7479d29dc41`; I did not run the precompile command. AI-assisted review with Codex.
Author
Owner

@⁠SzczepanGrela on GitHub · 2026-11-26 06:21 UTC · original · edited 2026-11-26 09:01 UTC

Updated Linux/Wine verification of head 2d229b9f76b605edffed09419328dc2245b97e8a against main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. Unmodified source snapshots, release, existing synthetic fixtures only.

Tested

  • RX 9070 (RADV GFX1201), Mesa 26.3.1-arch3.5, Ryzen 7 7700, CachyOS kernel 7.3.0-5-cachyos, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build), DXC 1.9.2602.17, Rust 1.97.1, MinGW GCC 16.2.0. DXGI logs identify the RX 9070.
  • Built each revision with cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --test shaders_e2e --no-run.
  • Ran each resulting executable with Wine and --nocapture --test-threads=1, then --nocapture --test-threads=4.
  • Environment: XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0 VKD3D_SHADER_CACHE_PATH=0, native d3d12,d3d12core,dxgi, and XCL_DXC_DIR pointing to DXC. Application caches and working directories were separate per revision and run; the two graphics fixtures also create their own temporary caches.
Revision Threads Passed Failed Ignored Skipped
main b49be18 1 8 0 0 0
PR 2d229b9 1 10 0 0 0
main b49be18 4 8 0 0 0
PR 2d229b9 4 10 0 0 0

Both fresh-process graphics fixtures passed their cold compiled 2, already cached 0, errors 0 and warm compiled 0, already cached 2, errors 0 assertions. They also passed the warm translated/v2 and zero-DXC-hit assertions; the HLSL fixture checked the distinct PS(base=1) cache miss and DXIL. Native graphics PSO creation completed in both fixtures in both thread modes, with numeric timings and no GPU skips. These runs are correctness checks, not a performance comparison.

The earlier static-review item is addressed in source: time_native_graphics_pso returns Result<Option<f64>, String>, propagates root-signature and PSO errors, and both callers use expect. Genuine no-device returns call runner::skip_test. The successful runs above did not force either error branch.

Not tested

Full workspace suite, retail archives or workloads, scripts/smoke.ps1, rendered-image correctness, native Windows, NVIDIA/Intel, unavailable-device behavior, forced PSO failures, or cold-cache performance. No title-level regression or FPS result.

AI use

OpenAI Codex (GPT-6; exact serving variant unavailable) reviewed the changes, built and ran both revisions, checked source hashes and raw logs, and prepared this update for the account owner's review.

**@⁠SzczepanGrela** on GitHub · 2026-11-26 06:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7184352829) · edited 2026-11-26 09:01 UTC Updated Linux/Wine verification of head `2d229b9f76b605edffed09419328dc2245b97e8a` against `main` `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`. Unmodified source snapshots, release, existing synthetic fixtures only. **Tested** - RX 9070 (RADV GFX1201), Mesa `26.3.1-arch3.5`, Ryzen 7 7700, CachyOS kernel `7.3.0-5-cachyos`, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build), DXC `1.9.2602.17`, Rust `1.97.1`, MinGW GCC `16.2.0`. DXGI logs identify the RX 9070. - Built each revision with `cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --test shaders_e2e --no-run`. - Ran each resulting executable with Wine and `--nocapture --test-threads=1`, then `--nocapture --test-threads=4`. - Environment: `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0 VKD3D_SHADER_CACHE_PATH=0`, native `d3d12,d3d12core,dxgi`, and `XCL_DXC_DIR` pointing to DXC. Application caches and working directories were separate per revision and run; the two graphics fixtures also create their own temporary caches. | Revision | Threads | Passed | Failed | Ignored | Skipped | | :--- | ---: | ---: | ---: | ---: | ---: | | main `b49be18` | 1 | 8 | 0 | 0 | 0 | | PR `2d229b9` | 1 | 10 | 0 | 0 | 0 | | main `b49be18` | 4 | 8 | 0 | 0 | 0 | | PR `2d229b9` | 4 | 10 | 0 | 0 | 0 | Both fresh-process graphics fixtures passed their cold `compiled 2, already cached 0, errors 0` and warm `compiled 0, already cached 2, errors 0` assertions. They also passed the warm `translated/v2` and zero-DXC-hit assertions; the HLSL fixture checked the distinct PS(base=1) cache miss and DXIL. Native graphics PSO creation completed in both fixtures in both thread modes, with numeric timings and no GPU skips. These runs are correctness checks, not a performance comparison. The earlier static-review item is addressed in source: `time_native_graphics_pso` returns `Result<Option<f64>, String>`, propagates root-signature and PSO errors, and both callers use `expect`. Genuine no-device returns call `runner::skip_test`. The successful runs above did not force either error branch. **Not tested** Full workspace suite, retail archives or workloads, `scripts/smoke.ps1`, rendered-image correctness, native Windows, NVIDIA/Intel, unavailable-device behavior, forced PSO failures, or cold-cache performance. No title-level regression or FPS result. **AI use** OpenAI Codex (GPT-6; exact serving variant unavailable) reviewed the changes, built and ran both revisions, checked source hashes and raw logs, and prepared this update for the account owner's review.
github-bot force-pushed github-bot/gh-2613 from a3312c055c to 2d229b9f76 2026-11-26 06:47:08 +00:00 Compare
Author
Owner

@⁠Decodere on GitHub · 2026-11-26 06:43 UTC · original

Thanks @⁠luckyteagirl and @⁠SzczepanGrela — pushed 2d229b9f addressing both review items:

  1. Cache-hit accounting (@⁠luckyteagirl): added recomp::pso::console_to_dxil_in_status returning (Compiled, bool) (from_cache) and wired it into shaders.rs::precompile (CS, VS, and PS) so in-memory and translated/v2 hits increment already cached instead of compiled. Both shaders_e2e tests now verify cold compiled 2, already cached 0, errors 0 followed by a warm second --precompile run reporting compiled 0, already cached 2, errors 0.
  2. Native PSO error handling (@⁠SzczepanGrela): changed time_native_graphics_pso to return Result<Option<f64>, String> so root-signature and CreateGraphicsPipelineState failures fail the test with the exact error / HRESULT once a D3D12 device is created, while genuine no-device environments route through runner::skip_test("no D3D12 device").
  3. Re-verified release WARP & RTX 4060 shaders_e2e (10/0/0, 0 skipped), full release workspace (1437/0/47), and paired 60 s RTX 4060 smoke (1546 frames, 60 60 60, 0 removals/crashes).
**@⁠Decodere** on GitHub · 2026-11-26 06:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7184722434) Thanks @⁠luckyteagirl and @⁠SzczepanGrela — pushed `2d229b9f` addressing both review items: 1. **Cache-hit accounting (@⁠luckyteagirl):** added `recomp::pso::console_to_dxil_in_status` returning `(Compiled, bool)` (`from_cache`) and wired it into `shaders.rs::precompile` (CS, VS, and PS) so in-memory and `translated/v2` hits increment `already cached` instead of `compiled`. Both `shaders_e2e` tests now verify cold `compiled 2, already cached 0, errors 0` followed by a warm second `--precompile` run reporting `compiled 0, already cached 2, errors 0`. 2. **Native PSO error handling (@⁠SzczepanGrela):** changed `time_native_graphics_pso` to return `Result<Option<f64>, String>` so root-signature and `CreateGraphicsPipelineState` failures fail the test with the exact error / HRESULT once a D3D12 device is created, while genuine no-device environments route through `runner::skip_test("no D3D12 device")`. 3. Re-verified release WARP & RTX 4060 `shaders_e2e` (`10/0/0`, `0` skipped), full release workspace (`1437/0/47`), and paired 60 s RTX 4060 smoke (`1546` frames, `60 60 60`, `0` removals/crashes).
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 08:04 UTC · original · edited 2026-11-26 13:28 UTC

Correction (see 7193409689 below): the cleaner control, main with its own full --precompile (graphics included), also has almost no gap: median 23 ms, max 129 ms over 38 large pipelines. So most of the 4,024 ms → 6 ms below comes from precompiling graphics at all, not from this PR alone. This PR's own share in this measure is about 23 → 6 ms median (129 → 8 ms max).

Retail title, RTX 5090: the large graphics pipelines now start their driver compile within milliseconds instead of seconds. One 600 s run per side. Our control's precompile was compute-only (see Not tested).

Setup: RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11, release, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0.

  • PR side: main b49be18 + this PR at a3312c05 + #2551 (3567b2e). 2d229b9f differs only in the counters and tests. xcl shaders <pack> --precompile --used-only --pipelines (graphics included) took 42.3 min: 26,503 shaders, 0 errors; PS warmed at assumed sampler_base=0: 12101 (5765 with static samplers); VS with static samplers shifting paired PS base: 173; 2,812 pipelines, 0 refused.
  • Control: main b49be18, precompiled with --only cs.
  • Both: a 200 s warm-up, then 600 s on a copy of the warmed cache.

Large graphics pipelines (≥ 200 KB DXIL) in the world-start stall (no frames shown). Gap = time from the previous driver compile finishing to this one starting, from the driver compile start/finish trace lines:

control this PR
pipelines 31 34
median gap 4,024 ms 6 ms
longest gap 7,144 ms 8 ms

The rest of the stall is the NVIDIA driver's own compile, which this PR does not change. Run-wide graphics compiles with no driver blob: 1,328 taking 106.7 s on the control, 1,447 taking 131.1 s here.

Run totals: both reached 600 s with no removal or crash. Frames shown: 2,163 (control) vs 2,117. Two-second windows with no frame after 120 s: 206 vs 215 of 240. These totals are not a fair A/B, for two reasons:

  • The PR side hit about 100 s more of cold huge compute pipelines (314 s vs 214 s). --used-only came from a 200 s run that never reached them.
  • The control's exe had a warmer NVIDIA shader cache from earlier runs under the same name.

Not tested

  • main with its own full --precompile (graphics included) as the control. That is the cleaner A/B for this PR, and we can run it if useful.
  • A pair with identical NVIDIA cache warmth and full compute coverage.
  • 2d229b9f itself (only its diff against a3312c05 was read).
  • AMD, Intel, Linux.
  • Shifted sampler_base > 0 pixel shader paths.

AI use: Claude Code (Claude Opus 5.5) built and ran both sides. Gemini (Antigravity) extracted the trace numbers. Claude Code recomputed the gap table from the raw logs and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 08:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7186156070) · edited 2026-11-26 13:28 UTC > **Correction (see 7193409689 below):** the cleaner control, `main` with its own full `--precompile` (graphics included), also has almost no gap: median 23 ms, max 129 ms over 38 large pipelines. So most of the 4,024 ms → 6 ms below comes from precompiling graphics at all, not from this PR alone. This PR's own share in this measure is about 23 → 6 ms median (129 → 8 ms max). **Retail title, RTX 5090: the large graphics pipelines now start their driver compile within milliseconds instead of seconds.** One 600 s run per side. Our control's precompile was compute-only (see Not tested). **Setup:** RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11, release, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0`. - **PR side:** `main` `b49be18` + this PR at `a3312c05` + #2551 (`3567b2e`). `2d229b9f` differs only in the counters and tests. `xcl shaders <pack> --precompile --used-only --pipelines` (graphics included) took 42.3 min: 26,503 shaders, 0 errors; `PS warmed at assumed sampler_base=0: 12101 (5765 with static samplers); VS with static samplers shifting paired PS base: 173`; 2,812 pipelines, 0 refused. - **Control:** `main` `b49be18`, precompiled with `--only cs`. - Both: a 200 s warm-up, then 600 s on a copy of the warmed cache. **Large graphics pipelines (≥ 200 KB DXIL) in the world-start stall** (no frames shown). Gap = time from the previous driver compile finishing to this one starting, from the `driver compile start/finish` trace lines: | | control | this PR | |---|---:|---:| | pipelines | 31 | 34 | | median gap | 4,024 ms | 6 ms | | longest gap | 7,144 ms | 8 ms | The rest of the stall is the NVIDIA driver's own compile, which this PR does not change. Run-wide graphics compiles with no driver blob: 1,328 taking 106.7 s on the control, 1,447 taking 131.1 s here. **Run totals:** both reached 600 s with no removal or crash. Frames shown: 2,163 (control) vs 2,117. Two-second windows with no frame after 120 s: 206 vs 215 of 240. These totals are not a fair A/B, for two reasons: - The PR side hit about 100 s more of cold huge compute pipelines (314 s vs 214 s). `--used-only` came from a 200 s run that never reached them. - The control's exe had a warmer NVIDIA shader cache from earlier runs under the same name. **Not tested** - `main` with its own full `--precompile` (graphics included) as the control. That is the cleaner A/B for this PR, and we can run it if useful. - A pair with identical NVIDIA cache warmth and full compute coverage. - `2d229b9f` itself (only its diff against `a3312c05` was read). - AMD, Intel, Linux. - Shifted `sampler_base > 0` pixel shader paths. AI use: Claude Code (Claude Opus 5.5) built and ran both sides. Gemini (Antigravity) extracted the trace numbers. Claude Code recomputed the gap table from the raw logs and wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 08:29 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 08:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7186653326) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠Aniseto on GitHub · 2026-11-26 08:32 UTC · original

Ran the shaders end-to-end tests at 2d229b9:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

XCL_ADAPTER=nvidia cargo test -p xcl --test shaders_e2e -- --nocapture
10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out      (exit 0)

Both new fresh-process tests pass here. The timings printed on this adapter were warm_translate_dxc_ms=3.738 native_pso_ms=12.321 (direct VS+PS) and warm_translate_dxc_ms=3.191 native_pso_ms=21.054 (HLSL static-sampler VS+PS). They are single runs, not a benchmark.

What this adds: the hardware reports in the thread are on an RTX 4060 (Ada) and WARP, at the earlier head a3312c0. This is a Blackwell wave32 part at the current head 2d229b9, which addressed the review findings.

Not tested: a full retail shader archive, a paired 60 s smoke run, the whole workspace suite, AMD and Intel GPUs, native wave64, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-26 08:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7186714156) Ran the shaders end-to-end tests at `2d229b9`: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` XCL_ADAPTER=nvidia cargo test -p xcl --test shaders_e2e -- --nocapture 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (exit 0) ``` Both new fresh-process tests pass here. The timings printed on this adapter were `warm_translate_dxc_ms=3.738 native_pso_ms=12.321` (direct VS+PS) and `warm_translate_dxc_ms=3.191 native_pso_ms=21.054` (HLSL static-sampler VS+PS). They are single runs, not a benchmark. What this adds: the hardware reports in the thread are on an RTX 4060 (Ada) and WARP, at the earlier head `a3312c0`. This is a Blackwell wave32 part at the current head `2d229b9`, which addressed the review findings. Not tested: a full retail shader archive, a paired 60 s smoke run, the whole workspace suite, AMD and Intel GPUs, native wave64, Wine, release profile, title data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 13:28 UTC · original

Correction to 7186156070, with the cleaner control I offered there. main b49be18 with its own full --precompile --used-only --pipelines (graphics included, 42 min, 0 errors), the same recipe otherwise (200 s warm-up, then 600 s):

large graphics pipelines (≥ 200 KB) in the world-start stall control: main, compute-only precompile main, full precompile this PR + #2551, full precompile
count 31 38 34
median gap before the driver compile 4,024 ms 23 ms 6 ms
longest gap 7,144 ms 129 ms 8 ms

So the large drop in my earlier comment comes mostly from precompiling graphics at all, which main already does. In this measure, this PR takes it from ~23 ms to ~6 ms median (129 to 8 ms worst). I've put a note at the top of the earlier comment.

The full-precompile main run used an exe name with a warmer NVIDIA cache. The gap is XCL-side, so that shouldn't move it, but I'm noting it. That run ended with the #2403 removal at 577 s.

AI use: Claude Code (Claude Opus 5.5) ran the control, recomputed the gaps from the trace lines and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 13:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7193409689) **Correction to 7186156070, with the cleaner control I offered there.** `main` `b49be18` with its own full `--precompile --used-only --pipelines` (graphics included, 42 min, 0 errors), the same recipe otherwise (200 s warm-up, then 600 s): | large graphics pipelines (≥ 200 KB) in the world-start stall | control: `main`, compute-only precompile | `main`, full precompile | this PR + #2551, full precompile | |---|---:|---:|---:| | count | 31 | 38 | 34 | | median gap before the driver compile | 4,024 ms | 23 ms | 6 ms | | longest gap | 7,144 ms | 129 ms | 8 ms | So the large drop in my earlier comment comes mostly from precompiling graphics at all, which `main` already does. In this measure, this PR takes it from ~23 ms to ~6 ms median (129 to 8 ms worst). I've put a note at the top of the earlier comment. The full-precompile `main` run used an exe name with a warmer NVIDIA cache. The gap is XCL-side, so that shouldn't move it, but I'm noting it. That run ended with the #2403 removal at 577 s. AI use: Claude Code (Claude Opus 5.5) ran the control, recomputed the gaps from the trace lines and wrote this.
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-26 16:00 UTC · original

Hosted xcl run verification on current main after #2555. The supported vertex shader warmed correctly. An unsupported loose vertex shader also exposed a startup regression.

Five launches compared clean main 8b957bec6f82495aec940944c6bf47faa02db590 with its unmodified Git three-way merge with PR head 2d229b9f76b605edffed09419328dc2245b97e8a (tree 7a620e2bf3335ace3a34de65826b4c964985ad8b). RTX 4080 driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11, debug. Each used the same synthetic guest, isolated caches, and xcl run <fixture> -- --pr2600-vs-only with XCL_DIRECT_DXIL=all XCL_ADAPTER=4080 XCL_ASYNC_PSO=0 XCL_PSO_DISK_CACHE=0 XCL_HEAP_WINDOWS=0 XCL_UMA_WINDOWS=4.

  • All three launches with the supported VS created a native translated graphics PSO and exited 0. On main, startup wrote one HLSL cache entry and the guest translated the VS when it created the PSO. The integrated tree wrote the byte-identical 2,584-byte direct cache entry 24acc6835ffb0a75_Vertex_0_4_1.bin before the guest ran. A fresh integrated process with only that cache entry and no loose shaders created the same PSO, retained the entry byte for byte, and emitted no targeted direct compile dump or fallback.
  • In the other two launches, the loose 400-byte VS had one decoded v_cvt_off_f32_i4, and the guest still requested the separate supported VS. Main reported 0 errors, 1 skip, ran the guest to its PSO marker, and exited 0. The integrated build reported 1 error, 0 skips, logged incomplete translation, missing: ["v_cvt_off_f32_i4"], and exited 2 before guest entry.
  • The four launches that ran preparation added the same two empty NVIDIA driver-log directories in the synthetic folder on both builds. The outer folder-equality guard reported that difference. All original fixture files stayed byte-identical. The fresh cache-only replay passed the folder guard.

Could the hosted path preserve the old skip behavior for incomplete translations? Routing that case through the existing per-program handling would keep the successful cache warmup and let launch proceed past an unused unsupported shader.

**@⁠CryingLaughing** on GitHub · 2026-11-26 16:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2613#issuecomment-7197051946) Hosted `xcl run` verification on current `main` after #2555. The supported vertex shader warmed correctly. An unsupported loose vertex shader also exposed a startup regression. Five launches compared clean `main` `8b957bec6f82495aec940944c6bf47faa02db590` with its unmodified Git three-way merge with PR head `2d229b9f76b605edffed09419328dc2245b97e8a` (tree `7a620e2bf3335ace3a34de65826b4c964985ad8b`). RTX 4080 driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11, debug. Each used the same synthetic guest, isolated caches, and `xcl run <fixture> -- --pr2600-vs-only` with `XCL_DIRECT_DXIL=all XCL_ADAPTER=4080 XCL_ASYNC_PSO=0 XCL_PSO_DISK_CACHE=0 XCL_HEAP_WINDOWS=0 XCL_UMA_WINDOWS=4`. - All three launches with the supported VS created a native translated graphics PSO and exited 0. On main, startup wrote one HLSL cache entry and the guest translated the VS when it created the PSO. The integrated tree wrote the byte-identical 2,584-byte direct cache entry `24acc6835ffb0a75_Vertex_0_4_1.bin` before the guest ran. A fresh integrated process with only that cache entry and no loose shaders created the same PSO, retained the entry byte for byte, and emitted no targeted direct compile dump or fallback. - In the other two launches, the loose 400-byte VS had one decoded `v_cvt_off_f32_i4`, and the guest still requested the separate supported VS. Main reported **0 errors, 1 skip**, ran the guest to its PSO marker, and exited 0. The integrated build reported **1 error, 0 skips**, logged `incomplete translation, missing: ["v_cvt_off_f32_i4"]`, and exited 2 before guest entry. - The four launches that ran preparation added the same two empty NVIDIA driver-log directories in the synthetic folder on both builds. The outer folder-equality guard reported that difference. All original fixture files stayed byte-identical. The fresh cache-only replay passed the folder guard. Could the hosted path preserve the old skip behavior for incomplete translations? Routing that case through the existing per-program handling would keep the successful cache warmup and let launch proceed past an unused unsupported shader.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2613/head:github-bot/gh-2613'
git switch 'github-bot/gh-2613'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2613'
git switch 'github-bot/gh-2613'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2613'
git switch 'github-bot/gh-2613'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2613'
git switch 'main'
git merge --squash 'github-bot/gh-2613'
git switch 'main'
git merge --ff-only 'github-bot/gh-2613'
git switch 'main'
git merge 'github-bot/gh-2613'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.