Shaders: resolve deep DXIL SSA joins without recursion #1834

Merged
gloger2003 merged 1 commit from upstream-pr/1844 into main 2026-11-30 02:47:06 +00:00
gloger2003 commented 2026-11-24 21:43:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gloger2003 on 2026-11-24T21:43:41Z.


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

  • Walk pending joins on an explicit stack. Keep predecessor order, cached reads and lazy phi creation on loop backedges.
  • Add a regression test for the deep chain with identical incoming values.

Tested

  • Windows x64, Ryzen 7 5700X, Radeon RX 7800 XT.

  • cargo build --offline --locked --release -p xcl on 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 #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 #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 #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 #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 #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 #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_scc with XCL_DIRECT_DXIL=1 and XCL_REQUIRE_GPU=wave64. One passed.

  • The new test overflowed before the patch and passed with it.

  • Supplemental integration on main 689f2db plus 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 in fuzz_validate_and_gpu_1. A targeted run on clean 689f2db reproduced the same mismatch at output 30. The GPU scalar-loop and divergent-execution tests both passed with XCL_DIRECT_DXIL=1 and XCL_REQUIRE_GPU=wave64.

Regression run

Minecraft Preview, 30 seconds per build with matching settings and the default shader path.

xcl-smoke v1
commit: 177cd407e0114bd087622ae0c358fb3ba7e97484
gpu: AMD Radeon RX 7800 XT
title: c22a3829
seconds: 30
exit: 0x0
frames shown: 1588 (PresentX 1588)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 3380 MB
xcl-smoke v1
commit: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317
gpu: AMD Radeon RX 7800 XT
title: c22a3829
seconds: 30
exit: 0x0
frames shown: 1640 (PresentX 1640)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 3359 MB

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.

<!-- greyfinch-sync:ivall/xcl:issue:5480835366 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844). Originally posted by [gloger2003](https://github.com/gloger2003) on 2026-11-24T21:43:41Z. --- 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** - Walk pending joins on an explicit stack. Keep predecessor order, cached reads and lazy phi creation on loop backedges. - Add a regression test for the deep chain with identical incoming values. **Tested** - Windows x64, Ryzen 7 5700X, Radeon RX 7800 XT. - `cargo build --offline --locked --release -p xcl` on 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 #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 #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 #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 #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 #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 #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_scc` with `XCL_DIRECT_DXIL=1` and `XCL_REQUIRE_GPU=wave64`. One passed. - The new test overflowed before the patch and passed with it. - Supplemental integration on `main 689f2db` plus 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 in `fuzz_validate_and_gpu_1`. A targeted run on clean `689f2db` reproduced the same mismatch at output 30. The GPU scalar-loop and divergent-execution tests both passed with `XCL_DIRECT_DXIL=1` and `XCL_REQUIRE_GPU=wave64`. **Regression run** Minecraft Preview, 30 seconds per build with matching settings and the default shader path. ``` xcl-smoke v1 commit: 177cd407e0114bd087622ae0c358fb3ba7e97484 gpu: AMD Radeon RX 7800 XT title: c22a3829 seconds: 30 exit: 0x0 frames shown: 1588 (PresentX 1588) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 3380 MB ``` ``` xcl-smoke v1 commit: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317 gpu: AMD Radeon RX 7800 XT title: c22a3829 seconds: 30 exit: 0x0 frames shown: 1640 (PresentX 1640) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 3359 MB ``` **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.
frenziedcoder commented 2026-11-24 23:08:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-24T22:31:33Z.


NVIDIA test report for 71f2ceb: full suite green, its own test deep_joins_read_on_a_small_stack passes, and a clean smoke pair on the retail title (1654 vs 1655 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head 71f2ceb5a05951f8d3d1f6aebe92c13eec240317, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 958 passed, 0 failed, 42 ignored; the PR's own test deep_joins_read_on_a_small_stack passes. SKIPPED: gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave64: no wave64), 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 #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 packed, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 compares, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 conversions, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 rounding, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 three-source, wave64: no wave64), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 transcendentals, wave64: no wave64), gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64), gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer carries, wave64: no wave64), gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (177cd40, this PR's merge base with main):

xcl-smoke v1
commit: 177cd407e0114bd087622ae0c358fb3ba7e97484
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1655 (PresentX 1655)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

this PR:

xcl-smoke v1
commit: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317
gpu: NVIDIA GeForce RTX 5080
title: 16b5e5d4
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14595 MB

Not tested: this code in the title: it is on the opt-in direct-DXIL path (XCL_DIRECT_DXIL), which the smoke runs leave unset (default HLSL backend), so they show only that nothing else regressed; the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.

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.

<!-- greyfinch-sync:ivall/xcl:comment:7146333743 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7146333743). Originally posted by [frenziedcoder](https://github.com/frenziedcoder) on 2026-11-24T22:31:33Z. --- **NVIDIA test report for `71f2ceb`: full suite green, its own test `deep_joins_read_on_a_small_stack` passes, and a clean smoke pair on the retail title (1654 vs 1655 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `71f2ceb5a05951f8d3d1f6aebe92c13eec240317`, no local changes. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug): **958 passed, 0 failed, 42 ignored**; the PR's own test `deep_joins_read_on_a_small_stack` passes. SKIPPED: `gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` (no wave64), `gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu` (no wave64), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave64: no wave64), `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 #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 packed, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 compares, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 conversions, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 rounding, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 three-source, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 transcendentals, wave64: no wave64), `gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu` (f64, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer arithmetic, wave64: no wave64), `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer carries, wave64: no wave64), `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `test_title_draws_with_a_root_signature_under_the_debug_layer` reports ok, but this machine has no D3D12 debug layer (`debug layer requested but unavailable … (0x887A002D)`), so it ran without the layer and is no evidence either way. **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`177cd40`, this PR's merge base with `main`): ``` xcl-smoke v1 commit: 177cd407e0114bd087622ae0c358fb3ba7e97484 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1655 (PresentX 1655) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` this PR: ``` xcl-smoke v1 commit: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317 gpu: NVIDIA GeForce RTX 5080 title: 16b5e5d4 seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14595 MB ``` **Not tested:** this code in the title: it is on the opt-in direct-DXIL path (`XCL_DIRECT_DXIL`), which the smoke runs leave unset (default HLSL backend), so they show only that nothing else regressed; the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD. *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.*
YaBulochka commented 2026-11-24 23:08:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by YaBulochka on 2026-11-24T22:41:54Z.


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.

GPU RX 7600 XT (RDNA3), radv as recorded by the title runs on this box
OS Linux, Wine 11.22, x86_64-pc-windows-gnu, release
Mode xcl shaders <retail shaders.rpf> --compile 500 --json, XCL_DIRECT_DXIL=1, XCL_DXIL_CACHE=0 XCL_PSO_DISK_CACHE=0, no title run

Five runs in total; the last pair was taken with the same environment and no XCL_DXC_THREADS set:

base c160d86 this PR
wall 78.7 / 84.4 / 98.5 s 187.1 / 188.5 / 190.5 s
median 0.47 / 0.47 / 0.48 s 0.40 / 0.44 / 0.46 s
p90 2.50 / 3.01 / 3.94 s 3.03 / 3.15 / 3.63 s
max 6.5 / 9.7 / 17.6 s 8.6 / 13.3 / 13.7 s
sum (CPU) 494 / 558 / 722 s 532 / 554 / 555 s

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 XCL_DXC_THREADS=8 fixed, so it does not look like a thread-count artefact on my side.

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.

<!-- greyfinch-sync:ivall/xcl:comment:7146538568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7146538568). Originally posted by [YaBulochka](https://github.com/YaBulochka) on 2026-11-24T22:41:54Z. --- 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. | | | |---|---| | GPU | RX 7600 XT (RDNA3), radv as recorded by the title runs on this box | | OS | Linux, Wine 11.22, `x86_64-pc-windows-gnu`, release | | Mode | `xcl shaders <retail shaders.rpf> --compile 500 --json`, `XCL_DIRECT_DXIL=1`, `XCL_DXIL_CACHE=0 XCL_PSO_DISK_CACHE=0`, no title run | Five runs in total; the last pair was taken with the same environment and no `XCL_DXC_THREADS` set: | | base `c160d86` | this PR | |---|---|---| | wall | 78.7 / 84.4 / 98.5 s | 187.1 / 188.5 / 190.5 s | | median | 0.47 / 0.47 / 0.48 s | 0.40 / 0.44 / 0.46 s | | p90 | 2.50 / 3.01 / 3.94 s | 3.03 / 3.15 / 3.63 s | | max | 6.5 / 9.7 / 17.6 s | 8.6 / 13.3 / 13.7 s | | sum (CPU) | 494 / 558 / 722 s | 532 / 554 / 555 s | 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 `XCL_DXC_THREADS=8` fixed, so it does not look like a thread-count artefact on my side. 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.
itsd-effex commented 2026-11-24 23:08:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsd-effex on 2026-11-24T22:47:04Z.


A note from #1805's reporter: the Ssa::read suspicion in #1805's description was mine and is withdrawn. The retail crash there is in dxil-spirv (Royalflamejlh's analysis on #1805), and #1860 alone fixes it: with ssa.rs unchanged and dxil-spirv unpatched, the 21 retail pipelines that killed workers all build (test), against 0 of 21 without it. So this PR doesn't fix #1805's crash as far as I can tell. The deep-join recursion it removes is real on small stacks (vitor127wt's 2 MiB runs), so it may still be worth having as hardening. I haven't tested this PR against those 21. Sorry for the misdirection.

AI use

  • Claude Code (Claude Opus 5.5) wrote this comment.
<!-- greyfinch-sync:ivall/xcl:comment:7146640346 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7146640346). Originally posted by [itsd-effex](https://github.com/itsd-effex) on 2026-11-24T22:47:04Z. --- A note from #1805's reporter: the `Ssa::read` suspicion in #1805's description was mine and is withdrawn. The retail crash there is in dxil-spirv (Royalflamejlh's analysis on #1805), and #1860 alone fixes it: with `ssa.rs` unchanged and dxil-spirv unpatched, the 21 retail pipelines that killed workers all build ([test](https://github.com/xcl-dev/xcl/pull/1860#issuecomment-7146610700)), against 0 of 21 without it. So this PR doesn't fix #1805's crash as far as I can tell. The deep-join recursion it removes is real on small stacks (vitor127wt's 2 MiB runs), so it may still be worth having as hardening. I haven't tested this PR against those 21. Sorry for the misdirection. **AI use** - Claude Code (Claude Opus 5.5) wrote this comment.
throny commented 2026-11-25 01:10:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T00:51:21Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7148956369 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7148956369). Originally posted by [throny](https://github.com/throny) on 2026-11-25T00:51:21Z. --- <!-- xcl-1607-hint:D70 --> 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.
JJAutoCompare commented 2026-11-25 01:11:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:01:08Z.


Exact-head CPU validation with DXC 1.9.2609.5

On clean 71f2ceb5a05951f8d3d1f6aebe92c13eec240317, both focused tests ran and passed: gpu::dxil::ssa::tests::deep_joins_read_on_a_small_stack and gpu::dxil::core_tests::long_pixel_shader_translates_fast (2 passed, 0 failed, 0 ignored, 0 skipped). I used cargo test --locked -p xcl --lib <exact-name> -- --exact --nocapture --test-threads=1 separately for each. The long-shader case used DXC/DXIL 1.9.2609.5 for CPU validation.

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 (gpt-6.2-sol) ran the checks and prepared the test evidence.

<!-- greyfinch-sync:ivall/xcl:comment:7149121670 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7149121670). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T01:01:08Z. --- **Exact-head CPU validation with DXC 1.9.2609.5** On clean `71f2ceb5a05951f8d3d1f6aebe92c13eec240317`, both focused tests ran and passed: `gpu::dxil::ssa::tests::deep_joins_read_on_a_small_stack` and `gpu::dxil::core_tests::long_pixel_shader_translates_fast` (**2 passed, 0 failed, 0 ignored, 0 skipped**). I used `cargo test --locked -p xcl --lib <exact-name> -- --exact --nocapture --test-threads=1` separately for each. The long-shader case used DXC/DXIL 1.9.2609.5 for CPU validation. 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 (`gpt-6.2-sol`) ran the checks and prepared the test evidence.
DavidM1911 commented 2026-11-25 02:08:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:15:31Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7149364681 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7149364681). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T01:15:31Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
lewisnic94-max commented 2026-11-25 09:30:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by lewisnic94-max on 2026-11-25T09:30:33Z.

Review: COMMENTED


Reviewed commit 71f2ceb5a05951f8d3d1f6aebe92c13eec240317.

Both 8,192-level diamond and region shapes completed seven times each on a 256 KiB thread stack. The same probes overflowed the stack on the merge base 177cd407e0. A 4,000-deep shader join also translated on a 2 MiB stack. All 24 seeded draws on the head returned the expected 64 RGBA pixels, and all 24 DXIL blobs matched the corresponding base draw byte-for-byte.

The graphics dependency benchmark distinguishes this PR from #1852. At 1,024 steps the median additional peak process commit inside the walker was 0.832 MiB here, versus 16.531 MiB on #1852 at c2b1029c22 (seven release processes each). Median phase times were 43.09 and 50.78 ms respectively. Both produced the same DXIL SHA-256. This PR changes SSA join resolution. The other PR also changes graphics dependency traversal. Their SSA edits overlap, so applying both as-is produces a conflict in ssa.rs.

Windows 11 x64, Ryzen 7 5800X, GeForce RTX 3080 (616.92), Rust 1.100.0 MSVC and DXC 1.9.2602.17. No skips in those draw or head stack probes. Timing is specific to this synthetic shader and machine. No retail shader or native RDNA2 run. No additional actionable defect identified in this scope.

AI assistance: OpenAI Codex (GPT-6) inspected the implementation, analyzed the synthetic test evidence and drafted this review.

<!-- greyfinch-sync:ivall/xcl:review:6054990568 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#pullrequestreview-6054990568). Originally posted by [lewisnic94-max](https://github.com/lewisnic94-max) on 2026-11-25T09:30:33Z. **Review:** COMMENTED --- Reviewed commit `71f2ceb5a05951f8d3d1f6aebe92c13eec240317`. Both 8,192-level diamond and region shapes completed seven times each on a 256 KiB thread stack. The same probes overflowed the stack on the merge base 177cd407e0114bd087622ae0c358fb3ba7e97484. A 4,000-deep shader join also translated on a 2 MiB stack. All 24 seeded draws on the head returned the expected 64 RGBA pixels, and all 24 DXIL blobs matched the corresponding base draw byte-for-byte. The graphics dependency benchmark distinguishes this PR from #1852. At 1,024 steps the median additional peak process commit inside the walker was 0.832 MiB here, versus 16.531 MiB on #1852 at c2b1029c224fa279aa83323bf5b42a3684ba5c04 (seven release processes each). Median phase times were 43.09 and 50.78 ms respectively. Both produced the same DXIL SHA-256. This PR changes SSA join resolution. The other PR also changes graphics dependency traversal. Their SSA edits overlap, so applying both as-is produces a conflict in ssa.rs. Windows 11 x64, Ryzen 7 5800X, GeForce RTX 3080 (616.92), Rust 1.100.0 MSVC and DXC 1.9.2602.17. No skips in those draw or head stack probes. Timing is specific to this synthetic shader and machine. No retail shader or native RDNA2 run. No additional actionable defect identified in this scope. AI assistance: OpenAI Codex (GPT-6) inspected the implementation, analyzed the synthetic test evidence and drafted this review.
raylitebull commented 2026-11-25 11:09:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:58:18Z.


Diff review on 71f2ceb confirms Ssa::read in crates/xcl/src/gpu/dxil/ssa.rs uses purely per-call local vectors (chain and joins: Vec<ReadJoin>) with no shared or global synchronization state, and @lewisnic94-max + @frenziedcoder + RX 7800 XT runs are strong.

Before merge, it would be helpful to briefly close out @YaBulochka's Wine --compile 500 wall-time anomaly report (78-98s vs 187-190s) with a confirmation/note so there are no open timing questions on the thread.

<!-- greyfinch-sync:ivall/xcl:comment:7160415675 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7160415675). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:58:18Z. --- Diff review on `71f2ceb` confirms `Ssa::read` in `crates/xcl/src/gpu/dxil/ssa.rs` uses purely per-call local vectors (`chain` and `joins: Vec<ReadJoin>`) with no shared or global synchronization state, and `@lewisnic94-max` + `@frenziedcoder` + RX 7800 XT runs are strong. Before merge, it would be helpful to briefly close out `@YaBulochka`'s Wine `--compile 500` wall-time anomaly report (`78-98s` vs `187-190s`) with a confirmation/note so there are no open timing questions on the thread.
CalvyPZ commented 2026-11-25 23:09:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:43:11Z.


This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

<!-- greyfinch-sync:ivall/xcl:comment:7176706850 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7176706850). Originally posted by [CalvyPZ](https://github.com/CalvyPZ) on 2026-11-25T22:43:11Z. --- This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
ClosetPie107 commented 2026-11-26 07:03:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T06:48:58Z.


AMD RDNA4 / Linux (Proton Experimental) test report on head 71f2ceb5 (merged cleanly onto main b49be183):

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu

Isolated unit tests (main b49be183 + #1844 71f2ceb5, debug, --test-threads=1):

  • xcl.exe gpu::dxil::ssa:: -- --test-threads=1: 1 passed, 0 failed, 0 ignored (0 skipped).

Combined 300 s retail sanity run (release, main b49be183 + #1540 + #1675 + #1844 + #1899 + #2123 + #2369 + #2422, retail 1.0.2.1 pressing A past menus):

  • Completed full 300 s (exit=0), 0 crashes, 0 device removals, 2,014 PresentX frames, 131,072 translated draws, 660,943 dispatches (44,546 chained split-compute dispatches), 102,631 Opus packets (0 errors).

Not tested

  • Native Windows, full workspace test suite, or #1844 alone in a retail run.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged #1844 onto main, ran the Proton unit tests and combined retail run on this machine, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7184810471 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7184810471). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T06:48:58Z. --- AMD RDNA4 / Linux (Proton Experimental) test report on head `71f2ceb5` (merged cleanly onto `main` `b49be183`): **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` **Isolated unit tests** (`main` `b49be183` + #1844 `71f2ceb5`, debug, `--test-threads=1`): - `xcl.exe gpu::dxil::ssa:: -- --test-threads=1`: **1 passed, 0 failed, 0 ignored** (0 skipped). **Combined 300 s retail sanity run** (release, `main` `b49be183` + #1540 + #1675 + #1844 + #1899 + #2123 + #2369 + #2422, retail 1.0.2.1 pressing `A` past menus): - Completed full **300 s (`exit=0`)**, **0 crashes**, **0 device removals**, `2,014` `PresentX` frames, `131,072` translated draws, `660,943` dispatches (`44,546` chained split-compute dispatches), `102,631` Opus packets (0 errors). **Not tested** - Native Windows, full workspace test suite, or #1844 alone in a retail run. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged #1844 onto `main`, ran the Proton unit tests and combined retail run on this machine, and drafted this report.
throny commented 2026-11-27 19:24:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:24:34Z.


merge-check claim
head: 71f2ceb5a0

<!-- greyfinch-sync:ivall/xcl:comment:7226498174 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7226498174). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:24:34Z. --- merge-check claim head: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317
throny commented 2026-11-27 19:43:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:43:51Z.


merge-check
base: 6089122a
head: 71f2ceb5a0
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: none. The explicit stack follows the old recursion: same cache points, same visiting and phi handling on loop backs, same operand order; preds[0] cannot be empty on the join path. The test overflows the stack without the change. Open from the thread, not blocking: a 2.2x wall-time report under Wine without a cause in the code; it overlaps #1852 in ssa.rs.
performance: only the opt-in direct-DXIL path uses this code; its cache hash changes, the HLSL path does not re-translate (reasoned).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7226814720 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7226814720). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:43:51Z. --- merge-check base: 6089122a head: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored review: none. The explicit stack follows the old recursion: same cache points, same visiting and phi handling on loop backs, same operand order; preds[0] cannot be empty on the join path. The test overflows the stack without the change. Open from the thread, not blocking: a 2.2x wall-time report under Wine without a cause in the code; it overlaps #1852 in ssa.rs. performance: only the opt-in direct-DXIL path uses this code; its cache hash changes, the HLSL path does not re-translate (reasoned). verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-27 23:29:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-27T23:29:23Z.


merge-check claim
head: 71f2ceb5a0

<!-- greyfinch-sync:ivall/xcl:comment:7230180025 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7230180025). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-27T23:29:23Z. --- merge-check claim head: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317
KOLESNiii commented 2026-11-28 00:16:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T00:16:03Z.


merge-check
base: 2c717a043c
head: 71f2ceb5a0
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1466 passed, 1 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: hle::kernelx::tests::fine_timer_makes_short_sleeps_short, under the concurrent load only: rerun alone on the same merge commit it passed (1 passed, 0 failed); the diff does not touch kernelx; not run on the base. The suite ran on this PC at the same time as six other PRs' suites, in one queued job.
review: none. Whole diff read (ssa.rs: read() rewritten iteratively, ReadJoin, 1 test). Traced against the old recursive read(): same depth-first left-to-right operand order (same init/phi creation order), same caching of chain blocks and join blocks, same visiting-marker loop phis; preds_of() never returns empty for a block with preds, so preds[0] is safe.
performance: reasoned, not measured: shader translation only; same work per read, heap Vec instead of stack frames.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 99cedecd5726f9914d4f7a8f7dbc51ee25402482 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7230778671 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7230778671). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T00:16:03Z. --- merge-check base: 2c717a043c8488938179fca81da4bb9e7913a358 head: 71f2ceb5a05951f8d3d1f6aebe92c13eec240317 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1466 passed, 1 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: hle::kernelx::tests::fine_timer_makes_short_sleeps_short, under the concurrent load only: rerun alone on the same merge commit it passed (1 passed, 0 failed); the diff does not touch kernelx; not run on the base. The suite ran on this PC at the same time as six other PRs' suites, in one queued job. review: none. Whole diff read (ssa.rs: read() rewritten iteratively, ReadJoin, 1 test). Traced against the old recursive read(): same depth-first left-to-right operand order (same init/phi creation order), same caching of chain blocks and join blocks, same visiting-marker loop phis; preds_of() never returns empty for a block with preds, so preds[0] is safe. performance: reasoned, not measured: shader translation only; same work per read, heap Vec instead of stack frames. verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 99cedecd5726f9914d4f7a8f7dbc51ee25402482 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
SJ99970 commented 2026-11-28 14:45:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SJ99970 on 2026-11-28T14:45:40Z.


Tested on RX 9070 XT using the same Direct DXIL + Heap Windows configuration that previously reproduced the DXIL translator failures.

Before #1844 I consistently hit:

0xc0000409 around 23,747 / 26,503 records
xcl-dxil-translate stack overflow (0xc00000fd) around 24,600 / 26,503 records

With #1844 applied (71f2ceb), shader preparation completed successfully:

compiled 4344
already cached 31246
errors 0
skipped 390
pipelines made on the GPU 9462
refused 1

and reported:

Shader preparation stopped:
0 record failures,
1 refused pipeline,
0 over the size cap

The previously reproducible stack overflow was not observed.

Follow-up testing using XCL_PREPARE=0 progressed into runtime rendering, indicating the remaining issue is different from the DXIL recursion failure addressed by #1844

<!-- greyfinch-sync:ivall/xcl:comment:7240910643 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1844#issuecomment-7240910643). Originally posted by [SJ99970](https://github.com/SJ99970) on 2026-11-28T14:45:40Z. --- Tested on RX 9070 XT using the same Direct DXIL + Heap Windows configuration that previously reproduced the DXIL translator failures. Before #1844 I consistently hit: 0xc0000409 around 23,747 / 26,503 records xcl-dxil-translate stack overflow (0xc00000fd) around 24,600 / 26,503 records With #1844 applied (71f2ceb), shader preparation completed successfully: compiled 4344 already cached 31246 errors 0 skipped 390 pipelines made on the GPU 9462 refused 1 and reported: Shader preparation stopped: 0 record failures, 1 refused pipeline, 0 over the size cap The previously reproducible stack overflow was not observed. Follow-up testing using XCL_PREPARE=0 progressed into runtime rendering, indicating the remaining issue is different from the DXIL recursion failure addressed by #1844
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1834
No description provided.