D3D12.X: DXC compiles XCL's own HLSL when D3DCompile refuses it #3018
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3018"
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?
Imported from ivall/xcl. Originally posted by voiceovarian1-max on 2026-11-27T12:37:52Z.
For nvidia-dev.
real::compilebuilds XCL's own small programs withD3DCompile: the indirect count check's (indirect_guard), the scatter program and the stand-ins. Under Wine,D3DCompileis Wine's own HLSL compiler, and it refuses the count check's program:compilereturned nothing and the count check was off (ExecuteIndirect: the counts are not checked (its program does not compile)). In a retail title, an indirect dispatch whose group counts came from GPU-written floats (0x3f800000 x 0x3eafef26 x 0x3d146851) then never ended, and the device was removed. With this change, DXC compiles the program ascs_6_0, the check works, and a 300 s run of the same title had no GPU-wait timeout and no device removal (41 out-of-range dispatches were not run). WhereD3DCompiletakes the program, as on Windows, nothing changes.compile's refusal message is now logged.This is also why #3009's new test and nvidia-dev's
an_execute_indirect_with_garbage_counts_*tests fail under Wine.What is in it
hle/d3d12x/real.rs:compilereadsD3DCompile's errors and falls back todxc::compilefor the 6.0 profile. Testa_program_d3dcompile_refuses_still_compiles.Tested
x86_64-pc-windows-gnu, release. DXC 1.9.2609.5 (XCL_DXC_DIR). Head25656f87on nvidia-dev3f39671d.cargo test -p xcl --lib -- --test-threads=4):3f39671d: 1691 passed, 8 failed, 28 ignoredan_execute_indirect_with_garbage_counts_draws_nothingandan_execute_indirect_with_garbage_counts_runs_no_groups.watch::tests::a_thread_in_the_driver_is_seen_until_it_returns. It is timing-dependent under the full parallel suite:watch::alone passed 5 of 5 runs (9 passed each) on this head.Regression run
scripts/smoke.ps1needs Windows, and we only have Linux. On Windows,D3DCompilecompiles these programs, so the new path is not taken.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T12:44:24Z.
On native Windows x64 (RTX 5070 Ti Laptop, DXC 1.8.2502.11),
Load3takes the existing D3DCompile path. A one-thread compute shader usingWaveActiveSumalso gives you a way to exercise the fallback on Windows. I copiedreal::compileunchanged from25656f87into a small harness linked to my existing XCL DXC wrapper and GPU runner.Load3on[2, 3, 7]produced an SM5SHEXchunk and wrote the expected sum12.WaveActiveSum(b.Load(0)) + b.Load(4)with one active lane got X3004 from D3DCompile, produced aDXILchunk through thecs_6_0retry, and wrote the expected5on the GPU.This covers the compiler selection and GPU execution in isolation. The full PR build, indirect count guard and retail smoke were outside this run. AI-assisted verification with OpenAI Codex (GPT-6).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T13:12:17Z.
Tested
Clean detached PR head
25656f87fcf2da20d7a36d420b2fd588b029cd0don native Windows 11 x64 build 26200.9974, AMD Ryzen 7 3800X, Rust/Cargo 1.100.0 MSVC, and Windows SDK DXC/DXIL 1.9.2602.17. CPU only, using the debug test profile.1 passed, 0 failed, 0 ignored, 0 skipped, with 1,727 filtered out and Cargo exit 0. Cargo reused the pinned exact-head libtest binary. DXC initialized and the stock
Load3fixture returned nonempty bytecode. The run emitted no fallback diagnostic.Not tested
Forced D3DCompile refusal and DXC retry, GPU execution, indirect count guard, full workspace suite, and retail smoke.
AI use
T3 Code / Codex (
gpt-6.2-sol) independently reran the stock test and wrote this report.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:20:10Z.
Triage (#1607) – head
25656f8#3536 fixes the same failure (Wine's d3dcompiler refusing the indirect guard's
Load3on a RWByteAddressBuffer) by compiling the guard itself with DXC, with a D3DCompile fallback; this PR instead makes everyreal::compilecaller fall back to DXC.In
real::compile: when only one of a VS/PS pair is refused, the caller gets DXBC for one stage and DXIL for the other, which one PSO cannot mix (the dummy pipelines compilevs_5_0/ps_5_0separately).a_program_d3dcompile_refuses_still_compilespasses on Windows without the fix, since Windows' D3DCompile acceptsLoad3; it only exercises the fallback under Wine.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.