Recompiler: split large direct compute pipelines at CFG edges #2080

Manually merged
github merged 5 commits from gh-pr/2080/head into gh-pr/2080/base 2026-11-26 05:18:01 +00:00
Owner

@⁠Kalmarv on GitHub · 2026-11-25 03:25 UTC · original
Kalmarv:direct-dispatch-split → main · +1292 −83 · 16 files · 5 commits · merged 2026-11-25 13:36 UTC

Part of #1269. The NVIDIA driver's compute pipeline build time grows faster than linearly with program size, roughly N^1.47 on an RTX 5070 Ti. So the title's largest direct-route programs take 14–23 s each to build cold on main, even after #2034 made them smaller. Cut into pieces of about 12,500 DXIL instructions, the same work builds in parallel on the PSO workers in 2.2–2.5 s.

What is in it

  • crates/xcl/src/gpu/dxil/module/split.rs: partitions the optimized compute entry at CFG edges. A dispatch can't jump back to an earlier one, so each strongly connected component (every loop) stays in one piece. The values live across each crossing edge go to a per-dispatch scratch UAV, one lane-contiguous plane per live dword, indexed by group and logical wave lane. The two wave32 halves of a wave64 stay correct across dispatches.
  • crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs, pso.rs, pso_async.rs: one pipeline per piece, built on the PSO workers. Direct Dispatch records the chain as consecutive dispatches with UAV ordering between them. ExecuteIndirect builds and uses the whole form on demand.
  • XCL_DIRECT_SPLIT_INSTRUCTIONS sets the target instructions per piece (default 12500, 0 disables). It's documented in the README. The split applies to programs on the direct route: all of them with XCL_DIRECT_DXIL=1, and, since #2120, the enormous HLSL programs that are rerouted there by default.
  • Each piece declares only the shader features it uses. The whole program's typed-UAV-load flag stays only on pieces that have a typed UAV load, because the validator wants flags to match usage. Each piece is validated when it is made, and one that fails keeps the program whole with a compute split: piece N of M refused warning instead of silently. @⁠ivall found that since #2156 no CS_RaytracingResolve program split for this reason (comment). Test: dispatch_chain_declares_typed_uav_loads_only_where_they_are, which fails without the fix under the DXC 1.9 validator.
  • From @⁠ettehn's review: the helper threads that build a program's other pieces carry the parent's BUILDING context, so a title thread waiting for the chain makes all its pieces wanted. A chained pipeline keeps its driver disk blob under its own .chain.pso name, so it no longer overwrites, or reads, the title's own blob for the same DXIL.
  • GPU tests (dispatch_chain_wave32_live_loops, dispatch_chain_wave64_live_loops_and_exchange): they compare a split program that has live values across loops, and a wave64 half exchange, with its unsplit form.
  • dispatch_chain_native_wave64_builds_whole (commit 6c34370, test only): a program that native wave64 hardware runs as wave64 gets no chain and keeps its whole pipeline, because chains are built only for 32-wide hardware waves. On a wave64 adapter it also runs the whole pipeline and checks its output. On the RTX 5070 Ti it compiles and validates, and skips the GPU part (no native wave64). @⁠bielfreedom ran it on an RX 9070 XT (RDNA4), where it passed with no skip (comment).
  • dispatch_chain_divergent_forward_edges_3d, a fixture by @⁠WebIdentity1 (commit e2db0c0, test only). On a 2×3×2 grid, lanes return early, skip a piece, or run different numbers of loop iterations. The test checks whole and split outputs and guard words against a CPU model, for native wave32 and split wave64.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, release, DXC 1.9.2609.

  • Cold pipeline build (fresh process, 16 threads, implicit caches off), against the whole program from main:

    Program Whole Split Pieces Sum of pieces Faster
    ef008c0f 14.38 s 2.49 s 10 5.8×
    c3ae6819 23.29 s 2.27 s 14 20.8 s 10.3×
    fb1c6d2d 22.51 s 2.23 s 14 20.5 s 10.1×

    ef008c0f is this head's output; c3ae6819 and fb1c6d2d are from 413e0c0, before the scratch layout change. The slowest piece sets each wall time.

  • Output on the GPU, ef008c0f, two seeded inputs, 64 groups (an early-exit path and the late shading path; a CPU trace of the second runs every piece of a 5-way split and 9 of 10 of a 10-way one): the whole and split forms each write 2048 words, 0 of them different, and match the expected 2048 texels.

  • GPU time, ef008c0f: at the card's steady P3 state (a compute-only load doesn't hold full clocks, and the clocks weren't locked; each form reproduces within 1% across two jobs, with all forms taking turns in one process), whole 112.5 µs and split 176.8 µs (1.57×) on the late shading path, whole 17.6 µs and split 36.3 µs (2.06×) on the early-exit path. That's over 1.5×: the handoff moves about 30 MB per dispatch on the shading path, and cutting it is follow-up work. Launch plus barrier is under 1 µs per piece.

  • In the title (120 s, XCL_DIRECT_DXIL=1, this change at 1444f61 plus a dispatch trace): 13 programs split into 54 pieces, and 74 chained dispatches ran, all after 70 s (the regression run below, on this head, has 117); exit 0, no device removal. Every compute program the trace saw was dispatched through plain Dispatch until 63.5 s; 33 later ones go through single-command ExecuteIndirect and so use the whole form.

  • AMD RDNA4, measured by @⁠bielfreedom (comment), RX 9070 XT, Ryzen 7 7700, on af2bd61: across 17 split programs, the whole pipelines take 991 s to build and the pieces on 16 threads take 116 s (8.6×). Every build succeeds, and the two chain tests pass. Peak process memory was 11.7–13.4 GB with up to 16 pieces building at once.

  • Linux, checked by @⁠Royalflamejlh (comment), CPU only, on 17a984b: vkd3d-proton's dxil-spirv turns 4,125 of the 4,130 pieces (478 split programs) into SPIR-V that passes spirv-val. The other 5 hit its known crash (#1805) on loops that already crash it in the whole program. With #1860 merged in, all 4,130 convert.

  • Checked by @⁠ettehn (comment) on 6c34370, DXC 1.8.2502: a local compute record that gave 0 pieces before the typed-UAV fix gives 12, and the whole form and every piece pass the validator. With a test against an isolated disk cache, the chained request reads only its .chain.pso blob and the title's own blob stays a hit. With two workers, a helper's piece becomes wanted when the title waits for the chain, and does not without the inherited BUILDING.

  • cargo test --release --offline --workspace -- --test-threads=4 on 413e0c0: 1156 passed, 0 failed, 46 ignored, with 24 skip notices (no native wave64, three unsupported per-lane FP cases, no heap windows). On af2bd61 the two new GPU tests pass: 96 wave32 and 192 split-wave64 output words match the unsplit form, 64-bit values and cross-half exchange included. On 17a984b all three dispatch_chain tests pass. The new one splits into three pieces in each geometry, and its 384 and 768 words plus 16 guards match the CPU model in both the whole and split forms.

  • In the title on an RTX 4090, run by @⁠Raghav314 (comment): main 1a0bbe3 with 6c34370 merged, 300 s cold (no DXIL or driver blobs), XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1. 33 programs split into 179 pieces, and 89 chained dispatches ran. The longest cold compute build was 7.9 s. No removal or crash. The world load still stops presenting at about 74 s: 47 of the 57 cold compute builds (146 s of driver time) came after the last present, one after another, so bounding each build doesn't remove that stop by itself. For reference, on another tree (#2057) on the same machine the longest was 12 s, with the same stop.

  • Cold build on an RTX 3060, measured by @⁠pvfreis (comment), on 40d1b15 plus the typed-UAV fix, switch windows, 12 threads, driver caches off, median of 3: five programs split into 11–14 pieces each and every piece builds. Whole against all pieces built: ef008c0f 49.4 → 9.1 s, ab570963 41.6 → 5.3 s, 33743bd6 37.1 → 3.8 s, c3ae6819 80.9 → 14.5 s, fb1c6d2d 63.7 → 9.1 s (5.5–9.7×). Without the fix, all five are refused with Flags must match usage.

  • AMD Radeon RX 9070, regression pair by @⁠Toons29 (comment), Ryzen 7 7800X3D, on 40d1b15 (this branch before the latest rebase), 60 s of a title on the default route: main 568e7db 1566 frames and this PR 1632, peak commit 14592 / 14565 MB, no crash or device removal in either.

  • cargo test --workspace -- --test-threads=4 (debug) on 6c34370, rebased onto main 9633138: 1246 passed, 2 failed, 46 ignored. The two failures, device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa and pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator, fail on main 9633138 too; #2245 fixed both on main since. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows.

Regression run

The branch was rebased onto main 9633138. The conflicts and what changed with them: the translated-cache identity in pso.rs (#2174's compact-nest tag kept, the split tag after it); #2064's container check, now also on the whole form and each piece of a cached chain; #2176 and #2178 in pso_async.rs (the queue here takes closures, so the spared-build resend and the orphan check moved into enqueue); and the test fixtures, which #2194's merging of straight-line blocks left with too few cut points, so they now branch on the lane index.

scripts/smoke.ps1 -Seconds 120, the same retail title, one after the other on the machine under Tested, release builds from clean trees.

main 9633138 (this PR's base):

xcl-smoke v1
commit: 963313835813f475037b3a9f5fcc3cb591696928
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1323 (PresentX 1323)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 29175 MB

this PR, 6c34370:

xcl-smoke v1
commit: 6c34370946dd11cdc429fdb106f49b798b63b443
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1310 (PresentX 1310)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 29471 MB

PR vs main: 1310 / 1323 frames (99 %), peak commit 29471 / 29175 MB (101 %); device removals 0 and crashes 0 on the PR run, 0 and 0 on main.

Both runs use XCL_DIRECT_DXIL=1 and start with the same private XCL pipeline cache, holding only the pipeline list; the driver's own cache was left alone. The PR run logged compute split: 29 programs split, 132 pieces built, 117 chained dispatches issued at 120 s (0 by 60 s, all 117 by 70 s), and no piece ... refused warning. Before the rebase, 8eefdef logged 25 programs, 117 pieces, 90 chains in the same setup; how far the title gets before it stops varies between runs. Both runs present no frames in their last 6 s, for a reason this change doesn't touch.

Not tested

  • Peak memory when many pieces build at once on a machine with 16 GB of RAM or less.
  • AMD, native wave64 on hardware.
  • Linux with vkd3d-proton 3.1 does not work with the split. Its dxil-spirv crashes on most pieces: 3,754 of the title's 4,130 in @⁠Royalflamejlh's offline pass (comment), and in three of the new GPU tests (@⁠JoaoPauluu's report). dxil-spirv from vkd3d-proton master (30b0eb9) converts the same pieces as well as it converts the whole programs: 4,125 of 4,130, all valid, and the 5 failures are #1805's. The three tests that crash on 3.1 pass with it under Wine on an RTX 2060. Giving each piece a single return block doesn't fix 3.1 by itself (282 crashes and 1,152 invalid of the rest, in the same pass). Without XCL_DIRECT_DXIL=1 only the enormous programs #2120 reroutes can split.
  • Output on real title inputs; c3ae6819 and fb1c6d2d on the GPU.
  • The full workspace suite on af2bd61 (only the split module's tests ran there).
  • The split on the default route, for the enormous programs #2120 reroutes: the regression run uses XCL_DIRECT_DXIL=1.
  • Frame time with the split taken: in the title, the chains first run after presentation has already stopped, at about 64 s, for a separate reason.

Scope. This PR splits wave32 programs and single-wave 64×1×1 wave64 programs without group shared memory or UAV atomics (only AND/OR atomics whose results are unused are allowed); everything else keeps the whole pipeline. ExecuteIndirect also uses the whole form. A follow-up PR is in progress for multi-wave wave64 groups (8×16 and 16×16), which covers the cascade-shadow programs: in the 120 s run, seven of them, 70–125k instructions each, are declined for their group shape alone and build one at a time for 11–26 s each. Group shared memory, atomics and ExecuteIndirect come after that.

AI use

OpenAI Codex (GPT-6) wrote the split pass, the runtime chain and the tests. Claude Code (Claude Opus 5.5) helpers ran the driver timings and GPU checks, and Claude Code wrote this description and opened the PR.

🤖 Generated with Claude Code

**@⁠Kalmarv** on GitHub · 2026-11-25 03:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080) `Kalmarv:direct-dispatch-split` → `main` · +1292 −83 · 16 files · 5 commits · merged 2026-11-25 13:36 UTC Part of #1269. The NVIDIA driver's compute pipeline build time grows faster than linearly with program size, roughly N^1.47 on an RTX 5070 Ti. So the title's largest direct-route programs take 14–23 s each to build cold on `main`, even after #2034 made them smaller. Cut into pieces of about 12,500 DXIL instructions, the same work builds in parallel on the PSO workers in 2.2–2.5 s. **What is in it** - `crates/xcl/src/gpu/dxil/module/split.rs`: partitions the optimized compute entry at CFG edges. A dispatch can't jump back to an earlier one, so each strongly connected component (every loop) stays in one piece. The values live across each crossing edge go to a per-dispatch scratch UAV, one lane-contiguous plane per live dword, indexed by group and logical wave lane. The two wave32 halves of a wave64 stay correct across dispatches. - `crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs`, `pso.rs`, `pso_async.rs`: one pipeline per piece, built on the PSO workers. Direct Dispatch records the chain as consecutive dispatches with UAV ordering between them. ExecuteIndirect builds and uses the whole form on demand. - `XCL_DIRECT_SPLIT_INSTRUCTIONS` sets the target instructions per piece (default 12500, 0 disables). It's documented in the README. The split applies to programs on the direct route: all of them with `XCL_DIRECT_DXIL=1`, and, since #2120, the enormous HLSL programs that are rerouted there by default. - Each piece declares only the shader features it uses. The whole program's typed-UAV-load flag stays only on pieces that have a typed UAV load, because the validator wants flags to match usage. Each piece is validated when it is made, and one that fails keeps the program whole with a `compute split: piece N of M refused` warning instead of silently. @⁠ivall found that since #2156 no `CS_RaytracingResolve` program split for this reason ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)). Test: `dispatch_chain_declares_typed_uav_loads_only_where_they_are`, which fails without the fix under the DXC 1.9 validator. - From @⁠ettehn's review: the helper threads that build a program's other pieces carry the parent's `BUILDING` context, so a title thread waiting for the chain makes all its pieces wanted. A chained pipeline keeps its driver disk blob under its own `.chain.pso` name, so it no longer overwrites, or reads, the title's own blob for the same DXIL. - GPU tests (`dispatch_chain_wave32_live_loops`, `dispatch_chain_wave64_live_loops_and_exchange`): they compare a split program that has live values across loops, and a wave64 half exchange, with its unsplit form. - `dispatch_chain_native_wave64_builds_whole` (commit `6c34370`, test only): a program that native wave64 hardware runs as wave64 gets no chain and keeps its whole pipeline, because chains are built only for 32-wide hardware waves. On a wave64 adapter it also runs the whole pipeline and checks its output. On the RTX 5070 Ti it compiles and validates, and skips the GPU part (no native wave64). @⁠bielfreedom ran it on an RX 9070 XT (RDNA4), where it passed with no skip ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)). - `dispatch_chain_divergent_forward_edges_3d`, a fixture by @⁠WebIdentity1 (commit `e2db0c0`, test only). On a 2×3×2 grid, lanes return early, skip a piece, or run different numbers of loop iterations. The test checks whole and split outputs and guard words against a CPU model, for native wave32 and split wave64. **Tested** - Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, release, DXC 1.9.2609. - **Cold pipeline build** (fresh process, 16 threads, implicit caches off), against the whole program from `main`: | Program | Whole | Split | Pieces | Sum of pieces | Faster | |---|---|---|---|---|---| | ef008c0f | 14.38 s | 2.49 s | 10 | | 5.8× | | c3ae6819 | 23.29 s | 2.27 s | 14 | 20.8 s | 10.3× | | fb1c6d2d | 22.51 s | 2.23 s | 14 | 20.5 s | 10.1× | ef008c0f is this head's output; c3ae6819 and fb1c6d2d are from `413e0c0`, before the scratch layout change. The slowest piece sets each wall time. - **Output on the GPU, ef008c0f, two seeded inputs, 64 groups** (an early-exit path and the late shading path; a CPU trace of the second runs every piece of a 5-way split and 9 of 10 of a 10-way one): the whole and split forms each write 2048 words, 0 of them different, and match the expected 2048 texels. - **GPU time, ef008c0f:** at the card's steady P3 state (a compute-only load doesn't hold full clocks, and the clocks weren't locked; each form reproduces within 1% across two jobs, with all forms taking turns in one process), whole 112.5 µs and split 176.8 µs (1.57×) on the late shading path, whole 17.6 µs and split 36.3 µs (2.06×) on the early-exit path. That's over 1.5×: the handoff moves about 30 MB per dispatch on the shading path, and cutting it is follow-up work. Launch plus barrier is under 1 µs per piece. - **In the title** (120 s, `XCL_DIRECT_DXIL=1`, this change at `1444f61` plus a dispatch trace): 13 programs split into 54 pieces, and 74 chained dispatches ran, all after 70 s (the regression run below, on this head, has 117); exit 0, no device removal. Every compute program the trace saw was dispatched through plain Dispatch until 63.5 s; 33 later ones go through single-command ExecuteIndirect and so use the whole form. - **AMD RDNA4, measured by @⁠bielfreedom** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)), RX 9070 XT, Ryzen 7 7700, on `af2bd61`: across 17 split programs, the whole pipelines take 991 s to build and the pieces on 16 threads take 116 s (8.6×). Every build succeeds, and the two chain tests pass. Peak process memory was 11.7–13.4 GB with up to 16 pieces building at once. - **Linux, checked by @⁠Royalflamejlh** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)), CPU only, on `17a984b`: vkd3d-proton's dxil-spirv turns 4,125 of the 4,130 pieces (478 split programs) into SPIR-V that passes `spirv-val`. The other 5 hit its known crash (#1805) on loops that already crash it in the whole program. With #1860 merged in, all 4,130 convert. - **Checked by @⁠ettehn** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)) on `6c34370`, DXC 1.8.2502: a local compute record that gave 0 pieces before the typed-UAV fix gives 12, and the whole form and every piece pass the validator. With a test against an isolated disk cache, the chained request reads only its `.chain.pso` blob and the title's own blob stays a hit. With two workers, a helper's piece becomes wanted when the title waits for the chain, and does not without the inherited `BUILDING`. - `cargo test --release --offline --workspace -- --test-threads=4` on `413e0c0`: 1156 passed, 0 failed, 46 ignored, with 24 skip notices (no native wave64, three unsupported per-lane FP cases, no heap windows). On `af2bd61` the two new GPU tests pass: 96 wave32 and 192 split-wave64 output words match the unsplit form, 64-bit values and cross-half exchange included. On `17a984b` all three `dispatch_chain` tests pass. The new one splits into three pieces in each geometry, and its 384 and 768 words plus 16 guards match the CPU model in both the whole and split forms. - **In the title on an RTX 4090, run by @⁠Raghav314** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)): `main` `1a0bbe3` with `6c34370` merged, 300 s cold (no DXIL or driver blobs), `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1`. 33 programs split into 179 pieces, and 89 chained dispatches ran. The longest cold compute build was 7.9 s. No removal or crash. The world load still stops presenting at about 74 s: 47 of the 57 cold compute builds (146 s of driver time) came after the last present, one after another, so bounding each build doesn't remove that stop by itself. For reference, on another tree (#2057) on the same machine the longest was 12 s, with the same stop. - **Cold build on an RTX 3060, measured by @⁠pvfreis** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)), on `40d1b15` plus the typed-UAV fix, switch windows, 12 threads, driver caches off, median of 3: five programs split into 11–14 pieces each and every piece builds. Whole against all pieces built: ef008c0f 49.4 → 9.1 s, ab570963 41.6 → 5.3 s, 33743bd6 37.1 → 3.8 s, c3ae6819 80.9 → 14.5 s, fb1c6d2d 63.7 → 9.1 s (5.5–9.7×). Without the fix, all five are refused with `Flags must match usage`. - **AMD Radeon RX 9070, regression pair by @⁠Toons29** ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)), Ryzen 7 7800X3D, on `40d1b15` (this branch before the latest rebase), 60 s of a title on the default route: `main` `568e7db` 1566 frames and this PR 1632, peak commit 14592 / 14565 MB, no crash or device removal in either. - `cargo test --workspace -- --test-threads=4` (debug) on `6c34370`, rebased onto `main` `9633138`: 1246 passed, 2 failed, 46 ignored. The two failures, `device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` and `pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator`, fail on `main` `9633138` too; #2245 fixed both on `main` since. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows. **Regression run** The branch was rebased onto `main` `9633138`. The conflicts and what changed with them: the translated-cache identity in `pso.rs` (#2174's compact-nest tag kept, the split tag after it); #2064's container check, now also on the whole form and each piece of a cached chain; #2176 and #2178 in `pso_async.rs` (the queue here takes closures, so the spared-build resend and the orphan check moved into `enqueue`); and the test fixtures, which #2194's merging of straight-line blocks left with too few cut points, so they now branch on the lane index. `scripts/smoke.ps1 -Seconds 120`, the same retail title, one after the other on the machine under **Tested**, release builds from clean trees. `main` `9633138` (this PR's base): ``` xcl-smoke v1 commit: 963313835813f475037b3a9f5fcc3cb591696928 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 120 exit: 0x0 frames shown: 1323 (PresentX 1323) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 29175 MB ``` this PR, `6c34370`: ``` xcl-smoke v1 commit: 6c34370946dd11cdc429fdb106f49b798b63b443 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 120 exit: 0x0 frames shown: 1310 (PresentX 1310) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 29471 MB ``` PR vs `main`: 1310 / 1323 frames (99 %), peak commit 29471 / 29175 MB (101 %); device removals 0 and crashes 0 on the PR run, 0 and 0 on `main`. Both runs use `XCL_DIRECT_DXIL=1` and start with the same private XCL pipeline cache, holding only the pipeline list; the driver's own cache was left alone. The PR run logged `compute split: 29 programs split, 132 pieces built, 117 chained dispatches issued` at 120 s (0 by 60 s, all 117 by 70 s), and no `piece ... refused` warning. Before the rebase, `8eefdef` logged 25 programs, 117 pieces, 90 chains in the same setup; how far the title gets before it stops varies between runs. Both runs present no frames in their last 6 s, for a reason this change doesn't touch. **Not tested** - Peak memory when many pieces build at once on a machine with 16 GB of RAM or less. - AMD, native wave64 on hardware. - **Linux with vkd3d-proton 3.1 does not work with the split.** Its dxil-spirv crashes on most pieces: 3,754 of the title's 4,130 in @⁠Royalflamejlh's offline pass ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)), and in three of the new GPU tests (@⁠JoaoPauluu's report). dxil-spirv from vkd3d-proton `master` (`30b0eb9`) converts the same pieces as well as it converts the whole programs: 4,125 of 4,130, all valid, and the 5 failures are #1805's. The three tests that crash on 3.1 pass with it under Wine on an RTX 2060. Giving each piece a single return block doesn't fix 3.1 by itself (282 crashes and 1,152 invalid of the rest, in the same pass). Without `XCL_DIRECT_DXIL=1` only the enormous programs #2120 reroutes can split. - Output on real title inputs; c3ae6819 and fb1c6d2d on the GPU. - The full workspace suite on `af2bd61` (only the split module's tests ran there). - The split on the default route, for the enormous programs #2120 reroutes: the regression run uses `XCL_DIRECT_DXIL=1`. - Frame time with the split taken: in the title, the chains first run after presentation has already stopped, at about 64 s, for a separate reason. **Scope.** This PR splits wave32 programs and single-wave 64×1×1 wave64 programs without group shared memory or UAV atomics (only AND/OR atomics whose results are unused are allowed); everything else keeps the whole pipeline. ExecuteIndirect also uses the whole form. A follow-up PR is in progress for multi-wave wave64 groups (8×16 and 16×16), which covers the cascade-shadow programs: in the 120 s run, seven of them, 70–125k instructions each, are declined for their group shape alone and build one at a time for 11–26 s each. Group shared memory, atomics and ExecuteIndirect come after that. **AI use** OpenAI Codex (GPT-6) wrote the split pass, the runtime chain and the tests. Claude Code (Claude Opus 5.5) helpers ran the driver timings and GPU checks, and Claude Code wrote this description and opened the PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Keep control-flow cycles in one pipeline, pass edge-live values through per-dispatch scratch and compile the pieces on the PSO workers. Direct dispatch records the chain with UAV ordering. Indirect dispatch builds the whole form on demand.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The synthetic split fixture declared u2 twice with different coherence flags. Bind its existing memory window and validate the whole fixture before checking the cut.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adjacent lanes previously accessed ef008c0f's continuation data 1,612 bytes apart. Store the tag and each live dword in a separate lane-contiguous plane; transport both halves of i64 values through their own planes.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adopt WebIdentity1's fixture from #2080. Lanes return early, skip ahead
over a piece, or run different numbers of loop iterations. Check the
whole and split outputs against the CPU model and guard words on a
2 x 3 x 2 dispatch grid for native wave32 and split wave64.

Source: https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152187595
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <[email protected]>
Compile and validate a partitionable CFG through the native-wave64 admission gate. On a wave64 adapter, run the whole pipeline and check its lane count and output. Identify the existing compare(64) case as two hardware waves.

Assisted-by: OpenAI Codex (GPT-6)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:17:57 +00:00
github manually merged commit 6c34370946 into gh-pr/2080/base 2026-11-26 05:18:01 +00:00
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:43 UTC · original

PR #2080 — Arc A770 dispatch-chain parity

Tested revision

GitHub PR #2080 was open at af2bd61e39344b0db2f37f14d950c78e0022e7df before and after testing. git ls-remote --exit-code origin refs/pull/2080/head returned this SHA both times. The assigned checkout was clean and detached at that SHA for the build and tests. I read AGENTS.md and CONTRIBUTING.md and confirmed the files were identical at the tested revision.

The sole T3 thread returned for #2080 was this run. The public PR conversation showed the author's RTX 5070 Ti test of the same fixtures and no visible independent Arc report or JJAutoCompare comment. This run adds Intel hardware coverage.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0 (3acc79c0c), unoptimized test profile with debug info disabled. Both test processes reported DXC and DXIL 1.9.2609.5 (dxcompiler build 01b62ad4).
  • Prebuilt outside the GPU lock with cargo test --locked -p xcl --lib --no-run (exit 0, 44.24 s). Used CARGO_TARGET_DIR=L:/XclTooling/pr1512-tiling-edges-fddfa267/target, CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, and CARGO_PROFILE_TEST_DEBUG=0.
  • Ran powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File "L:/XclTooling/pr2080/pr2080-af2bd61-20261125T034112523Z/run-arc.ps1" with XCL_ADAPTER=A770, XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64, and both TEMP and TMP set to the run's temp subdirectory. The checked-in fixtures ran from the prebuilt binary, serially under the shared lock:
$exe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & $exe 'gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops' --exact --test-threads=1 --nocapture
    $wave32 = $LASTEXITCODE
    Write-Output "Wave32 test exit: $wave32"
    & $exe 'gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange' --exact --test-threads=1 --nocapture
    $wave64 = $LASTEXITCODE
    Write-Output "Split-wave64 test exit: $wave64"
    $global:LASTEXITCODE = if ($wave32) { $wave32 } else { $wave64 }
}
Fixture GPU dispatch and wave form Output parity Passed / failed / ignored / explicit skips
dispatch_chain_wave32_live_loops Dispatch(3,1,1) with 32×1×1 threads per group and one physical wave32 per group. One whole dispatch versus a chain of at least three dispatches with the same grid. 96 of 96 words matched 1 / 0 / 0 / 0
dispatch_chain_wave64_live_loops_and_exchange Dispatch(3,1,1) with 64×1×1 threads per group and two physical wave32 halves per logical wave64, including a cross-half exchange. One whole dispatch versus a chain of at least three dispatches with the same grid. 192 of 192 words matched 1 / 0 / 0 / 0

Both fixtures carry live per-lane values, including a packed 64-bit value, across the 16-loop program. The tests checked the whole dispatch against the fixture's independently computed expected vector and then compared the split chain's entire vector with the whole dispatch. Together, 288 words matched with zero differences. Each run filtered out 1,125 tests and exited 0. Total was 2 passed, 0 failed, 0 ignored, 0 explicit SKIPPED notices. The fixtures assert at least three pieces and emit no exact piece counts.

Not tested

Native wave64, other GPUs, other fixtures or configurations, full workspace suite, retail titles, main-vs-head smoke runs, production D3D12.X dispatch or ExecuteIndirect, and pipeline build or dispatch performance.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the existing tests, checked the results, and wrote this report.

Logs and evidence are in build.log, arc.log, run-arc.ps1, and postflight.json beside this report. Both the GPU lock and the exclusive Cargo target slot were released.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152189044) # PR #2080 — Arc A770 dispatch-chain parity **Tested revision** GitHub PR https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080 was open at `af2bd61e39344b0db2f37f14d950c78e0022e7df` before and after testing. `git ls-remote --exit-code origin refs/pull/2080/head` returned this SHA both times. The assigned checkout was clean and detached at that SHA for the build and tests. I read `AGENTS.md` and `CONTRIBUTING.md` and confirmed the files were identical at the tested revision. The sole T3 thread returned for #2080 was this run. The public PR conversation showed the author's RTX 5070 Ti test of the same fixtures and no visible independent Arc report or JJAutoCompare comment. This run adds Intel hardware coverage. **Tested** - STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 (26200.9974), AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175. Rust 1.100.0 (`0ef1bc386`, `x86_64-pc-windows-msvc`), Cargo 1.100.0 (`3acc79c0c`), unoptimized test profile with debug info disabled. Both test processes reported DXC and DXIL 1.9.2609.5 (`dxcompiler` build `01b62ad4`). - Prebuilt outside the GPU lock with `cargo test --locked -p xcl --lib --no-run` (exit 0, 44.24 s). Used `CARGO_TARGET_DIR=L:/XclTooling/pr1512-tiling-edges-fddfa267/target`, `CARGO_BUILD_JOBS=2`, `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, and `CARGO_PROFILE_TEST_DEBUG=0`. - Ran `powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File "L:/XclTooling/pr2080/pr2080-af2bd61-20261125T034112523Z/run-arc.ps1"` with `XCL_ADAPTER=A770`, `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`, and both `TEMP` and `TMP` set to the run's `temp` subdirectory. The checked-in fixtures ran from the prebuilt binary, serially under the shared lock: ```powershell $exe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $exe 'gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops' --exact --test-threads=1 --nocapture $wave32 = $LASTEXITCODE Write-Output "Wave32 test exit: $wave32" & $exe 'gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange' --exact --test-threads=1 --nocapture $wave64 = $LASTEXITCODE Write-Output "Split-wave64 test exit: $wave64" $global:LASTEXITCODE = if ($wave32) { $wave32 } else { $wave64 } } ``` | Fixture | GPU dispatch and wave form | Output parity | Passed / failed / ignored / explicit skips | | --- | --- | --- | --- | | `dispatch_chain_wave32_live_loops` | `Dispatch(3,1,1)` with 32×1×1 threads per group and one physical wave32 per group. One whole dispatch versus a chain of at least three dispatches with the same grid. | 96 of 96 words matched | 1 / 0 / 0 / 0 | | `dispatch_chain_wave64_live_loops_and_exchange` | `Dispatch(3,1,1)` with 64×1×1 threads per group and two physical wave32 halves per logical wave64, including a cross-half exchange. One whole dispatch versus a chain of at least three dispatches with the same grid. | 192 of 192 words matched | 1 / 0 / 0 / 0 | Both fixtures carry live per-lane values, including a packed 64-bit value, across the 16-loop program. The tests checked the whole dispatch against the fixture's independently computed expected vector and then compared the split chain's entire vector with the whole dispatch. Together, 288 words matched with zero differences. Each run filtered out 1,125 tests and exited 0. Total was 2 passed, 0 failed, 0 ignored, 0 explicit `SKIPPED` notices. The fixtures assert at least three pieces and emit no exact piece counts. **Not tested** Native wave64, other GPUs, other fixtures or configurations, full workspace suite, retail titles, main-vs-head smoke runs, production D3D12.X dispatch or ExecuteIndirect, and pipeline build or dispatch performance. **AI use** T3 Code / Codex (gpt-6.2-sol) ran the existing tests, checked the results, and wrote this report. Logs and evidence are in `build.log`, `arc.log`, `run-arc.ps1`, and `postflight.json` beside this report. Both the GPU lock and the exclusive Cargo target slot were released.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 03:46 UTC · original

Thanks, both.

@⁠JJAutoCompare: good to have the two chain tests passing on an Arc A770 (288 of 288 words). It's the first non-NVIDIA coverage for this.

@⁠WebIdentity1: those are the right cases to push on. Our seeded inputs for ef008c0f take one path per input, so forward edges that skip pieces and divergent early exits get less coverage there than in the unit tests. On the 3D grid: the scratch slot is indexed from the group ID as (z * height + y) * width + x, with width and height passed as root constants, so a non-1 Y or Z goes through that line. A failure there would show up as words crossing between groups.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 03:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152223476) Thanks, both. @⁠JJAutoCompare: good to have the two chain tests passing on an Arc A770 (288 of 288 words). It's the first non-NVIDIA coverage for this. @⁠WebIdentity1: those are the right cases to push on. Our seeded inputs for ef008c0f take one path per input, so forward edges that skip pieces and divergent early exits get less coverage there than in the unit tests. On the 3D grid: the scratch slot is indexed from the group ID as `(z * height + y) * width + x`, with width and height passed as root constants, so a non-1 Y or Z goes through that line. A failure there would show up as words crossing between groups. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Author
Owner

@⁠WebIdentity1 on GitHub · 2026-11-25 03:43 UTC · original · edited 2026-11-25 03:46 UTC

Native Ampere follow-up on af2bd61e39344b0db2f37f14d950c78e0022e7df: the two existing loop/exchange tests and a new divergent-forward-edge fixture pass. No runtime defect found in these cases. The attached test is offered for adoption; it adds coverage beyond the existing reconverging-loop fixtures.

Tested

  • Windows 10 Home 19045, Ryzen 7 7800X3D, NVIDIA RTX 3090 driver 591.74 / 32.0.15.9174, Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug. Actual adapter printed NVIDIA GeForce RTX 3090.
  • XCL_ADAPTER=3090, XCL_DIRECT_COMPACT=0; XCL_REQUIRE_GPU, XCL_DIRECT_DXIL, XCL_SPLIT_WAVE64 unset.
  • cargo test --locked -p xcl --lib -- gpu::dxil::module::split::tests::dispatch_chain --test-threads=1 --nocapture: 3 passed / 0 failed / 0 ignored; zero SKIPPED notices, exit 0. Recompiled in 34.09s; tests 0.41s. These are harness elapsed times, not shader-performance measurements.
  • Existing fixtures check 96 wave32 and 192 split-wave64 output words against the CPU model and split/whole forms, including live 64-bit values and cross-half exchange.
  • New fixture: lane classes exit immediately, skip loops1–8, execute all 16, or exit after loop 8. Inputs vary by lane/group, with lane-dependent loop trip counts. Grid (2,3,2) exercises all three scratch-index axes. It asserts a crossing edge skips at least one intermediate piece.
Group form Pieces Scratch dwords/group Output words checked per whole/split form Guards per form
32 threads, native wave32 3 192 384 16
64 threads, split wave64 3 384 768 16

Both whole and split results match the independently calculated expected values, including all guards. All 324 source hashes match before/after and the local source snapshot. Only the attached test differs from the author head.

Not tested: production D3D12.X chain allocation/lifetimes, ExecuteIndirect, AMD/native64, retail smoke or gameplay, full workspace suite, shader compilation/GPU throughput/memory cost. This uses synthetic DXIL and the runner, not console shader assets. New fixture has no cross-half exchange; that coverage comes from the author's existing test. The author already owns the multi-wave follow-up; this test doesn't cover or implement it.

AI use: Codex (GPT-6) inspected the change, wrote the new test, ran native Windows verification and prepared this report.

Portable test-only patch on af2bd61
diff --git a/crates/xcl/src/gpu/dxil/module/split.rs b/crates/xcl/src/gpu/dxil/module/split.rs
index c4cfe66..7af0f2a 100644
--- a/crates/xcl/src/gpu/dxil/module/split.rs
+++ b/crates/xcl/src/gpu/dxil/module/split.rs
@@ -613,4 +613,122 @@ mod tests {
 
     #[test]
     fn dispatch_chain_wave64_live_loops_and_exchange() { compare(64); }
+    /// Early exits and forward skips retain their own continuation tags; group
+    /// indexing must keep every lane separate across all three dispatch axes.
+    #[test]
+    fn dispatch_chain_divergent_forward_edges_3d() {
+        if !runner::wave32_supported().unwrap_or(false) {
+            runner::skip_test("no wave32 GPU");
+            return;
+        }
+        println!("CHAIN_GPU={}", runner::adapter().unwrap());
+        for threads in [32, 64] {
+            let geometry = [threads, 1, 1];
+            let split = threads == 64;
+            let cs = CsInterface { threads: geometry, ..Default::default() };
+            let options = KernelOptions { wave64: split, split, mem_windows: 1, sampler_base: 0 };
+            let mut lw = Lw::new(&[], &Default::default(), options, &Entry::Compute(cs));
+            let (tid, _) = lw.setup_lanes_compute(geometry, false);
+            let mem = lw.mems[0];
+            let [x, y, z] = [0, 1, 2].map(|axis| lw.s.group_id(axis));
+            let three = lw.c(3);
+            let row = lw.mul(z, three);
+            let row = lw.add(row, y);
+            let row = lw.shlc(row, 1);
+            let group = lw.add(row, x);
+            let count = lw.c(threads);
+            let base = lw.mul(group, count);
+            let index = lw.add(base, tid);
+            let offset = lw.shlc(index, 2);
+            let original = lw.s.raw_load(mem, offset, 1)[0];
+            let mode = lw.andc(tid, 3);
+            let trips = lw.addc(mode, 1);
+            let zero = lw.c(0);
+            let one = lw.c(1);
+            let i32 = lw.s.m.i32();
+            let early = lw.s.m.new_block();
+            let choose = lw.s.m.new_block();
+            let first = lw.s.m.new_block();
+            let middle = lw.s.m.new_block();
+            let second = lw.s.m.new_block();
+            let done = lw.s.m.new_block();
+            let exits = lw.cmp(Pred::Eq, mode, zero);
+            lw.s.m.cond_br(exits, early, choose);
+            lw.s.m.set_block(early);
+            let marker = lw.addc(index, 100_000);
+            lw.s.raw_store(mem, offset, &[marker]);
+            lw.s.m.ret();
+            lw.s.m.set_block(choose);
+            let skips = lw.cmp(Pred::Eq, mode, one);
+            lw.s.m.cond_br(skips, middle, first);
+            lw.s.m.set_block(first);
+            let mut value = original;
+            let mut middle_value = None;
+            for round in 1..=16 {
+                if round == 9 {
+                    let previous = lw.cur();
+                    lw.s.m.br(middle);
+                    lw.s.m.set_block(middle);
+                    let joined = lw.s.m.phi(i32);
+                    lw.s.m.add_incoming(joined, original, choose);
+                    lw.s.m.add_incoming(joined, value, previous);
+                    value = joined;
+                    middle_value = Some(joined);
+                    let stops = lw.cmp(Pred::Eq, mode, three);
+                    lw.s.m.cond_br(stops, done, second);
+                    lw.s.m.set_block(second);
+                }
+                let pred = lw.cur();
+                let body = lw.s.m.new_block();
+                let exit = lw.s.m.new_block();
+                lw.s.m.br(body);
+                lw.s.m.set_block(body);
+                let counter = lw.s.m.phi(i32);
+                let acc = lw.s.m.phi(i32);
+                lw.s.m.add_incoming(counter, zero, pred);
+                lw.s.m.add_incoming(acc, value, pred);
+                let next = lw.addc(counter, 1);
+                value = lw.add(acc, original);
+                value = lw.addc(value, round);
+                lw.s.m.add_incoming(counter, next, body);
+                lw.s.m.add_incoming(acc, value, body);
+                let again = lw.cmp(Pred::ULt, next, trips);
+                lw.s.m.cond_br(again, body, exit);
+                lw.s.m.set_block(exit);
+            }
+            let last = lw.cur();
+            lw.s.m.br(done);
+            lw.s.m.set_block(done);
+            let final_value = lw.s.m.phi(i32);
+            lw.s.m.add_incoming(final_value, middle_value.unwrap(), middle);
+            lw.s.m.add_incoming(final_value, value, last);
+            lw.s.raw_store(mem, offset, &[final_value]);
+            lw.s.m.ret();
+            lw.s.m.optimize();
+            let plan = lw.s.m.dispatch_plan(64).expect("partition branch fixture");
+            let stage = |b| plan.blocks.iter().position(|blocks| blocks.contains(&b)).unwrap();
+            assert!(plan.edges.iter().any(|edge| stage(edge.to) > stage(edge.from) + 1), "exercise a forward skip over an intermediate piece");
+            let chain = lw.s.split_compute(geometry, split.then_some(tid), 64).expect("split branch fixture");
+            assert!(chain.pieces.len() >= 3);
+            let whole = lw.s.finish_optimized(geometry, Some(32)).unwrap();
+            crate::gpu::dxil::validate::validate(&whole).expect("valid unsplit fixture");
+            let words = (threads * 12) as usize;
+            let initial: Vec<_> = (0..words + 16).map(|i| if i < words { i as u32 + 17 } else { 0xdeadbeef }).collect();
+            let expected: Vec<_> = initial.iter().enumerate().map(|(i, &v)| {
+                if i >= words { return v; }
+                match i as u32 % 4 {
+                    0 => 100_000 + i as u32,
+                    1 => v + 2 * (8 * v + 100),
+                    2 => v + 3 * (16 * v + 136),
+                    _ => v + 4 * (8 * v + 36),
+                }
+            }).collect();
+            let reference = runner::dispatch(&whole, [2, 3, 2], &[], &initial).unwrap();
+            assert_eq!(reference, expected, "unsplit {threads}");
+            let result = runner::dispatch_split(&chain, [2, 3, 2], &initial).unwrap();
+            assert_eq!(result, expected, "split {threads}");
+            println!("CHAIN_BRANCH threads={threads} pieces={} scratch_words_per_group={} checked_words={words} guards=16", chain.pieces.len(), chain.dwords_per_group);
+        }
+    }
+
 }
**@⁠WebIdentity1** on GitHub · 2026-11-25 03:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152187595) · edited 2026-11-25 03:46 UTC Native Ampere follow-up on `af2bd61e39344b0db2f37f14d950c78e0022e7df`: the two existing loop/exchange tests and a new divergent-forward-edge fixture pass. No runtime defect found in these cases. The attached test is offered for adoption; it adds coverage beyond the existing reconverging-loop fixtures. **Tested** - Windows 10 Home 19045, Ryzen 7 7800X3D, NVIDIA RTX 3090 driver 591.74 / 32.0.15.9174, Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug. Actual adapter printed NVIDIA GeForce RTX 3090. - `XCL_ADAPTER=3090`, `XCL_DIRECT_COMPACT=0`; `XCL_REQUIRE_GPU`, `XCL_DIRECT_DXIL`, `XCL_SPLIT_WAVE64` unset. - `cargo test --locked -p xcl --lib -- gpu::dxil::module::split::tests::dispatch_chain --test-threads=1 --nocapture`: **3 passed / 0 failed / 0 ignored; zero SKIPPED notices**, exit 0. Recompiled in 34.09s; tests 0.41s. These are harness elapsed times, not shader-performance measurements. - Existing fixtures check 96 wave32 and 192 split-wave64 output words against the CPU model and split/whole forms, including live 64-bit values and cross-half exchange. - New fixture: lane classes exit immediately, skip loops1–8, execute all 16, or exit after loop 8. Inputs vary by lane/group, with lane-dependent loop trip counts. Grid `(2,3,2)` exercises all three scratch-index axes. It asserts a crossing edge skips at least one intermediate piece. | Group form | Pieces | Scratch dwords/group | Output words checked per whole/split form | Guards per form | |---|---:|---:|---:|---:| |32 threads, native wave32|3|192|384|16| |64 threads, split wave64|3|384|768|16| Both whole and split results match the independently calculated expected values, including all guards. All 324 source hashes match before/after and the local source snapshot. Only the attached test differs from the author head. **Not tested:** production D3D12.X chain allocation/lifetimes, ExecuteIndirect, AMD/native64, retail smoke or gameplay, full workspace suite, shader compilation/GPU throughput/memory cost. This uses synthetic DXIL and the runner, not console shader assets. New fixture has no cross-half exchange; that coverage comes from the author's existing test. The author already owns the multi-wave follow-up; this test doesn't cover or implement it. **AI use:** Codex (GPT-6) inspected the change, wrote the new test, ran native Windows verification and prepared this report. <details> <summary>Portable test-only patch on af2bd61</summary> ```diff diff --git a/crates/xcl/src/gpu/dxil/module/split.rs b/crates/xcl/src/gpu/dxil/module/split.rs index c4cfe66..7af0f2a 100644 --- a/crates/xcl/src/gpu/dxil/module/split.rs +++ b/crates/xcl/src/gpu/dxil/module/split.rs @@ -613,4 +613,122 @@ mod tests { #[test] fn dispatch_chain_wave64_live_loops_and_exchange() { compare(64); } + /// Early exits and forward skips retain their own continuation tags; group + /// indexing must keep every lane separate across all three dispatch axes. + #[test] + fn dispatch_chain_divergent_forward_edges_3d() { + if !runner::wave32_supported().unwrap_or(false) { + runner::skip_test("no wave32 GPU"); + return; + } + println!("CHAIN_GPU={}", runner::adapter().unwrap()); + for threads in [32, 64] { + let geometry = [threads, 1, 1]; + let split = threads == 64; + let cs = CsInterface { threads: geometry, ..Default::default() }; + let options = KernelOptions { wave64: split, split, mem_windows: 1, sampler_base: 0 }; + let mut lw = Lw::new(&[], &Default::default(), options, &Entry::Compute(cs)); + let (tid, _) = lw.setup_lanes_compute(geometry, false); + let mem = lw.mems[0]; + let [x, y, z] = [0, 1, 2].map(|axis| lw.s.group_id(axis)); + let three = lw.c(3); + let row = lw.mul(z, three); + let row = lw.add(row, y); + let row = lw.shlc(row, 1); + let group = lw.add(row, x); + let count = lw.c(threads); + let base = lw.mul(group, count); + let index = lw.add(base, tid); + let offset = lw.shlc(index, 2); + let original = lw.s.raw_load(mem, offset, 1)[0]; + let mode = lw.andc(tid, 3); + let trips = lw.addc(mode, 1); + let zero = lw.c(0); + let one = lw.c(1); + let i32 = lw.s.m.i32(); + let early = lw.s.m.new_block(); + let choose = lw.s.m.new_block(); + let first = lw.s.m.new_block(); + let middle = lw.s.m.new_block(); + let second = lw.s.m.new_block(); + let done = lw.s.m.new_block(); + let exits = lw.cmp(Pred::Eq, mode, zero); + lw.s.m.cond_br(exits, early, choose); + lw.s.m.set_block(early); + let marker = lw.addc(index, 100_000); + lw.s.raw_store(mem, offset, &[marker]); + lw.s.m.ret(); + lw.s.m.set_block(choose); + let skips = lw.cmp(Pred::Eq, mode, one); + lw.s.m.cond_br(skips, middle, first); + lw.s.m.set_block(first); + let mut value = original; + let mut middle_value = None; + for round in 1..=16 { + if round == 9 { + let previous = lw.cur(); + lw.s.m.br(middle); + lw.s.m.set_block(middle); + let joined = lw.s.m.phi(i32); + lw.s.m.add_incoming(joined, original, choose); + lw.s.m.add_incoming(joined, value, previous); + value = joined; + middle_value = Some(joined); + let stops = lw.cmp(Pred::Eq, mode, three); + lw.s.m.cond_br(stops, done, second); + lw.s.m.set_block(second); + } + let pred = lw.cur(); + let body = lw.s.m.new_block(); + let exit = lw.s.m.new_block(); + lw.s.m.br(body); + lw.s.m.set_block(body); + let counter = lw.s.m.phi(i32); + let acc = lw.s.m.phi(i32); + lw.s.m.add_incoming(counter, zero, pred); + lw.s.m.add_incoming(acc, value, pred); + let next = lw.addc(counter, 1); + value = lw.add(acc, original); + value = lw.addc(value, round); + lw.s.m.add_incoming(counter, next, body); + lw.s.m.add_incoming(acc, value, body); + let again = lw.cmp(Pred::ULt, next, trips); + lw.s.m.cond_br(again, body, exit); + lw.s.m.set_block(exit); + } + let last = lw.cur(); + lw.s.m.br(done); + lw.s.m.set_block(done); + let final_value = lw.s.m.phi(i32); + lw.s.m.add_incoming(final_value, middle_value.unwrap(), middle); + lw.s.m.add_incoming(final_value, value, last); + lw.s.raw_store(mem, offset, &[final_value]); + lw.s.m.ret(); + lw.s.m.optimize(); + let plan = lw.s.m.dispatch_plan(64).expect("partition branch fixture"); + let stage = |b| plan.blocks.iter().position(|blocks| blocks.contains(&b)).unwrap(); + assert!(plan.edges.iter().any(|edge| stage(edge.to) > stage(edge.from) + 1), "exercise a forward skip over an intermediate piece"); + let chain = lw.s.split_compute(geometry, split.then_some(tid), 64).expect("split branch fixture"); + assert!(chain.pieces.len() >= 3); + let whole = lw.s.finish_optimized(geometry, Some(32)).unwrap(); + crate::gpu::dxil::validate::validate(&whole).expect("valid unsplit fixture"); + let words = (threads * 12) as usize; + let initial: Vec<_> = (0..words + 16).map(|i| if i < words { i as u32 + 17 } else { 0xdeadbeef }).collect(); + let expected: Vec<_> = initial.iter().enumerate().map(|(i, &v)| { + if i >= words { return v; } + match i as u32 % 4 { + 0 => 100_000 + i as u32, + 1 => v + 2 * (8 * v + 100), + 2 => v + 3 * (16 * v + 136), + _ => v + 4 * (8 * v + 36), + } + }).collect(); + let reference = runner::dispatch(&whole, [2, 3, 2], &[], &initial).unwrap(); + assert_eq!(reference, expected, "unsplit {threads}"); + let result = runner::dispatch_split(&chain, [2, 3, 2], &initial).unwrap(); + assert_eq!(result, expected, "split {threads}"); + println!("CHAIN_BRANCH threads={threads} pieces={} scratch_words_per_group={} checked_words={words} guards=16", chain.pieces.len(), chain.dwords_per_group); + } + } + } ``` </details>
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 03:59 UTC · original

@⁠WebIdentity1 thanks, your fixture is now in the PR as 17a984b8 (test-only, split.rs test module, with you as co-author). dispatch_chain_divergent_forward_edges_3d covers lanes that return early, skip a piece, or run different loop counts on a 2×3×2 grid, for native wave32 and split wave64. On an RTX 5070 Ti (NVIDIA 610.74, DXC 1.9.2609) all three dispatch_chain tests pass. Your new test splits into three pieces in each geometry, and its 384 and 768 output words plus 16 guard words match the CPU model in both the whole and split forms.

The description check will fail until I add a regression run made on this head. That run is queued.

AI use: Claude Code (Claude Opus 5.5) and Codex helpers adapted the fixture and ran the tests, and Claude Code wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 03:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152428289) @⁠WebIdentity1 thanks, your fixture is now in the PR as 17a984b8 (test-only, `split.rs` test module, with you as co-author). `dispatch_chain_divergent_forward_edges_3d` covers lanes that return early, skip a piece, or run different loop counts on a 2×3×2 grid, for native wave32 and split wave64. On an RTX 5070 Ti (NVIDIA 610.74, DXC 1.9.2609) all three `dispatch_chain` tests pass. Your new test splits into three pieces in each geometry, and its 384 and 768 output words plus 16 guard words match the CPU model in both the whole and split forms. The description check will fail until I add a regression run made on this head. That run is queued. AI use: Claude Code (Claude Opus 5.5) and Codex helpers adapted the fixture and ran the tests, and Claude Code wrote this comment.
Author
Owner

@⁠bielfreedom on GitHub · 2026-11-25 04:09 UTC · original

AMD RDNA4 data for #2080: the AMD driver builds the split form 8.6× faster. Across 17 split programs, building the whole pipelines takes 991 s; the pieces on 16 threads take 116 s. Even the plain sum of the pieces' build times is 15 % below the whole build. Every build succeeded, and both of the PR's chain tests pass.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4), AMD driver 32.0.32029.2010.
  • CPU and memory: Ryzen 7 7700 (8 cores, 16 threads), 32 GB RAM, Windows 11. DXC 1.8.2502.11.
  • Build: head af2bd61, release.
  • A local patch for measurement only (not for this PR): in xcl shaders --precompile --pipelines, a program that has a dispatch_chain gets its whole DXIL built with abi_root_signature_with. Then its pieces are built with dispatch_chain_root_signature, on up to 16 threads. Every CreateComputePipelineState is timed.

Method

  • XCL_DIRECT_DXIL=1, default XCL_DIRECT_SPLIT_INSTRUCTIONS (12,500), XCL_HEAP_WINDOWS=0, 4 windows.
  • XCL_PSO_DISK_CACHE=0. A fresh exe name per round, because the AMD driver's own cache is keyed on the exe's file name (A26). One program at a time; 2 rounds.
  • Census with this head: 462 of 2,689 retail compute programs get a dispatch chain, in 2 to 14 pieces (98 with 2 pieces; 302 with 10–12).
  • I measured 17 of them: 12 spread evenly by size, plus the largest. Also three that the direct route without splitting made about 2× slower than HLSL on this card (#1809 data).

Results (mean of 2 rounds; all 2 × 17 whole builds and all 2 × 162 piece builds succeeded)

direct DXIL pieces whole split, 16 threads (wall) faster sum of pieces slowest piece
108 KB 2 1.3 s 0.9 s 1.45× 1.3 s 0.9 s
133 KB 2 2.1 s 1.4 s 1.46× 2.4 s 1.4 s
166 KB 2 2.4 s 1.2 s 1.94× 2.3 s 1.2 s
786 KB 9 26.9 s 6.7 s 4.0× 38.5 s 6.7 s
792 KB 10 54.4 s 6.4 s 8.6× 37.6 s 6.4 s
830 KB 10 62.4 s 7.9 s 7.9× 48.1 s 7.9 s
845 KB 10 63.4 s 6.8 s 9.3× 42.3 s 6.8 s
917 KB 10 70.6 s 9.5 s 7.5× 74.0 s 9.5 s
918 KB 10 70.7 s 9.4 s 7.5× 75.6 s 9.4 s
959 KB 12 96.6 s 6.1 s 15.7× 52.4 s 6.1 s
1005 KB 11 86.0 s 8.0 s 10.7× 58.6 s 8.0 s
1014 KB 11 107.9 s 7.2 s 15.0× 58.9 s 7.2 s
1016 KB 12 93.4 s 7.8 s 12.0× 68.5 s 7.8 s
1036 KB 12 58.4 s 10.3 s 5.7× 70.3 s 10.3 s
1071 KB 12 54.6 s 11.1 s 4.9× 76.5 s 11.1 s
1201 KB 13 58.8 s 6.8 s 8.7× 63.1 s 6.8 s
1299 KB 14 81.6 s 8.0 s 10.2× 75.4 s 8.0 s
total 991 s 116 s 8.6× 846 s
  • The 792, 830 and 917 KB rows are the three programs that the direct route without splitting made about 2× slower than HLSL on this card. Split, they build in 6–10 s, against 54–71 s whole here and 18–22 s on the HLSL path in my #1809 run (a different base, 8e87fc7).
  • Memory: peak private bytes of the process were 11.7 and 13.4 GB in the two rounds. That is while up to 16 pieces build at once, after a whole build of up to ~1.3 MB.
  • Wall times are the slowest piece plus scheduling: with 9–14 pieces on 16 threads, every piece runs at once.

GPU tests on this card

  • cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1 with XCL_REQUIRE_GPU=1: 2 passed, 0 failed. The tests are dispatch_chain_wave32_live_loops and dispatch_chain_wave64_live_loops_and_exchange.
  • Note: compare(64) sets split = threads == 64 and always builds the split-wave64 form. So on AMD it does not exercise a native wave64 ([WaveSize(64)]) chain, even though this card has one. The 462 census programs were translated without the split form here (split false on this adapter), so native wave64 chains do occur on AMD. They have no GPU test yet. A compare variant with split: false on a wave64-capable adapter would cover it.

Read / inference

  • On RDNA4 the AMD compiler responds even more strongly than NVIDIA to the cut. The per-program wall gains, 4–16× above ~780 KB, match or beat the 5.8–10.3× in the description.
  • Unlike NVIDIA (sum of pieces about 90 % of whole), the AMD sum of pieces is 85 % of whole. Even one PSO worker gains a little; the large gain needs several workers.
  • With split on, the direct route goes from slower than HLSL on large programs on AMD to much faster.
  • The 16-way build roughly triples peak memory compared with one whole build. On 16 GB machines the PSO worker count may matter more than the piece size.

Not tested

  • Dispatch output of split retail programs on AMD (only the two synthetic chain tests ran).
  • Native wave64 chains on the GPU.
  • A title run.
  • GPU time per dispatch.
  • RDNA2 and RDNA3.

AI use: Claude Code (Claude Opus 5.5) wrote the local timing patch, ran the census, timings and tests, and drafted this. Counts and timings only, no game data.

**@⁠bielfreedom** on GitHub · 2026-11-25 04:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152588976) **AMD RDNA4 data for #2080: the AMD driver builds the split form 8.6× faster.** Across 17 split programs, building the whole pipelines takes 991 s; the pieces on 16 threads take 116 s. Even the plain sum of the pieces' build times is 15 % below the whole build. Every build succeeded, and both of the PR's chain tests pass. **Setup** - GPU: RX 9070 XT 16 GB (RDNA4), AMD driver 32.0.32029.2010. - CPU and memory: Ryzen 7 7700 (8 cores, 16 threads), 32 GB RAM, Windows 11. DXC 1.8.2502.11. - Build: head `af2bd61`, release. - A local patch for measurement only (not for this PR): in `xcl shaders --precompile --pipelines`, a program that has a `dispatch_chain` gets its whole DXIL built with `abi_root_signature_with`. Then its pieces are built with `dispatch_chain_root_signature`, on up to 16 threads. Every `CreateComputePipelineState` is timed. **Method** - `XCL_DIRECT_DXIL=1`, default `XCL_DIRECT_SPLIT_INSTRUCTIONS` (12,500), `XCL_HEAP_WINDOWS=0`, 4 windows. - `XCL_PSO_DISK_CACHE=0`. A fresh exe name per round, because the AMD driver's own cache is keyed on the exe's file name ([A26](https://git.gtahub.st/github/xcl-dev--xcl/issues/1269)). One program at a time; 2 rounds. - Census with this head: **462 of 2,689** retail compute programs get a dispatch chain, in 2 to 14 pieces (98 with 2 pieces; 302 with 10–12). - I measured 17 of them: 12 spread evenly by size, plus the largest. Also three that the direct route without splitting made about 2× slower than HLSL on this card ([#1809 data](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1809)). **Results** (mean of 2 rounds; all 2 × 17 whole builds and all 2 × 162 piece builds succeeded) | direct DXIL | pieces | whole | split, 16 threads (wall) | faster | sum of pieces | slowest piece | |---:|---:|---:|---:|---:|---:|---:| | 108 KB | 2 | 1.3 s | 0.9 s | 1.45× | 1.3 s | 0.9 s | | 133 KB | 2 | 2.1 s | 1.4 s | 1.46× | 2.4 s | 1.4 s | | 166 KB | 2 | 2.4 s | 1.2 s | 1.94× | 2.3 s | 1.2 s | | 786 KB | 9 | 26.9 s | 6.7 s | 4.0× | 38.5 s | 6.7 s | | 792 KB | 10 | 54.4 s | 6.4 s | 8.6× | 37.6 s | 6.4 s | | 830 KB | 10 | 62.4 s | 7.9 s | 7.9× | 48.1 s | 7.9 s | | 845 KB | 10 | 63.4 s | 6.8 s | 9.3× | 42.3 s | 6.8 s | | 917 KB | 10 | 70.6 s | 9.5 s | 7.5× | 74.0 s | 9.5 s | | 918 KB | 10 | 70.7 s | 9.4 s | 7.5× | 75.6 s | 9.4 s | | 959 KB | 12 | 96.6 s | 6.1 s | 15.7× | 52.4 s | 6.1 s | | 1005 KB | 11 | 86.0 s | 8.0 s | 10.7× | 58.6 s | 8.0 s | | 1014 KB | 11 | 107.9 s | 7.2 s | 15.0× | 58.9 s | 7.2 s | | 1016 KB | 12 | 93.4 s | 7.8 s | 12.0× | 68.5 s | 7.8 s | | 1036 KB | 12 | 58.4 s | 10.3 s | 5.7× | 70.3 s | 10.3 s | | 1071 KB | 12 | 54.6 s | 11.1 s | 4.9× | 76.5 s | 11.1 s | | 1201 KB | 13 | 58.8 s | 6.8 s | 8.7× | 63.1 s | 6.8 s | | 1299 KB | 14 | 81.6 s | 8.0 s | 10.2× | 75.4 s | 8.0 s | | **total** | | **991 s** | **116 s** | **8.6×** | **846 s** | | - The 792, 830 and 917 KB rows are the three programs that the direct route without splitting made about 2× slower than HLSL on this card. Split, they build in 6–10 s, against 54–71 s whole here and 18–22 s on the HLSL path in my #1809 run (a different base, `8e87fc7`). - **Memory:** peak private bytes of the process were 11.7 and 13.4 GB in the two rounds. That is while up to 16 pieces build at once, after a whole build of up to ~1.3 MB. - Wall times are the slowest piece plus scheduling: with 9–14 pieces on 16 threads, every piece runs at once. **GPU tests on this card** - `cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1` with `XCL_REQUIRE_GPU=1`: **2 passed, 0 failed**. The tests are `dispatch_chain_wave32_live_loops` and `dispatch_chain_wave64_live_loops_and_exchange`. - Note: `compare(64)` sets `split = threads == 64` and always builds the split-wave64 form. So on AMD it does not exercise a native wave64 (`[WaveSize(64)]`) chain, even though this card has one. The 462 census programs were translated without the split form here (`split false` on this adapter), so native wave64 chains do occur on AMD. They have no GPU test yet. A `compare` variant with `split: false` on a wave64-capable adapter would cover it. **Read / inference** - On RDNA4 the AMD compiler responds even more strongly than NVIDIA to the cut. The per-program wall gains, 4–16× above ~780 KB, match or beat the 5.8–10.3× in the description. - Unlike NVIDIA (sum of pieces about 90 % of whole), the AMD sum of pieces is 85 % of whole. Even one PSO worker gains a little; the large gain needs several workers. - With split on, the direct route goes from slower than HLSL on large programs on AMD to much faster. - The 16-way build roughly triples peak memory compared with one whole build. On 16 GB machines the PSO worker count may matter more than the piece size. **Not tested** - Dispatch output of split retail programs on AMD (only the two synthetic chain tests ran). - Native wave64 chains on the GPU. - A title run. - GPU time per dispatch. - RDNA2 and RDNA3. AI use: Claude Code (Claude Opus 5.5) wrote the local timing patch, ran the census, timings and tests, and drafted this. Counts and timings only, no game data.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:13 UTC · original

@⁠bielfreedom thanks, this is very useful: 8.6× on RDNA4 (991 → 116 s over 17 programs), with every build succeeding, is better than what I measured on NVIDIA. I'll add the three programs that build 2× slower than HLSL whole, and the memory peak, to the description.

Good catch on compare(64). It always builds the split-wave64 form, so a native [WaveSize(64)] chain has no GPU test. I'm adding a variant with split: false that runs only on an adapter with native wave64 and skips with a notice otherwise (so it skips on my 5070 Ti). Once it's pushed, could you run it on the 9070 XT?

On memory: 11.7–13.4 GB peak with 16 pieces building at once is a lot for a 16 GB machine. The PSO worker count and #2098's admission check for large builds (3 GiB of free commit per build) should bound it, but I haven't measured that on a small machine. I'll list it under Not tested.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152646885) @⁠bielfreedom thanks, this is very useful: 8.6× on RDNA4 (991 → 116 s over 17 programs), with every build succeeding, is better than what I measured on NVIDIA. I'll add the three programs that build 2× slower than HLSL whole, and the memory peak, to the description. Good catch on `compare(64)`. It always builds the split-wave64 form, so a native `[WaveSize(64)]` chain has no GPU test. I'm adding a variant with `split: false` that runs only on an adapter with native wave64 and skips with a notice otherwise (so it skips on my 5070 Ti). Once it's pushed, could you run it on the 9070 XT? On memory: 11.7–13.4 GB peak with 16 pieces building at once is a lot for a 16 GB machine. The PSO worker count and #2098's admission check for large builds (3 GiB of free commit per build) should bound it, but I haven't measured that on a small machine. I'll list it under Not tested. AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:14 UTC · original

@⁠bielfreedom correction to my reply above: I checked, and a native wave64 chain can't happen on this head. A dispatch chain is built only when the hardware wave is 32 (kernel.rs, hw == 32), and every piece is signed WaveSize(32). So on an adapter with native wave64, a wave64 program keeps its whole pipeline, and the chains in your census are the programs that run as wave32 there. What's missing is a test that proves native wave64 stays whole, so I'm adding that instead of a positive native-wave64 chain test. Splitting native wave64 programs would be a separate change.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152660710) @⁠bielfreedom correction to my reply above: I checked, and a native wave64 chain can't happen on this head. A dispatch chain is built only when the hardware wave is 32 (`kernel.rs`, `hw == 32`), and every piece is signed `WaveSize(32)`. So on an adapter with native wave64, a wave64 program keeps its whole pipeline, and the chains in your census are the programs that run as wave32 there. What's missing is a test that proves native wave64 stays whole, so I'm adding that instead of a positive native-wave64 chain test. Splitting native wave64 programs would be a separate change. AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠bielfreedom on GitHub · 2026-11-25 04:18 UTC · original

@⁠Kalmarv thanks for checking. That fits the census: on this adapter the 462 programs with a chain are the ones that run as wave32, and the native wave64 ones stay whole. "Native wave64 chains" in my Not tested list doesn't apply on this head.

17a984b on the RX 9070 XT (RDNA4, AMD driver 32.0.32029.2010, Windows 11, release, XCL_ADAPTER=9070, XCL_REQUIRE_GPU=1):

cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1 --nocapture gave 3 passed, 0 failed, 0 skipped:

  • dispatch_chain_divergent_forward_edges_3d passed. Its output:
    • CHAIN_GPU=AMD Radeon RX 9070 XT
    • CHAIN_BRANCH threads=32 pieces=3 scratch_words_per_group=192 checked_words=384 guards=16
    • CHAIN_BRANCH threads=64 pieces=3 scratch_words_per_group=384 checked_words=768 guards=16
  • dispatch_chain_wave32_live_loops passed.
  • dispatch_chain_wave64_live_loops_and_exchange passed.

I'll run the test that checks native wave64 stays whole on this card as soon as it's pushed.

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

**@⁠bielfreedom** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152719389) @⁠Kalmarv thanks for checking. That fits the census: on this adapter the 462 programs with a chain are the ones that run as wave32, and the native wave64 ones stay whole. "Native wave64 chains" in my Not tested list doesn't apply on this head. **`17a984b` on the RX 9070 XT** (RDNA4, AMD driver 32.0.32029.2010, Windows 11, release, `XCL_ADAPTER=9070`, `XCL_REQUIRE_GPU=1`): `cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1 --nocapture` gave **3 passed, 0 failed, 0 skipped**: - `dispatch_chain_divergent_forward_edges_3d` passed. Its output: - `CHAIN_GPU=AMD Radeon RX 9070 XT` - `CHAIN_BRANCH threads=32 pieces=3 scratch_words_per_group=192 checked_words=384 guards=16` - `CHAIN_BRANCH threads=64 pieces=3 scratch_words_per_group=384 checked_words=768 guards=16` - `dispatch_chain_wave32_live_loops` passed. - `dispatch_chain_wave64_live_loops_and_exchange` passed. I'll run the test that checks native wave64 stays whole on this card as soon as it's pushed. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 04:18 UTC · original

Kalmarv, I used PortBridge to investigate the scratch-traffic follow-up on 17a984b8. Two independent candidates gave different results.

Grouping four dwords reduced the generated producer/consumer's raw memory operations from 39 to 11, without changing bytes or median GPU time. Keeping a fixed slot for first-piece scalars live on every crossing edge removed actual repeated word transfers. Later pieces only load such a word if an original instruction uses it. The tag, dispatch ordering and maximum scratch size stay the same.

Across four RTX 4070 Ti SUPER processes on a generated three-dispatch chain, the larger grid moved from 47.104 to 32.768 µs and was faster in 31/32 paired trials. Each arm matched the expected digest for every lane and seed. The middle piece avoided 16 loads and 16 stores per lane that took it. An independent graph model covered skips, early exits and i64 words, including zero savings when no value qualifies.

Source patch, exact extracted slot tests and both sets of raw timings. The GPU result uses authored synthetic shaders on physical wave32, including a two-wave workgroup. I have not measured the amount retained or GPU time on your actual example, or built all of XCL with the candidate. Early measurement on the real split plan would determine whether this narrow first-piece intersection is large enough. AI-assisted PortBridge engineering (OpenAI Codex).

**@⁠akimfomin** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152730206) Kalmarv, I used [PortBridge](https://github.com/akimfomin/PortBridge) to investigate the scratch-traffic follow-up on `17a984b8`. Two independent candidates gave different results. Grouping four dwords reduced the generated producer/consumer's raw memory operations from 39 to 11, without changing bytes or median GPU time. Keeping a fixed slot for first-piece scalars live on **every** crossing edge removed actual repeated word transfers. Later pieces only load such a word if an original instruction uses it. The tag, dispatch ordering and maximum scratch size stay the same. Across four RTX 4070 Ti SUPER processes on a generated three-dispatch chain, the larger grid moved from 47.104 to 32.768 µs and was faster in 31/32 paired trials. Each arm matched the expected digest for every lane and seed. The middle piece avoided 16 loads and 16 stores per lane that took it. An independent graph model covered skips, early exits and i64 words, including zero savings when no value qualifies. [Source patch, exact extracted slot tests and both sets of raw timings](https://github.com/akimfomin/PortBridge/blob/3eb42e56893e3f5a1931e928919b68078cbb7de4/research/xcl-dxil-night/scratch-transport/portbridge-xcl-scratch-tiles/README.md). The GPU result uses authored synthetic shaders on physical wave32, including a two-wave workgroup. I have not measured the amount retained or GPU time on your actual example, or built all of XCL with the candidate. Early measurement on the real split plan would determine whether this narrow first-piece intersection is large enough. AI-assisted PortBridge engineering (OpenAI Codex).
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:20 UTC · original

@⁠akimfomin thanks, this goes after the right cost. The handoff is what keeps the split's GPU time at 1.57× the whole program on ef008c0f's late shading path, where each lane moves 1,866 dwords each way. 47 → 33 µs on the three-dispatch chain, with digests matching, is a good sign. I agree the next question is how much the real plans carry through a piece that doesn't use the value.

I'm counting that now on the real split plans for ef008c0f, c3ae6819, fb1c6d2d and the rest of the 81 programs. For each chain I compare the dwords per lane stored today with two alternatives: store each value once at the cut where it's defined and load it only in the pieces that use it, and your narrower first-piece version. I'll post the numbers here. If the saving is large, I'd do it as a follow-up PR after this one rather than grow #2080.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152751075) @⁠akimfomin thanks, this goes after the right cost. The handoff is what keeps the split's GPU time at 1.57× the whole program on ef008c0f's late shading path, where each lane moves 1,866 dwords each way. 47 → 33 µs on the three-dispatch chain, with digests matching, is a good sign. I agree the next question is how much the real plans carry through a piece that doesn't use the value. I'm counting that now on the real split plans for ef008c0f, c3ae6819, fb1c6d2d and the rest of the 81 programs. For each chain I compare the dwords per lane stored today with two alternatives: store each value once at the cut where it's defined and load it only in the pieces that use it, and your narrower first-piece version. I'll post the numbers here. If the saving is large, I'd do it as a follow-up PR after this one rather than grow #2080. AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:23 UTC · original

@⁠bielfreedom thanks for the RDNA4 run of 17a984b. The test that checks native wave64 stays whole is pushed as 12cd2fa (test only): dispatch_chain_native_wave64_builds_whole in kernel.rs. On the 5070 Ti it compiles, builds no chain and passes the validator, and it skips the GPU part with "no wave64". So your card is the first one that runs it.

AI use: Claude Code (Claude Opus 5.5) wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152804342) @⁠bielfreedom thanks for the RDNA4 run of `17a984b`. The test that checks native wave64 stays whole is pushed as `12cd2fa` (test only): `dispatch_chain_native_wave64_builds_whole` in `kernel.rs`. On the 5070 Ti it compiles, builds no chain and passes the validator, and it skips the GPU part with "no wave64". So your card is the first one that runs it. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:26 UTC · original

@⁠akimfomin the counts on the real split plans, as promised. These are static sums over crossing edges, dwords per lane, stores / loads, not traffic weighted by the path taken:

Plan Today Store once on the defining piece's exits, restore only where an original use is reached Saved
ef008c0f 8,998 / 8,998 3,720 / 5,592 48 %
c3ae6819 10,929 / 10,929 4,257 / 6,429 51 %
fb1c6d2d 11,386 / 11,386 4,408 / 6,763 51 %
all 25 split programs of the 81 124,453 / 124,453 63,676 / 87,583 39 %

If each value could be written once and read once per piece that uses it, the bound is 79 % (ef008c0f: 81 %). The narrow version, a first-piece value live on every crossing edge, finds no words in any of the 25 plans. So the general form is the one worth building.

Separately, the same handoff turns out to matter for build time too. In one 18k-instruction ef008c0f piece, 38 % of the values the driver has to keep live across blocks are handoff values restored at the piece's entry and first used 8 or more blocks later. So I'm prototyping one change: a fixed slot per value, written once, and loaded where it's used. I'll measure both build time and GPU time, and it'll be a follow-up PR after #2080. The counting is our own; I haven't used your patch.

AI use: Claude Code (Claude Opus 5.5) and Codex helpers made the counts, and Claude Code wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152849712) @⁠akimfomin the counts on the real split plans, as promised. These are static sums over crossing edges, dwords per lane, stores / loads, not traffic weighted by the path taken: | Plan | Today | Store once on the defining piece's exits, restore only where an original use is reached | Saved | |---|---|---|---| | ef008c0f | 8,998 / 8,998 | 3,720 / 5,592 | 48 % | | c3ae6819 | 10,929 / 10,929 | 4,257 / 6,429 | 51 % | | fb1c6d2d | 11,386 / 11,386 | 4,408 / 6,763 | 51 % | | all 25 split programs of the 81 | 124,453 / 124,453 | 63,676 / 87,583 | 39 % | If each value could be written once and read once per piece that uses it, the bound is 79 % (ef008c0f: 81 %). The narrow version, a first-piece value live on every crossing edge, finds no words in any of the 25 plans. So the general form is the one worth building. Separately, the same handoff turns out to matter for build time too. In one 18k-instruction ef008c0f piece, 38 % of the values the driver has to keep live across blocks are handoff values restored at the piece's entry and first used 8 or more blocks later. So I'm prototyping one change: a fixed slot per value, written once, and loaded where it's used. I'll measure both build time and GPU time, and it'll be a follow-up PR after #2080. The counting is our own; I haven't used your patch. AI use: Claude Code (Claude Opus 5.5) and Codex helpers made the counts, and Claude Code wrote this.
Author
Owner

@⁠bielfreedom on GitHub · 2026-11-25 04:27 UTC · original

@⁠Kalmarv 12cd2fa on the RX 9070 XT (RDNA4, native wave64, AMD driver 32.0.32029.2010, Windows 11, release, XCL_ADAPTER=9070, XCL_REQUIRE_GPU=1):

  • dispatch_chain_native_wave64_builds_whole passed, with no SKIPPED notice:
    • dispatch_plan(64) is Some;
    • dispatch_chain is None;
    • the whole pipeline's GPU dispatch ran on native wave64 and matched expected.
      It ran both inside the dispatch_chain filter and alone, by exact name.
  • cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1 --nocapture gave 4 passed, 0 failed, 0 skipped:
    • dispatch_chain_native_wave64_builds_whole;
    • dispatch_chain_divergent_forward_edges_3d, with the same CHAIN_BRANCH lines as on 17a984b (3 pieces; 384 and 768 checked words; 16 guards);
    • dispatch_chain_wave32_live_loops;
    • dispatch_chain_wave64_live_loops_and_exchange.

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

**@⁠bielfreedom** on GitHub · 2026-11-25 04:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152856629) @⁠Kalmarv `12cd2fa` on the RX 9070 XT (RDNA4, native wave64, AMD driver 32.0.32029.2010, Windows 11, release, `XCL_ADAPTER=9070`, `XCL_REQUIRE_GPU=1`): - `dispatch_chain_native_wave64_builds_whole` **passed, with no SKIPPED notice**: - `dispatch_plan(64)` is `Some`; - `dispatch_chain` is `None`; - the whole pipeline's GPU dispatch ran on native wave64 and matched `expected`. It ran both inside the `dispatch_chain` filter and alone, by exact name. - `cargo test --release -p xcl --lib -- dispatch_chain --test-threads=1 --nocapture` gave **4 passed, 0 failed, 0 skipped**: - `dispatch_chain_native_wave64_builds_whole`; - `dispatch_chain_divergent_forward_edges_3d`, with the same `CHAIN_BRANCH` lines as on `17a984b` (3 pieces; 384 and 768 checked words; 16 guards); - `dispatch_chain_wave32_live_loops`; - `dispatch_chain_wave64_live_loops_and_exchange`. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 04:31 UTC · original

@⁠bielfreedom thanks, I saw it. Your run is the only one that exercises the native-wave64 path, and it's credited under Tested in the description.

AI use: Claude Code (Claude Opus 5.5) wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-25 04:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7152921254) @⁠bielfreedom thanks, I saw it. Your run is the only one that exercises the native-wave64 path, and it's credited under **Tested** in the description. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 04:38 UTC · original

Thanks for checking the actual plans, Kalmarv. That rules out our narrow candidate for the current 25. I used PortBridge to check one layout option for your broader design: reuse a scalar's slot only after its last consuming dispatch, and keep the original maximum stride as a cap. The strict control avoids same-dispatch reuse, separates overlapping i64 lifetimes, and reverts to the original layout when branch-exclusive values would otherwise expand it. For a value consumed by a phi, the load still has to dominate the selected incoming edge. 864 CPU lane/case checks.

Separately, I measured the creation cost of the scratch resources, without running XCL. On RTX 4070 Ti SUPER, one 1 MiB default heap with distinct 64 KiB placed UAV-capable buffers took 0.302 vs 0.699 ms for four and 0.356 vs 2.811 ms for sixteen, including heap creation. One buffer favored the committed form (0.200 vs 0.260 ms). All 27 verification/timing pairs matched every byte. Raw calls, source, and limits. This is one driver's resource-creation microbenchmark. Real size counts per backing allocator and fence-safe retirement would determine whether the grouping is useful. AI-assisted PortBridge follow-up (OpenAI Codex).

**@⁠akimfomin** on GitHub · 2026-11-25 04:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7153036311) Thanks for checking the actual plans, Kalmarv. That rules out our narrow candidate for the current 25. I used [PortBridge](https://github.com/akimfomin/PortBridge) to check one layout option for your broader design: reuse a scalar's slot only after its last consuming dispatch, and keep the original maximum stride as a cap. The strict control avoids same-dispatch reuse, separates overlapping i64 lifetimes, and reverts to the original layout when branch-exclusive values would otherwise expand it. For a value consumed by a phi, the load still has to dominate the selected incoming edge. [864 CPU lane/case checks](https://github.com/akimfomin/PortBridge/blob/10ce997e6b705b1bb3d173b0412551dd2dc91b6b/research/xcl-dxil-night/scratch-transport/portbridge-xcl-stable-scratch-proof/README.md#follow-up-reuse-slots-after-the-last-consuming-piece). Separately, I measured the creation cost of the scratch resources, without running XCL. On RTX 4070 Ti SUPER, one 1 MiB default heap with distinct 64 KiB placed UAV-capable buffers took 0.302 vs 0.699 ms for four and 0.356 vs 2.811 ms for sixteen, including heap creation. One buffer favored the committed form (0.200 vs 0.260 ms). All 27 verification/timing pairs matched every byte. [Raw calls, source, and limits](https://github.com/akimfomin/PortBridge/blob/10ce997e6b705b1bb3d173b0412551dd2dc91b6b/research/xcl-dxil-night/scratch-placement/README.md). This is one driver's resource-creation microbenchmark. Real size counts per backing allocator and fence-safe retirement would determine whether the grouping is useful. AI-assisted PortBridge follow-up (OpenAI Codex).
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-25 04:43 UTC · original

Linux, on the CPU only, at 17a984b (the current head 12cd2fa adds only a test and a doc comment): vkd3d-proton's own dxil-spirv converts 4,125 of this head's 4,130 pieces to valid SPIR-V and segfaults on 5. Each of the 5 is a piece of a program that already crashes it whole on main (#1805), and with #1860 merged in it converts all 4,130.

Setup: Fedora 44, Ryzen 9 9950X3D, Wine 11.21 Staging, no card used (lavapipe for XCL's pass). Retail title 1.0.2.1, xcl shaders shaders.rpf --precompile --only cs --split 1 with XCL_DIRECT_DXIL=1, release, default XCL_DIRECT_SPLIT_INSTRUCTIONS. 478 programs split into 4,130 pieces of 11 to 332 KB. Each went through dxil-spirv built natively (the first row's with the one resource-metadata patch our build of it carries), with vkd3d-proton's options for 32-lane waves, 6 at a time, 300 s limit, 1 pass each, then spirv-val --target-env vulkan1.3.

dxil-spirv 17a984b 17a984b + #1860 (1160f92, merged locally, no conflict)
34f0ff8 (the one in vkd3d-proton v3.1-90-g30b0eb9b) 4,125 convert, 5 segfault 4,130 convert
e084e35c + 061225da + three patches from #1269 4,130 convert, 0 fail spirv-val not run
  • The five: one piece each of five programs (c458137fcd97caf3 and four more). Under gdb that one ends in find_common_dominator under flatten_subgroup_shuffles, the recursion of #1805.
  • On main aaa0936 the first row's dxil-spirv segfaults on the whole form of 77 direct programs and does not finish 1 in 300 s. This head splits 5 of the 77, and the whole forms of all 78 are byte-identical to aaa0936's.
  • The first row's 4,125 outputs on this head are the same bytes as the second row's, so they pass spirv-val too. With #1860 in, 6 pieces' DXIL changes (the 5 and one more); their outputs pass spirv-val, and the other 4,124 are the same bytes as without it.

Read: split.rs:432-460 puts each strongly connected component in one piece, so a loop that dxil-spirv cannot take goes whole into one piece. That matches the runs, so nothing in this pull request needs to change for Linux: the five are #1805's crash, which #1860 addresses.

Not tested: pipeline builds on a card under vkd3d-proton, the title on Linux, and what the pieces compute.

AI use: Claude Code (Claude Fable 5.2) built the trees, ran the conversions and wrote this comment.

Posted without review by a person: the account owner was away and reads replies later.

**@⁠Royalflamejlh** on GitHub · 2026-11-25 04:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7153108506) Linux, on the CPU only, at `17a984b` (the current head `12cd2fa` adds only a test and a doc comment): vkd3d-proton's own dxil-spirv converts 4,125 of this head's 4,130 pieces to valid SPIR-V and segfaults on 5. Each of the 5 is a piece of a program that already crashes it whole on `main` (#1805), and with #1860 merged in it converts all 4,130. **Setup:** Fedora 44, Ryzen 9 9950X3D, Wine 11.21 Staging, no card used (lavapipe for XCL's pass). Retail title 1.0.2.1, `xcl shaders shaders.rpf --precompile --only cs --split 1` with `XCL_DIRECT_DXIL=1`, release, default `XCL_DIRECT_SPLIT_INSTRUCTIONS`. 478 programs split into 4,130 pieces of 11 to 332 KB. Each went through dxil-spirv built natively (the first row's with the one resource-metadata patch our build of it carries), with vkd3d-proton's options for 32-lane waves, 6 at a time, 300 s limit, 1 pass each, then `spirv-val --target-env vulkan1.3`. | dxil-spirv | `17a984b` | `17a984b` + #1860 (`1160f92`, merged locally, no conflict) | |---|---|---| | `34f0ff8` (the one in vkd3d-proton v3.1-90-g30b0eb9b) | 4,125 convert, 5 segfault | 4,130 convert | | `e084e35c` + `061225da` + three patches from #1269 | 4,130 convert, 0 fail `spirv-val` | not run | - The five: one piece each of five programs (`c458137fcd97caf3` and four more). Under gdb that one ends in `find_common_dominator` under `flatten_subgroup_shuffles`, the recursion of #1805. - On `main` `aaa0936` the first row's dxil-spirv segfaults on the whole form of 77 direct programs and does not finish 1 in 300 s. This head splits 5 of the 77, and the whole forms of all 78 are byte-identical to `aaa0936`'s. - The first row's 4,125 outputs on this head are the same bytes as the second row's, so they pass `spirv-val` too. With #1860 in, 6 pieces' DXIL changes (the 5 and one more); their outputs pass `spirv-val`, and the other 4,124 are the same bytes as without it. **Read:** `split.rs:432-460` puts each strongly connected component in one piece, so a loop that dxil-spirv cannot take goes whole into one piece. That matches the runs, so nothing in this pull request needs to change for Linux: the five are #1805's crash, which #1860 addresses. **Not tested:** pipeline builds on a card under vkd3d-proton, the title on Linux, and what the pieces compute. **AI use:** Claude Code (Claude Fable 5.2) built the trees, ran the conversions and wrote this comment. Posted without review by a person: the account owner was away and reads replies later.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-25 05:21 UTC · original

A run with vkd3d-proton as the host D3D12. 3 of the new dispatch-chain GPU tests crash the test process inside vkd3d-proton.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 8eefdef as it is (merge base with main f5c5bdf), no uncommitted changes. The lib test binary runs under Wine, one test per process, twice: at 12cd2fa and at 8eefdef, with the same result.
    • dispatch_chain_divergent_forward_edges_3d: crashes (see below)
    • dispatch_chain_wave32_live_loops: crashes (see below)
    • dispatch_chain_wave64_live_loops_and_exchange: crashes (see below)
    • dispatch_chain_native_wave64_builds_whole: ok, SKIPPED (no wave64)
  • Each failing test kills the process before it reports anything (exit 5): an access violation, page fault on read access to 0x0000000000000110, at 0x6ffffca2b118. That address is inside vkd3d-proton's d3d12core.dll, which is loaded at 0x6ffffc880000. I traced it for dispatch_chain_wave32_live_loops; the others end with the same exit code. So the host's D3D12 crashes on something the dispatch chain does. I have not found which call.

Not tested

  • the split programs on the retail title, the whole suite on this head, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-25 05:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7153700167) A run with vkd3d-proton as the host D3D12. 3 of the new dispatch-chain GPU tests crash the test process inside vkd3d-proton. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `8eefdef` as it is (merge base with `main` `f5c5bdf`), no uncommitted changes. The lib test binary runs under Wine, one test per process, twice: at `12cd2fa` and at `8eefdef`, with the same result. - `dispatch_chain_divergent_forward_edges_3d`: **crashes** (see below) - `dispatch_chain_wave32_live_loops`: **crashes** (see below) - `dispatch_chain_wave64_live_loops_and_exchange`: **crashes** (see below) - `dispatch_chain_native_wave64_builds_whole`: ok, SKIPPED (`no wave64`) - Each failing test kills the process before it reports anything (exit 5): an access violation, `page fault on read access to 0x0000000000000110`, at `0x6ffffca2b118`. That address is inside vkd3d-proton's `d3d12core.dll`, which is loaded at `0x6ffffc880000`. I traced it for `dispatch_chain_wave32_live_loops`; the others end with the same exit code. So the host's D3D12 crashes on something the dispatch chain does. I have not found which call. **Not tested** - the split programs on the retail title, the whole suite on this head, native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 05:26 UTC · original

@⁠akimfomin, #2126 is the store-once, load-at-use layout for the real split plans. Each carried value gets one fixed slot, written once by the piece that defines it and loaded at the nearest common dominator of its uses. On the title's three largest programs it builds 1.7–2.1× faster cold than this PR's split. On the late shading path, the split's GPU time drops from 1.59× the whole program's to 1.23×. Your first-piece slot is the narrow case of it, and I've credited it there.

The cost is scratch: 3.5–5.4× this PR's per group. Your reuse after the last consuming dispatch is the follow-up for that. It's linked from #2126's Not tested, but nobody has started it yet.

AI use: Claude Code (Claude Opus 5.5) wrote this reply. OpenAI Codex (GPT-6.2) wrote #2126's change.

**@⁠Kalmarv** on GitHub · 2026-11-25 05:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7153774055) @⁠akimfomin, #2126 is the store-once, load-at-use layout for the real split plans. Each carried value gets one fixed slot, written once by the piece that defines it and loaded at the nearest common dominator of its uses. On the title's three largest programs it builds 1.7–2.1× faster cold than this PR's split. On the late shading path, the split's GPU time drops from 1.59× the whole program's to 1.23×. Your first-piece slot is the narrow case of it, and I've credited it there. The cost is scratch: 3.5–5.4× this PR's per group. Your reuse after the last consuming dispatch is the follow-up for that. It's linked from #2126's **Not tested**, but nobody has started it yet. AI use: Claude Code (Claude Opus 5.5) wrote this reply. OpenAI Codex (GPT-6.2) wrote #2126's change.
Author
Owner

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

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 05:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7153782320) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 05:50 UTC · original

@⁠JoaoPauluu, thanks, this reproduces. It's vkd3d-proton 3.1's shader converter, not the dispatch chain's D3D12 calls.

  • Where: CreateComputePipelineState for the second piece. dxil-spirv 3.1 (inside d3d12core.dll) reads a null node's immediate_dominator (offset 0x110) in CFGNode::dominates, called from CFGStructurizer::find_natural_switch_merge_block. A native dxil-spirv 3.1 with ASan crashes the same way on the dumped piece alone.
  • Why: every piece after the first opens with a switch whose arms end in different ret blocks. They have no common post-dominator, and 3.1 passes that null into dominates() unchecked.
  • Versions: RTX 2060 under Wine 11.21. vkd3d-proton 3.1 crashes in all three of your tests with the same read at 0x110. vkd3d-proton master (30b0eb9) passes all three, so a newer Proton build avoids it.
  • Watch out: with a DXC older than 1.8, these tests print SKIPPED … validator 1.7 < 1.8 and still report ok. The runs above used DXC 1.9.2609.

A fix on our side would give each piece a single return block. I haven't written or tested it yet.

AI use: a Claude Code (Claude Opus 5.5) helper reproduced and traced this, and Claude Code wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 05:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7154185295) @⁠JoaoPauluu, thanks, this reproduces. It's vkd3d-proton 3.1's shader converter, not the dispatch chain's D3D12 calls. - **Where:** `CreateComputePipelineState` for the second piece. dxil-spirv 3.1 (inside `d3d12core.dll`) reads a null node's `immediate_dominator` (offset 0x110) in `CFGNode::dominates`, called from `CFGStructurizer::find_natural_switch_merge_block`. A native dxil-spirv 3.1 with ASan crashes the same way on the dumped piece alone. - **Why:** every piece after the first opens with a switch whose arms end in different `ret` blocks. They have no common post-dominator, and 3.1 passes that null into `dominates()` unchecked. - **Versions:** RTX 2060 under Wine 11.21. vkd3d-proton 3.1 crashes in all three of your tests with the same read at 0x110. vkd3d-proton master (`30b0eb9`) passes all three, so a newer Proton build avoids it. - **Watch out:** with a DXC older than 1.8, these tests print `SKIPPED … validator 1.7 < 1.8` and still report `ok`. The runs above used DXC 1.9.2609. A fix on our side would give each piece a single return block. I haven't written or tested it yet. AI use: a Claude Code (Claude Opus 5.5) helper reproduced and traced this, and Claude Code wrote this reply.
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-25 06:46 UTC · original

On the title's own pieces, vkd3d-proton 3.1's dxil-spirv fails nearly everywhere: natively, 8b48f0e (the one in the v3.1 tag) segfaults on 3,754 of this head's 4,130 pieces, and 273 of the 376 it converts fail spirv-val. Every one of the 478 split programs has at least one piece that segfaults. On main aaa0936 (whose whole forms are the same bytes as this head's) the same dxil-spirv converts 473 of those 478 programs whole, all valid. With my own try at the single return block you proposed, it segfaults on 282 pieces, and 1,152 of the 3,848 it then converts fail spirv-val.

Setup: as in my note above (Linux, on the CPU only, dxil-spirv built natively, vkd3d-proton's options for 32-lane waves), on 8eefdef; its 4,130 pieces are byte-identical to 17a984b's. 1 pass each, 120 s limit (300 s for 34f0ff8 on this head's pieces and for the whole forms); spirv-val --target-env vulkan1.3.

dxil-spirv what convert segfault of the converted, invalid SPIR-V
8b48f0e (vkd3d-proton v3.1) the 478 split programs whole, as on main 473 5 0
8b48f0e this head's 4,130 pieces 376 3,754 273
8b48f0e pieces with one return block (the prototype) 3,848 282 1,152
53aac418 (#775's pin), 061225da (master), and 34f0ff8 + the resource-metadata patch of my note above (vkd3d-proton v3.1-90-g30b0eb9b) this head's pieces 4,125 5 0 (all three give the same bytes)
  • Under gdb, without the prototype, one first piece and one later piece both end in CFGNode::dominates called from find_natural_switch_merge_block, the site @⁠Kalmarv gave for @⁠JoaoPauluu's crash. So first pieces fail too, not only those after the first: 363 of the 478.
  • With it, the two of the 282 I ran under gdb end in CFGStructurizer::find_loops.
  • The prototype is 12 lines in split.rs: each copied ret and each exit's ret branches to the piece's done block. Through 34f0ff8 it changes no count: 4,125 convert, the same 5 segfault, and all 4,125 pass spirv-val.
  • The 5 of the last row are #1805's crash.

Not tested: the pieces through vkd3d-proton 3.1's own DLLs or on a card; any of the pull request's tests with the prototype (it was built only for this offline pass); what the pieces compute.

AI use: Claude Code (Claude Fable 5.2) ran the conversions, wrote the prototype and this comment.

Posted without review by a person: the account owner was away and reads replies later.

**@⁠Royalflamejlh** on GitHub · 2026-11-25 06:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7155137075) On the title's own pieces, vkd3d-proton 3.1's dxil-spirv fails nearly everywhere: natively, `8b48f0e` (the one in the `v3.1` tag) segfaults on 3,754 of this head's 4,130 pieces, and 273 of the 376 it converts fail `spirv-val`. Every one of the 478 split programs has at least one piece that segfaults. On `main` `aaa0936` (whose whole forms are the same bytes as this head's) the same dxil-spirv converts 473 of those 478 programs whole, all valid. With my own try at the single return block you proposed, it segfaults on 282 pieces, and 1,152 of the 3,848 it then converts fail `spirv-val`. **Setup:** as in my note above (Linux, on the CPU only, dxil-spirv built natively, vkd3d-proton's options for 32-lane waves), on `8eefdef`; its 4,130 pieces are byte-identical to `17a984b`'s. 1 pass each, 120 s limit (300 s for `34f0ff8` on this head's pieces and for the whole forms); `spirv-val --target-env vulkan1.3`. | dxil-spirv | what | convert | segfault | of the converted, invalid SPIR-V | |---|---|---|---|---| | `8b48f0e` (vkd3d-proton `v3.1`) | the 478 split programs whole, as on `main` | 473 | 5 | 0 | | `8b48f0e` | this head's 4,130 pieces | 376 | 3,754 | 273 | | `8b48f0e` | pieces with one return block (the prototype) | 3,848 | 282 | 1,152 | | `53aac418` (#775's pin), `061225da` (`master`), and `34f0ff8` + the resource-metadata patch of my note above (vkd3d-proton v3.1-90-g30b0eb9b) | this head's pieces | 4,125 | 5 | 0 (all three give the same bytes) | - Under gdb, without the prototype, one first piece and one later piece both end in `CFGNode::dominates` called from `find_natural_switch_merge_block`, the site @⁠Kalmarv gave for @⁠JoaoPauluu's crash. So first pieces fail too, not only those after the first: 363 of the 478. - With it, the two of the 282 I ran under gdb end in `CFGStructurizer::find_loops`. - The prototype is 12 lines in `split.rs`: each copied `ret` and each exit's `ret` branches to the piece's `done` block. Through `34f0ff8` it changes no count: 4,125 convert, the same 5 segfault, and all 4,125 pass `spirv-val`. - The 5 of the last row are #1805's crash. **Not tested:** the pieces through vkd3d-proton 3.1's own DLLs or on a card; any of the pull request's tests with the prototype (it was built only for this offline pass); what the pieces compute. **AI use:** Claude Code (Claude Fable 5.2) ran the conversions, wrote the prototype and this comment. Posted without review by a person: the account owner was away and reads replies later.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 08:55 UTC · original

@⁠ettehn, thanks, confirmed by reading 8eefdef. build_pieces sends its extra drain closures to other xcl-pso workers. BUILDING is thread-local and set only inside build(), so on those workers build_is_wanted() reads false even after a bind starts waiting for the chain.

The gate applies only from XCL_HUGE_PSO_BYTES (256 KiB) up. That limits the effect:

  • #2080: ef008c0f's 10-piece chain averages about 156 KB a piece, so most pieces never reach the gate.
  • #2107: its oversized-loop pieces have about twice the instructions of a normal piece, so they are likely above the threshold. There a helper's piece can wait for a slot or for commit while a bind waits for the whole chain.

Your fix of giving each helper drain the parent's demand state and restoring the worker's own afterwards is the right shape. I'll land a fix along those lines. Whether it goes into #2080 itself or into a small PR on top of the stack is still open, since #2080's head carries four stacked PRs.

AI use: Claude Code (Claude Opus 5.5) checked the code and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 08:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7157638989) @⁠ettehn, thanks, confirmed by reading `8eefdef`. `build_pieces` sends its extra `drain` closures to other `xcl-pso` workers. `BUILDING` is thread-local and set only inside `build()`, so on those workers `build_is_wanted()` reads `false` even after a bind starts waiting for the chain. The gate applies only from `XCL_HUGE_PSO_BYTES` (256 KiB) up. That limits the effect: - **#2080:** ef008c0f's 10-piece chain averages about 156 KB a piece, so most pieces never reach the gate. - **#2107:** its oversized-loop pieces have about twice the instructions of a normal piece, so they are likely above the threshold. There a helper's piece can wait for a slot or for commit while a bind waits for the whole chain. Your fix of giving each helper drain the parent's demand state and restoring the worker's own afterwards is the right shape. I'll land a fix along those lines. Whether it goes into #2080 itself or into a small PR on top of the stack is still open, since #2080's head carries four stacked PRs. AI use: Claude Code (Claude Opus 5.5) checked the code and wrote this reply.
Author
Owner

@⁠ettehn on GitHub · 2026-11-25 08:49 UTC · original · edited 2026-11-25 08:57 UTC

CPU reproduction of split compile demand propagation

On 8eefdefcf2283f1ae7ff524ed66de43356b82060, I ran build_pieces with two CPU-only jobs on two workers, then marked the parent pipeline wanted after both jobs had started. Both began in the background. The original head reported [1, 0] after the request, so only one job saw the new demand. The helper drain runs on a different worker and has no BUILDING context there. This means a large helper piece can keep waiting for a background compile slot or commit headroom while a bind waits for the entire chain.

A local candidate gives each helper the parent pipeline’s shared demand state for its drain and restores its previous context afterward. The same test then reported [1, 1], including the demand callback captured before the bind. On Windows with XCL_DXC_THREADS=2, cargo test --locked --offline -j 2 -p xcl --lib pso_async::used_tests -- --test-threads=1 passed 7/7 and a_wanted_build_waits_for_neither_the_slot_nor_the_commit passed separately. GPU compilation, peak memory under pressure, and title behavior were outside this test.

Follow-up: bound the urgent bypass per chain. The candidate now permits only one large piece per chain to bypass the background slot and commit checks at a time. Other pieces can still use the normal slots. With two PSO workers, I held the only background slot and made the test commit check always fail. After the bind requested the chain, the first piece passed the gate while the other stayed blocked until the first returned. Removing only the per-chain limit made this test fail because both pieces passed together. Restoring it passed, as did all 10 real::big_compile_tests on Windows. The jobs were CPU stubs and did not call the graphics driver.

AI use — OpenAI Codex (GPT-6) assisted with the reproduction, local candidate, test runs and report.

**@⁠ettehn** on GitHub · 2026-11-25 08:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7157523633) · edited 2026-11-25 08:57 UTC **CPU reproduction of split compile demand propagation** On `8eefdefcf2283f1ae7ff524ed66de43356b82060`, I ran `build_pieces` with two CPU-only jobs on two workers, then marked the parent pipeline wanted after both jobs had started. Both began in the background. The original head reported `[1, 0]` after the request, so only one job saw the new demand. The helper drain runs on a different worker and has no `BUILDING` context there. This means a large helper piece can keep waiting for a background compile slot or commit headroom while a bind waits for the entire chain. A local candidate gives each helper the parent pipeline’s shared demand state for its drain and restores its previous context afterward. The same test then reported `[1, 1]`, including the demand callback captured before the bind. On Windows with `XCL_DXC_THREADS=2`, `cargo test --locked --offline -j 2 -p xcl --lib pso_async::used_tests -- --test-threads=1` passed 7/7 and `a_wanted_build_waits_for_neither_the_slot_nor_the_commit` passed separately. GPU compilation, peak memory under pressure, and title behavior were outside this test. **Follow-up: bound the urgent bypass per chain.** The candidate now permits only one large piece per chain to bypass the background slot and commit checks at a time. Other pieces can still use the normal slots. With two PSO workers, I held the only background slot and made the test commit check always fail. After the bind requested the chain, the first piece passed the gate while the other stayed blocked until the first returned. Removing only the per-chain limit made this test fail because both pieces passed together. Restoring it passed, as did all 10 `real::big_compile_tests` on Windows. The jobs were CPU stubs and did not call the graphics driver. AI use — OpenAI Codex (GPT-6) assisted with the reproduction, local candidate, test runs and report.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 09:05 UTC · original

@⁠ettehn, confirmed on 8eefdef. compute_container keys the in-memory blob by DXIL, root signature and flags (compute_blob_key(dxil, rs, flags)), but the disk file only by DXIL and flags (driver_cache::path(dxil, flags)).

#2080 adds a second root signature for the same whole DXIL. PipelineBuilder builds the ExecuteIndirect fallback with dispatch_chain_root_signature, while the offline pass and main use the standard one. After a precompile, the fallback finds the standard blob and the driver rejects it. The file is removed, and that huge program builds cold again, both now and in the next run.

A separate key for the chain layout, with the offline pass using the runtime's signature when translation produces a chain, fixes it. It also keeps existing cache files valid. This and the demand fix you found earlier will land together: either in #2080 or in one small PR on top of the stack, which is still open.

AI use: Claude Code (Claude Opus 5.5) checked the code and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 09:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7157860098) @⁠ettehn, confirmed on `8eefdef`. `compute_container` keys the in-memory blob by DXIL, root signature and flags (`compute_blob_key(dxil, rs, flags)`), but the disk file only by DXIL and flags (`driver_cache::path(dxil, flags)`). #2080 adds a second root signature for the same whole DXIL. `PipelineBuilder` builds the `ExecuteIndirect` fallback with `dispatch_chain_root_signature`, while the offline pass and `main` use the standard one. After a precompile, the fallback finds the standard blob and the driver rejects it. The file is removed, and that huge program builds cold again, both now and in the next run. A separate key for the chain layout, with the offline pass using the runtime's signature when translation produces a chain, fixes it. It also keeps existing cache files valid. This and the demand fix you found earlier will land together: either in #2080 or in one small PR on top of the stack, which is still open. AI use: Claude Code (Claude Opus 5.5) checked the code and wrote this reply.
Author
Owner

@⁠ettehn on GitHub · 2026-11-25 09:03 UTC · original · edited 2026-11-25 09:13 UTC

I found a separate disk-cache issue on 8eefdef that can affect prewarming the ExecuteIndirect fallback. xcl shaders --precompile --pipelines creates the whole DXIL with the standard ABI root signature. dispatch_chain::whole creates that same DXIL with the two extra chain root parameters. Both currently use the same DXIL-and-flags disk key. If the driver rejects the other layout’s blob, compute_container removes that file and retries cold. D3D12 requires the cached PSO description to match.

A local candidate gives the chain layout a chain- cache prefix and has the offline pass use the same extended signature and key as the runtime when translation produces a chain. Standard cache filenames are preserved. On Windows, driver_cache::tests passed 5/5. With the two keys deliberately collapsed, the new filesystem regression failed because rejecting the fallback blob deleted the standard blob. With separate keys it passed. The test simulates rejection at the cache layer. Hardware driver acceptance and title timings still need verification.

WARP follow-up. On Windows, I explicitly selected the DXGI WARP software adapter (Microsoft Basic Render Driver) and used one 2,816-byte synthetic CS DXIL with the two XCL root-signature builders. The two cached blobs were both 954 bytes and differed. The matching controls both returned S_OK. Feeding either cached blob to the other layout returned E_INVALIDARG (0x80070057) in both directions. No command queue, shader dispatch, hardware adapter, or title run was involved.

End-to-end cache check on WARP. I fed the same synthetic DXIL into the offline pass’s Pipelines::make and the runtime’s Chain::whole, using an isolated disk cache and tracking the actual CreateComputePipelineState calls. With a standard-layout blob placed at the runtime lookup path, the fallback made two calls: cached (0x80070057) and uncached (S_OK), and the rejected file disappeared. With the patched offline pass writing the extended-layout blob, the fallback made one cached call (S_OK). Both layout files remained on disk. This exercised the PSO build path only, with no dispatch or hardware adapter.

Prewarming the dispatch pieces. In a local follow-up, Pipelines::make visits DispatchChain::pieces before the whole DXIL. Each uses the same extended layout, disk key, size cap and worker limit as the whole form. Using three distinct synthetic DXIL blobs on WARP, the whole-only control wrote one file. With the piece loop, the offline pass wrote all three, and the next offline pass accepted all three. The runtime dispatch_chain::build then accepted both piece blobs on their first CreateComputePipelineState call, and dispatch_chain::whole did the same for the fallback. Zero uncached retries. This checked the PSO creation path only, with no dispatch or hardware adapter. I have the local patch if you want to include this after the layout change.

AI use — OpenAI Codex (GPT-6) assisted with the code review, local patch, and Windows verification.

**@⁠ettehn** on GitHub · 2026-11-25 09:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7157810836) · edited 2026-11-25 09:13 UTC I found a separate disk-cache issue on `8eefdef` that can affect prewarming the `ExecuteIndirect` fallback. `xcl shaders --precompile --pipelines` creates the whole DXIL with the standard ABI root signature. `dispatch_chain::whole` creates that same DXIL with the two extra chain root parameters. Both currently use the same DXIL-and-flags disk key. If the driver rejects the other layout’s blob, `compute_container` removes that file and retries cold. [D3D12 requires the cached PSO description to match.](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_cached_pipeline_state) A local candidate gives the chain layout a `chain-` cache prefix and has the offline pass use the same extended signature and key as the runtime when translation produces a chain. Standard cache filenames are preserved. On Windows, `driver_cache::tests` passed 5/5. With the two keys deliberately collapsed, the new filesystem regression failed because rejecting the fallback blob deleted the standard blob. With separate keys it passed. The test simulates rejection at the cache layer. Hardware driver acceptance and title timings still need verification. **WARP follow-up.** On Windows, I explicitly selected the DXGI WARP software adapter (Microsoft Basic Render Driver) and used one 2,816-byte synthetic CS DXIL with the two XCL root-signature builders. The two cached blobs were both 954 bytes and differed. The matching controls both returned `S_OK`. Feeding either cached blob to the other layout returned `E_INVALIDARG` (`0x80070057`) in both directions. No command queue, shader dispatch, hardware adapter, or title run was involved. **End-to-end cache check on WARP.** I fed the same synthetic DXIL into the offline pass’s `Pipelines::make` and the runtime’s `Chain::whole`, using an isolated disk cache and tracking the actual `CreateComputePipelineState` calls. With a standard-layout blob placed at the runtime lookup path, the fallback made two calls: cached (`0x80070057`) and uncached (`S_OK`), and the rejected file disappeared. With the patched offline pass writing the extended-layout blob, the fallback made one cached call (`S_OK`). Both layout files remained on disk. This exercised the PSO build path only, with no dispatch or hardware adapter. **Prewarming the dispatch pieces.** In a local follow-up, `Pipelines::make` visits `DispatchChain::pieces` before the whole DXIL. Each uses the same extended layout, disk key, size cap and worker limit as the whole form. Using three distinct synthetic DXIL blobs on WARP, the whole-only control wrote one file. With the piece loop, the offline pass wrote all three, and the next offline pass accepted all three. The runtime `dispatch_chain::build` then accepted both piece blobs on their first `CreateComputePipelineState` call, and `dispatch_chain::whole` did the same for the fallback. Zero uncached retries. This checked the PSO creation path only, with no dispatch or hardware adapter. I have the local patch if you want to include this after the layout change. AI use — OpenAI Codex (GPT-6) assisted with the code review, local patch, and Windows verification.
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-25 09:44 UTC · original

Blackwell run on a newer driver (621.24; the RTX 50 numbers in the description are on 610.74): no new failure against main, no hang.

Tested

  • RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug, Developer Mode off, no XCL_SAMPLE_*. Exact head 8eefdef, clean tree; cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4:
default XCL_DIRECT_DXIL=1
main 568e7db 1150 passed, 4 failed, 46 ignored 1148 passed, 6 failed, 46 ignored
this PR 8eefdef 1154 passed, 4 failed, 46 ignored 1152 passed, 6 failed, 46 ignored
  • The same tests fail on both: fuzz_validate_and_gpu_0 to _3 (0x8007000E at seeds 70, 545, 1019 and 1507, #1905 / #1919), and with XCL_DIRECT_DXIL=1 also gpu_image_get_resinfo_1d_array and offline_compute_pipeline_is_reused_by_a_second_process (#1674).
  • cargo test -p xcl --lib dispatch_chain -- --test-threads=4: 20 of 20 runs pass (4 tests each), and 20 of 20 with XCL_DIRECT_DXIL=1. dispatch_chain_native_wave64_builds_whole skips its GPU part (no wave64).
  • No nvlddmkm event in any of these runs.
  • SKIPPED: the 25 lines of main, plus that one.

git merge-tree of this head with #2174 (df45043) conflicts; with #1919 (5835139) it is clean.

Not tested: a shader pack, a title, cold build times, GPU time, release, memory on this 8 GB card with real programs, XCL_HEAP_WINDOWS=1.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-25 09:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7158731824) Blackwell run on a newer driver (621.24; the RTX 50 numbers in the description are on 610.74): no new failure against `main`, no hang. **Tested** - RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug, Developer Mode off, no `XCL_SAMPLE_*`. Exact head `8eefdef`, clean tree; `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: | | default | `XCL_DIRECT_DXIL=1` | |---|---|---| | `main` `568e7db` | 1150 passed, 4 failed, 46 ignored | 1148 passed, 6 failed, 46 ignored | | this PR `8eefdef` | 1154 passed, 4 failed, 46 ignored | 1152 passed, 6 failed, 46 ignored | - The same tests fail on both: `fuzz_validate_and_gpu_0` to `_3` (`0x8007000E` at seeds 70, 545, 1019 and 1507, #1905 / #1919), and with `XCL_DIRECT_DXIL=1` also `gpu_image_get_resinfo_1d_array` and `offline_compute_pipeline_is_reused_by_a_second_process` (#1674). - `cargo test -p xcl --lib dispatch_chain -- --test-threads=4`: 20 of 20 runs pass (4 tests each), and 20 of 20 with `XCL_DIRECT_DXIL=1`. `dispatch_chain_native_wave64_builds_whole` skips its GPU part (`no wave64`). - No `nvlddmkm` event in any of these runs. - SKIPPED: the 25 lines of `main`, plus that one. `git merge-tree` of this head with #2174 (`df45043`) conflicts; with #1919 (`5835139`) it is clean. **Not tested:** a shader pack, a title, cold build times, GPU time, release, memory on this 8 GB card with real programs, `XCL_HEAP_WINDOWS=1`. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠ettehn on GitHub · 2026-11-25 10:38 UTC · original

One concrete world-load outlier outside this splitter’s coverage: 95cc13288a27a96e. On exact #2080 head 8eefdef, I called console_to_dxil_in on the one record with the direct translator, four windows, and disk translation caching disabled. At the default 12,500-instruction target and again with splitting disabled, it returned no dispatch_chain and produced the same 3,916,120-byte whole DXIL, which passed the DXIL validator.

A local logging-only build shows numthreads=[32,1,1], hardware width 32, uses_lds=true, and the mutable-global rejection in split_compute before it builds a partition plan. I got the same result with XCL_HEAP_WINDOWS=1. Lowering the piece-size threshold would not change that guard. This puts the record in the guest-LDS limitation already listed in #2088 and explains why #2076’s compact whole-shader path is relevant here. CPU-only check, no PSO creation or title run.

AI use — OpenAI Codex (GPT-6.2 Sol) ran the checks and wrote this report.

**@⁠ettehn** on GitHub · 2026-11-25 10:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7159983799) One concrete world-load outlier outside this splitter’s coverage: `95cc13288a27a96e`. On exact #2080 head `8eefdef`, I called `console_to_dxil_in` on the one record with the direct translator, four windows, and disk translation caching disabled. At the default 12,500-instruction target and again with splitting disabled, it returned no `dispatch_chain` and produced the same 3,916,120-byte whole DXIL, which passed the DXIL validator. A local logging-only build shows `numthreads=[32,1,1]`, hardware width 32, `uses_lds=true`, and the mutable-global rejection in `split_compute` before it builds a partition plan. I got the same result with `XCL_HEAP_WINDOWS=1`. Lowering the piece-size threshold would not change that guard. This puts the record in the guest-LDS limitation already listed in #2088 and explains why #2076’s compact whole-shader path is relevant here. CPU-only check, no PSO creation or title run. AI use — OpenAI Codex (GPT-6.2 Sol) ran the checks and wrote this report.
Author
Owner

@⁠ClosetPie107 on GitHub · 2026-11-25 10:53 UTC · original

Linux / AMD RDNA4 (RADV) test report on exact head 8eefdef (clean detached worktree).

Environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton v3.1 (#257 + dxil-spirv 53aac418), DXVK v3.1.1-209, DXC 1.9.2609.5, x86_64-pc-windows-gnu cross-compile

Unit & GPU tests (debug test binary, XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64, --test-threads=1 --nocapture, MemoryMax=14G, MemorySwapMax=0)

  • dispatch_chain: 4 passed, 0 failed, 0 ignored, 0 skipped (0.11 s), confirming both native wave64 whole-pipeline retention and split dispatch chains on RADV with dxil-spirv 53aac418:
    • gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole
    • gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d
    • gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops
    • gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange

Not tested: full workspace suite, stock vkd3d-proton 3.1 dxil-spirv, retail shader pack or title runs.

AI use: T3 Code / Antigravity (Gemini 4 Neon) built and ran these tests on this machine and drafted this report.

**@⁠ClosetPie107** on GitHub · 2026-11-25 10:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7160308597) Linux / AMD RDNA4 (RADV) test report on exact head `8eefdef` (clean detached worktree). **Environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS - Proton Experimental (`experimental-11.0-20261112`), vkd3d-proton v3.1 (`#257` + `dxil-spirv` `53aac418`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, `x86_64-pc-windows-gnu` cross-compile **Unit & GPU tests** (debug test binary, `XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64`, `--test-threads=1 --nocapture`, `MemoryMax=14G`, `MemorySwapMax=0`) - `dispatch_chain`: **4 passed, 0 failed, 0 ignored, 0 skipped** (0.11 s), confirming both native wave64 whole-pipeline retention and split dispatch chains on RADV with `dxil-spirv` `53aac418`: - `gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole` - `gpu::dxil::module::split::tests::dispatch_chain_divergent_forward_edges_3d` - `gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops` - `gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange` **Not tested:** full workspace suite, stock vkd3d-proton 3.1 `dxil-spirv`, retail shader pack or title runs. **AI use:** T3 Code / Antigravity (Gemini 4 Neon) built and ran these tests on this machine and drafted this report.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 11:06 UTC · original

Quick CI check on ecadab8: Build and test (Windows, no GPU) failed to compile in crates/xcl/src/hle/d3d12x/pso_async.rs:786:54 (error[E0308]: mismatched types: expected Box<dyn FnOnce() + Send>, found Arc<Pending> at queue().lock().unwrap().send(p.clone()), from merging #2176's resolve_spared onto the queue change).

**@⁠raylitebull** on GitHub · 2026-11-25 11:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7160588005) Quick CI check on `ecadab8`: `Build and test (Windows, no GPU)` failed to compile in `crates/xcl/src/hle/d3d12x/pso_async.rs:786:54` (`error[E0308]: mismatched types: expected Box<dyn FnOnce() + Send>, found Arc<Pending>` at `queue().lock().unwrap().send(p.clone())`, from merging `#2176`'s `resolve_spared` onto the queue change).
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 11:10 UTC · original

Thanks. That was ours to fix: this PR turns the worker queue into a queue of closures, and #2176's resolve_spared still sent the Pending itself. It now goes through enqueue like the other sends, in the first commit. The stack is rebased onto main 96331383 (#2080 40d1b15; #2097, #2107, #2123 and #2126 on top of it). The rebase also changed one test fixture: #2194 now merges linear blocks, so the native-wave64 test builds conditional blocks instead.

"Build and test" can still fail on two unit tests that fail on main itself: device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (noted on #1991) and pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator (noted on #2120). New smoke pairs for the new heads are running; the descriptions get them when they're done.

AI use: Claude Code (Claude Opus 5.5) found the cause, made the fix and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 11:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7160699776) Thanks. That was ours to fix: this PR turns the worker queue into a queue of closures, and #2176's `resolve_spared` still sent the `Pending` itself. It now goes through `enqueue` like the other sends, in the first commit. The stack is rebased onto `main` `96331383` (#2080 `40d1b15`; #2097, #2107, #2123 and #2126 on top of it). The rebase also changed one test fixture: #2194 now merges linear blocks, so the native-wave64 test builds conditional blocks instead. "Build and test" can still fail on two unit tests that fail on `main` itself: `device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` (noted on #1991) and `pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator` (noted on #2120). New smoke pairs for the new heads are running; the descriptions get them when they're done. AI use: Claude Code (Claude Opus 5.5) found the cause, made the fix and wrote this reply.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 11:27 UTC · original

Regression run of 40d1b15f on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: 40d1b15fbbeb9761ac5b5ecad8ea082314753c09
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1632 (PresentX 1632)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14565 MB

Against the limits in CONTRIBUTING.md: 104 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

**@⁠Toons29** on GitHub · 2026-11-25 11:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7161079554) Regression run of `40d1b15f` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `568e7db7`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14592 MB ``` ``` xcl-smoke v1 commit: 40d1b15fbbeb9761ac5b5ecad8ea082314753c09 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1632 (PresentX 1632) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14565 MB ``` Against the limits in CONTRIBUTING.md: 104 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; a script posted this right after the run, with both blocks exactly as printed.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 11:37 UTC · original

On current main this stack splits none of the CS_RaytracingResolve programs I tried, silently. Cause and a fix below; with it they split and run in the title on AMD RDNA4 (native wave64).

Cause. dispatch_piece copies the whole program's features and infer_piece_features drops only doubles, int64 and the heap-indexing ones. Since #2156 (ec356bc) such a program has a typed UAV load in a few places, so the whole declares TypedUavLoadAdditionalFormats. A piece without one then fails the validator:

error: Flags must match usage.
note: Flags declared=3221757968, actual=3221749776        (the difference is bit 13)

make_piece turns that into None (validate(&blob).ok()?), so split_compute returns None and the program is built whole, with no line in the log. Found at the stack's heads 40d1b15 / 049dec8 / c9e3945 merged on 426a5a7: the plan had 11 pieces, piece 5 (ef008c0f04b6261a), 3 (742a41ceb422beb5) or 4 (33743bd6d1e45443) was refused.

Fix I tested (in infer_piece_features):

diff --git a/crates/xcl/src/gpu/dxil/module/split.rs b/crates/xcl/src/gpu/dxil/module/split.rs
index 6d98f51..50395f7 100644
--- a/crates/xcl/src/gpu/dxil/module/split.rs
+++ b/crates/xcl/src/gpu/dxil/module/split.rs
@@ -245,6 +245,13 @@ impl Shader {
                   Feature::ResourceHeapIndexing, Feature::SamplerHeapIndexing] {
             self.features.remove(&f);
         }
+        // typed UAV loads (`Shader::texture_load` without a mip): the whole program's flag stays
+        // only on the pieces that have one, the validator wants flags to match usage
+        let uav_load = |args: &[Value], m: &Module| args.get(2).is_some_and(|&mip| matches!(mip, Value::Const(c) if matches!(m.consts[c as usize], super::ConstDef::Undef(_))));
+        if !self.m.blocks.iter().flatten().any(|&i| matches!(&self.m.insts[i as usize].op,
+            Op::Call(f, args) if self.m.funcs[*f as usize].name.starts_with("dx.op.textureLoad") && uav_load(args, &self.m))) {
+            self.features.remove(&Feature::TypedUavLoadAdditionalFormats);
+        }
         for def in &self.m.insts {
             if let Op::Call(f, args) = &def.op {
                 if self.m.funcs[*f as usize].name == "dx.op.createHandleFromHeap" {
record whole before with the fix
ef008c0f04b6261a 933,964 B 0 pieces 11 (12 – 178 KB)
ab570963c407e5c0 889,396 B 0 11 (12 – 173 KB)
742a41ceb422beb5 939,868 B 0 11 (15 – 133 KB)
33743bd6d1e45443 851,232 B 0 11 (12 – 153 KB)

Please also log when a piece is refused; a refusal is invisible now. A test that splits a program with a typed UAV load in only one piece would hold it.

In the title (tree: 426a5a7 + #2180 + #2029 + #1782 + #2080 + #2107 + #2126 + the fix; XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0, AMD RDNA4, Windows, release, one run, still going at 254 s): compute split: 11 programs split, 50 pieces built, 97 chained dispatches issued, no device removal, no crash. The longest driver compile so far is 19 s; the same programs took 51 – 55 s each, one after the other on a title thread, in the run before (568e7db, whole). Presents stop at about 70 s in both.

Tests on that tree, debug, cargo test --workspace --no-fail-fast -- --test-threads=4: 1253 passed, 5 failed, 46 ignored; XCL_DIRECT_DXIL=all cargo test -p xcl --lib gpu::: 634 passed, the same 5 failed, 22 ignored. Three of the five are on main (fuzz_validate_and_gpu_1 and _3, #2115; gpu_image_get_resinfo_past_last_level). The other two are #2126's dispatch_chain_payload_skips_middle_piece and dispatch_chain_payload_survives_reused_edge_slot: split_compute gives None there. I take it that #2194 now merges the fixtures' straight-line blocks, so there is no edge to cut at, as you already fixed for dispatch_chain_native_wave64_builds_whole; I did not check further.

Still open from the earlier comments, and not in these heads: helpers do not see the parent's demand, the disk key of the whole form does not tell the two root signatures apart. For the first, setting BUILDING to the parent in the helper's closure and restoring it afterwards worked in a local build of the older heads.

Two more from reading dispatch_chain.rs: scratch_buffer makes a committed resource for every chained dispatch (up to 4 GiB, no pool), and whole() for an ExecuteIndirect builds the entire program on the recording thread. Neither has shown as a problem in the run above.

Not tested: GPU time of the chains, output against the whole form on these four programs, NVIDIA, the flag fix alone on #2080 without #2107 / #2126.

AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the fix, ran the tests and the title and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 11:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7161278234) **On current `main` this stack splits none of the `CS_RaytracingResolve` programs I tried, silently.** Cause and a fix below; with it they split and run in the title on AMD RDNA4 (native wave64). **Cause.** `dispatch_piece` copies the whole program's features and `infer_piece_features` drops only doubles, int64 and the heap-indexing ones. Since #2156 (`ec356bc`) such a program has a typed UAV load in a few places, so the whole declares `TypedUavLoadAdditionalFormats`. A piece without one then fails the validator: ``` error: Flags must match usage. note: Flags declared=3221757968, actual=3221749776 (the difference is bit 13) ``` `make_piece` turns that into `None` (`validate(&blob).ok()?`), so `split_compute` returns `None` and the program is built whole, with no line in the log. Found at the stack's heads `40d1b15` / `049dec8` / `c9e3945` merged on `426a5a7`: the plan had 11 pieces, piece 5 (`ef008c0f04b6261a`), 3 (`742a41ceb422beb5`) or 4 (`33743bd6d1e45443`) was refused. **Fix I tested** (in `infer_piece_features`): ```diff diff --git a/crates/xcl/src/gpu/dxil/module/split.rs b/crates/xcl/src/gpu/dxil/module/split.rs index 6d98f51..50395f7 100644 --- a/crates/xcl/src/gpu/dxil/module/split.rs +++ b/crates/xcl/src/gpu/dxil/module/split.rs @@ -245,6 +245,13 @@ impl Shader { Feature::ResourceHeapIndexing, Feature::SamplerHeapIndexing] { self.features.remove(&f); } + // typed UAV loads (`Shader::texture_load` without a mip): the whole program's flag stays + // only on the pieces that have one, the validator wants flags to match usage + let uav_load = |args: &[Value], m: &Module| args.get(2).is_some_and(|&mip| matches!(mip, Value::Const(c) if matches!(m.consts[c as usize], super::ConstDef::Undef(_)))); + if !self.m.blocks.iter().flatten().any(|&i| matches!(&self.m.insts[i as usize].op, + Op::Call(f, args) if self.m.funcs[*f as usize].name.starts_with("dx.op.textureLoad") && uav_load(args, &self.m))) { + self.features.remove(&Feature::TypedUavLoadAdditionalFormats); + } for def in &self.m.insts { if let Op::Call(f, args) = &def.op { if self.m.funcs[*f as usize].name == "dx.op.createHandleFromHeap" { ``` | record | whole | before | with the fix | |---|---:|---|---| | `ef008c0f04b6261a` | 933,964 B | 0 pieces | 11 (12 – 178 KB) | | `ab570963c407e5c0` | 889,396 B | 0 | 11 (12 – 173 KB) | | `742a41ceb422beb5` | 939,868 B | 0 | 11 (15 – 133 KB) | | `33743bd6d1e45443` | 851,232 B | 0 | 11 (12 – 153 KB) | Please also log when a piece is refused; a refusal is invisible now. A test that splits a program with a typed UAV load in only one piece would hold it. **In the title** (tree: `426a5a7` + #2180 + #2029 + #1782 + #2080 + #2107 + #2126 + the fix; `XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0`, AMD RDNA4, Windows, release, one run, still going at 254 s): `compute split: 11 programs split, 50 pieces built, 97 chained dispatches issued`, no device removal, no crash. The longest driver compile so far is 19 s; the same programs took 51 – 55 s each, one after the other on a title thread, in the run before (`568e7db`, whole). Presents stop at about 70 s in both. **Tests** on that tree, debug, `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1253 passed, 5 failed, 46 ignored; `XCL_DIRECT_DXIL=all cargo test -p xcl --lib gpu::`: 634 passed, the same 5 failed, 22 ignored. Three of the five are on `main` (`fuzz_validate_and_gpu_1` and `_3`, #2115; `gpu_image_get_resinfo_past_last_level`). The other two are #2126's `dispatch_chain_payload_skips_middle_piece` and `dispatch_chain_payload_survives_reused_edge_slot`: `split_compute` gives `None` there. I take it that #2194 now merges the fixtures' straight-line blocks, so there is no edge to cut at, as you already fixed for `dispatch_chain_native_wave64_builds_whole`; I did not check further. **Still open from the earlier comments**, and not in these heads: helpers do not see the parent's demand, the disk key of the whole form does not tell the two root signatures apart. For the first, setting `BUILDING` to the parent in the helper's closure and restoring it afterwards worked in a local build of the older heads. Two more from reading `dispatch_chain.rs`: `scratch_buffer` makes a committed resource for every chained dispatch (up to 4 GiB, no pool), and `whole()` for an `ExecuteIndirect` builds the entire program on the recording thread. Neither has shown as a problem in the run above. **Not tested:** GPU time of the chains, output against the whole form on these four programs, NVIDIA, the flag fix alone on #2080 without #2107 / #2126. AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the fix, ran the tests and the title and wrote this on the maintainer's behalf.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 11:51 UTC · original

Thank you, and for the fix. It's in the first commit of 6c34370, with what you asked for and what was still open:

  • Typed UAV loads: your change to infer_piece_features as you wrote it.
  • Refusals are logged: compute split: piece N of M refused, the program stays whole: <first line of the error>, for a failed finish or a failed validation.
  • Test: dispatch_chain_declares_typed_uav_loads_only_where_they_are splits a program with a typed UAV load (float4 heap texture) in one of its pieces. With DXC 1.9's validator (XCL_DXC_DIR) it fails without the fix, with your Flags must match usage, and passes with it. With the SDK's 1.7 validator, validation is skipped, so it only shows the fix with 1.8 or newer.
  • Helpers see the parent's demand: build_pieces hands the parent's BUILDING to each helper closure and restores the helper's own after it, as you did locally.
  • The whole form's disk key: compute_container takes chained. Builds under the chain's root signature (its pieces and its whole form) keep their driver blob in <name>.chain.pso, so a refused blob no longer deletes the title-signature file of the same DXIL.

scratch_buffer per dispatch and the ExecuteIndirect whole build are unchanged. I'll take them separately if they show up.

#2097, #2107, #2123 and #2126 are restacked on it: 8b2fa0e, 697e8fd, 7f4b22d, f6fa8a9. #2126's two payload tests now keep their three blocks apart with a branch every lane takes. As you found, #2194 had merged them, and #2123's add-result test needed the same change. On these heads, with DXC 1.9: the split and dispatch-chain tests pass, and the pipeline-queue and gate tests pass on #2080. The full suites and new smoke pairs are running.

Two things from our runs on the previous heads (main 9633138, NVIDIA RTX 5070 Ti, direct route, 120 s):

  • Less split since #2194: each PR splits fewer programs than before it. #2080 split 21 programs into 95 pieces (25 into 117 before). #2107 split 19 into 86 (33 into 173 before). Merged blocks leave fewer edges to cut at.
  • #2126 crashed in both of its runs, at 30.6 s and 59.5 s. The stack was the same both times: memcpy < tiling::Chain::detile_level < title_textures::title_bytes (title_textures.rs:1202, the borrowed path after shader::readable()), on a subresources_on worker. main and the other four heads ran clean. Your AMD run with #2126 in the tree didn't crash. I don't know yet whether the split is involved; the next run tries #2126 with the split off.

AI use: Claude Code (Claude Opus 5.5) applied the fix, made the other changes and the tests, ran them, and wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 11:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7161593942) Thank you, and for the fix. It's in the first commit of `6c34370`, with what you asked for and what was still open: - **Typed UAV loads:** your change to `infer_piece_features` as you wrote it. - **Refusals are logged:** `compute split: piece N of M refused, the program stays whole: <first line of the error>`, for a failed finish or a failed validation. - **Test:** `dispatch_chain_declares_typed_uav_loads_only_where_they_are` splits a program with a typed UAV load (float4 heap texture) in one of its pieces. With DXC 1.9's validator (`XCL_DXC_DIR`) it fails without the fix, with your `Flags must match usage`, and passes with it. With the SDK's 1.7 validator, validation is skipped, so it only shows the fix with 1.8 or newer. - **Helpers see the parent's demand:** `build_pieces` hands the parent's `BUILDING` to each helper closure and restores the helper's own after it, as you did locally. - **The whole form's disk key:** `compute_container` takes `chained`. Builds under the chain's root signature (its pieces and its whole form) keep their driver blob in `<name>.chain.pso`, so a refused blob no longer deletes the title-signature file of the same DXIL. `scratch_buffer` per dispatch and the `ExecuteIndirect` whole build are unchanged. I'll take them separately if they show up. #2097, #2107, #2123 and #2126 are restacked on it: `8b2fa0e`, `697e8fd`, `7f4b22d`, `f6fa8a9`. #2126's two payload tests now keep their three blocks apart with a branch every lane takes. As you found, #2194 had merged them, and #2123's add-result test needed the same change. On these heads, with DXC 1.9: the split and dispatch-chain tests pass, and the pipeline-queue and gate tests pass on #2080. The full suites and new smoke pairs are running. Two things from our runs on the previous heads (`main` `9633138`, NVIDIA RTX 5070 Ti, direct route, 120 s): - **Less split since #2194:** each PR splits fewer programs than before it. #2080 split 21 programs into 95 pieces (25 into 117 before). #2107 split 19 into 86 (33 into 173 before). Merged blocks leave fewer edges to cut at. - **#2126 crashed** in both of its runs, at 30.6 s and 59.5 s. The stack was the same both times: `memcpy` < `tiling::Chain::detile_level` < `title_textures::title_bytes` (`title_textures.rs:1202`, the borrowed path after `shader::readable()`), on a `subresources_on` worker. `main` and the other four heads ran clean. Your AMD run with #2126 in the tree didn't crash. I don't know yet whether the split is involved; the next run tries #2126 with the split off. AI use: Claude Code (Claude Opus 5.5) applied the fix, made the other changes and the tests, ran them, and wrote this reply.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 12:15 UTC · original

Thanks @⁠Toons29 for the RX 9070 pairs on all five split PRs. Each one is now in that PR's Tested section with the commit you ran. They're marked as before the latest rebase, since all five branches have been rebased onto main 9633138 since. The current heads are #2080 6c34370, #2097 8b2fa0e, #2107 697e8fd, #2123 7f4b22d and #2126 f6fa8a9.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 12:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7162122621) Thanks @⁠Toons29 for the RX 9070 pairs on all five split PRs. Each one is now in that PR's **Tested** section with the commit you ran. They're marked as before the latest rebase, since all five branches have been rebased onto `main` `9633138` since. The current heads are #2080 `6c34370`, #2097 `8b2fa0e`, #2107 `697e8fd`, #2123 `7f4b22d` and #2126 `f6fa8a9`. AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠ettehn on GitHub · 2026-11-25 11:59 UTC · original · edited 2026-11-25 12:31 UTC

Independent Windows check of the typed-UAV split fix on exact 6c34370 with DXC/DXIL 1.8.2502.11. The same local compute record through console_to_dxil_in, with XCL_DIRECT_DXIL=1, 12,500-instruction target, split-wave policy and four windows, translated to 0 dispatch pieces on 40d1b15 merged onto 426a5a7. The latest head generated 12 pieces (39,924–215,060 bytes); the 957,016-byte whole form and every piece passed the DXIL validator. Disk translation caching was disabled. The probe did not create a GPU pipeline.

On the exact same head, cargo test --offline --locked -p xcl --lib dispatch_chain -- --test-threads=1 --nocapture reported 5 passed, 0 failed, 0 ignored. That includes the typed-UAV validator test and three executed dispatch-chain comparisons on the RTX 5070 Ti Laptop. The native-wave64 GPU portion explicitly skipped. I did not run the full suite or launch a title.

Driver-cache follow-up: I added a local test that calls compute_container against an isolated disk cache and a simulated driver callback. With the chain suffix removed, the chained request picked up the title blob. On 6c34370, it read the chain blob, discarded only that file after rejection, and retried without a blob. The next title request hit the original title blob. compute_blob_tests: 2 passed, 0 failed with the suffix. This verifies the disk lookup and eviction paths.

Native NVIDIA follow-up: A 2,928-byte synthetic compute shader on the RTX 5070 Ti Laptop generated a 1,498-byte driver blob under each of the title ABI and dispatch-chain root signatures. Crossing the blobs returned 0x80070057 in both directions. With the two matching blobs in an isolated directory, compute_container accepted both as disk hits and left both files intact. The local hardware test passed (1 passed, 0 failed, 0 skips); it created small PSOs and did not launch a title or time a large pipeline.

Worker-demand follow-up: On Windows, a local two-worker test started one piece on the parent and one on a distinct helper before triggering the waiting bind. On 6c34370, both pieces observed the transition from background to wanted via wanted_here() and build_is_wanted(). With only the helper’s inherited BUILDING context removed, the parent still observed the bind and the helper stayed unwanted until the test’s four-second timeout. This exercises the actual queue and bind path with synthetic jobs; no driver compilation timing was measured.

Combined stack check: I merged #2097 8b2fa0e, #2107 697e8fd, #2123 7f4b22d and #2126 f6fa8a9 (all on #2080 6c34370) onto main 1a0bbe3. Local integration head mirrored on my fork. The conflict resolution keeps each joined spin region in one piece, allows a region above the target up to the four-times ceiling, preserves the global UAV-add polling fallback, and allocates the shared wave checkpoint after stable SSA payload slots. This is a combined test branch.

On Windows with the RTX 5070 Ti Laptop, cargo test --offline --locked -p xcl --lib gpu::dxil::module::split::tests -- --test-threads=1 --nocapture ran 12 tests: 12 passed, 0 failed, 0 ignored, 0 runtime skips. This includes the four-wave and exited-wave cases, oversized loops, atomic-add handling, and both payload readback cases.

Combined startup smoke: Clean Release builds on the same RTX 5070 Ti Laptop, the same retail title for 20 s each, networking off, one pipeline worker, preloading off, separate fresh XCL caches. main 1a0bbe3 showed 92 frames / 11,519 MB peak commit; e44a513 showed 90 frames / 11,483 MB. Both exited 0x0 with zero crashes and zero device removals. This covers startup only. No in-world run or full suite on the combined tree.

AI use: OpenAI Codex (GPT-6.2 Sol) assisted with verification.

_Originally posted by @⁠ettehn in #2080

_Originally posted by @⁠ettehn in #2080

_Originally posted by @⁠ettehn in #2080

_Originally posted by @⁠ettehn in #2080

_Originally posted by @⁠ettehn in #2080

**@⁠ettehn** on GitHub · 2026-11-25 11:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7161777038) · edited 2026-11-25 12:31 UTC Independent Windows check of the typed-UAV split fix on exact `6c34370` with DXC/DXIL 1.8.2502.11. The same local compute record through `console_to_dxil_in`, with `XCL_DIRECT_DXIL=1`, 12,500-instruction target, split-wave policy and four windows, translated to 0 dispatch pieces on `40d1b15` merged onto `426a5a7`. The latest head generated 12 pieces (39,924–215,060 bytes); the 957,016-byte whole form and every piece passed the DXIL validator. Disk translation caching was disabled. The probe did not create a GPU pipeline. On the exact same head, `cargo test --offline --locked -p xcl --lib dispatch_chain -- --test-threads=1 --nocapture` reported 5 passed, 0 failed, 0 ignored. That includes the typed-UAV validator test and three executed dispatch-chain comparisons on the RTX 5070 Ti Laptop. The native-wave64 GPU portion explicitly skipped. I did not run the full suite or launch a title. **Driver-cache follow-up:** I added a local test that calls `compute_container` against an isolated disk cache and a simulated driver callback. With the chain suffix removed, the chained request picked up the title blob. On `6c34370`, it read the chain blob, discarded only that file after rejection, and retried without a blob. The next title request hit the original title blob. `compute_blob_tests`: 2 passed, 0 failed with the suffix. This verifies the disk lookup and eviction paths. **Native NVIDIA follow-up:** A 2,928-byte synthetic compute shader on the RTX 5070 Ti Laptop generated a 1,498-byte driver blob under each of the title ABI and dispatch-chain root signatures. Crossing the blobs returned `0x80070057` in both directions. With the two matching blobs in an isolated directory, `compute_container` accepted both as disk hits and left both files intact. The local hardware test passed (1 passed, 0 failed, 0 skips); it created small PSOs and did not launch a title or time a large pipeline. **Worker-demand follow-up:** On Windows, a local two-worker test started one piece on the parent and one on a distinct helper before triggering the waiting bind. On `6c34370`, both pieces observed the transition from background to wanted via `wanted_here()` and `build_is_wanted()`. With only the helper’s inherited `BUILDING` context removed, the parent still observed the bind and the helper stayed unwanted until the test’s four-second timeout. This exercises the actual queue and bind path with synthetic jobs; no driver compilation timing was measured. **Combined stack check:** I merged #2097 `8b2fa0e`, #2107 `697e8fd`, #2123 `7f4b22d` and #2126 `f6fa8a9` (all on #2080 `6c34370`) onto `main` `1a0bbe3`. [Local integration head mirrored on my fork](https://github.com/ettehn/xcl/commit/e44a5137f4ca574a1c48f1f8f0d640d354f4c379). The conflict resolution keeps each joined spin region in one piece, allows a region above the target up to the four-times ceiling, preserves the global UAV-add polling fallback, and allocates the shared wave checkpoint after stable SSA payload slots. This is a combined test branch. On Windows with the RTX 5070 Ti Laptop, `cargo test --offline --locked -p xcl --lib gpu::dxil::module::split::tests -- --test-threads=1 --nocapture` ran 12 tests: 12 passed, 0 failed, 0 ignored, 0 runtime skips. This includes the four-wave and exited-wave cases, oversized loops, atomic-add handling, and both payload readback cases. **Combined startup smoke:** Clean Release builds on the same RTX 5070 Ti Laptop, the same retail title for 20 s each, networking off, one pipeline worker, preloading off, separate fresh XCL caches. `main` `1a0bbe3` showed 92 frames / 11,519 MB peak commit; `e44a513` showed 90 frames / 11,483 MB. Both exited `0x0` with zero crashes and zero device removals. This covers startup only. No in-world run or full suite on the combined tree. AI use: OpenAI Codex (GPT-6.2 Sol) assisted with verification. _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2080 _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2080 _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2080 _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2080 _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2080
Author
Owner

@⁠Raghav314 on GitHub · 2026-11-25 12:41 UTC · original

A title run of #2080 on an RTX 4090: the split works and caps the longest build at 7.9 s, but the world load still stops presenting at ~74 s behind cold compute builds one after another. No removal, no crash, no GPU wait timeout in 300 s.

Setup: RTX 4090 24 GB (driver 617.14), 32 GB RAM, Windows 11, release. main 1a0bbe3 with #2080 at 6c34370 merged (no conflicts; 62f78ed). Retail title 1.0.2.1, A pressed from 20 s, 300 s, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GPU_PROFILE=1 XCL_NETWORK=0. Cold: no DXIL or driver blobs for this tree before the run. One run.

xcl-smoke v1
commit: 62f78ed7117c65fce1baaf4c1e191ea8b447139c
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 300
exit: 0x0
frames shown: 1461 (PresentX 1461)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 31967 MB
  • compute split: 33 programs split, 179 pieces built, 89 chained dispatches issued at 300 s.
  • 57 logged cold compute builds (driver compile finish), 181 s of driver time in all, the longest 7.9 s. 47 of them (146 s) came after the last present at ~74 s, with the GPU nearly idle (0–3 dispatches per 2 s).
  • Still compiling at the end: 56c0cd3b82a00c6e (449 KB DXIL) started at 296.8 s.
  • For reference, not an A/B (a different tree): #2057 4df1e6e cold on the same machine and switches, earlier today, stopped presenting at ~74 s too, with 57 cold builds of 190 s and a longest of 12 s.

Read: on this card the pieces build quickly, but the title still binds big compute programs one at a time after 74 s, and one cold run does not get through them. Not tested: plain main in the same session, a warm second run.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote it for @⁠Raghav314.

**@⁠Raghav314** on GitHub · 2026-11-25 12:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7162718019) A title run of #2080 on an RTX 4090: the split works and caps the longest build at 7.9 s, but the world load still stops presenting at ~74 s behind cold compute builds one after another. No removal, no crash, no GPU wait timeout in 300 s. **Setup:** RTX 4090 24 GB (driver 617.14), 32 GB RAM, Windows 11, release. `main` `1a0bbe3` with #2080 at `6c34370` merged (no conflicts; `62f78ed`). Retail title 1.0.2.1, A pressed from 20 s, 300 s, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GPU_PROFILE=1 XCL_NETWORK=0`. Cold: no DXIL or driver blobs for this tree before the run. One run. ``` xcl-smoke v1 commit: 62f78ed7117c65fce1baaf4c1e191ea8b447139c gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 300 exit: 0x0 frames shown: 1461 (PresentX 1461) presents per 2 s (last 3): 0 0 0 device removals: 0 crashes: 0 peak commit: 31967 MB ``` - `compute split: 33 programs split, 179 pieces built, 89 chained dispatches issued` at 300 s. - 57 logged cold compute builds (`driver compile finish`), 181 s of driver time in all, the longest 7.9 s. 47 of them (146 s) came after the last present at ~74 s, with the GPU nearly idle (0–3 dispatches per 2 s). - Still compiling at the end: `56c0cd3b82a00c6e` (449 KB DXIL) started at 296.8 s. - For reference, not an A/B (a different tree): #2057 `4df1e6e` cold on the same machine and switches, earlier today, stopped presenting at ~74 s too, with 57 cold builds of 190 s and a longest of 12 s. **Read:** on this card the pieces build quickly, but the title still binds big compute programs one at a time after 74 s, and one cold run does not get through them. Not tested: plain `main` in the same session, a warm second run. AI use: Claude Code (Claude Opus 5.5) ran this and wrote it for @⁠Raghav314.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 07:06 UTC · original · edited 2026-11-25 13:03 UTC

Recheck on 6c34370

Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11, debug. cargo build --offline --locked --workspace --jobs 6 passed on the exact PR head, and the integration built with --jobs 4. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture gave:

  • Exact PR head: 1246 passed, 2 failed, 46 ignored. rerouted_disk_entries_follow_the_direct_translator (68 vs 1) and pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (28 vs 85) failed with the same assertion values when rerun individually on clean pinned base 9633138.
  • PR merged locally onto main 1a0bbe3: 1255 passed, 0 failed, 46 ignored. Main includes #2245, which corrected both assertions.

Both builds passed the typed-UAV validator fixture and the wave32, emulated-wave64, and divergent 3D dispatch comparisons. Cargo’s passed count includes 26 explicit skip notices on each run. The native-wave64 fixture skipped at the GPU capability check. These were synthetic tests without retail world load or pipeline timing.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the recheck and drafted this update.

Earlier verification

Independent native Windows GPU run on 8eefdef, from a clean checkout. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.

Tested

  • cargo build --offline --locked --workspace -j 3 passed.
  • cargo test --offline --locked --workspace --no-fail-fast -j 3 -- --nocapture --test-threads=4 exited 0. Harness totals: 1,158 passed, 0 failed, 46 ignored.
  • All three split dispatch GPU comparisons ran on the RTX 3080 Ti and passed: wave32 live loops, guest wave64 live loops and lane exchange, and divergent forward edges with a 3D group.
  • The suite emitted 26 runtime skip notices, separate from the 46 ignored tests: 21 for unavailable native wave64 (including the whole pipeline fixture’s GPU leg), three for unsupported f16 arithmetic, packed arithmetic or conversion, one for the driver cache disable probe, and one for unavailable heap windows.

Not tested
Retail load or performance, AMD/native wave64, and Wine.

AI use
Codex (GPT-6.2 Sol) ran the build and tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-25 07:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7155492355) · edited 2026-11-25 13:03 UTC **Recheck on [6c34370](https://github.com/xcl-dev/xcl/commit/6c34370946dd11cdc429fdb106f49b798b63b443)** Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, DXC/DXIL 1.8.2502.11, debug. `cargo build --offline --locked --workspace --jobs 6` passed on the exact PR head, and the integration built with `--jobs 4`. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture` gave: - Exact PR head: **1246 passed, 2 failed, 46 ignored**. `rerouted_disk_entries_follow_the_direct_translator` (68 vs 1) and `pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` (28 vs 85) failed with the same assertion values when rerun individually on clean pinned base [9633138](https://github.com/xcl-dev/xcl/commit/963313835813f475037b3a9f5fcc3cb591696928). - PR merged locally onto [main 1a0bbe3](https://github.com/xcl-dev/xcl/commit/1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6): **1255 passed, 0 failed, 46 ignored**. Main includes [#2245](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2245), which corrected both assertions. Both builds passed the typed-UAV validator fixture and the wave32, emulated-wave64, and divergent 3D dispatch comparisons. Cargo’s passed count includes 26 explicit skip notices on each run. The native-wave64 fixture skipped at the GPU capability check. These were synthetic tests without retail world load or pipeline timing. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the recheck and drafted this update. **Earlier verification** Independent native Windows GPU run on [8eefdef](https://github.com/xcl-dev/xcl/commit/8eefdefcf2283f1ae7ff524ed66de43356b82060), from a clean checkout. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. **Tested** - `cargo build --offline --locked --workspace -j 3` passed. - `cargo test --offline --locked --workspace --no-fail-fast -j 3 -- --nocapture --test-threads=4` exited 0. Harness totals: 1,158 passed, 0 failed, 46 ignored. - All three split dispatch GPU comparisons ran on the RTX 3080 Ti and passed: wave32 live loops, guest wave64 live loops and lane exchange, and divergent forward edges with a 3D group. - The suite emitted 26 runtime skip notices, separate from the 46 ignored tests: 21 for unavailable native wave64 (including the whole pipeline fixture’s GPU leg), three for unsupported f16 arithmetic, packed arithmetic or conversion, one for the driver cache disable probe, and one for unavailable heap windows. **Not tested** Retail load or performance, AMD/native wave64, and Wine. **AI use** Codex (GPT-6.2 Sol) ran the build and tests and drafted this report.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 13:05 UTC · original

The scratch is 187 KB a group (median), and each dispatch makes its own: I think it has to be bounded before this goes in. A commit for it is written and tested; it follows after a title run.

Measured on the translated cache of a retail title (AMD RDNA4, heads 6c34370 + 697e8fd + f6fa8a9, wave32): dwords_per_group of its 176 split programs is 6.6 KB at least, 187 KB median, 214 KB at 90 %, 249 KB at most. For a dispatch that is

Grid (8x4 groups) Groups Median Most
480x270 4 080 0.75 GB 1.0 GB
960x540 16 200 3.0 GB 3.9 GB
1920x1080 64 800 11.8 GB (over the 4 GiB limit: the whole form) 15.8 GB

dispatch_chain::dispatch commits that much per dispatch and the recording keeps it until the allocator's reset, so a few of them in flight fill a card; over 4 GiB the whole form is built on the title's thread. I have not logged the grids the title uses, so how much of this happened in a run is not known: the runs here issued 51, 95 and 67 chained dispatches, and the third ended in 0x887a0006 (cause unknown, other changes were in that tree too).

What the commit does, on top of #2080 + #2107 + #2126:

  • a dispatch runs in slabs of whole planes / rows / parts of a row, at most XCL_SPLIT_SCRATCH_MB (256) of scratch at once; the pieces add the slab's origin (four more root constants) to their group ids, the scratch index stays the slab's own
  • the chains recorded on one list share one buffer, with a UAV barrier between them (the first piece writes every lane's tag, so old contents do not matter)
  • log_counts prints the scratch alive, the most there was, and the largest dispatch

Tests: dispatch_chain_divergent_forward_edges_3d also with 1, 2, 3, 6, 7 and 12 groups at once (the same words as the whole form), and a unit test of the slabs. Whole suite with it, on main 1a0bbe3 + #1428 + the three: 1261 passed, 2 failed (#2115, as on main), 46 ignored; without it 1260 / 2 / 46.

Two more things from merging: the conflict with #1428 in kernel.rs / bind.rs is small (the early return of a group past a folded dispatch's count writes tag 0, so the later pieces skip it), and the ExecuteIndirect error path has to call clamp::done before it returns.

AI use: Claude Code (Claude Opus 5.5) wrote the code, ran the tests and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 13:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163269671) **The scratch is 187 KB a group (median), and each dispatch makes its own: I think it has to be bounded before this goes in.** A commit for it is written and tested; it follows after a title run. Measured on the translated cache of a retail title (AMD RDNA4, heads `6c34370` + `697e8fd` + `f6fa8a9`, wave32): `dwords_per_group` of its 176 split programs is 6.6 KB at least, **187 KB median**, 214 KB at 90 %, 249 KB at most. For a dispatch that is | Grid (8x4 groups) | Groups | Median | Most | |---|---|---|---| | 480x270 | 4 080 | 0.75 GB | 1.0 GB | | 960x540 | 16 200 | 3.0 GB | 3.9 GB | | 1920x1080 | 64 800 | 11.8 GB (over the 4 GiB limit: the whole form) | 15.8 GB | `dispatch_chain::dispatch` commits that much per dispatch and the recording keeps it until the allocator's reset, so a few of them in flight fill a card; over 4 GiB the whole form is built on the title's thread. I have **not** logged the grids the title uses, so how much of this happened in a run is not known: the runs here issued 51, 95 and 67 chained dispatches, and the third ended in 0x887a0006 (cause unknown, other changes were in that tree too). What the commit does, on top of #2080 + #2107 + #2126: - a dispatch runs in slabs of whole planes / rows / parts of a row, at most `XCL_SPLIT_SCRATCH_MB` (256) of scratch at once; the pieces add the slab's origin (four more root constants) to their group ids, the scratch index stays the slab's own - the chains recorded on one list share one buffer, with a UAV barrier between them (the first piece writes every lane's tag, so old contents do not matter) - `log_counts` prints the scratch alive, the most there was, and the largest dispatch Tests: `dispatch_chain_divergent_forward_edges_3d` also with 1, 2, 3, 6, 7 and 12 groups at once (the same words as the whole form), and a unit test of the slabs. Whole suite with it, on `main` `1a0bbe3` + #1428 + the three: 1261 passed, 2 failed (#2115, as on `main`), 46 ignored; without it 1260 / 2 / 46. Two more things from merging: the conflict with #1428 in `kernel.rs` / `bind.rs` is small (the early return of a group past a folded dispatch's count writes tag 0, so the later pieces skip it), and the `ExecuteIndirect` error path has to call `clamp::done` before it returns. AI use: Claude Code (Claude Opus 5.5) wrote the code, ran the tests and wrote this on the maintainer's behalf.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-25 13:06 UTC · original

NVIDIA driver build times with ivall's typed-UAV fix, on #2080 without #2107 / #2126 (NVIDIA and the fix on #2080 alone were both under "Not tested" in ivall's comment): on an RTX 3060 five programs split, every piece builds, and all pieces are built 5.5 to 9.7 times sooner than the whole form (12 threads, nothing else compiling). A sixth needs #2107.

Raghav314's title run above is NVIDIA too, at 6c34370, with heap windows; this adds whole against pieces per program, in the switch form.

Built: main ea088a5 + #2080 40d1b15 + ivall's diff, release, uncommitted. 6c34370 merged onto main 1a0bbe3 has the same crates/xcl/src/gpu, file for file, except that its split.rs has the refusal log, a reworded comment and a test (compared, not rebuilt). On its own base 9633138 it lacks #2180 and ea088a5, so sizes there can differ.

Method: xcl shaders <pack> --measure-pso <hash> with a local addition (XCL_DIRECT_DXIL=1, translated cache off, split wave64, four switch windows): the whole form, then all pieces on 12 threads, driver and D3D caches disabled (ShaderCacheControl), three runs in one process per program. Pieces use the chain's root signature; the whole form used the ABI one without the input-assembler flag.

record pieces whole, s: median (min–max) pieces, wall s: median (min–max) sum of pieces ratio
ef008c0f04b6261a 11 49.4 (45.8–50.2) 9.1 (7.3–10.1) 51.9 5.5
ab570963c407e5c0 11 41.6 (40.4–43.5) 5.3 (5.3–5.4) 37.6 7.9
33743bd6d1e45443 11 37.1 (34.2–37.4) 3.8 (3.7–4.5) 25.8 9.7
c3ae68197a76d57f 14 80.9 (80.6–81.2) 14.5 (14.4–14.7) 66.1 5.6
fb1c6d2d04361754 14 63.7 (63.6–68.8) 9.1 (8.2–10.3) 62.1 7.0
742a41ceb422beb5, #2080 alone none 45.6 (43.3–48.7)
742a41ceb422beb5, + #2107's planner change (697e8fd) 11 42.1 (41.4–42.6) 4.4 (4.4–4.5) 32.3 9.5
  • Without the fix (the same build with it switched off): 0 pieces for all six. Each of the five is refused with Flags must match usage (declared 3221757968, actual 3221749776); 742a41ce with #2107 as ivall described it, piece 3 of 11 (counting from 0), declared 3222806544, actual 3222798352.
  • 742a41ce on #2080 alone gives no piece and no refusal line: dispatch_plan returns None when one strongly connected component (a loop, or a block on its own) has more instructions than the piece target (cost > limit). With only #2107's three planner hunks added, it splits.
  • The wall time is the slowest piece's time to 0.01 s in every run, so 12 threads were enough and the remaining time is one piece. Ratios are wall time until every piece is built against the whole form's build, from the unrounded medians; not CPU work, and not through the title's PSO workers.

Suite at 6c34370 merged onto main 1a0bbe3 (debug, sandbox without a display, DXC 1.9.2602.17): cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4: 1254 passed, 1 failed, 46 ignored. The failure is the e2e title test (presents is 0 in my sandbox). The five dispatch_chain tests pass, one of them with its GPU part skipped ("no wave64"); 25 SKIPPED lines in all.

Title, regression check only: one 180 s run each of that tree (without the measuring addition) with the split on and off (XCL_DIRECT_SPLIT_INSTRUCTIONS=0); retail title, XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_NETWORK=0, empty DXIL cache, a new exe name, no device removal, no crash, exit 0. Presents 1171 on and 1134 off, the last at about 112 and 110 s. 4 programs split (8 pieces, 52 chained dispatches), all after the last present. None of the six programs above was built in either run.

Hardware: RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, 32 GB, Windows 11 (10.0.26300), Rust 1.100.0 MSVC.

Not tested: ivall's bounded scratch (its extra root constants and group-id adds change the pieces, so times there can differ), outputs against the whole form, GPU time, piece builds through the title's PSO workers, the driver's blob cache and .chain.pso files, the worker changes of 6c34370 in the title, AMD, wave64 hardware.

AI use: Claude Code (Claude Opus 5.5) wrote the measuring addition, ran everything and wrote this; a second Claude Opus 5.5 agent recomputed the timings against the logs, and Claude Fable 5.2 checked this text, except the two sentences on Raghav314's run and the bounded scratch, added after.

**@⁠pvfreis** on GitHub · 2026-11-25 13:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163312319) NVIDIA driver build times with ivall's typed-UAV fix, on #2080 without #2107 / #2126 (NVIDIA and the fix on #2080 alone were both under "Not tested" in [ivall's comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080)): on an RTX 3060 five programs split, every piece builds, and all pieces are built 5.5 to 9.7 times sooner than the whole form (12 threads, nothing else compiling). A sixth needs #2107. Raghav314's title run above is NVIDIA too, at `6c34370`, with heap windows; this adds whole against pieces per program, in the switch form. **Built:** `main` `ea088a5` + #2080 `40d1b15` + ivall's diff, release, uncommitted. `6c34370` merged onto `main` `1a0bbe3` has the same `crates/xcl/src/gpu`, file for file, except that its `split.rs` has the refusal log, a reworded comment and a test (compared, not rebuilt). On its own base `9633138` it lacks #2180 and `ea088a5`, so sizes there can differ. **Method:** `xcl shaders <pack> --measure-pso <hash>` with a local addition (`XCL_DIRECT_DXIL=1`, translated cache off, split wave64, four switch windows): the whole form, then all pieces on 12 threads, driver and D3D caches disabled (`ShaderCacheControl`), three runs in one process per program. Pieces use the chain's root signature; the whole form used the ABI one without the input-assembler flag. | record | pieces | whole, s: median (min–max) | pieces, wall s: median (min–max) | sum of pieces | ratio | |---|---|---|---|---|---| | `ef008c0f04b6261a` | 11 | 49.4 (45.8–50.2) | 9.1 (7.3–10.1) | 51.9 | 5.5 | | `ab570963c407e5c0` | 11 | 41.6 (40.4–43.5) | 5.3 (5.3–5.4) | 37.6 | 7.9 | | `33743bd6d1e45443` | 11 | 37.1 (34.2–37.4) | 3.8 (3.7–4.5) | 25.8 | 9.7 | | `c3ae68197a76d57f` | 14 | 80.9 (80.6–81.2) | 14.5 (14.4–14.7) | 66.1 | 5.6 | | `fb1c6d2d04361754` | 14 | 63.7 (63.6–68.8) | 9.1 (8.2–10.3) | 62.1 | 7.0 | | `742a41ceb422beb5`, #2080 alone | none | 45.6 (43.3–48.7) | | | | | `742a41ceb422beb5`, + #2107's planner change (`697e8fd`) | 11 | 42.1 (41.4–42.6) | 4.4 (4.4–4.5) | 32.3 | 9.5 | - **Without the fix** (the same build with it switched off): 0 pieces for all six. Each of the five is refused with `Flags must match usage` (declared 3221757968, actual 3221749776); `742a41ce` with #2107 as ivall described it, piece 3 of 11 (counting from 0), declared 3222806544, actual 3222798352. - `742a41ce` on #2080 alone gives no piece and no refusal line: `dispatch_plan` returns `None` when one strongly connected component (a loop, or a block on its own) has more instructions than the piece target (`cost > limit`). With only #2107's three planner hunks added, it splits. - The wall time is the slowest piece's time to 0.01 s in every run, so 12 threads were enough and the remaining time is one piece. Ratios are wall time until every piece is built against the whole form's build, from the unrounded medians; not CPU work, and not through the title's PSO workers. **Suite at `6c34370` merged onto `main` `1a0bbe3`** (debug, sandbox without a display, DXC 1.9.2602.17): `cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4`: 1254 passed, 1 failed, 46 ignored. The failure is the e2e title test (`presents` is 0 in my sandbox). The five `dispatch_chain` tests pass, one of them with its GPU part skipped ("no wave64"); 25 SKIPPED lines in all. **Title, regression check only:** one 180 s run each of that tree (without the measuring addition) with the split on and off (`XCL_DIRECT_SPLIT_INSTRUCTIONS=0`); retail title, `XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_NETWORK=0`, empty DXIL cache, a new exe name, no device removal, no crash, exit 0. Presents 1171 on and 1134 off, the last at about 112 and 110 s. 4 programs split (8 pieces, 52 chained dispatches), all after the last present. None of the six programs above was built in either run. **Hardware:** RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, 32 GB, Windows 11 (10.0.26300), Rust 1.100.0 MSVC. **Not tested:** ivall's bounded scratch (its extra root constants and group-id adds change the pieces, so times there can differ), outputs against the whole form, GPU time, piece builds through the title's PSO workers, the driver's blob cache and `.chain.pso` files, the worker changes of `6c34370` in the title, AMD, wave64 hardware. AI use: Claude Code (Claude Opus 5.5) wrote the measuring addition, ran everything and wrote this; a second Claude Opus 5.5 agent recomputed the timings against the logs, and Claude Fable 5.2 checked this text, except the two sentences on Raghav314's run and the bounded scratch, added after.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 13:07 UTC · original

@⁠ivall thanks, agreed: the scratch has to be bounded before this goes in. #2126's per-value slots make it larger again, by 3.5–5.4× per group, as its Not tested says.

I won't push to #2080, #2107 or #2126 until your commit is up, so it applies to the heads you measured (6c34370, 697e8fd, f6fa8a9). If you'd like it carried on one of our branches rather than as your own PR on top, say which and I'll take it as is, with your authorship.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 13:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163313581) @⁠ivall thanks, agreed: the scratch has to be bounded before this goes in. #2126's per-value slots make it larger again, by 3.5–5.4× per group, as its **Not tested** says. I won't push to #2080, #2107 or #2126 until your commit is up, so it applies to the heads you measured (`6c34370`, `697e8fd`, `f6fa8a9`). If you'd like it carried on one of our branches rather than as your own PR on top, say which and I'll take it as is, with your authorship. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 13:24 UTC · original

@⁠ivall a note for your scratch commit: main 379725a (#1592, DRED pipeline labels) now conflicts with the whole split stack, in real.rs only. I've rebased all five locally and each one builds (cargo check -p xcl --tests --release). Nothing is pushed, as promised.

The two hunks:

  • forget_pso keeps both calls, dred::forget_pso and dispatch_chain::forget.
  • #2080 moves the compute PSO's success tail out of the function main changed. So the new dred::label(*ppv, cs) goes into that tail, and also into the chained branch, so DRED names a split program by its console shader too.

Which do you prefer? I can push the rebase now and you rebase the slab commit onto it, which only touches real.rs near those lines. Or I wait and push both together once your commit is up.

AI use: Claude Code (Claude Opus 5.5) did the rebase and wrote this note.

**@⁠Kalmarv** on GitHub · 2026-11-25 13:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163730228) @⁠ivall a note for your scratch commit: `main` `379725a` (#1592, DRED pipeline labels) now conflicts with the whole split stack, in `real.rs` only. I've rebased all five locally and each one builds (`cargo check -p xcl --tests --release`). Nothing is pushed, as promised. The two hunks: - `forget_pso` keeps both calls, `dred::forget_pso` and `dispatch_chain::forget`. - #2080 moves the compute PSO's success tail out of the function `main` changed. So the new `dred::label(*ppv, cs)` goes into that tail, and also into the chained branch, so DRED names a split program by its console shader too. Which do you prefer? I can push the rebase now and you rebase the slab commit onto it, which only touches `real.rs` near those lines. Or I wait and push both together once your commit is up. AI use: Claude Code (Claude Opus 5.5) did the rebase and wrote this note.
Author
Owner

@⁠claudetools-gh on GitHub · 2026-11-25 13:26 UTC · original

@⁠Kalmarv a suggestion for the runtime-cost side, not measured here: use the chain only until the whole program is built, then switch to the whole pipeline.

Right now a split program pays the chain's GPU time for the rest of the run, and in every later run too (1.57–2.06× on the late shading path, or ~1.4× with #2126). But the chain only buys the first build: once the whole pipeline's driver blob is on disk, the whole form loads in milliseconds like any other cached program. So the cost could be limited to the first cold encounter:

  1. First use, no blob for the whole form: build and use the chain as this PR does. At the same time, queue the whole program on a low-priority PSO worker (never "wanted", so it never blocks a title thread and doesn't take a huge-compile slot that a wanted build needs).
  2. When the whole pipeline is ready: keep its blob under the title's own name, as the unsplit path does today, and point the program at it for later dispatches. Something like an AtomicPtr / generation on the program's entry, read where Direct Dispatch picks between dispatch_chain and the whole PSO. The dispatches already recorded keep the chain they were recorded with, so nothing in flight changes.
  3. Later runs: the whole form's blob exists, so dispatch_plan can skip splitting altogether. The .chain.pso blobs are then only needed for programs whose whole build never finished, for example in a run that ended early.

What this would keep: the chain's ~2 s cold build for the first frames that need the program. What it would remove: the chain's GPU time after that, and in every warm run. The background whole builds cost CPU, and peak commit while they overlap the title's own builds, so they may want their own cap, for example one at a time.

A small extra: a switch to turn the swap off (stay on the chain) would make A/B timing of the two forms in the same run easy.

AI-assisted.

**@⁠claudetools-gh** on GitHub · 2026-11-25 13:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163773162) @⁠Kalmarv a suggestion for the runtime-cost side, not measured here: **use the chain only until the whole program is built, then switch to the whole pipeline.** Right now a split program pays the chain's GPU time for the rest of the run, and in every later run too (1.57–2.06× on the late shading path, or ~1.4× with #2126). But the chain only buys the *first* build: once the whole pipeline's driver blob is on disk, the whole form loads in milliseconds like any other cached program. So the cost could be limited to the first cold encounter: 1. **First use, no blob for the whole form:** build and use the chain as this PR does. At the same time, queue the whole program on a low-priority PSO worker (never "wanted", so it never blocks a title thread and doesn't take a huge-compile slot that a wanted build needs). 2. **When the whole pipeline is ready:** keep its blob under the title's own name, as the unsplit path does today, and point the program at it for later dispatches. Something like an `AtomicPtr` / generation on the program's entry, read where Direct Dispatch picks between `dispatch_chain` and the whole PSO. The dispatches already recorded keep the chain they were recorded with, so nothing in flight changes. 3. **Later runs:** the whole form's blob exists, so `dispatch_plan` can skip splitting altogether. The `.chain.pso` blobs are then only needed for programs whose whole build never finished, for example in a run that ended early. What this would keep: the chain's ~2 s cold build for the first frames that need the program. What it would remove: the chain's GPU time after that, and in every warm run. The background whole builds cost CPU, and peak commit while they overlap the title's own builds, so they may want their own cap, for example one at a time. A small extra: a switch to turn the swap off (stay on the chain) would make A/B timing of the two forms in the same run easy. AI-assisted.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 13:27 UTC · original

@⁠claudetools-gh thanks. I've noted it as a possible follow-up, not for #2080 itself: ivall's scratch bound comes first, and Kalmarv decides on the direction.

Two things the background whole build would have to handle:

  • Build time and memory. The whole builds are the long ones. @⁠brothernog's RTX 3050 measurement of 95cc13288a27a96e above took 8,255 s and an 18–20 GB working set. Even the programs in #2080's table take 14–81 s each. So a background build would need the cap you mention, and a commit check like the huge-build gate's. Otherwise it would compete with the title's own builds during the world load, where the stop already is.
  • GPU time is still unmeasured on title inputs. The 1.57–2.06× is a synthetic seeded input at P3 clocks. Whether the chain's GPU time shows up in frame time is still unknown, because in our runs the chains only start after presentation has stopped.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 13:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163796331) @⁠claudetools-gh thanks. I've noted it as a possible follow-up, not for #2080 itself: ivall's scratch bound comes first, and Kalmarv decides on the direction. Two things the background whole build would have to handle: - **Build time and memory.** The whole builds are the long ones. @⁠brothernog's RTX 3050 measurement of `95cc13288a27a96e` above took 8,255 s and an 18–20 GB working set. Even the programs in #2080's table take 14–81 s each. So a background build would need the cap you mention, and a commit check like the huge-build gate's. Otherwise it would compete with the title's own builds during the world load, where the stop already is. - **GPU time is still unmeasured on title inputs.** The 1.57–2.06× is a synthetic seeded input at P3 clocks. Whether the chain's GPU time shows up in frame time is still unknown, because in our runs the chains only start after presentation has stopped. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 13:34 UTC · original

Correction to my comment above: the scratch concern does not hold for this title. I put the sizes in a table of hypothetical grids and said it has to be bounded before this goes in. A run that logs it shows otherwise.

AMD RDNA4, a retail title, 90 s into its world (the tree of that comment plus the slab commit and the logging): 75 chained dispatches, 177 programs split, all 75 in one slab; scratch alive at most 54 MiB, the largest dispatch 15 MiB. The 187 KB a group is right, the grids are just small (hundreds of groups, not tens of thousands). The case I worried about is still possible for a title with larger grids, but nothing measured here reaches it.

So the bound is not a condition for merging this, and I withdraw it. The slab commit stays here in case a larger dispatch shows up; it is tested but not needed by what was measured. That run ended in 0x887a0006 in a list that had no chained dispatch at the point DRED stopped, so this says nothing against the split.

AI use: Claude Code (Claude Opus 5.5) measured this and wrote the comment on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 13:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7163966010) **Correction to my [comment above](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080): the scratch concern does not hold for this title.** I put the sizes in a table of hypothetical grids and said it has to be bounded before this goes in. A run that logs it shows otherwise. AMD RDNA4, a retail title, 90 s into its world (the tree of that comment plus the slab commit and the logging): **75 chained dispatches, 177 programs split, all 75 in one slab; scratch alive at most 54 MiB, the largest dispatch 15 MiB.** The 187 KB a group is right, the grids are just small (hundreds of groups, not tens of thousands). The case I worried about is still possible for a title with larger grids, but nothing measured here reaches it. So the bound is not a condition for merging this, and I withdraw it. The slab commit stays here in case a larger dispatch shows up; it is tested but not needed by what was measured. That run ended in 0x887a0006 in a list that had no chained dispatch at the point DRED stopped, so this says nothing against the split. AI use: Claude Code (Claude Opus 5.5) measured this and wrote the comment on the maintainer's behalf.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 13:36 UTC · original

Merged as afc5ee8 together with the other two of the split (#2080, #2107, #2126), thanks.

Tested on the merged tree: AMD RDNA4, Windows, DXC 1.8.2502.11, debug. cargo test --workspace --no-fail-fast -- --test-threads=4: 1261 passed, 2 failed (fuzz_validate_and_gpu_1 / _3, #2115, as on main), 46 ignored. XCL_DIRECT_DXIL=all on gpu::: 638 passed, the same 2 failed, 22 ignored.

In a title (these heads on main 1a0bbe3 with other open PRs on top: #1803, #2092, #541; AMD RDNA4): two runs of 366 s and 699 s without a removal, and one of 96 s that ended in 0x887a0006, in a list whose last labelled pipeline was a graphics one (a light shader), not a chain. That 96 s run, with a slab commit on top, logged 177 programs split, 1 809 pieces, 75 chained dispatches, each in one slab, scratch at most 54 MiB, largest dispatch 15 MiB. The merge tree itself has not been run in a title.

Conflicts with #1592 (real.rs: the moved compute container and the XCL_DRED labels) and with the test in split.rs were resolved in the merge; XCL_DRED=1 now labels the compute pipelines that a chain returns.

AI use: Claude Code (Claude Opus 5.5) merged it, ran the tests and wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 13:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7164030497) Merged as `afc5ee8` together with the other two of the split (#2080, #2107, #2126), thanks. **Tested on the merged tree:** AMD RDNA4, Windows, DXC 1.8.2502.11, debug. `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1261 passed, 2 failed (`fuzz_validate_and_gpu_1` / `_3`, #2115, as on `main`), 46 ignored. `XCL_DIRECT_DXIL=all` on `gpu::`: 638 passed, the same 2 failed, 22 ignored. **In a title** (these heads on `main` `1a0bbe3` with other open PRs on top: #1803, #2092, #541; AMD RDNA4): two runs of 366 s and 699 s without a removal, and one of 96 s that ended in 0x887a0006, in a list whose last labelled pipeline was a graphics one (a light shader), not a chain. That 96 s run, with a slab commit on top, logged 177 programs split, 1 809 pieces, 75 chained dispatches, each in one slab, scratch at most 54 MiB, largest dispatch 15 MiB. The merge tree itself has not been run in a title. Conflicts with #1592 (`real.rs`: the moved compute container and the `XCL_DRED` labels) and with the test in `split.rs` were resolved in the merge; `XCL_DRED=1` now labels the compute pipelines that a chain returns. AI use: Claude Code (Claude Opus 5.5) merged it, ran the tests and wrote this on the maintainer's behalf.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 14:19 UTC · original

@⁠claudetools-gh following up on the switch-back idea: we're not taking it up for now. It needs a measured cost to justify a background whole build. Nobody has yet seen the chain's GPU time in frame time in the title, because the chains only start after presentation stops. If someone measures a frame-time cost with the split taken, it's worth revisiting, with the cap and the commit check you mentioned.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 14:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7165100157) @⁠claudetools-gh following up on the switch-back idea: we're not taking it up for now. It needs a measured cost to justify a background whole build. Nobody has yet seen the chain's GPU time in frame time in the title, because the chains only start after presentation stops. If someone measures a frame-time cost with the split taken, it's worth revisiting, with the cap and the commit check you mentioned. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Author
Owner

@⁠claudetools-gh on GitHub · 2026-11-25 14:42 UTC · original

@⁠Kalmarv a follow-up from the title side, measured here: a split program that the title also uses through ExecuteIndirect stops the title for its whole build, on the title's own thread, and XCL_PSO_WAIT_MS does not cover that path. A small local change that builds the whole form on its own thread got the title moving again.

Setup: RTX 5070 Ti 16 GB, Ryzen 7 9700X, 62 GB, Windows 11 26300, release. #2057 + main afc5ee8 (this stack merged) + #2092 / #541 / #1803 / #1887 + #2270 + #2306 + the #2308 stack, XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50 XCL_HUGE_PSO_CONCURRENCY=4 XCL_PSO_PRELOAD=1 XCL_NETWORK=0. One run each.

Without the change (the title world-loads, then): from ~135 s the log never has more than one driver compile in flight, a 645–833 KB whole compute program with driver blob absent, 20–35 s each, one after another to the end of the 1 200 s run, and no present after ~135 s. The thread dump has the title thread in bind::execute_indirect → dispatch_chain::whole → Chain::whole (waiting on build_whole or building).

With the change: the title keeps presenting through the start of the intro (it reached it at ~100 s here; slow, ~4 fps at 150 s), and by ~300 s 12 911 of 131 072 dispatches had been skipped while whole forms built in the background. That run ended at 314 s in a title crash (a read of 0xFFFFFFFFFFFFFFFF), which I have not looked into and do not attribute to this.

The change (dispatch_chain.rs, plus a one-line pub(in crate::hle::d3d12x) on pso_async::wait_budget, and bind.rs skipping the dispatch without the warning for this one error):

pub(in crate::hle::d3d12x) const WHOLE_NOT_READY: &str = "whole compute PSO still building";

pub(in crate::hle::d3d12x) unsafe fn whole(pso: usize) -> Result<Option<ID3D12PipelineState>, String> {
    let Some(c) = CHAINS.lock().unwrap().get(&pso).cloned() else { return Ok(None) };
    if let Some(p) = c.whole.get() {
        return Ok(Some(p.clone()));
    }
    // with a bind wait budget the title does not stand still for a whole build:
    // it goes to a thread of its own, and the indirect dispatch is skipped meanwhile
    if super::super::pso_async::wait_budget().is_some() {
        if !c.whole_started.swap(true, std::sync::atomic::Ordering::AcqRel) {
            let c2 = c.clone();
            let _ = std::thread::Builder::new().name("xcl-pso-whole".into()).spawn(move || {
                if let Err(e) = unsafe { c2.whole() } {
                    crate::xlog_warn!("D3D12.X: background whole compute PSO: {e}");
                }
            });
        }
        return Err(WHOLE_NOT_READY.into());
    }
    c.whole().map(Some)
}

(whole_started: AtomicBool is a new field of Chain, set to false in build.) Without XCL_PSO_WAIT_MS nothing changes. A better home for the build is probably the PSO workers with "wanted" demand rather than a thread per program; I kept it minimal.

One more observation for @⁠ivall's scratch bound: in the dump at 324 s of the second run, three title threads sit in dev_create_committed_resource under dispatch_chain::dispatch and two under bind::default_uav_buffer from execute_indirect, so per-dispatch allocations are on the title's threads here too.

Not tested: more than one run each; the change without the page-alias and mesh stacks; AMD.

AI-assisted.

**@⁠claudetools-gh** on GitHub · 2026-11-25 14:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7165682632) @⁠Kalmarv a follow-up from the title side, measured here: **a split program that the title also uses through ExecuteIndirect stops the title for its whole build, on the title's own thread, and `XCL_PSO_WAIT_MS` does not cover that path.** A small local change that builds the whole form on its own thread got the title moving again. **Setup:** RTX 5070 Ti 16 GB, Ryzen 7 9700X, 62 GB, Windows 11 26300, release. #2057 + `main` `afc5ee8` (this stack merged) + #2092 / #541 / #1803 / #1887 + #2270 + #2306 + the #2308 stack, `XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50 XCL_HUGE_PSO_CONCURRENCY=4 XCL_PSO_PRELOAD=1 XCL_NETWORK=0`. One run each. **Without the change** (the title world-loads, then): from ~135 s the log never has more than one driver compile in flight, a 645–833 KB whole compute program with `driver blob absent`, 20–35 s each, one after another to the end of the 1 200 s run, and no present after ~135 s. The thread dump has the title thread in `bind::execute_indirect` → `dispatch_chain::whole` → `Chain::whole` (waiting on `build_whole` or building). **With the change:** the title keeps presenting through the start of the intro (it reached it at ~100 s here; slow, ~4 fps at 150 s), and by ~300 s 12 911 of 131 072 dispatches had been skipped while whole forms built in the background. That run ended at 314 s in a title crash (a read of `0xFFFFFFFFFFFFFFFF`), which I have not looked into and do not attribute to this. The change (`dispatch_chain.rs`, plus a one-line `pub(in crate::hle::d3d12x)` on `pso_async::wait_budget`, and `bind.rs` skipping the dispatch without the warning for this one error): ```rust pub(in crate::hle::d3d12x) const WHOLE_NOT_READY: &str = "whole compute PSO still building"; pub(in crate::hle::d3d12x) unsafe fn whole(pso: usize) -> Result<Option<ID3D12PipelineState>, String> { let Some(c) = CHAINS.lock().unwrap().get(&pso).cloned() else { return Ok(None) }; if let Some(p) = c.whole.get() { return Ok(Some(p.clone())); } // with a bind wait budget the title does not stand still for a whole build: // it goes to a thread of its own, and the indirect dispatch is skipped meanwhile if super::super::pso_async::wait_budget().is_some() { if !c.whole_started.swap(true, std::sync::atomic::Ordering::AcqRel) { let c2 = c.clone(); let _ = std::thread::Builder::new().name("xcl-pso-whole".into()).spawn(move || { if let Err(e) = unsafe { c2.whole() } { crate::xlog_warn!("D3D12.X: background whole compute PSO: {e}"); } }); } return Err(WHOLE_NOT_READY.into()); } c.whole().map(Some) } ``` (`whole_started: AtomicBool` is a new field of `Chain`, set to `false` in `build`.) Without `XCL_PSO_WAIT_MS` nothing changes. A better home for the build is probably the PSO workers with "wanted" demand rather than a thread per program; I kept it minimal. One more observation for @⁠ivall's scratch bound: in the dump at 324 s of the second run, three title threads sit in `dev_create_committed_resource` under `dispatch_chain::dispatch` and two under `bind::default_uav_buffer` from `execute_indirect`, so per-dispatch allocations are on the title's threads here too. **Not tested:** more than one run each; the change without the page-alias and mesh stacks; AMD. AI-assisted.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 14:45 UTC · original

Thanks @⁠claudetools-gh and @⁠KDenKC, both findings are right and both are bugs in the split.

  • ExecuteIndirect builds the whole form on the title's thread. bind.rs asks dispatch_chain::whole, and Chain::whole compiles synchronously with no wait budget, so a cold huge program stops the title for its whole build. I'm moving that build onto the same async path an unsplit pipeline uses, with the same huge-build slots, driver blob cache and XCL_PSO_WAIT_MS skip behaviour. Thanks for the thread dump and the patch; I'm keeping the build inside the huge-build slots instead of on its own thread.
  • --precompile --pipelines builds no pieces. Pipelines::make builds only Compiled::dxil and ignores dispatch_chain, so no .chain.pso blob is written. The fix builds each piece the way the runtime does (same root signature and blob path), so the title finds a blob for each one.

They'll be two separate PRs. I'll link them here.

AI use: drafted with Claude Code (Claude Opus 5.5) from reading the code on main 06c9f55.

**@⁠Kalmarv** on GitHub · 2026-11-25 14:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7165755330) Thanks @⁠claudetools-gh and @⁠KDenKC, both findings are right and both are bugs in the split. - **ExecuteIndirect builds the whole form on the title's thread.** `bind.rs` asks `dispatch_chain::whole`, and `Chain::whole` compiles synchronously with no wait budget, so a cold huge program stops the title for its whole build. I'm moving that build onto the same async path an unsplit pipeline uses, with the same huge-build slots, driver blob cache and `XCL_PSO_WAIT_MS` skip behaviour. Thanks for the thread dump and the patch; I'm keeping the build inside the huge-build slots instead of on its own thread. - **`--precompile --pipelines` builds no pieces.** `Pipelines::make` builds only `Compiled::dxil` and ignores `dispatch_chain`, so no `.chain.pso` blob is written. The fix builds each piece the way the runtime does (same root signature and blob path), so the title finds a blob for each one. They'll be two separate PRs. I'll link them here. AI use: drafted with Claude Code (Claude Opus 5.5) from reading the code on `main` `06c9f55`.
Author
Owner

@⁠anes66 on GitHub · 2026-11-25 14:54 UTC · original

CPU-only follow-up on main 06c9f5505f63f10c5ec49ef932d75b2c28177324, after this merge and the persistent-payload fixes. A new test checks dispatch partitioning and every crossing payload against independent graph/liveness calculations. Optional companion e8f6269 adds one test directly on that main; production code is unchanged.

Tested

  • Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug. No GPU, DXC, validator or title execution.
  • 216 plans and 1,242 crossing payloads: nine block-allocation rotations, forward/reversed allocation, two loop-body costs and six partition limits. The graph has a diamond, edge-specific phi values, a loop with two loop-carried phis, a forward skip to a final phi, and an unreachable expensive block.
  • Floyd–Warshall reachability independently checks that each SCC stays together. Every reachable block occurs once, edges move only forward through dispatches, the crossing-edge set is exact, and only an indivisible bounded SCC may exceed the soft instruction target. Zero limits and already-fitting programs produce no chain; unreachable cost is excluded.
  • Each edge's exact live-value set is checked by a forward path search that stops at a value's definition and treats phi operands as reads on their own incoming edge. This is independent of the planner's backward liveness worklist. Payload lists must have no duplicates.
  • Exact-name selection of dispatch_plan_matches_forward_liveness_and_independent_sccs and existing oversized_loop_occupies_one_piece_up_to_the_hard_ceiling, with cargo test --locked -p xcl --lib -j 2 -- --exact <both full test names> --nocapture --test-threads=1: 2 passed / 0 failed / 0 ignored / 0 skips.
  • Negative control: temporarily omitting crossing phi inputs from the payload makes the new test fail at Block(1) -> Block(3) with its predecessor-defined value missing. Restored before the final passing run and commit.

Not tested
Generated piece execution or serialization, scratch address/layout correctness, GPU behavior, full workspace, release or a title. This checks the planner's graph and liveness contracts, not the async/precompile issues being worked on above.

**@⁠anes66** on GitHub · 2026-11-25 14:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7166004584) CPU-only follow-up on `main` `06c9f5505f63f10c5ec49ef932d75b2c28177324`, after this merge and the persistent-payload fixes. A new test checks dispatch partitioning and every crossing payload against independent graph/liveness calculations. Optional companion [e8f6269](https://github.com/anes66/xcl/commit/e8f6269ab0ff58d7f8663c01af1b6f472426d509) adds one test directly on that main; production code is unchanged. **Tested** - Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug. No GPU, DXC, validator or title execution. - **216 plans and 1,242 crossing payloads**: nine block-allocation rotations, forward/reversed allocation, two loop-body costs and six partition limits. The graph has a diamond, edge-specific phi values, a loop with two loop-carried phis, a forward skip to a final phi, and an unreachable expensive block. - Floyd–Warshall reachability independently checks that each SCC stays together. Every reachable block occurs once, edges move only forward through dispatches, the crossing-edge set is exact, and only an indivisible bounded SCC may exceed the soft instruction target. Zero limits and already-fitting programs produce no chain; unreachable cost is excluded. - Each edge's exact live-value set is checked by a forward path search that stops at a value's definition and treats phi operands as reads on their own incoming edge. This is independent of the planner's backward liveness worklist. Payload lists must have no duplicates. - Exact-name selection of `dispatch_plan_matches_forward_liveness_and_independent_sccs` and existing `oversized_loop_occupies_one_piece_up_to_the_hard_ceiling`, with `cargo test --locked -p xcl --lib -j 2 -- --exact <both full test names> --nocapture --test-threads=1`: **2 passed / 0 failed / 0 ignored / 0 skips**. - Negative control: temporarily omitting crossing phi inputs from the payload makes the new test fail at `Block(1) -> Block(3)` with its predecessor-defined value missing. Restored before the final passing run and commit. **Not tested** Generated piece execution or serialization, scratch address/layout correctness, GPU behavior, full workspace, release or a title. This checks the planner's graph and liveness contracts, not the async/precompile issues being worked on above.
Author
Owner

@⁠claudetools-gh on GitHub · 2026-11-25 15:01 UTC · original

@⁠Kalmarv on the measured cost of the chain in the title you asked for: in the only stretch where this title presents with chains in use here (the start of the intro, ~2 fps), the chains are not where the GPU time goes, so this doesn't show a frame-time cost either way. Numbers, for what they're worth.

Same machine and tree as my comment above (with the background whole build), XCL_GPU_PROFILE=1, two runs, 120–230 s:

split on (default) XCL_DIRECT_SPLIT_INSTRUCTIONS=0
chains 299 programs split, 2 553 pieces built by ~290 s 0
GPU time per 2 s window (sum over ops) 1.81 s 2.17 s
timed ops per 2 s ~1 800 ~5 800
frame rate < 2.4 fps (frames 3 000 → < 3 300 over 110–233 s) 1.9 fps (frames 2 990 → 3 170 over 110–204 s)
  • The op counts differ because the split-on run was still skipping dispatches whose whole form was building, so the GPU totals aren't a like-for-like comparison of the two forms.
  • In both runs the top of the profile is the same few unsplit programs: 24de2aef6c31d55e (19 KB code, 32 threads, ~63 500 groups, up to 158 ms a call), b78fa10b425b8e54 (up to 355 ms for one 160×90 dispatch), 1b5466f261a70cde (226–245 ms), d79af1d04922a49b. No chain piece appears in the top six of any window I looked at.
  • The world draws in this stretch land nothing in the depth target (details on #697), so this is not representative of a rendering world either.

So: no frame-time cost of the split measurable here, and the title is GPU-bound on other programs first. I'll measure again once the world renders.

AI-assisted.

**@⁠claudetools-gh** on GitHub · 2026-11-25 15:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7166196522) @⁠Kalmarv on the measured cost of the chain in the title you asked for: **in the only stretch where this title presents with chains in use here (the start of the intro, ~2 fps), the chains are not where the GPU time goes**, so this doesn't show a frame-time cost either way. Numbers, for what they're worth. Same machine and tree as [my comment above](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2080) (with the background whole build), `XCL_GPU_PROFILE=1`, two runs, 120–230 s: | | split on (default) | `XCL_DIRECT_SPLIT_INSTRUCTIONS=0` | |---|---|---| | chains | 299 programs split, 2 553 pieces built by ~290 s | 0 | | GPU time per 2 s window (sum over ops) | 1.81 s | 2.17 s | | timed ops per 2 s | ~1 800 | ~5 800 | | frame rate | < 2.4 fps (frames 3 000 → < 3 300 over 110–233 s) | 1.9 fps (frames 2 990 → 3 170 over 110–204 s) | - The op counts differ because the split-on run was still skipping dispatches whose whole form was building, so the GPU totals aren't a like-for-like comparison of the two forms. - In both runs the top of the profile is the same few **unsplit** programs: `24de2aef6c31d55e` (19 KB code, 32 threads, ~63 500 groups, up to 158 ms a call), `b78fa10b425b8e54` (up to 355 ms for one 160×90 dispatch), `1b5466f261a70cde` (226–245 ms), `d79af1d04922a49b`. No chain piece appears in the top six of any window I looked at. - The world draws in this stretch land nothing in the depth target (details on #697), so this is not representative of a rendering world either. So: no frame-time cost of the split measurable here, and the title is GPU-bound on other programs first. I'll measure again once the world renders. AI-assisted.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-25 14:38 UTC · original · edited 2026-11-25 15:18 UTC

@⁠Kalmarv @⁠zohaiblazuli a measured cost of the precompile gap zohaiblazuli claimed on #1269 (--precompile --pipelines does not build the dispatch-chain variants), on main after this merge: with every compute pipeline precompiled, the world load now stops presenting for 410 s+ while big compute programs compile cold on a title thread, 10–23 s each.

Setup: RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 26200, release. Retail title of #505, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1 XCL_NETWORK=0, fresh data folder, pad input through the menus. Before each run, xcl shaders <pack> --precompile --only cs --pipelines with the same switches on that build.

main 1a0bbe3 (before) main 06c9f55 (after #2080 / #2107 / #2126)
precompile 2,689 compiled, 0 errors, 0 refused (70 min, cold) 2,689 compiled, 0 errors, 0 refused, all 2,689 from the driver cache (82 s)
.chain.pso blobs written by the precompile – 0
.chain.pso blobs written during the title run – 2,331
records 33743bd6d1e45443, 81fe677790c1299a, 31b81a7b0427b16c, ef008c0f04b6261a, 742a41ceb422beb5 at world load same DXIL sizes (707,256 / 948,256 / 745,204 / 776,344 / 780,892 B), driver blob supplied same sizes, driver blob absent
cold compute builds after 185 s 0 28 started, 27 finished by the end (huge, ungated here (a title thread's …), 10.4–22.8 s each, 407 s of driver time, one after another)
presents world drawn from ~156 s (its second run; the first reached the world at ~510 s with graphics pipelines cold) stop at 188.5 s and do not resume to the end of the 600 s run (0 submits from 190 s)
  • In the 06c9f55 run: compute split: 281 programs split, 2407 pieces built, 102 chained dispatches issued; 0 GPU-wait timeouts, no removal, no crash.
  • So with a precompiled cache, the chained variants of the largest programs are now the cold builds at world start. A precompile that also builds the chain variants (and their .chain.pso blobs), as zohaiblazuli described, would cover them.

Edit, a second run on 06c9f55 (same settings; run 1's .chain.pso blobs on disk): run 1's cold records came back from their blobs (89 compute builds driver blob supplied), and the title got further sooner, but it met 30 other big chained variants cold (29 new .chain.pso files written; only 1 of the 30 records was also cold in run 1). Presents stopped at 162.1 s instead of 188.5 s and did not resume (600 s, no removal, no crash). In both runs the stop comes right after the title's first #101 (186.07 / 160.97 s) and with the first cold huge chained build (187.53 / 161.90 s), so these runs cannot say which of the two stops the frames (@⁠throny saw the stop at the first #101 on #505 too). Moving the whole-form build off the title thread, as you describe, should separate them.

Not tested: XCL_DIRECT_DXIL off; a third run (each run so far reached new cold variants); AMD.

AI use: Claude Code (Claude Opus 5.5) ran the precompiles and both title runs, read the logs and the cache folder, and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-25 14:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7165579759) · edited 2026-11-25 15:18 UTC @⁠Kalmarv @⁠zohaiblazuli a measured cost of the precompile gap zohaiblazuli claimed on #1269 (`--precompile --pipelines` does not build the dispatch-chain variants), on `main` after this merge: **with every compute pipeline precompiled, the world load now stops presenting for 410 s+ while big compute programs compile cold on a title thread, 10–23 s each.** **Setup:** RTX 5090 32 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 26200, release. Retail title of #505, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1 XCL_NETWORK=0`, fresh data folder, pad input through the menus. Before each run, `xcl shaders <pack> --precompile --only cs --pipelines` with the same switches on that build. | | `main` `1a0bbe3` (before) | `main` `06c9f55` (after #2080 / #2107 / #2126) | |---|---|---| | precompile | 2,689 compiled, 0 errors, 0 refused (70 min, cold) | 2,689 compiled, 0 errors, 0 refused, all 2,689 from the driver cache (82 s) | | `.chain.pso` blobs written by the precompile | – | **0** | | `.chain.pso` blobs written during the title run | – | **2,331** | | records `33743bd6d1e45443`, `81fe677790c1299a`, `31b81a7b0427b16c`, `ef008c0f04b6261a`, `742a41ceb422beb5` at world load | same DXIL sizes (707,256 / 948,256 / 745,204 / 776,344 / 780,892 B), `driver blob supplied` | same sizes, **`driver blob absent`** | | cold compute builds after 185 s | 0 | **28** started, 27 finished by the end (`huge, ungated here (a title thread's …)`, 10.4–22.8 s each, 407 s of driver time, one after another) | | presents | world drawn from ~156 s (its second run; the first reached the world at ~510 s with graphics pipelines cold) | **stop at 188.5 s and do not resume** to the end of the 600 s run (0 submits from 190 s) | - In the `06c9f55` run: `compute split: 281 programs split, 2407 pieces built, 102 chained dispatches issued`; 0 GPU-wait timeouts, no removal, no crash. - So with a precompiled cache, the chained variants of the largest programs are now the cold builds at world start. A precompile that also builds the chain variants (and their `.chain.pso` blobs), as zohaiblazuli described, would cover them. **Edit, a second run on `06c9f55`** (same settings; run 1's `.chain.pso` blobs on disk): run 1's cold records came back from their blobs (89 compute builds `driver blob supplied`), and the title got further sooner, but it met **30 other big chained variants cold** (29 new `.chain.pso` files written; only 1 of the 30 records was also cold in run 1). Presents stopped at **162.1 s** instead of 188.5 s and did not resume (600 s, no removal, no crash). In both runs the stop comes right after the title's first `#101` (186.07 / 160.97 s) and with the first cold huge chained build (187.53 / 161.90 s), so these runs cannot say which of the two stops the frames (@⁠throny saw the stop at the first `#101` on #505 too). Moving the whole-form build off the title thread, as you describe, should separate them. **Not tested:** `XCL_DIRECT_DXIL` off; a third run (each run so far reached new cold variants); AMD. AI use: Claude Code (Claude Opus 5.5) ran the precompiles and both title runs, read the logs and the cache folder, and wrote this.
Author
Owner

@⁠ivall on GitHub · 2026-11-25 15:20 UTC · original

Third note on the scratch: it can be large after all, and the bounds are on main now. I said it has to be bounded, then withdrew that after a run that used at most 54 MiB. A later run of the same title with its GPU-view buffers readable (so its indirect dispatches have real group counts) went to 1 241 MiB over all recordings and was still growing when the machine ran out of memory at about 306 s. The earlier figure was right for the run it came from, and wrong as a limit for the title.

Pushed, on top of this PR:

  • slabs: at most XCL_SPLIT_SCRATCH_MB (256) of scratch for one dispatch at once; the pieces add the slab's origin to the group ids
  • XCL_SPLIT_SCRATCH_TOTAL_MB (384): over that, dispatches run in smaller slabs in the buffer their list already has, or in 2 MiB
  • gpu_...divergent_forward_edges_3d also in slabs of 1, 2, 3, 6, 7 and 12 groups, and unit tests of the sizing

Suite on the pushed tree (AMD RDNA4, debug): 1270 passed, 2 failed (#2115, as before), 46 ignored; XCL_DIRECT_DXIL=all on gpu::: 641 passed, the same 2 failed. The total bound has not been run in a title yet.

AI use: Claude Code (Claude Opus 5.5) wrote the code and this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 15:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7166692037) **Third note on the scratch: it can be large after all, and the bounds are on `main` now.** I said it has to be bounded, then withdrew that after a run that used at most 54 MiB. A later run of the same title with its GPU-view buffers readable (so its indirect dispatches have real group counts) went to **1 241 MiB over all recordings** and was still growing when the machine ran out of memory at about 306 s. The earlier figure was right for the run it came from, and wrong as a limit for the title. Pushed, on top of this PR: - slabs: at most `XCL_SPLIT_SCRATCH_MB` (256) of scratch for one dispatch at once; the pieces add the slab's origin to the group ids - `XCL_SPLIT_SCRATCH_TOTAL_MB` (384): over that, dispatches run in smaller slabs in the buffer their list already has, or in 2 MiB - `gpu_...divergent_forward_edges_3d` also in slabs of 1, 2, 3, 6, 7 and 12 groups, and unit tests of the sizing Suite on the pushed tree (AMD RDNA4, debug): 1270 passed, 2 failed (#2115, as before), 46 ignored; `XCL_DIRECT_DXIL=all` on `gpu::`: 641 passed, the same 2 failed. The total bound has not been run in a title yet. AI use: Claude Code (Claude Opus 5.5) wrote the code and this on the maintainer's behalf.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 15:34 UTC · original

Update on the precompile half of my note above: #2338 (@⁠ChalanaGimhanaX) now builds the split pieces under --precompile --pipelines. I won't open a duplicate.

One part stays cold after it. A split program's whole form is built at runtime under the same chained root signature, at <whole>.chain.pso (Chain::whole → compute_container(.., chained: true)). On main 0829441 that form is still what ExecuteIndirect binds (bind.rs, dispatch_chain::whole), and what a dispatch uses when no scratch is available. #2338 builds the pieces only, so those wholes keep compiling cold at world load. @⁠KDenKC's five driver blob absent world-load builds of 10–23 s were these. Precompiling the whole the same way, next to its pieces, would cover them.

AI use: Claude Code (Claude Opus 5.5), from reading main and the #2338 diff.

**@⁠Kalmarv** on GitHub · 2026-11-25 15:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7167062810) Update on the precompile half of my note above: #2338 (@⁠ChalanaGimhanaX) now builds the split pieces under `--precompile --pipelines`. I won't open a duplicate. One part stays cold after it. A split program's whole form is built at runtime under the same chained root signature, at `<whole>.chain.pso` (`Chain::whole` → `compute_container(.., chained: true)`). On `main` `0829441` that form is still what ExecuteIndirect binds (`bind.rs`, `dispatch_chain::whole`), and what a dispatch uses when no scratch is available. #2338 builds the pieces only, so those wholes keep compiling cold at world load. @⁠KDenKC's five `driver blob absent` world-load builds of 10–23 s were these. Precompiling the whole the same way, next to its pieces, would cover them. AI use: Claude Code (Claude Opus 5.5), from reading `main` and the #2338 diff.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-25 15:48 UTC · original

@⁠ivall a first title run of the total bound (NVIDIA, one run, about 80 s of dispatching): scratch alive never passed 430 MiB (46 over the 384 total) in 6,633 chained dispatches, one of which wanted 2,109 MiB in one slab.

Setup: RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, 32 GB, Windows 11, release, a retail title. main 0829441 + #1405 (bb27ed6) + #751 (59f8e7c), both open; XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50 XCL_COHERENT_MB=512 XCL_COHERENT_HEAPS=0 XCL_NETWORK=0, scratch limits at their defaults, 300 s.

s chained dispatches slabs scratch alive / most, MiB other local video memory, MB same on 06c9f55 (chained dispatches)
130 118 118 55 / 55 1,916 1,814 (0)
150 1,317 1,564 356 / 401 2,296 2,153 (297)
170 2,737 6,419 384 / 401 2,349 3,275 (1,553)
190 5,077 35,364 387 / 430 2,443 3,826 (2,688)
210 6,633 51,535 387 / 430 2,469 4,108 (3,712)
230 idle 5,976 (5,025)
  • "Other local": local video memory minus pools, arenas and sparse pools; most 2,501 MB. Last column: the same stack before the bounds.
  • Slabs per dispatch: 1.2 up to 150 s, 9.4 after; GPU time not measured.
  • Submits stopped at 208 s: a title thread built an 851 KB whole form cold for 89 s (the stop reported above).
  • Not a clean A/B: 625a0f3, 12f25f1 and #2305 also lie between, the driver cache was warm, and 1,316 DirectStorage requests failed at 72-92 s (0 before).

Not tested: longer runs, AMD, #2322.

AI use: Claude Code (Claude Opus 5.5) built and ran the tree, read both logs and wrote this; Claude Fable 5.2 checked the numbers against the logs; checked by a person before posting.

**@⁠pvfreis** on GitHub · 2026-11-25 15:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7167331700) @⁠ivall a first title run of the total bound (NVIDIA, one run, about 80 s of dispatching): **scratch alive never passed 430 MiB (46 over the 384 total) in 6,633 chained dispatches, one of which wanted 2,109 MiB in one slab.** **Setup:** RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, 32 GB, Windows 11, release, a retail title. `main` `0829441` + #1405 (`bb27ed6`) + #751 (`59f8e7c`), both open; `XCL_DIRECT_DXIL=1 XCL_PSO_WAIT_MS=50 XCL_COHERENT_MB=512 XCL_COHERENT_HEAPS=0 XCL_NETWORK=0`, scratch limits at their defaults, 300 s. | s | chained dispatches | slabs | scratch alive / most, MiB | other local video memory, MB | same on `06c9f55` (chained dispatches) | |---|---|---|---|---|---| | 130 | 118 | 118 | 55 / 55 | 1,916 | 1,814 (0) | | 150 | 1,317 | 1,564 | 356 / 401 | 2,296 | 2,153 (297) | | 170 | 2,737 | 6,419 | 384 / 401 | 2,349 | 3,275 (1,553) | | 190 | 5,077 | 35,364 | 387 / 430 | 2,443 | 3,826 (2,688) | | 210 | 6,633 | 51,535 | 387 / 430 | 2,469 | 4,108 (3,712) | | 230 | idle | | | | 5,976 (5,025) | - "Other local": local video memory minus pools, arenas and sparse pools; most 2,501 MB. Last column: the same stack before the bounds. - Slabs per dispatch: 1.2 up to 150 s, 9.4 after; GPU time not measured. - Submits stopped at 208 s: a title thread built an 851 KB whole form cold for 89 s (the stop reported above). - Not a clean A/B: `625a0f3`, `12f25f1` and #2305 also lie between, the driver cache was warm, and 1,316 DirectStorage requests failed at 72-92 s (0 before). **Not tested:** longer runs, AMD, #2322. AI use: Claude Code (Claude Opus 5.5) built and ran the tree, read both logs and wrote this; Claude Fable 5.2 checked the numbers against the logs; checked by a person before posting.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 15:52 UTC · original

Plan for the whole-form stall that @⁠pvfreis, @⁠claudetools-gh and @⁠KDenKC measured. I'm working on it now, to avoid duplicates.

On an RTX 5070 Ti, main 0829441 with XCL_DIRECT_DXIL=1 (600 s): all 11 per-material ray-tracing resolve programs the title reached were split into 9–14 pieces, and the pieces built quickly. Each was then dispatched through ExecuteIndirect, and execute_indirect → dispatch_chain::whole → Chain::whole compiled the whole program (690–950 KB DXIL) on the title thread, 16–40 s each, one after another from 326 s to the end of the run. In all 66 cdb samples inside those compiles, the title thread had this stack.

The fix I'm writing makes ExecuteIndirect run the chain itself, so the whole form isn't needed there at all. A small XCL pass reads the title's argument and count buffers on the GPU and writes per-slab commands for each piece (root constants plus the dispatch, inside @⁠ivall's bounded scratch). Then each piece runs as one ExecuteIndirect, with a UAV barrier between pieces. The whole form stays only for what can't be chained: bundles, no scratch, and signatures that change root arguments.

AI use: Claude Code (Claude Opus 5.5); the measurements are from our run.

**@⁠Kalmarv** on GitHub · 2026-11-25 15:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7167388550) Plan for the whole-form stall that @⁠pvfreis, @⁠claudetools-gh and @⁠KDenKC measured. I'm working on it now, to avoid duplicates. On an RTX 5070 Ti, `main` `0829441` with `XCL_DIRECT_DXIL=1` (600 s): all 11 per-material ray-tracing resolve programs the title reached were split into 9–14 pieces, and the pieces built quickly. Each was then dispatched through ExecuteIndirect, and `execute_indirect` → `dispatch_chain::whole` → `Chain::whole` compiled the whole program (690–950 KB DXIL) on the title thread, 16–40 s each, one after another from 326 s to the end of the run. In all 66 cdb samples inside those compiles, the title thread had this stack. The fix I'm writing makes ExecuteIndirect run the chain itself, so the whole form isn't needed there at all. A small XCL pass reads the title's argument and count buffers on the GPU and writes per-slab commands for each piece (root constants plus the dispatch, inside @⁠ivall's bounded scratch). Then each piece runs as one ExecuteIndirect, with a UAV barrier between pieces. The whole form stays only for what can't be chained: bundles, no scratch, and signatures that change root arguments. AI use: Claude Code (Claude Opus 5.5); the measurements are from our run.
Author
Owner

@⁠jeroenhaentjens on GitHub · 2026-11-25 16:08 UTC · original

Taking a small follow-up on main 0829441 (workstream 4 of #2088): make dispatch_slabs a lazy iterator and count slabs while recording. The current runtime builds a slab Vec before the no-scratch whole() fallback, and successful recording builds it twice. A bounded allocation regression with grid [1024,1024,1], most=1, requesting one slab measures 24 MiB on the current code; the lazy version allocates zero and emits the same sequence. CPU and wave32/split-wave64 GPU checks are in progress. This is separate from #2333 and the ExecuteIndirect implementation; noting the dispatch_slabs return-type change for that work. No claim that this caused a reported retail crash.

AI use: Codex with subagents; exact model identifier unavailable in this session.

**@⁠jeroenhaentjens** on GitHub · 2026-11-25 16:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7167627655) Taking a small follow-up on main 0829441 (workstream 4 of #2088): make dispatch_slabs a lazy iterator and count slabs while recording. The current runtime builds a slab Vec before the no-scratch whole() fallback, and successful recording builds it twice. A bounded allocation regression with grid [1024,1024,1], most=1, requesting one slab measures 24 MiB on the current code; the lazy version allocates zero and emits the same sequence. CPU and wave32/split-wave64 GPU checks are in progress. This is separate from #2333 and the ExecuteIndirect implementation; noting the dispatch_slabs return-type change for that work. No claim that this caused a reported retail crash. AI use: Codex with subagents; exact model identifier unavailable in this session.
Author
Owner

@⁠tatazildo on GitHub · 2026-11-25 16:26 UTC · original

Independent validation on 0829441 using an i9-13900K, RTX 3080 Ti 12 GB, driver 621.24 and 64 GB RAM.

Sequential release workspace results: 1272 passed, 0 failed, 46 ignored.

The divergent forward-edge dispatch-chain tests passed on the RTX 3080 Ti with both 32 and 64 threads. The aggregate scratch memory budget test, reused edge payload tests and split Wave64 live-loop tests also passed.

All 2000 shader fuzz seeds validated, including 1232 GPU comparisons.

ChatGPT assisted with testing and report preparation.

**@⁠tatazildo** on GitHub · 2026-11-25 16:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7167980139) Independent validation on `0829441` using an i9-13900K, RTX 3080 Ti 12 GB, driver 621.24 and 64 GB RAM. Sequential release workspace results: 1272 passed, 0 failed, 46 ignored. The divergent forward-edge dispatch-chain tests passed on the RTX 3080 Ti with both 32 and 64 threads. The aggregate scratch memory budget test, reused edge payload tests and split Wave64 live-loop tests also passed. All 2000 shader fuzz seeds validated, including 1232 GPU comparisons. ChatGPT assisted with testing and report preparation.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 17:03 UTC · original

@⁠Eterst @⁠claudetools-gh #2372 builds a split program's whole form on the PSO workers, under XCL_PSO_WAIT_MS, in place of on the title's thread. On main 0829441 with XCL_PSO_WAIT_MS=50 this title stopped presenting for good at about 66 s, in a 150 s whole build on the submitting thread. With #2372, the same run kept going until it hit other crashes, both described in the PR.

It's not shown to fix your trees, and the budget's skips have costs of their own (see Not tested there). The fix I'd rather have, running an ExecuteIndirect as chained pieces so the whole form is rarely needed, is still being built.

AI use: Claude Code (Claude Opus 5.5) wrote this comment.

**@⁠Kalmarv** on GitHub · 2026-11-25 17:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7168929182) @⁠Eterst @⁠claudetools-gh #2372 builds a split program's whole form on the PSO workers, under `XCL_PSO_WAIT_MS`, in place of on the title's thread. On `main` `0829441` with `XCL_PSO_WAIT_MS=50` this title stopped presenting for good at about 66 s, in a 150 s whole build on the submitting thread. With #2372, the same run kept going until it hit other crashes, both described in the PR. It's not shown to fix your trees, and the budget's skips have costs of their own (see **Not tested** there). The fix I'd rather have, running an ExecuteIndirect as chained pieces so the whole form is rarely needed, is still being built. **AI use:** Claude Code (Claude Opus 5.5) wrote this comment.
Author
Owner

@⁠Eterst on GitHub · 2026-11-25 16:40 UTC · original · edited 2026-11-25 17:31 UTC

A data point on NVIDIA: with dispatch splitting on, a retail title stops at its world load when its first chained dispatches run; with XCL_DIRECT_SPLIT_INSTRUCTIONS=0 the same build goes on.

Setup: RTX 4070 SUPER 12 GB (wave32-only, split wave64), driver 616.92, Ryzen 7 5700X, 32 GB, Windows 10 19045, release. Not plain main: main at 0829441 (with e9ddf17 / 0829441, the bounded scratch) merged into a test tree with #2057 (41303e4) and a few other open PRs, so it may not reproduce on main alone. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_PSO_WAIT_MS=50 XCL_NETWORK=0, XCL and NVIDIA caches warm (compute and the pipeline journal precompiled for each split setting), 1 run each.

run split chained dispatches when presents stop scratch last presents after it
1 default (12,500) 0 at 100 s → 105 at 110 s (before the bound) ~104 s 0 presents, 0 submits, 0 draws to the end; no device removal, no crash, no watchdog line
2 default (+ #1702's texture pages in system memory) 0 at 100 s → 98 at 120 s (before the bound) ~114 s the same
3 default, with e9ddf17 / 0829441 0 at 100 s → 50 at 110 s 4 MiB (largest dispatch 3 MiB, one slab each) ~106 s the same
4 XCL_DIRECT_SPLIT_INSTRUCTIONS=0 0 (0 programs split) – – presents went on (3–10 per 2 s, 9k–26k dispatches per 2 s) until a device removal at 299 s from video memory running out, as in our runs before #2080

In runs 1–3 the last 2 s before the stop had a burst of 1,417–7,579 dispatches and then the title's threads submitted nothing more; the chained-dispatch count did not grow after it (105 / 98 / 50 until the run was stopped minutes later). So it looks like a CPU-side stall at or right after the first chained dispatches rather than a GPU hang (no TDR in 50+ s). I could not see where the threads wait (no debugger on this machine), and did not check which programs those first chains were.

Not tested: plain main, AMD or another NVIDIA card, a run of run 3's build with only #2080's own commits, which split program the first chains belonged to.

Update – where it waits. With #2333 (e406771) on top the stop is the same (run 5: chained dispatches 0 → 97 at 100–110 s, 58 MiB scratch, then 0 submits). A thread dump (XCL_THREAD_DUMP_AT=125,140) in run 6 shows it is not a deadlock but serialized cold compiles of the whole pipeline on title threads:

  • a title thread waits in ExecuteIndirect (bind.rs, dispatch_chain::whole) on Chain::build_whole, at 125 s and still at 140 s;
  • another title thread holds it and builds whole programs with the chain's root signature one after another, with no driver blob for that signature: 742a41ceb422beb5 780,880 B DXIL 10,452 ms, 99604bc99eb833eb 744,732 B 10,281 ms, cfd8542440a534bb 653,948 B 8,412 ms, bc2a621ee6d3e652 943,700 B (blob refused, retry still building at the dump). The ones with a blob took 28–161 ms.

So once the first split programs are dispatched indirectly, each needs its unsplit pipeline built on the title's thread (8–10 s cold here), and nothing builds it ahead: the precompile only makes the whole program under the title's root signature (.pso), not under the chain's (.chain.pso). With splitting off the same programs come from the .pso blobs and the title goes on.

Not tested (update): a precompile that also builds the whole program under the chain's root signature.

AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this; posted with my OK.

**@⁠Eterst** on GitHub · 2026-11-25 16:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7168349739) · edited 2026-11-25 17:31 UTC A data point on NVIDIA: with dispatch splitting on, a retail title stops at its world load when its first chained dispatches run; with `XCL_DIRECT_SPLIT_INSTRUCTIONS=0` the same build goes on. **Setup:** RTX 4070 SUPER 12 GB (wave32-only, split wave64), driver 616.92, Ryzen 7 5700X, 32 GB, Windows 10 19045, release. Not plain `main`: `main` at `0829441` (with e9ddf17 / 0829441, the bounded scratch) merged into a test tree with #2057 (`41303e4`) and a few other open PRs, so it may not reproduce on `main` alone. `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_PSO_WAIT_MS=50 XCL_NETWORK=0`, XCL and NVIDIA caches warm (compute and the pipeline journal precompiled for each split setting), 1 run each. | run | split | chained dispatches when presents stop | scratch | last presents | after it | |---|---|---|---|---|---| | 1 | default (12,500) | 0 at 100 s → 105 at 110 s | (before the bound) | ~104 s | 0 presents, 0 submits, 0 draws to the end; no device removal, no crash, no watchdog line | | 2 | default (+ #1702's texture pages in system memory) | 0 at 100 s → 98 at 120 s | (before the bound) | ~114 s | the same | | 3 | default, with e9ddf17 / 0829441 | 0 at 100 s → 50 at 110 s | 4 MiB (largest dispatch 3 MiB, one slab each) | ~106 s | the same | | 4 | `XCL_DIRECT_SPLIT_INSTRUCTIONS=0` | 0 (0 programs split) | – | – | presents went on (3–10 per 2 s, 9k–26k dispatches per 2 s) until a device removal at 299 s from video memory running out, as in our runs before #2080 | In runs 1–3 the last 2 s before the stop had a burst of 1,417–7,579 dispatches and then the title's threads submitted nothing more; the chained-dispatch count did not grow after it (105 / 98 / 50 until the run was stopped minutes later). So it looks like a CPU-side stall at or right after the first chained dispatches rather than a GPU hang (no TDR in 50+ s). I could not see where the threads wait (no debugger on this machine), and did not check which programs those first chains were. **Not tested:** plain `main`, AMD or another NVIDIA card, a run of run 3's build with only #2080's own commits, which split program the first chains belonged to. **Update – where it waits.** With #2333 (`e406771`) on top the stop is the same (run 5: chained dispatches 0 → 97 at 100–110 s, 58 MiB scratch, then 0 submits). A thread dump (`XCL_THREAD_DUMP_AT=125,140`) in run 6 shows it is not a deadlock but serialized cold compiles of the **whole** pipeline on title threads: - a title thread waits in `ExecuteIndirect` (`bind.rs`, `dispatch_chain::whole`) on `Chain::build_whole`, at 125 s and still at 140 s; - another title thread holds it and builds whole programs with the chain's root signature one after another, with no driver blob for that signature: `742a41ceb422beb5` 780,880 B DXIL 10,452 ms, `99604bc99eb833eb` 744,732 B 10,281 ms, `cfd8542440a534bb` 653,948 B 8,412 ms, `bc2a621ee6d3e652` 943,700 B (blob refused, retry still building at the dump). The ones with a blob took 28–161 ms. So once the first split programs are dispatched indirectly, each needs its unsplit pipeline built on the title's thread (8–10 s cold here), and nothing builds it ahead: the precompile only makes the whole program under the title's root signature (`.pso`), not under the chain's (`.chain.pso`). With splitting off the same programs come from the `.pso` blobs and the title goes on. **Not tested (update):** a precompile that also builds the whole program under the chain's root signature. **AI use:** Claude Code (Claude Opus 5.5) made the runs and wrote this; posted with my OK.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 07:28 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 07:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#issuecomment-7185498944) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Author
Owner

@⁠O5-7 on GitHub · 2026-11-25 08:14 UTC · original · reviewed

Independent test report for PR #2080 on head commit 8eefdefcf2283f1ae7ff524ed66de43356b82060 (8eefdef).

Setup

  • GPU: NVIDIA GeForce RTX 5080 16 GB (wave32-only, driver 32.0.15.9579)
  • CPU / RAM: AMD Ryzen 7 9700X, 32 GB RAM
  • OS / Toolchain: Windows 11 Pro 10.0.26100, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0)

Test results (debug)

  • cargo test -p xcl dispatch_chain -- --nocapture: 4 passed, 0 failed, 0 ignored (dispatch_chain_native_wave64_builds_whole reported SKIPPED ...: no wave64 on this wave32-only GPU)
  • XCL_DIRECT_DXIL=1 cargo test -p xcl dispatch_chain -- --nocapture: 4 passed, 0 failed, 0 ignored (dispatch_chain_native_wave64_builds_whole reported SKIPPED ...: no wave64 on this wave32-only GPU)
  • cargo test --workspace -- --test-threads=4: 1158 passed, 0 failed, 46 ignored

Regression run (clean detached HEAD 8eefdef)

xcl-smoke v1
commit: 8eefdefcf2283f1ae7ff524ed66de43356b82060
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1688 (PresentX 1688)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14075 MB

(Same clean-machine main cbc296a 60 s baseline: 1686 frames (PresentX 1686), 60 60 60, 0 removals, 0 crashes, 14083 MB.)

AI use

  • Antigravity (Gemini 4 Neon) ran the builds, test suites, and smoke run, and formatted this report.
**@⁠O5-7** on GitHub · 2026-11-25 08:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/2080#pullrequestreview-6053969961) · **reviewed** Independent test report for PR #2080 on head commit `8eefdefcf2283f1ae7ff524ed66de43356b82060` (`8eefdef`). **Setup** - GPU: NVIDIA GeForce RTX 5080 16 GB (wave32-only, driver `32.0.15.9579`) - CPU / RAM: AMD Ryzen 7 9700X, 32 GB RAM - OS / Toolchain: Windows 11 Pro `10.0.26100`, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.8.2502.11` (Windows SDK `10.0.26100.0`) **Test results (debug)** - `cargo test -p xcl dispatch_chain -- --nocapture`: 4 passed, 0 failed, 0 ignored (`dispatch_chain_native_wave64_builds_whole` reported `SKIPPED ...: no wave64` on this wave32-only GPU) - `XCL_DIRECT_DXIL=1 cargo test -p xcl dispatch_chain -- --nocapture`: 4 passed, 0 failed, 0 ignored (`dispatch_chain_native_wave64_builds_whole` reported `SKIPPED ...: no wave64` on this wave32-only GPU) - `cargo test --workspace -- --test-threads=4`: 1158 passed, 0 failed, 46 ignored **Regression run (clean detached HEAD `8eefdef`)** ``` xcl-smoke v1 commit: 8eefdefcf2283f1ae7ff524ed66de43356b82060 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1688 (PresentX 1688) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14075 MB ``` (Same clean-machine `main` `cbc296a` 60 s baseline: `1686 frames (PresentX 1686)`, `60 60 60`, `0` removals, `0` crashes, `14083 MB`.) **AI use** - Antigravity (Gemini 4 Neon) ran the builds, test suites, and smoke run, and formatted this report.
This discussion has been locked. Commenting is limited to contributors.
No description provided.