Repository navigation
Shaders: resolve deep DXIL SSA joins without recursion - #1844
gloger2003 wants to merge 1 commit into
Conversation
Walk pending joins on a heap-backed stack while preserving lazy phi creation and predecessor order. A synthetic test covers 8192 joins on a 256 KiB thread stack. Assisted-by: OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode)
|
NVIDIA test report for Tested
Regression run ( base ( this PR: Not tested: this code in the title: it is on the opt-in direct-DXIL path ( AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it. |
|
AMD/RADV check, and it does not reproduce as a speed-up here: on this machine the per-shader numbers improve but the wall time doubles.
Five runs in total; the last pair was taken with the same environment and no
Reading: the CPU sum is the same (555 vs 558 on the clean pair), the medians favour the PR, but the wall is 2.2x worse and remarkably stable at ~188 s while the base swings 79-98 s. The same shape appears with My guess, offered as a guess: the explicit-stack walk shares state that serialises the workers, so the work is the same but less of it runs concurrently. If you have a way to log how many DXC compiles are in flight at once, that would confirm or kill it in one run. No crash or stack overflow at 500 shaders on this box, so the overflow this PR targets did not show up in this mode. |
|
A note from #1805's reporter: the AI use
|
|
Two contributors checked independently and found that #1852 solves the same problem (for #1805) in a different way: #1607, group D70. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Exact-head CPU validation with DXC 1.9.2609.5 On clean Host: Ryzen 7 3800X, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC debug, Windows SDK 10.0.26100.0, Intel Arc A770 (driver 32.0.101.9175). This adds a newer DXC version to the existing exact-head report. Not tested: GPU execution, full workspace suite, retail smoke, or the pre-fix baseline. Codex in T3 Code ( |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Part of #1805. The direct DXIL SSA reader could exhaust a worker stack when resolving a definition across many sealed control-flow joins. A synthetic chain of 8,192 joins reproduces the overflow on a 256 KiB stack.
What is in it
Tested
Windows x64, Ryzen 7 5700X, Radeon RX 7800 XT.
cargo build --offline --locked --release -p xclon the baseline and this head.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output. 958 reported passed, 0 failed, 42 ignored. Runtime GPU skips: 7 (gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)), heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).gpu_scalar_loop_and_sccwithXCL_DIRECT_DXIL=1andXCL_REQUIRE_GPU=wave64. One passed.The new test overflowed before the patch and passed with it.
Supplemental integration on
main 689f2dbplus this patch (cc07eac), RX 7800 XT. DXIL suite: 100 passed, one failed, three ignored. The new deep-join test passed. The failure was seed 722 infuzz_validate_and_gpu_1. A targeted run on clean689f2dbreproduced the same mismatch at output 30. The GPU scalar-loop and divergent-execution tests both passed withXCL_DIRECT_DXIL=1andXCL_REQUIRE_GPU=wave64.Regression run
Minecraft Preview, 30 seconds per build with matching settings and the default shader path.
Not tested
The title and Wine setup reported in #1805.
AI use
OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) wrote the code and regression test, ran the checks and drafted this description.