D3D12.X: retry driver-rejected compute PSOs without DXC GVN (#756) #1398

Open
github-bot wants to merge 3 commits from github-bot/gh-1398 into main AGit
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 15:35 UTC · original
KarolKurzyna:d3d12x/retry-compute-pso-no-gvn → main · +421 −23 · 4 files · 3 commits · open

Part of #1269 (addresses the DXC GVN compute PSO refusal pattern originally reported in #756, following @⁠psuedo-tty's analysis of phi %dx.types.Handle triggers under DXC GVN, @⁠pickles976's review on logging cache keys and driver refusal reasons, and @⁠erickbobd's review and verification).

What is in it

  • Keeps the default GVN-enabled DXC build on the primary path so normal compile speed and code quality do not change.
  • Retries once with DXC -opt-disable gvn when the driver refuses CreateComputePipelineState on a translated console compute shader (crates/xcl/src/hle/d3d12x/real.rs, crates/xcl/src/shaders.rs), bounded to fast refusals (<= 5 s via NO_GVN_RETRY_MAX_REFUSAL) so multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile.
  • Keys DXC's disk cache on extra compiler flags via cache_key_for_toolchain_extra / cache_key_with_extra (crates/xcl/src/gpu/recomp/dxc.rs) so fallback DXIL is cached on disk without overwriting default entries.
  • Exposes console_to_dxil_without_gvn and console_to_dxil_in_without_gvn returning WithoutGvn (crates/xcl/src/gpu/recomp/pso.rs), bypassing ShaderCache and the translated memory cache and short-circuiting shaders over 8 MB HLSL (already compiled at -O0).
  • Reuses driver_cache on the retry DXIL, skips the second driver call if the fallback DXIL is byte-identical, and logs both DXIL disk-cache keys (<gvn_key> -> <no_gvn_key>) plus the first line of the driver rejection message (retained D3D12 debug-layer error on the calling thread or formatted HRESULT) in both translated_compute_pso_once and xcl shaders --pipelines (Pipelines::make).
  • Rebased onto main (1a0bbe3, PR #1524 driver_compile_identified / huge_pso_bytes + PR #1426/#1693 Direct DXIL + PR #680 heap windows): compile_console_shader preserves Direct DXIL routing while compile_console_shader_with_extra serves the HLSL -opt-disable gvn retry path, translated_compute_pso_once routes both attempts through driver_compile_identified (so NO_GVN_RETRY_MAX_REFUSAL measures driver-only compile time excluding slot wait time), and the no-GVN retry stays guarded by !HEAP_WINDOW_OOM.with(|o| o.get()) so with_switch_fallback runs in_switch_form first on heap-window E_OUTOFMEMORY.

Tested

  • Hardware: Intel Core i5-14600K; NVIDIA GeForce RTX 3070 Ti (8017 MiB VRAM, driver 32.0.16.2124); Rust 1.100.0; DXC 1.9.2602.17.
  • cargo build --release -p xcl: passed. Two existing Atomic::fetch_update deprecation warnings are in untouched files/lines.
  • cargo test --workspace -- --test-threads=4 on head 36e23fddc939: xcl library had 1189 passed, 1 failed, 26 ignored. The failure is gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet); it reproduces on base 1a0bbe3a2ba9 as well.

Regression run

Fresh main baseline (warm cache):

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3070 Ti
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14428 MB

This PR head (warm cache):

xcl-smoke v1
commit: 36e23fddc9396f550c5a3e352b6857c1814c4586
gpu: NVIDIA GeForce RTX 3070 Ti
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1613 (PresentX 1614)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14392 MB

Not tested

  • Remaining workspace/integration targets were not reached because Cargo stopped at the library test failure above.
  • A live driver refusal triggering the no-GVN retry did not occur in this 60-second run; retry behavior is covered by unit tests. AMD and Intel GPUs were not available locally.

AI use

Original implementation and initial evidence were prepared with Google Antigravity (Gemini 4 Neon). Codex (GPT-6) rebased/reviewed the branch and ran the current build, tests, and smoke checks.

**@⁠KarolKurzyna** on GitHub · 2026-11-24 15:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398) `KarolKurzyna:d3d12x/retry-compute-pso-no-gvn` → `main` · +421 −23 · 4 files · 3 commits · open Part of #1269 (addresses the DXC GVN compute PSO refusal pattern originally reported in #756, following @⁠psuedo-tty's analysis of `phi %dx.types.Handle` triggers under DXC GVN, @⁠pickles976's review on logging cache keys and driver refusal reasons, and @⁠erickbobd's review and verification). **What is in it** - Keeps the default GVN-enabled DXC build on the primary path so normal compile speed and code quality do not change. - Retries once with DXC `-opt-disable gvn` when the driver refuses `CreateComputePipelineState` on a translated console compute shader (`crates/xcl/src/hle/d3d12x/real.rs`, `crates/xcl/src/shaders.rs`), bounded to fast refusals (`<= 5 s` via `NO_GVN_RETRY_MAX_REFUSAL`) so multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile. - Keys DXC's disk cache on extra compiler flags via `cache_key_for_toolchain_extra` / `cache_key_with_extra` (`crates/xcl/src/gpu/recomp/dxc.rs`) so fallback DXIL is cached on disk without overwriting default entries. - Exposes `console_to_dxil_without_gvn` and `console_to_dxil_in_without_gvn` returning `WithoutGvn` (`crates/xcl/src/gpu/recomp/pso.rs`), bypassing `ShaderCache` and the `translated` memory cache and short-circuiting shaders over 8 MB HLSL (already compiled at `-O0`). - Reuses `driver_cache` on the retry DXIL, skips the second driver call if the fallback DXIL is byte-identical, and logs both DXIL disk-cache keys (`<gvn_key> -> <no_gvn_key>`) plus the first line of the driver rejection message (retained D3D12 debug-layer error on the calling thread or formatted `HRESULT`) in both `translated_compute_pso_once` and `xcl shaders --pipelines` (`Pipelines::make`). - Rebased onto `main` (`1a0bbe3`, PR #1524 `driver_compile_identified` / `huge_pso_bytes` + PR #1426/#1693 Direct DXIL + PR #680 heap windows): `compile_console_shader` preserves Direct DXIL routing while `compile_console_shader_with_extra` serves the HLSL `-opt-disable gvn` retry path, `translated_compute_pso_once` routes both attempts through `driver_compile_identified` (so `NO_GVN_RETRY_MAX_REFUSAL` measures driver-only compile time excluding slot wait time), and the no-GVN retry stays guarded by `!HEAP_WINDOW_OOM.with(|o| o.get())` so `with_switch_fallback` runs `in_switch_form` first on heap-window `E_OUTOFMEMORY`. **Tested** - Hardware: Intel Core i5-14600K; NVIDIA GeForce RTX 3070 Ti (8017 MiB VRAM, driver 32.0.16.2124); Rust `1.100.0`; DXC `1.9.2602.17`. - `cargo build --release -p xcl`: passed. Two existing `Atomic::fetch_update` deprecation warnings are in untouched files/lines. - `cargo test --workspace -- --test-threads=4` on head `36e23fddc939`: xcl library had 1189 passed, 1 failed, 26 ignored. The failure is `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`DXIL not compiled yet`); it reproduces on base `1a0bbe3a2ba9` as well. **Regression run** Fresh main baseline (warm cache): ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3070 Ti title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14428 MB ``` This PR head (warm cache): ``` xcl-smoke v1 commit: 36e23fddc9396f550c5a3e352b6857c1814c4586 gpu: NVIDIA GeForce RTX 3070 Ti title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1613 (PresentX 1614) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14392 MB ``` **Not tested** - Remaining workspace/integration targets were not reached because Cargo stopped at the library test failure above. - A live driver refusal triggering the no-GVN retry did not occur in this 60-second run; retry behavior is covered by unit tests. AMD and Intel GPUs were not available locally. **AI use** Original implementation and initial evidence were prepared with **Google Antigravity** (**Gemini 4 Neon**). **Codex (GPT-6)** rebased/reviewed the branch and ran the current build, tests, and smoke checks.
NVIDIA D3D12 drivers can fail CreateComputePipelineState with
E_OUTOFMEMORY (0x8007000E) when DXC's GVN pass merges descriptor heap
handles into `phi %dx.types.Handle`, as diagnosed by @psuedo-tty in

Keep the fast GVN-optimized DXIL build on the primary path and retry
once with `-opt-disable gvn` only when the driver rejects the PSO:

- Key DXC's disk cache on extra compiler flags (`cache_key_for_toolchain_extra`)
  so fallback DXIL is cached on disk without overwriting default entries.
- Add `console_to_dxil_without_gvn` / `console_to_dxil_in_without_gvn`
  bypassing `ShaderCache` and the `translated` memory cache, and skip
  recompiling >8 MB HLSL already compiled at `-O0`.
- Retry once on driver failure in `translated_compute_pso` (reusing the
  driver blob cache path) and in `xcl shaders --pipelines` (`Pipelines::make`).

Fixes #756. Part of #1269.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses review feedback from @pickles976 on #1398:

- Return both DXIL disk-cache keys (default GVN build -> `-opt-disable gvn`
  build) via `WithoutGvn` and log them whenever a compute PSO is retried or
  refused.
- Capture the first non-empty line of any D3D12 debug-layer error emitted on
  the calling thread (or fall back to Windows' formatted HRESULT) and include it
  in `translated_compute_pso` and `Pipelines::make` retry/failure logs.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Addresses two review points from @erickbobd on #1398:

- Guard `-opt-disable gvn` retries on `first_elapsed <= 5 s`
  (`NO_GVN_RETRY_MAX_REFUSAL`) in both `translated_compute_pso` and
  `Pipelines::make`, resetting `started` around uncached fallback driver
  compiles so slow multi-minute driver OOMs on huge programs do not pay for
  a second, larger no-GVN compile.
- Strengthen `dxil_cache_with_extra_flags_round_trip` with a GVN-sensitive
  HLSL compute shader and `assert_ne!(default_dxil, nogvn_dxil)`, plus
  `runner::skip_test("no DXC")` when DXC is absent.

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

@⁠pickles976 on GitHub · 2026-11-24 15:37 UTC · original

Review from the DXC-memory lane: the design is right — default GVN path untouched, one retry with -opt-disable gvn scoped to driver rejection (not DXC failure), and crucially the successful variant caches under a key that includes the extra flags (cache_key_for_toolchain_extra, with both the key-distinctness and round-trip tests), so a warm cache pays one compile per shader forever after — the double-compile cost is cold-cache-only. Two small asks: ① log the retry with both cache keys (the rejected GVN build's and the accepted no-GVN one) so field reports can tell "slow first boot" from "GVN retry storm"; ② if the driver rejection message is retained, include its first line in the log — #756 evidence showed NVIDIA and AMD refuse with different text, and after #534-style OOM noise the distinction between "driver refused" and "compile died" is load-bearing for cohort triage. From psuedo-tty's phi-Handle analysis this should stay compute-scoped as written — no scope creep requested.

**@⁠pickles976** on GitHub · 2026-11-24 15:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7136351225) Review from the DXC-memory lane: the design is right — default GVN path untouched, one retry with `-opt-disable gvn` scoped to *driver* rejection (not DXC failure), and crucially the successful variant **caches under a key that includes the extra flags** (`cache_key_for_toolchain_extra`, with both the key-distinctness and round-trip tests), so a warm cache pays one compile per shader forever after — the double-compile cost is cold-cache-only. Two small asks: ① log the retry with both cache keys (the rejected GVN build's and the accepted no-GVN one) so field reports can tell "slow first boot" from "GVN retry storm"; ② if the driver rejection message is retained, include its first line in the log — #756 evidence showed NVIDIA and AMD refuse with different text, and after #534-style OOM noise the distinction between "driver refused" and "compile died" is load-bearing for cohort triage. From psuedo-tty's phi-Handle analysis this should stay compute-scoped as written — no scope creep requested.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 15:55 UTC · original · edited 2026-11-24 15:59 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 732d3a5 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 757 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: cache_key_tracks_extra_dxc_flags, dxil_cache_with_extra_flags_round_trip, compute_pso_success_skips_no_gvn_retry, compute_pso_refusal_retries_without_gvn, compute_pso_refusal_skips_second_driver_call_when_dxil_unchanged, compute_pso_refusal_propagates_failure_when_retry_fails.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 757 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-24 15:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7136850111) · edited 2026-11-24 15:59 UTC Full-suite run, since this PR has no test report yet. Tested exact head `732d3a5` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **757 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `cache_key_tracks_extra_dxc_flags`, `dxil_cache_with_extra_flags_round_trip`, `compute_pso_success_skips_no_gvn_retry`, `compute_pso_refusal_retries_without_gvn`, `compute_pso_refusal_skips_second_driver_call_when_dxil_unchanged`, `compute_pso_refusal_propagates_failure_when_retry_fails`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **757 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 16:04 UTC · original

@⁠pickles976 Thanks for the review — addressed both asks in 2b73d16 (and rebased onto 345661b so the real.rs test-module conflict is cleared):

  1. Both DXIL disk-cache keys (rejected_key for the default GVN build -> retry_key for -opt-disable gvn) are now returned via WithoutGvn and logged in both runtime and xcl shaders --pipelines:
    • runtime success: D3D12.X: compute PSO with the translated console CS (... ms, retried without GVN (dxil cache <gvn> -> <no-gvn>; driver refused: <first line>))
    • runtime refusal on retry too: ... (<first_reason>; retry without GVN <gvn> -> <no-gvn> refused: <retry_reason>)
    • offline --pipelines: <name>: driver refused compute pipeline (<first line>); built without GVN (dxil cache <gvn> -> <no-gvn>, ... B DXIL)
  2. Driver rejection messages keep the first non-empty line of any retained error-severity D3D12 debug-layer callback on the calling thread (<hr>: <first line>), falling back to the first line of windows::core::Error::from_hresult(...).

Re-verified on 2b73d16 (RTX 3070 Ti): .\scripts\test.ps1 passed 774 passed, 0 failed, 41 ignored (2 wave64 tests skipped on this adapter; 0 warnings in modified files), release build succeeded, and 60 s xcl-smoke ran cleanly (1640 frames shown, 0 device removals / crashes, 14611 MB peak commit).

@⁠futurepro62 Thank you for running and posting the RTX 5070 Ti verification report as well!

**@⁠KarolKurzyna** on GitHub · 2026-11-24 16:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7137064762) @⁠pickles976 Thanks for the review — addressed both asks in `2b73d16` (and rebased onto `345661b` so the `real.rs` test-module conflict is cleared): 1. Both DXIL disk-cache keys (`rejected_key` for the default GVN build -> `retry_key` for `-opt-disable gvn`) are now returned via `WithoutGvn` and logged in both runtime and `xcl shaders --pipelines`: - runtime success: `D3D12.X: compute PSO with the translated console CS (... ms, retried without GVN (dxil cache <gvn> -> <no-gvn>; driver refused: <first line>))` - runtime refusal on retry too: `... (<first_reason>; retry without GVN <gvn> -> <no-gvn> refused: <retry_reason>)` - offline `--pipelines`: `<name>: driver refused compute pipeline (<first line>); built without GVN (dxil cache <gvn> -> <no-gvn>, ... B DXIL)` 2. Driver rejection messages keep the first non-empty line of any retained error-severity D3D12 debug-layer callback on the calling thread (`<hr>: <first line>`), falling back to the first line of `windows::core::Error::from_hresult(...)`. Re-verified on `2b73d16` (RTX 3070 Ti): `.\scripts\test.ps1` passed **774 passed, 0 failed, 41 ignored** (2 wave64 tests skipped on this adapter; `0` warnings in modified files), release build succeeded, and 60 s `xcl-smoke` ran cleanly (`1640` frames shown, `0` device removals / crashes, `14611 MB` peak commit). @⁠futurepro62 Thank you for running and posting the RTX 5070 Ti verification report as well!
Author
Owner

@⁠erickbobd on GitHub · 2026-11-24 16:11 UTC · original

Test report for 2b73d16 (and 732d3a5 before it) on a card where the refusal does happen. I had started the same change after my plan in #1269; this PR covers it, so I am testing it here instead of opening a second one.

Tested

  • RTX 5070 Ti 16 GB (NVIDIA 617.14, 32-lane waves), Ryzen 5 5600X, 32 GB RAM, Windows 11 25H2 (26200), Rust 1.100.0, DXC 1.8.2502.11 (Windows SDK 10.0.26100), release build.
  • The five compute programs @⁠psuedo-tty named in #1269 (part 3), taken from a retail 1.0.2.1 pack: xcl shaders <folder> --precompile --only cs --pipelines --windows N, fresh XCL_DXIL_CACHE, XCL_PSO_DISK_CACHE=0, each program alone and the five together:
1 memory window 4 memory windows
main 930e8b4 made 4, refused 1 made 4, refused 1
this PR 732d3a5 made 5, refused 0 made 5, refused 0
this PR 2b73d16 made 5, refused 0 made 5, refused 0
  • The refused one on main is f377ca6830935314 (355 instructions), in the switch form. With this PR the driver refuses it with 0x8007000E (your new log line), it is compiled without GVN (60 388 B of DXIL with 1 window, 73 616 B with 4) and built. The other four build on main too: @⁠psuedo-tty saw them refused only in #680's heap-window form, which is not on main.
  • So the end-to-end path your Not tested lists does work here, in the --pipelines pass. I have not seen a title run reach this program: 180 s smoke runs from a first boot built one compute pipeline.

Two points from the review, both checked here

  • The retry runs after every refusal. The refusals of #756 come in under a second; the other kind is the driver running out of memory after a long compile of a huge program (27 – 284 s on @⁠psuedo-tty's RTX 5090), and for those a second build without GVN is another long compile of larger DXIL (985 → 1 502 KB on a 21 615-instruction program in their table). The 8 MB HLSL check leaves out only the -O0 ones. A bound on how fast the refusal came (I used 5 s) would keep the retry to the case it is for.
  • dxil_cache_with_extra_flags_round_trip shows the flags get their own cache entry, but not that they change the DXIL. DXC 1.8.2502.11 takes any name after -opt-disable without an error: with gnv instead of gvn it compiled the same DXIL as the default build, byte for byte. A test that compiles a program GVN does change, with and without the flags, and asserts the two differ would catch a typo or a DXC that drops the option. This one passes here:
    RWByteAddressBuffer o : register(u0);
    [numthreads(64, 1, 1)] void main(uint3 t : SV_DispatchThreadID) {
        uint a = o.Load(t.x * 4);
        uint b = (a & 1) ? o.Load(t.x * 4 + 256) : o.Load(t.x * 4 + 256) + 1;
        o.Store(t.x * 4, b);
    }
    
    It returns without a word when DXC is missing; CONTRIBUTING asks for runner::skip_test("no DXC") there.

Not tested

  • This PR's whole suite and smoke run on this card (I ran both for my own version of the change, not for this PR's commits).
  • A title run that reaches a refused program; AMD and Intel; Linux / Wine; DXC 1.9.x.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and measurements and drafted this report.
**@⁠erickbobd** on GitHub · 2026-11-24 16:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7137263045) Test report for `2b73d16` (and `732d3a5` before it) on a card where the refusal does happen. I had started the same change after my plan in #1269; this PR covers it, so I am testing it here instead of opening a second one. **Tested** - RTX 5070 Ti 16 GB (NVIDIA 617.14, 32-lane waves), Ryzen 5 5600X, 32 GB RAM, Windows 11 25H2 (26200), Rust 1.100.0, DXC 1.8.2502.11 (Windows SDK 10.0.26100), release build. - The five compute programs @⁠psuedo-tty named in #1269 (part 3), taken from a retail 1.0.2.1 pack: `xcl shaders <folder> --precompile --only cs --pipelines --windows N`, fresh `XCL_DXIL_CACHE`, `XCL_PSO_DISK_CACHE=0`, each program alone and the five together: | | 1 memory window | 4 memory windows | |---|---|---| | `main` `930e8b4` | made 4, refused 1 | made 4, refused 1 | | this PR `732d3a5` | **made 5, refused 0** | **made 5, refused 0** | | this PR `2b73d16` | **made 5, refused 0** | **made 5, refused 0** | - The refused one on `main` is `f377ca6830935314` (355 instructions), in the switch form. With this PR the driver refuses it with `0x8007000E` (your new log line), it is compiled without GVN (60 388 B of DXIL with 1 window, 73 616 B with 4) and built. The other four build on `main` too: @⁠psuedo-tty saw them refused only in #680's heap-window form, which is not on `main`. - So the end-to-end path your **Not tested** lists does work here, in the `--pipelines` pass. I have not seen a title run reach this program: 180 s smoke runs from a first boot built one compute pipeline. **Two points from the review, both checked here** - The retry runs after every refusal. The refusals of #756 come in under a second; the other kind is the driver running out of memory after a long compile of a huge program (27 – 284 s on @⁠psuedo-tty's RTX 5090), and for those a second build without GVN is another long compile of larger DXIL (985 → 1 502 KB on a 21 615-instruction program in their table). The 8 MB HLSL check leaves out only the `-O0` ones. A bound on how fast the refusal came (I used 5 s) would keep the retry to the case it is for. - `dxil_cache_with_extra_flags_round_trip` shows the flags get their own cache entry, but not that they change the DXIL. DXC 1.8.2502.11 takes any name after `-opt-disable` without an error: with `gnv` instead of `gvn` it compiled the same DXIL as the default build, byte for byte. A test that compiles a program GVN does change, with and without the flags, and asserts the two differ would catch a typo or a DXC that drops the option. This one passes here: ```hlsl RWByteAddressBuffer o : register(u0); [numthreads(64, 1, 1)] void main(uint3 t : SV_DispatchThreadID) { uint a = o.Load(t.x * 4); uint b = (a & 1) ? o.Load(t.x * 4 + 256) : o.Load(t.x * 4 + 256) + 1; o.Store(t.x * 4, b); } ``` It returns without a word when DXC is missing; CONTRIBUTING asks for `runner::skip_test("no DXC")` there. **Not tested** - This PR's whole suite and smoke run on this card (I ran both for my own version of the change, not for this PR's commits). - A title run that reaches a refused program; AMD and Intel; Linux / Wine; DXC 1.9.x. **AI use** - Claude Code (Claude Opus 5.5) ran the builds and measurements and drafted this report.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 16:16 UTC · original

Verified head 2b73d163719679c05e07d11276c46256fdf5c0f5 on Windows 11 / NVIDIA RTX 5080 (Blackwell):

  • cargo build --workspace: OK (0 new warnings)
  • cargo test --workspace -- --test-threads=4: 774 passed, 0 failed, 41 ignored

Clean build and full test suite pass on RTX 5080.

**@⁠mastrr9** on GitHub · 2026-11-24 16:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7137407211) Verified head `2b73d163719679c05e07d11276c46256fdf5c0f5` on Windows 11 / NVIDIA RTX 5080 (Blackwell): - `cargo build --workspace`: OK (0 new warnings) - `cargo test --workspace -- --test-threads=4`: **774 passed, 0 failed, 41 ignored** Clean build and full test suite pass on RTX 5080.
Author
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 16:27 UTC · original

@⁠erickbobd Thank you for running the end-to-end verification on f377ca6830935314 (made 5, refused 0) and for the review points — both are in 58bfd73:

  1. Bounded the -opt-disable gvn retry to fast driver refusals (first_elapsed <= 5 s via NO_GVN_RETRY_MAX_REFUSAL in translated_compute_pso and Pipelines::make, resetting the timer before uncached fallback compiles in try_create) with unit coverage in compute_pso_slow_refusal_skips_no_gvn_retry.
  2. Updated dxil_cache_with_extra_flags_round_trip to compile your GVN-sensitive HLSL shader, assert default_dxil != nogvn_dxil, and call runner::skip_test("no DXC") if DXC is absent.

Re-verified on RTX 3070 Ti (58bfd73): .\scripts\test.ps1 passed 775 passed, 0 failed, 41 ignored (2 wave64 tests skipped; 0 new warnings), release build ok, and 60 s xcl-smoke ok (1635 frames shown, 0 device removals / crashes, 14592 MB peak commit).

@⁠mastrr9 Thanks as well for verifying 2b73d16 on RTX 5080!

**@⁠KarolKurzyna** on GitHub · 2026-11-24 16:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7137702965) @⁠erickbobd Thank you for running the end-to-end verification on `f377ca6830935314` (`made 5, refused 0`) and for the review points — both are in `58bfd73`: 1. Bounded the `-opt-disable gvn` retry to fast driver refusals (`first_elapsed <= 5 s` via `NO_GVN_RETRY_MAX_REFUSAL` in `translated_compute_pso` and `Pipelines::make`, resetting the timer before uncached fallback compiles in `try_create`) with unit coverage in `compute_pso_slow_refusal_skips_no_gvn_retry`. 2. Updated `dxil_cache_with_extra_flags_round_trip` to compile your GVN-sensitive HLSL shader, assert `default_dxil != nogvn_dxil`, and call `runner::skip_test("no DXC")` if DXC is absent. Re-verified on RTX 3070 Ti (`58bfd73`): `.\scripts\test.ps1` passed **775 passed, 0 failed, 41 ignored** (2 wave64 tests skipped; `0` new warnings), release build ok, and 60 s `xcl-smoke` ok (`1635` frames shown, `0` device removals / crashes, `14592 MB` peak commit). @⁠mastrr9 Thanks as well for verifying `2b73d16` on RTX 5080!
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 16:55 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32) test report on latest head 58bfd732328c7e294f535747d8bc68ab5af9336f.

Tested

  • Commit: 58bfd732328c7e294f535747d8bc68ab5af9336f (clean tree, merge-base 345661b)
  • Hardware / software: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, driver 32.0.16.2101), rustc 1.100.0 (x86_64-pc-windows-msvc, MSVC 14.44.35207), DXC 1.9.2602.17 (SDK 10.0.26100.0), --release
  • cargo build --release --workspace: ok (exit 0)
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4: 775 passed, 0 failed, 41 ignored, exit 0
    • New/updated tests passed: gpu::recomp::dxc::cache_tests::dxil_cache_with_extra_flags_round_trip, hle::d3d12x::real::compute_pso_retry_tests::compute_pso_slow_refusal_skips_no_gvn_retry
    • SKIPPED (no wave64): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware

Regression run
main baseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1508 (PresentX 1508)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14730 MB

PR head (58bfd732328c7e294f535747d8bc68ab5af9336f):

xcl-smoke v1
commit: 58bfd732328c7e294f535747d8bc68ab5af9336f
gpu: NVIDIA GeForce RTX 3060 Ti
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14713 MB

Not tested: debug build, XCL_SAMPLE_* tests / xcl shaders --pipelines on this branch, AMD / native wave64 hardware, extended gameplay past 60 s.

AI use: Antigravity (Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.

**@⁠LocranKing** on GitHub · 2026-11-24 16:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7138417349) Independent Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32) test report on latest head `58bfd732328c7e294f535747d8bc68ab5af9336f`. **Tested** - Commit: `58bfd732328c7e294f535747d8bc68ab5af9336f` (clean tree, merge-base `345661b`) - Hardware / software: Windows 11 Home Build 26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, driver `32.0.16.2101`), `rustc 1.100.0` (`x86_64-pc-windows-msvc`, MSVC `14.44.35207`), DXC `1.9.2602.17` (SDK `10.0.26100.0`), `--release` - `cargo build --release --workspace`: ok (`exit 0`) - `cargo test --workspace --release --no-fail-fast -- --test-threads=4`: **775 passed, 0 failed, 41 ignored**, exit `0` - New/updated tests passed: `gpu::recomp::dxc::cache_tests::dxil_cache_with_extra_flags_round_trip`, `hle::d3d12x::real::compute_pso_retry_tests::compute_pso_slow_refusal_skips_no_gvn_retry` - `SKIPPED` (`no wave64`): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` **Regression run** `main` baseline (`b7aa9f3bd212088e0d927439284dc5ed325ce3c7`): ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1508 (PresentX 1508) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14730 MB ``` PR head (`58bfd732328c7e294f535747d8bc68ab5af9336f`): ``` xcl-smoke v1 commit: 58bfd732328c7e294f535747d8bc68ab5af9336f gpu: NVIDIA GeForce RTX 3060 Ti title: retail-1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1603 (PresentX 1603) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14713 MB ``` **Not tested:** debug build, `XCL_SAMPLE_*` tests / `xcl shaders --pipelines` on this branch, AMD / native wave64 hardware, extended gameplay past 60 s. **AI use:** Antigravity (`Gemini 4 Hydrogen`) ran the build, tests, and smoke runs and drafted this report from the command outputs.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 17:01 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 17:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7138573897) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 17:18 UTC · original

Rebased onto main (9e3831e, PR #680 heap windows) — new head is a0f2cc6.

@⁠LocranKing @⁠DavidM1911 @⁠RodrigoTorreao thank you for the independent verifications on RTX 3060 Ti and RX 6750 XT! On @RodrigoTorreao's AMD load-refusal point: if a load refusal triggers the retry cleanly, logging the first-line driver reason alongside both DXIL keys should help surface why the driver refused it, and identical fallback DXIL still skips the second build.

#680 interop on a0f2cc6

  • Resolved the translated_compute_pso conflict by keeping #680's with_switch_fallback(|| translated_compute_pso_once(...)) wrapper.
  • Guarded the -opt-disable gvn retry inside translated_compute_pso_once with if hr < 0 && !HEAP_WINDOW_OOM.with(|o| o.get()) so heap-window E_OUTOFMEMORY reaches with_switch_fallback (in_switch_form) first rather than retrying with -opt-disable gvn early; if the switch-form pipeline still refuses quickly (<= 5 s), -opt-disable gvn retries cleanly inside that pass.

Re-verified on a0f2cc6 (RTX 3070 Ti, DXC 1.9.2602.17)

  • .\scripts\test.ps1: 785 passed, 0 failed, 41 ignored across 20 runs (unittests src\lib.rs: 736 passed, 0 failed, 21 ignored; GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows)).
  • $env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, 0 ignored, including heap_window_out_of_memory_falls_back_to_the_switch_form.
  • Release build (cargo build --release -p xcl) + 60 s scripts/smoke.ps1: exit: 0x0, 1639 frames (PresentX 1639), 60 60 60, 0 device removals/crashes, 14594 MB peak commit.
**@⁠KarolKurzyna** on GitHub · 2026-11-24 17:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7138989579) Rebased onto `main` (`9e3831e`, PR #680 heap windows) — new head is `a0f2cc6`. @⁠LocranKing @⁠DavidM1911 @⁠RodrigoTorreao thank you for the independent verifications on RTX 3060 Ti and RX 6750 XT! On `@RodrigoTorreao`'s AMD load-refusal point: if a load refusal triggers the retry cleanly, logging the first-line driver reason alongside both DXIL keys should help surface why the driver refused it, and identical fallback DXIL still skips the second build. **#680 interop on `a0f2cc6`** - Resolved the `translated_compute_pso` conflict by keeping #680's `with_switch_fallback(|| translated_compute_pso_once(...))` wrapper. - Guarded the `-opt-disable gvn` retry inside `translated_compute_pso_once` with `if hr < 0 && !HEAP_WINDOW_OOM.with(|o| o.get())` so heap-window `E_OUTOFMEMORY` reaches `with_switch_fallback` (`in_switch_form`) first rather than retrying with `-opt-disable gvn` early; if the switch-form pipeline still refuses quickly (`<= 5 s`), `-opt-disable gvn` retries cleanly inside that pass. **Re-verified on `a0f2cc6` (RTX 3070 Ti, DXC 1.9.2602.17)** - `.\scripts\test.ps1`: **785 passed, 0 failed, 41 ignored** across 20 runs (`unittests src\lib.rs`: `736 passed, 0 failed, 21 ignored`; `GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows)`). - `$env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture`: **4 passed, 0 failed, 0 ignored**, including `heap_window_out_of_memory_falls_back_to_the_switch_form`. - Release build (`cargo build --release -p xcl`) + 60 s `scripts/smoke.ps1`: `exit: 0x0`, `1639` frames (`PresentX 1639`), `60 60 60`, `0` device removals/crashes, `14594 MB` peak commit.
Author
Owner

@⁠RodrigoTorreao on GitHub · 2026-11-24 17:11 UTC · original · edited 2026-11-24 17:38 UTC

Update: re-tested on the rebased head a0f2cc6 (on main 9e3831e, with #680), unmodified. Same hardware as below.

  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, XCL_SAMPLE_* set): 782 passed, 3 failed, 41 ignored.
    • The three failures are the same known RDNA2 packed-mip ones as below.
    • One test was SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form ("no heap windows"), because the suite ran without XCL_HEAP_WINDOWS.
  • XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, including heap_window_out_of_memory_falls_back_to_the_switch_form. So the heap-window OOM fallback runs and passes on AMD native wave64.
  • The two ParaboloidShadows programs, alone and cold as below, one run each, on main 9e3831e and on a0f2cc6:
form DXIL result (main and this PR) xcl total time
switch (default) 363 460 B made 1, refused 0, in all 4 runs 20.7 – 27.0 s
heap windows (XCL_HEAP_WINDOWS=1) 301 872 B made 1, refused 0, in all 4 runs 16.0 – 17.1 s
  • The no-GVN retry and the heap-window fallback were not reached, since nothing was refused. With heap windows the DXIL is 17 % smaller and the run (DXC plus the driver) about 25 % shorter on this card. That is one run per cell, so the time is indicative only.

Test report on AMD (RDNA2, Windows driver) for 58bfd73, this PR's head, unmodified. As far as I can see in the thread, it is the first AMD run of it.

Short version: the suite passes apart from three known RDNA2 failures that are not from this PR. The two programs the AMD driver refused in my earlier whole-pack --pipelines pass build on this PR's base when compiled alone, so the retry never fires for them. That earlier refusal looks like load, not GVN, and on AMD one such refusal came in under the 5 s bound.

Tested

  • Hardware and software:
    • AMD Radeon RX 6750 XT 12 GB (RDNA2, native wave64), driver 32.0.21045.29003
    • Intel i5-14600KF, 16 GB RAM
    • Windows 11 25H2 build 26200.9974
    • Rust 1.100.0 (stable-x86_64-pc-windows-msvc)
    • DXC 1.9.2609.5 via XCL_DXC_DIR
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, XCL_SAMPLE_RPF/DLLS/TTPF/BVH4 set to a retail title's files): 772 passed, 3 failed, 41 ignored, 0 SKIPPED.
    • The three failures are placed_title_textures_share_vram_and_preserve_pixels (3D 64x64x64 4 mips: subresource 2 mismatch) and two PoisonError follow-ons.
    • The same three fail on main 47efa2e on this card. This is the RDNA2 packed-mip readback that #470 / #1028 fix, and it is not touched by this PR.
  • The programs the AMD driver refused. In an earlier whole-pack xcl shaders <pack> --precompile --only cs --pipelines pass, the AMD driver refused meshlet_culling:CS_BatchCullMeshlets_ParaboloidShadows_445ed429 and its _Prev twin.
    • That pass ran on main 47efa2e, with 4 driver compiles and 19 DXC threads at once, under a 20 GB job memory cap.
    • Both programs translate to the same 372 212 B of DXIL. The refusals came after 10.4 s and 3.2 s. That build did not log the reason.
  • I re-ran each program alone and cold: its own folder, fresh XCL_DXIL_CACHE, XCL_PSO_DISK_CACHE=0, XCL_TRANSLATED_CACHE=0, XCL_PIPELINE_THREADS=1, and a renamed copy of xcl.exe per run so the AMD driver cache is cold. There were two interleaved rounds.
build DXIL result alone, cold
47efa2e (the build of the refused pass) 372 212 B made 1, refused 0 (23.3 s in the driver)
this PR's base 345661b 363 460 B made 1, refused 0 in all 4 runs
this PR 58bfd73 363 460 B made 1, refused 0 in all 4 runs; the no-GVN retry is never reached
  • The exact DXIL the driver refused under load builds when compiled alone. So on this card those refusals were not the GVN pattern of #756.
  • One of them came in 3.2 s, under NO_GVN_RETRY_MAX_REFUSAL (5 s). With this PR, a refusal like that, caused by load, would get a no-GVN recompile and a second driver build. Not harmful, but on AMD the time bound alone does not keep the retry to #756's case. Logging the refusal reason (which this PR adds) in that situation would show what the driver actually said.

Not tested

  • A GVN-pattern refusal on AMD. I have no program that the AMD driver refuses alone, so the retry path itself has not run on AMD.
  • CS_ScreenProbes_ActivateRays: 14.1 MB of DXIL, refused by the AMD driver in 24 s in the same pass. It is over the 8 MB HLSL check and the 5 s bound, so this PR leaves it alone.
  • A title run, or the suite on this PR's base 345661b on this card (the comparison above is against 47efa2e).
  • Other AMD generations and drivers.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this report. The counts, times and sizes were copied from the test output and the xcl logs.
**@⁠RodrigoTorreao** on GitHub · 2026-11-24 17:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7138830754) · edited 2026-11-24 17:38 UTC **Update: re-tested on the rebased head a0f2cc6 (on `main` 9e3831e, with #680), unmodified. Same hardware as below.** - `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug, `XCL_SAMPLE_*` set): **782 passed, 3 failed, 41 ignored**. - The three failures are the same known RDNA2 packed-mip ones as below. - One test was SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` ("no heap windows"), because the suite ran without `XCL_HEAP_WINDOWS`. - `XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e -- --nocapture`: **4 passed, 0 failed**, including `heap_window_out_of_memory_falls_back_to_the_switch_form`. So the heap-window OOM fallback runs and passes on AMD native wave64. - The two ParaboloidShadows programs, alone and cold as below, one run each, on `main` 9e3831e and on a0f2cc6: | form | DXIL | result (main and this PR) | `xcl` total time | |---|---|---|---| | switch (default) | 363 460 B | made 1, refused 0, in all 4 runs | 20.7 – 27.0 s | | heap windows (`XCL_HEAP_WINDOWS=1`) | 301 872 B | made 1, refused 0, in all 4 runs | 16.0 – 17.1 s | - The no-GVN retry and the heap-window fallback were not reached, since nothing was refused. With heap windows the DXIL is 17 % smaller and the run (DXC plus the driver) about 25 % shorter on this card. That is one run per cell, so the time is indicative only. --- Test report on AMD (RDNA2, Windows driver) for 58bfd73, this PR's head, unmodified. As far as I can see in the thread, it is the first AMD run of it. Short version: the suite passes apart from three known RDNA2 failures that are not from this PR. The two programs the AMD driver refused in my earlier whole-pack `--pipelines` pass build on this PR's base when compiled alone, so the retry never fires for them. That earlier refusal looks like load, not GVN, and on AMD one such refusal came in under the 5 s bound. **Tested** - Hardware and software: - AMD Radeon RX 6750 XT 12 GB (RDNA2, native wave64), driver 32.0.21045.29003 - Intel i5-14600KF, 16 GB RAM - Windows 11 25H2 build 26200.9974 - Rust 1.100.0 (stable-x86_64-pc-windows-msvc) - DXC 1.9.2609.5 via `XCL_DXC_DIR` - `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug, `XCL_SAMPLE_RPF/DLLS/TTPF/BVH4` set to a retail title's files): **772 passed, 3 failed, 41 ignored, 0 SKIPPED**. - The three failures are `placed_title_textures_share_vram_and_preserve_pixels` (`3D 64x64x64 4 mips: subresource 2 mismatch`) and two `PoisonError` follow-ons. - The same three fail on `main` 47efa2e on this card. This is the RDNA2 packed-mip readback that #470 / #1028 fix, and it is not touched by this PR. - **The programs the AMD driver refused.** In an earlier whole-pack `xcl shaders <pack> --precompile --only cs --pipelines` pass, the AMD driver refused `meshlet_culling:CS_BatchCullMeshlets_ParaboloidShadows_445ed429` and its `_Prev` twin. - That pass ran on `main` 47efa2e, with 4 driver compiles and 19 DXC threads at once, under a 20 GB job memory cap. - Both programs translate to the same 372 212 B of DXIL. The refusals came after 10.4 s and 3.2 s. That build did not log the reason. - I re-ran each program alone and cold: its own folder, fresh `XCL_DXIL_CACHE`, `XCL_PSO_DISK_CACHE=0`, `XCL_TRANSLATED_CACHE=0`, `XCL_PIPELINE_THREADS=1`, and a renamed copy of `xcl.exe` per run so the AMD driver cache is cold. There were two interleaved rounds. | build | DXIL | result alone, cold | |---|---|---| | 47efa2e (the build of the refused pass) | 372 212 B | made 1, refused 0 (23.3 s in the driver) | | this PR's base 345661b | 363 460 B | made 1, refused 0 in all 4 runs | | this PR 58bfd73 | 363 460 B | made 1, refused 0 in all 4 runs; the no-GVN retry is never reached | - The exact DXIL the driver refused under load builds when compiled alone. So on this card those refusals were not the GVN pattern of #756. - One of them came in **3.2 s**, under `NO_GVN_RETRY_MAX_REFUSAL` (5 s). With this PR, a refusal like that, caused by load, would get a no-GVN recompile and a second driver build. Not harmful, but on AMD the time bound alone does not keep the retry to #756's case. Logging the refusal reason (which this PR adds) in that situation would show what the driver actually said. **Not tested** - A GVN-pattern refusal on AMD. I have no program that the AMD driver refuses alone, so the retry path itself has not run on AMD. - `CS_ScreenProbes_ActivateRays`: 14.1 MB of DXIL, refused by the AMD driver in 24 s in the same pass. It is over the 8 MB HLSL check and the 5 s bound, so this PR leaves it alone. - A title run, or the suite on this PR's base 345661b on this card (the comparison above is against 47efa2e). - Other AMD generations and drivers. **AI use** - Claude Code (Claude Opus 5.5) ran the builds and tests on my machine and wrote this report. The counts, times and sizes were copied from the test output and the `xcl` logs.
Author
Owner

@⁠RodrigoTorreao on GitHub · 2026-11-24 17:38 UTC · original

@⁠KarolKurzyna I re-tested the rebased head a0f2cc6 on the RX 6750 XT (RDNA2, native wave64) and updated my report above: #1398

  • heap_window_out_of_memory_falls_back_to_the_switch_form, which was skipped on your 3070 Ti, runs and passes here with XCL_HEAP_WINDOWS=1. It was 4/4 in gpu_compute_e2e.
  • The full suite gives 782 passed, 3 failed (the known RDNA2 packed-mip ones), 41 ignored.
  • The two ParaboloidShadows programs build cold in both forms (switch 363 460 B, heap windows 301 872 B), so neither the retry nor the fallback was reached by a real program.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.

**@⁠RodrigoTorreao** on GitHub · 2026-11-24 17:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7139503328) @⁠KarolKurzyna I re-tested the rebased head `a0f2cc6` on the RX 6750 XT (RDNA2, native wave64) and updated my report above: https://git.gtahub.st/github/xcl-dev--xcl/pulls/1398 - `heap_window_out_of_memory_falls_back_to_the_switch_form`, which was skipped on your 3070 Ti, runs and passes here with `XCL_HEAP_WINDOWS=1`. It was 4/4 in `gpu_compute_e2e`. - The full suite gives 782 passed, 3 failed (the known RDNA2 packed-mip ones), 41 ignored. - The two ParaboloidShadows programs build cold in both forms (switch 363 460 B, heap windows 301 872 B), so neither the retry nor the fallback was reached by a real program. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
Author
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 19:56 UTC · original

@⁠RodrigoTorreao Thanks for re-testing a0f2cc6 on RX 6750 XT (4/4 in XCL_HEAP_WINDOWS=1 gpu_compute_e2e)!

Rebased onto main (6c89285, PR #1426 Direct DXIL + PR #1693 + PR #1195/#1288) — new head is 85ca7be.

Main 6c89285 interop

  • compile_console_shader (crates/xcl/src/gpu/recomp/pso.rs) preserves #1426's Direct DXIL routing (direct_compute / direct_graphics), while compile_console_shader_with_extra serves the HLSL -opt-disable gvn retry path.
  • Preserved !HEAP_WINDOW_OOM.with(|o| o.get()) around the no-GVN retry inside translated_compute_pso_once (crates/xcl/src/hle/d3d12x/real.rs).

Re-verified on 85ca7be (RTX 3070 Ti, DXC 1.9.2602.17)

  • .\scripts\test.ps1: 872 passed, 0 failed, 42 ignored across 20 runs (unittests src\lib.rs: 823 passed, 0 failed, 22 ignored; GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows)).
  • $env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, 0 ignored, including heap_window_out_of_memory_falls_back_to_the_switch_form.
  • Release build (cargo build --release -p xcl) + 60 s scripts/smoke.ps1: exit: 0x0, 1632 frames (PresentX 1632), 60 60 60, 0 device removals/crashes, 14540 MB peak commit.
**@⁠KarolKurzyna** on GitHub · 2026-11-24 19:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7142817070) @⁠RodrigoTorreao Thanks for re-testing `a0f2cc6` on RX 6750 XT (`4/4` in `XCL_HEAP_WINDOWS=1 gpu_compute_e2e`)! Rebased onto `main` (`6c89285`, PR #1426 Direct DXIL + PR #1693 + PR #1195/#1288) — new head is `85ca7be`. **Main `6c89285` interop** - `compile_console_shader` (`crates/xcl/src/gpu/recomp/pso.rs`) preserves #1426's Direct DXIL routing (`direct_compute` / `direct_graphics`), while `compile_console_shader_with_extra` serves the HLSL `-opt-disable gvn` retry path. - Preserved `!HEAP_WINDOW_OOM.with(|o| o.get())` around the no-GVN retry inside `translated_compute_pso_once` (`crates/xcl/src/hle/d3d12x/real.rs`). **Re-verified on `85ca7be` (RTX 3070 Ti, DXC 1.9.2602.17)** - `.\scripts\test.ps1`: **872 passed, 0 failed, 42 ignored** across 20 runs (`unittests src\lib.rs`: `823 passed, 0 failed, 22 ignored`; `GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows)`). - `$env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture`: **4 passed, 0 failed, 0 ignored**, including `heap_window_out_of_memory_falls_back_to_the_switch_form`. - Release build (`cargo build --release -p xcl`) + 60 s `scripts/smoke.ps1`: `exit: 0x0`, `1632` frames (`PresentX 1632`), `60 60 60`, `0` device removals/crashes, `14540 MB` peak commit.
Author
Owner

@⁠KarolKurzyna on GitHub · 2026-11-24 20:11 UTC · original

Rebased onto main (b9b6ea6, including PR #1524 driver_compile_identified / huge_pso_bytes, PR #1689, and PR #819) — new head is 834ea6d, and updated the PR description to frame #1269 as the active tracking issue with closed #756 as background.

#1524 interop on 834ea6d

  • translated_compute_pso_once (crates/xcl/src/hle/d3d12x/real.rs) routes both the default GVN compile and the -opt-disable gvn retry through driver_compile_identified and gate_compute_driver_compile.
  • NO_GVN_RETRY_MAX_REFUSAL (<= 5 s) now checks the driver-only duration returned by driver_compile_identified (excluding huge-pipeline slot wait time).

Re-verified on 834ea6d (RTX 3070 Ti, DXC 1.9.2602.17)

  • .\scripts\test.ps1: 898 passed, 0 failed, 42 ignored across 20 runs (unittests src\lib.rs: 849 passed, 0 failed, 22 ignored, including big_compile_tests 8/8 and compute_pso_retry_tests 7/7; GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows), 1 (cannot disable the driver cache (Windows Developer Mode is required): ... 0x887A002D)).
  • $env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, 0 ignored, including heap_window_out_of_memory_falls_back_to_the_switch_form.
  • Release build (cargo build --release -p xcl) + 60 s scripts/smoke.ps1: exit: 0x0, 1631 frames (PresentX 1631), 60 60 60, 0 device removals/crashes, 14541 MB peak commit.
**@⁠KarolKurzyna** on GitHub · 2026-11-24 20:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7143178197) Rebased onto `main` (`b9b6ea6`, including PR #1524 `driver_compile_identified` / `huge_pso_bytes`, PR #1689, and PR #819) — new head is `834ea6d`, and updated the PR description to frame `#1269` as the active tracking issue with closed `#756` as background. **#1524 interop on `834ea6d`** - `translated_compute_pso_once` (`crates/xcl/src/hle/d3d12x/real.rs`) routes both the default GVN compile and the `-opt-disable gvn` retry through `driver_compile_identified` and `gate_compute_driver_compile`. - `NO_GVN_RETRY_MAX_REFUSAL` (`<= 5 s`) now checks the driver-only duration returned by `driver_compile_identified` (excluding huge-pipeline slot wait time). **Re-verified on `834ea6d` (RTX 3070 Ti, DXC 1.9.2602.17)** - `.\scripts\test.ps1`: **898 passed, 0 failed, 42 ignored** across 20 runs (`unittests src\lib.rs`: `849 passed, 0 failed, 22 ignored`, including `big_compile_tests` 8/8 and `compute_pso_retry_tests` 7/7; `GPU tests skipped on this adapter: 2 (no wave64), 1 (no heap windows), 1 (cannot disable the driver cache (Windows Developer Mode is required): ... 0x887A002D)`). - `$env:XCL_HEAP_WINDOWS = "1"; cargo test -p xcl --test gpu_compute_e2e -- --nocapture`: **4 passed, 0 failed, 0 ignored**, including `heap_window_out_of_memory_falls_back_to_the_switch_form`. - Release build (`cargo build --release -p xcl`) + 60 s `scripts/smoke.ps1`: `exit: 0x0`, `1631` frames (`PresentX 1631`), `60 60 60`, `0` device removals/crashes, `14541 MB` peak commit.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 05:03 UTC · original

Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-26 05:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/1398#issuecomment-7183141847) Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/recomp/pso.rs
  • crates/xcl/src/hle/d3d12x/real.rs
  • crates/xcl/src/shaders.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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