D3D12.X: retry driver-rejected compute PSOs without DXC GVN (#756) #1398
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1398
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1398"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@KarolKurzyna on GitHub · 2026-11-24 15:35 UTC · original
KarolKurzyna:d3d12x/retry-compute-pso-no-gvn→main· +421 −23 · 4 files · 3 commits · openPart of #1269 (addresses the DXC GVN compute PSO refusal pattern originally reported in #756, following @psuedo-tty's analysis of
phi %dx.types.Handletriggers under DXC GVN, @pickles976's review on logging cache keys and driver refusal reasons, and @erickbobd's review and verification).What is in it
-opt-disable gvnwhen the driver refusesCreateComputePipelineStateon a translated console compute shader (crates/xcl/src/hle/d3d12x/real.rs,crates/xcl/src/shaders.rs), bounded to fast refusals (<= 5 sviaNO_GVN_RETRY_MAX_REFUSAL) so multi-minute driver OOMs on huge programs do not pay for a second, larger no-GVN compile.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.console_to_dxil_without_gvnandconsole_to_dxil_in_without_gvnreturningWithoutGvn(crates/xcl/src/gpu/recomp/pso.rs), bypassingShaderCacheand thetranslatedmemory cache and short-circuiting shaders over 8 MB HLSL (already compiled at-O0).driver_cacheon 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 formattedHRESULT) in bothtranslated_compute_pso_onceandxcl shaders --pipelines(Pipelines::make).main(1a0bbe3, PR #1524driver_compile_identified/huge_pso_bytes+ PR #1426/#1693 Direct DXIL + PR #680 heap windows):compile_console_shaderpreserves Direct DXIL routing whilecompile_console_shader_with_extraserves the HLSL-opt-disable gvnretry path,translated_compute_pso_onceroutes both attempts throughdriver_compile_identified(soNO_GVN_RETRY_MAX_REFUSALmeasures driver-only compile time excluding slot wait time), and the no-GVN retry stays guarded by!HEAP_WINDOW_OOM.with(|o| o.get())sowith_switch_fallbackrunsin_switch_formfirst on heap-windowE_OUTOFMEMORY.Tested
1.100.0; DXC1.9.2602.17.cargo build --release -p xcl: passed. Two existingAtomic::fetch_updatedeprecation warnings are in untouched files/lines.cargo test --workspace -- --test-threads=4on head36e23fddc939: xcl library had 1189 passed, 1 failed, 26 ignored. The failure isgpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(DXIL not compiled yet); it reproduces on base1a0bbe3a2ba9as well.Regression run
Fresh main baseline (warm cache):
This PR head (warm cache):
Not tested
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.
@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 gvnscoped 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.@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 base930e8b4).Tested
cargo build --workspace, thenXCL_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.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.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 757 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
@KarolKurzyna on GitHub · 2026-11-24 16:04 UTC · original
@pickles976 Thanks for the review — addressed both asks in
2b73d16(and rebased onto345661bso thereal.rstest-module conflict is cleared):rejected_keyfor the default GVN build ->retry_keyfor-opt-disable gvn) are now returned viaWithoutGvnand logged in both runtime andxcl shaders --pipelines:D3D12.X: compute PSO with the translated console CS (... ms, retried without GVN (dxil cache <gvn> -> <no-gvn>; driver refused: <first line>))... (<first_reason>; retry without GVN <gvn> -> <no-gvn> refused: <retry_reason>)--pipelines:<name>: driver refused compute pipeline (<first line>); built without GVN (dxil cache <gvn> -> <no-gvn>, ... B DXIL)<hr>: <first line>), falling back to the first line ofwindows::core::Error::from_hresult(...).Re-verified on
2b73d16(RTX 3070 Ti):.\scripts\test.ps1passed 774 passed, 0 failed, 41 ignored (2 wave64 tests skipped on this adapter;0warnings in modified files), release build succeeded, and 60 sxcl-smokeran cleanly (1640frames shown,0device removals / crashes,14611 MBpeak commit).@futurepro62 Thank you for running and posting the RTX 5070 Ti verification report as well!
@erickbobd on GitHub · 2026-11-24 16:11 UTC · original
Test report for
2b73d16(and732d3a5before 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
xcl shaders <folder> --precompile --only cs --pipelines --windows N, freshXCL_DXIL_CACHE,XCL_PSO_DISK_CACHE=0, each program alone and the five together:main930e8b4732d3a52b73d16mainisf377ca6830935314(355 instructions), in the switch form. With this PR the driver refuses it with0x8007000E(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 onmaintoo: @psuedo-tty saw them refused only in #680's heap-window form, which is not onmain.--pipelinespass. 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
-O0ones. 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_tripshows the flags get their own cache entry, but not that they change the DXIL. DXC 1.8.2502.11 takes any name after-opt-disablewithout an error: withgnvinstead ofgvnit 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: It returns without a word when DXC is missing; CONTRIBUTING asks forrunner::skip_test("no DXC")there.Not tested
AI use
@mastrr9 on GitHub · 2026-11-24 16:16 UTC · original
Verified head
2b73d163719679c05e07d11276c46256fdf5c0f5on Windows 11 / NVIDIA RTX 5080 (Blackwell):cargo build --workspace: OK (0 new warnings)cargo test --workspace -- --test-threads=4: 774 passed, 0 failed, 41 ignoredClean build and full test suite pass on RTX 5080.
@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 in58bfd73:-opt-disable gvnretry to fast driver refusals (first_elapsed <= 5 sviaNO_GVN_RETRY_MAX_REFUSALintranslated_compute_psoandPipelines::make, resetting the timer before uncached fallback compiles intry_create) with unit coverage incompute_pso_slow_refusal_skips_no_gvn_retry.dxil_cache_with_extra_flags_round_tripto compile your GVN-sensitive HLSL shader, assertdefault_dxil != nogvn_dxil, and callrunner::skip_test("no DXC")if DXC is absent.Re-verified on RTX 3070 Ti (
58bfd73):.\scripts\test.ps1passed 775 passed, 0 failed, 41 ignored (2 wave64 tests skipped;0new warnings), release build ok, and 60 sxcl-smokeok (1635frames shown,0device removals / crashes,14592 MBpeak commit).@mastrr9 Thanks as well for verifying
2b73d16on RTX 5080!@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
58bfd732328c7e294f535747d8bc68ab5af9336f(clean tree, merge-base345661b)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo build --release --workspace: ok (exit 0)cargo test --workspace --release --no-fail-fast -- --test-threads=4: 775 passed, 0 failed, 41 ignored, exit0gpu::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_retrySKIPPED(no wave64):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareRegression run
mainbaseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):PR head (
58bfd732328c7e294f535747d8bc68ab5af9336f):Not tested: debug build,
XCL_SAMPLE_*tests /xcl shaders --pipelineson 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.@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!
@KarolKurzyna on GitHub · 2026-11-24 17:18 UTC · original
Rebased onto
main(9e3831e, PR #680 heap windows) — new head isa0f2cc6.@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
a0f2cc6translated_compute_psoconflict by keeping #680'swith_switch_fallback(|| translated_compute_pso_once(...))wrapper.-opt-disable gvnretry insidetranslated_compute_pso_oncewithif hr < 0 && !HEAP_WINDOW_OOM.with(|o| o.get())so heap-windowE_OUTOFMEMORYreacheswith_switch_fallback(in_switch_form) first rather than retrying with-opt-disable gvnearly; if the switch-form pipeline still refuses quickly (<= 5 s),-opt-disable gvnretries 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, includingheap_window_out_of_memory_falls_back_to_the_switch_form.cargo build --release -p xcl) + 60 sscripts/smoke.ps1:exit: 0x0,1639frames (PresentX 1639),60 60 60,0device removals/crashes,14594 MBpeak commit.@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
main9e3831e, 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.heap_window_out_of_memory_falls_back_to_the_switch_form("no heap windows"), because the suite ran withoutXCL_HEAP_WINDOWS.XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, includingheap_window_out_of_memory_falls_back_to_the_switch_form. So the heap-window OOM fallback runs and passes on AMD native wave64.main9e3831eand on a0f2cc6:xcltotal timeXCL_HEAP_WINDOWS=1)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
--pipelinespass 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
XCL_DXC_DIRcargo test --workspace --no-fail-fast -- --test-threads=4(debug,XCL_SAMPLE_RPF/DLLS/TTPF/BVH4set to a retail title's files): 772 passed, 3 failed, 41 ignored, 0 SKIPPED.placed_title_textures_share_vram_and_preserve_pixels(3D 64x64x64 4 mips: subresource 2 mismatch) and twoPoisonErrorfollow-ons.main47efa2eon this card. This is the RDNA2 packed-mip readback that #470 / #1028 fix, and it is not touched by this PR.xcl shaders <pack> --precompile --only cs --pipelinespass, the AMD driver refusedmeshlet_culling:CS_BatchCullMeshlets_ParaboloidShadows_445ed429and its_Prevtwin.main47efa2e, with 4 driver compiles and 19 DXC threads at once, under a 20 GB job memory cap.XCL_DXIL_CACHE,XCL_PSO_DISK_CACHE=0,XCL_TRANSLATED_CACHE=0,XCL_PIPELINE_THREADS=1, and a renamed copy ofxcl.exeper run so the AMD driver cache is cold. There were two interleaved rounds.47efa2e(the build of the refused pass)345661bNO_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
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.345661bon this card (the comparison above is against47efa2e).AI use
xcllogs.@RodrigoTorreao on GitHub · 2026-11-24 17:38 UTC · original
@KarolKurzyna I re-tested the rebased head
a0f2cc6on the RX 6750 XT (RDNA2, native wave64) and updated my report above: #1398heap_window_out_of_memory_falls_back_to_the_switch_form, which was skipped on your 3070 Ti, runs and passes here withXCL_HEAP_WINDOWS=1. It was 4/4 ingpu_compute_e2e.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
@KarolKurzyna on GitHub · 2026-11-24 19:56 UTC · original
@RodrigoTorreao Thanks for re-testing
a0f2cc6on RX 6750 XT (4/4inXCL_HEAP_WINDOWS=1 gpu_compute_e2e)!Rebased onto
main(6c89285, PR #1426 Direct DXIL + PR #1693 + PR #1195/#1288) — new head is85ca7be.Main
6c89285interopcompile_console_shader(crates/xcl/src/gpu/recomp/pso.rs) preserves #1426's Direct DXIL routing (direct_compute/direct_graphics), whilecompile_console_shader_with_extraserves the HLSL-opt-disable gvnretry path.!HEAP_WINDOW_OOM.with(|o| o.get())around the no-GVN retry insidetranslated_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, includingheap_window_out_of_memory_falls_back_to_the_switch_form.cargo build --release -p xcl) + 60 sscripts/smoke.ps1:exit: 0x0,1632frames (PresentX 1632),60 60 60,0device removals/crashes,14540 MBpeak commit.@KarolKurzyna on GitHub · 2026-11-24 20:11 UTC · original
Rebased onto
main(b9b6ea6, including PR #1524driver_compile_identified/huge_pso_bytes, PR #1689, and PR #819) — new head is834ea6d, and updated the PR description to frame#1269as the active tracking issue with closed#756as background.#1524 interop on
834ea6dtranslated_compute_pso_once(crates/xcl/src/hle/d3d12x/real.rs) routes both the default GVN compile and the-opt-disable gvnretry throughdriver_compile_identifiedandgate_compute_driver_compile.NO_GVN_RETRY_MAX_REFUSAL(<= 5 s) now checks the driver-only duration returned bydriver_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, includingbig_compile_tests8/8 andcompute_pso_retry_tests7/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, includingheap_window_out_of_memory_falls_back_to_the_switch_form.cargo build --release -p xcl) + 60 sscripts/smoke.ps1:exit: 0x0,1631frames (PresentX 1631),60 60 60,0device removals/crashes,14541 MBpeak commit.@DavidM1911 on GitHub · 2026-11-26 05:03 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.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.Merge
Merge the changes and update on Forgejo.