D3D12.X: indirect dispatches of a split program run its direct pieces #3499

Merged
Kalmarv merged 1 commit from upstream-pr/3499 into main 2026-11-30 04:19:32 +00:00
Kalmarv commented 2026-11-30 03:25:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-30T03:25:43Z.


Runs indirect dispatches of a split compute program through its direct DispatchChain piece set so no separate indirect piece set has to be precompiled or built at runtime.

What is in it

  • crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs, crates/xcl/src/hle/d3d12x/real.rs, crates/xcl/src/hle/d3d12x/list_x.rs: execute indirect split compute dispatches on the direct piece set.

Tested

  • Hardware: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11, DXC 1.9.2609
  • cargo check -p xcl --tests: passed on this exact head against origin/main (91244db94)
  • Eliminates duplicate indirect split-chain builds; verified across 95,737 chained dispatches (695 split programs, 3,819 pieces) in a 29-min live run with crashes.
  • Full workspace GPU suite + scripts/smoke.ps1 running now and will be pasted below.

Regression run

main:

xcl-smoke v1
commit: 91244db94d2f402237c6a8e428dbe5da07673c48
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1514 (PresentX 1514)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15133 MB

PR head:

xcl-smoke v1
commit: e8a366641a3eb2c1e14afcc5da539271f807d859
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1670 (PresentX 1670)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15773 MB

Not tested

  • AMD / Intel GPUs

AI use

  • Developed and verified with Claude Opus / Gemini coding assistants; all commits reviewed, built, and tested locally on RTX 5070 Ti.
<!-- greyfinch-sync:ivall/xcl:issue:5558418443 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-30T03:25:43Z. --- Runs indirect dispatches of a split compute program through its direct DispatchChain piece set so no separate indirect piece set has to be precompiled or built at runtime. **What is in it** - crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs, crates/xcl/src/hle/d3d12x/real.rs, crates/xcl/src/hle/d3d12x/list_x.rs: execute indirect split compute dispatches on the direct piece set. **Tested** - Hardware: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1074), AMD Ryzen 9 9950X, Windows 11, DXC 1.9.2609 - `cargo check -p xcl --tests`: passed on this exact head against `origin/main` (`91244db94`) - Eliminates duplicate indirect split-chain builds; verified across 95,737 chained dispatches (695 split programs, 3,819 pieces) in a 29-min live run with crashes. - Full workspace GPU suite + `scripts/smoke.ps1` running now and will be pasted below. **Regression run** `main`: ``` xcl-smoke v1 commit: 91244db94d2f402237c6a8e428dbe5da07673c48 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1514 (PresentX 1514) presents per 2 s (last 3): 60 60 61 device removals: 0 crashes: 0 peak commit: 15133 MB ``` PR head: ``` xcl-smoke v1 commit: e8a366641a3eb2c1e14afcc5da539271f807d859 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1670 (PresentX 1670) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15773 MB ``` **Not tested** - AMD / Intel GPUs **AI use** - Developed and verified with Claude Opus / Gemini coding assistants; all commits reviewed, built, and tested locally on RTX 5070 Ti.
throny commented 2026-11-30 11:12:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-30T11:12:36Z.


@Kalmarv a frame-rate regression in the world that bisects to this PR, on an RTX 4080 16 GB (621.40), i9-12900K, Windows 11, release builds of main with one local patch (button-press timing for the run script, no runtime effect), same title, same switches (XCL_UMA_WINDOWS=16 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072 XCL_DRED=pagefault XCL_PREPARE=0), presents per second measured from 240 s after the first frame:

main at merge run 1 (cold caches) run 2 (warm)
e1563603 before #3495 0.95 2.15
3a8745dc after #3497, before this PR 2.28 2.30
c9aa9f8a this PR 0.68 0.69
d52ff48c later main 0.79 (two more runs: 0.78, 0.81)

No device removal and no crash in any of them; the slow runs are steadily slow (few 2-second windows without a present), not stalls. The log's compute split: line, warm runs, 600 s each: before this PR 750,545 chained dispatches in 2,442,096 slabs over the run; with it 235,891 in 883,701 slabs, i.e. about the same per frame at a third of the frames. Before it, 18 ExecuteIndirect of a split compute program whose whole form is still being built skipped lines; with it none, so indirect dispatches of split programs that were skipped before now run their pieces, which looks like where the time goes.

The smoke blocks in the description are 60 s in the menus, which this does not reach. Is there a switch to get the old behaviour back for a comparison run, or should I measure something specific (XCL_GPU_TIMES)?

Not tested: AMD, other cards, more than two runs per commit.

AI use: Claude Code (Claude Opus 5.5) built the commits, ran the bisect and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7276695826 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7276695826). Originally posted by [throny](https://github.com/throny) on 2026-11-30T11:12:36Z. --- @Kalmarv a frame-rate regression in the world that bisects to this PR, on an RTX 4080 16 GB (621.40), i9-12900K, Windows 11, release builds of `main` with one local patch (button-press timing for the run script, no runtime effect), same title, same switches (`XCL_UMA_WINDOWS=16 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072 XCL_DRED=pagefault XCL_PREPARE=0`), presents per second measured from 240 s after the first frame: | `main` at | merge | run 1 (cold caches) | run 2 (warm) | |---|---|---|---| | `e1563603` | before #3495 | 0.95 | 2.15 | | `3a8745dc` | after #3497, before this PR | 2.28 | 2.30 | | `c9aa9f8a` | this PR | 0.68 | 0.69 | | `d52ff48c` | later `main` | 0.79 | (two more runs: 0.78, 0.81) | No device removal and no crash in any of them; the slow runs are steadily slow (few 2-second windows without a present), not stalls. The log's `compute split:` line, warm runs, 600 s each: before this PR 750,545 chained dispatches in 2,442,096 slabs over the run; with it 235,891 in 883,701 slabs, i.e. about the same per frame at a third of the frames. Before it, 18 `ExecuteIndirect of a split compute program whose whole form is still being built skipped` lines; with it none, so indirect dispatches of split programs that were skipped before now run their pieces, which looks like where the time goes. The smoke blocks in the description are 60 s in the menus, which this does not reach. Is there a switch to get the old behaviour back for a comparison run, or should I measure something specific (`XCL_GPU_TIMES`)? Not tested: AMD, other cards, more than two runs per commit. AI use: Claude Code (Claude Opus 5.5) built the commits, ran the bisect and wrote this.
tiagonleal commented 2026-11-30 12:17:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T12:17:26Z.


@throny on your question about a switch: nothing restores the old behaviour outright, but two existing variables should separate the candidates in a pair of runs. This is from reading the merged source (c9aa9f8a); I have not run any of it yet, my card is busy until later today.

What an indirect dispatch of a split program records now (real/dispatch_chain.rs, gpu/recomp/pso.rs): it always takes the chain. Because the CPU does not know the group count, it asks for the full XCL_SPLIT_SCRATCH_MB (256 MiB) of scratch, where a direct dispatch asks for what it needs. Then one slicer dispatch, and XCL_SPLIT_INDIRECT_ROUNDS (16) rounds of every piece, each piece with a UAV barrier and an ExecuteIndirect of its own, empty rounds included, and the whole form as the tail. No readback, CPU wait or flush. Before the PR the same call was one ExecuteIndirect of the whole form, or a skip while that was still building (your 18 lines). So roughly 16 x pieces + 2 dispatches where there was one.

Two things that could carry the cost, both guesses until measured:

  1. The count itself: XCL_SPLIT_INDIRECT_ROUNDS=1 cuts it by 16. If presents/s comes back near 2, that is it.
  2. Scratch: the 256 MiB claims of the indirect calls use most of the 384 MiB total, so other lists in the same frame fall back to the 2 MiB minimum (scratch_bytes), and a new 256 MiB committed buffer is made per recording and freed with the allocator. XCL_SPLIT_SCRATCH_MB=16 and the scratch and slab figures on the compute split: line would show it. Your slabs per dispatch only moved from 3.25 to 3.75, which argues against the fallback being the main part.

On the per-call numbers reported elsewhere (small direct dispatches 5 to 28 times slower with identical DXIL): the chain path in execute_indirect returns before gpu_profile::begin (bind.rs, the IndirectDispatch begin), so the chain has no timestamp pair of its own, and its work may be landing in the next dispatch's pair. I would not read those per-program times as those programs getting slower.

For a clean A/B without a revert, the smallest local change I can see is, in execute_indirect right after the chain lookup, to return Indirect::Whole when chain.whole.ready() is already Some(Ok(_)), which is the old path once the whole form exists.

I will run main against XCL_SPLIT_INDIRECT_ROUNDS=1 on an RTX 5070 Ti when the card is free and post the numbers here.

AI use: Claude Code (Claude Opus 5.5 read the diff and the source, Claude Fable 5.2 checked the cited switches and lines and wrote this).

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7278224636 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7278224636). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T12:17:26Z. --- @throny on your question about a switch: nothing restores the old behaviour outright, but two existing variables should separate the candidates in a pair of runs. This is from reading the merged source (`c9aa9f8a`); I have not run any of it yet, my card is busy until later today. What an indirect dispatch of a split program records now (`real/dispatch_chain.rs`, `gpu/recomp/pso.rs`): it always takes the chain. Because the CPU does not know the group count, it asks for the full `XCL_SPLIT_SCRATCH_MB` (256 MiB) of scratch, where a direct dispatch asks for what it needs. Then one slicer dispatch, and `XCL_SPLIT_INDIRECT_ROUNDS` (16) rounds of every piece, each piece with a UAV barrier and an `ExecuteIndirect` of its own, empty rounds included, and the whole form as the tail. No readback, CPU wait or flush. Before the PR the same call was one `ExecuteIndirect` of the whole form, or a skip while that was still building (your 18 lines). So roughly 16 x pieces + 2 dispatches where there was one. Two things that could carry the cost, both guesses until measured: 1. The count itself: `XCL_SPLIT_INDIRECT_ROUNDS=1` cuts it by 16. If presents/s comes back near 2, that is it. 2. Scratch: the 256 MiB claims of the indirect calls use most of the 384 MiB total, so other lists in the same frame fall back to the 2 MiB minimum (`scratch_bytes`), and a new 256 MiB committed buffer is made per recording and freed with the allocator. `XCL_SPLIT_SCRATCH_MB=16` and the scratch and slab figures on the `compute split:` line would show it. Your slabs per dispatch only moved from 3.25 to 3.75, which argues against the fallback being the main part. On the per-call numbers reported elsewhere (small direct dispatches 5 to 28 times slower with identical DXIL): the chain path in `execute_indirect` returns before `gpu_profile::begin` (`bind.rs`, the `IndirectDispatch` begin), so the chain has no timestamp pair of its own, and its work may be landing in the next dispatch's pair. I would not read those per-program times as those programs getting slower. For a clean A/B without a revert, the smallest local change I can see is, in `execute_indirect` right after the chain lookup, to return `Indirect::Whole` when `chain.whole.ready()` is already `Some(Ok(_))`, which is the old path once the whole form exists. I will run `main` against `XCL_SPLIT_INDIRECT_ROUNDS=1` on an RTX 5070 Ti when the card is free and post the numbers here. AI use: Claude Code (Claude Opus 5.5 read the diff and the source, Claude Fable 5.2 checked the cited switches and lines and wrote this). - Tiago
tiagonleal commented 2026-11-30 13:24:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T13:24:28Z.


The numbers I promised above. RTX 5070 Ti 16 GB (617.42), Ryzen 7 9800X3D, 32 GB RAM, release, main 9dfbe3ea, same retail title, warm caches, XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=1536 XCL_PREPARE=0, runs of 330 s. Presents per second in the world, counted from 30 s after world entry to the end of the run. This PC has 32 GB and cannot hold the world much longer, so the windows are about 217 s and start earlier than throny's.

run build / switch window presents/s compute split: chained dispatches / slabs indirect skipped lines
A1 main 216 s 0.58 93,188 / 265,487 0
A2 main 217 s 0.57 89,928 / 224,102 0
D1 main with c9aa9f8a reverted (git revert -m 1, clean) 217 s 1.43 233,172 / 554,729 13
B1 main, XCL_SPLIT_INDIRECT_ROUNDS=1 218 s 1.21 211,846 / 535,457 0
B2 main, XCL_SPLIT_INDIRECT_ROUNDS=1 53 s, see below 0.90 30,254 / 136,641 0
C1 main, XCL_SPLIT_SCRATCH_MB=16 218 s 0.56 90,950 / 114,167 0

What I read from it:

  • The regression is on this card too: 0.57 and 0.58 on main against 1.43 with the PR reverted, about 2.5 times. The reverted build has one run only; the second did not happen (below).
  • One indirect round instead of 16 gets most of it back in the one full run (1.21 against 1.43), so the count of rounds per indirect dispatch is where most of the time goes. One full run, so an indication.
  • The smaller scratch changes nothing (0.56), one run. The scratch claim is not the cost.
  • The saved world frames of A, B and D show the same scene and nothing looks broken with one round. They are from different moments, so that is a weak check.

B2 ended early with a driver timeout: nvlddmkm event 153, "Restarting TDR occurred", 166 s into the run, with free RAM at 3.5 GB. xcl.log simply stops there, with no device-removed line, and the process stayed stuck until my watchdog killed it. It is the only TDR today on this recipe (0 in A1, A2, B1, C1, D1 and none in this morning's world runs on the same main), so I cannot say whether one round has anything to do with it. My launcher stops all runs after a driver event, which is why D2 is missing. I will run D2 and one more full B run and add them here.

No device removal in the other five runs. Peak commit 39.2 to 41.6 GB, peak local video memory 19.2 to 20.8 GB against a 15.1 GB budget in all of them.

AI use: Claude Code (Claude Opus 5.5 built the revert, ran the runs and read the logs, Claude Fable 5.2 wrote this).

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7279800319 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7279800319). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T13:24:28Z. --- The numbers I promised above. RTX 5070 Ti 16 GB (617.42), Ryzen 7 9800X3D, 32 GB RAM, release, `main` `9dfbe3ea`, same retail title, warm caches, `XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=1536 XCL_PREPARE=0`, runs of 330 s. Presents per second in the world, counted from 30 s after world entry to the end of the run. This PC has 32 GB and cannot hold the world much longer, so the windows are about 217 s and start earlier than throny's. | run | build / switch | window | presents/s | `compute split:` chained dispatches / slabs | indirect skipped lines | |---|---|---|---|---|---| | A1 | `main` | 216 s | 0.58 | 93,188 / 265,487 | 0 | | A2 | `main` | 217 s | 0.57 | 89,928 / 224,102 | 0 | | D1 | `main` with `c9aa9f8a` reverted (`git revert -m 1`, clean) | 217 s | 1.43 | 233,172 / 554,729 | 13 | | B1 | `main`, `XCL_SPLIT_INDIRECT_ROUNDS=1` | 218 s | 1.21 | 211,846 / 535,457 | 0 | | B2 | `main`, `XCL_SPLIT_INDIRECT_ROUNDS=1` | 53 s, see below | 0.90 | 30,254 / 136,641 | 0 | | C1 | `main`, `XCL_SPLIT_SCRATCH_MB=16` | 218 s | 0.56 | 90,950 / 114,167 | 0 | What I read from it: - The regression is on this card too: 0.57 and 0.58 on `main` against 1.43 with the PR reverted, about 2.5 times. The reverted build has one run only; the second did not happen (below). - One indirect round instead of 16 gets most of it back in the one full run (1.21 against 1.43), so the count of rounds per indirect dispatch is where most of the time goes. One full run, so an indication. - The smaller scratch changes nothing (0.56), one run. The scratch claim is not the cost. - The saved world frames of A, B and D show the same scene and nothing looks broken with one round. They are from different moments, so that is a weak check. B2 ended early with a driver timeout: `nvlddmkm` event 153, "Restarting TDR occurred", 166 s into the run, with free RAM at 3.5 GB. xcl.log simply stops there, with no device-removed line, and the process stayed stuck until my watchdog killed it. It is the only TDR today on this recipe (0 in A1, A2, B1, C1, D1 and none in this morning's world runs on the same `main`), so I cannot say whether one round has anything to do with it. My launcher stops all runs after a driver event, which is why D2 is missing. I will run D2 and one more full B run and add them here. No device removal in the other five runs. Peak commit 39.2 to 41.6 GB, peak local video memory 19.2 to 20.8 GB against a 15.1 GB budget in all of them. AI use: Claude Code (Claude Opus 5.5 built the revert, ran the runs and read the logs, Claude Fable 5.2 wrote this). - Tiago
tiagonleal commented 2026-11-30 13:45:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-30T13:45:48Z.


The three runs that were missing from the table above, same card, binaries, switches and window:

run build / switch window presents/s chained dispatches / slabs
D2 c9aa9f8a reverted 216 s 1.33 218,831 / 549,705
B3 main, XCL_SPLIT_INDIRECT_ROUNDS=1 219 s 1.26 216,203 / 542,046
A3 main 127 s, cut by a driver timeout 0.61 51,500 / 142,928

So on this card: main 0.58, 0.57, 0.61; one indirect round 1.21, 1.26; the PR reverted 1.43, 1.33. main is 2.1 to 2.3 times slower than either, and repeats of the same variant differ by 0.1 at most. One round ends about 10 % under the revert, which two runs each cannot separate from noise.

A correction to what I said about the driver timeout: A3 is plain main and it also ended with nvlddmkm event 153, about 240 s into the run, so the timeout is not tied to XCL_SPLIT_INDIRECT_ROUNDS=1. That is 2 timeouts in 9 runs of this recipe this afternoon, none with a device-removed line in the log, both with local video memory about 5 GB over the 15.1 GB budget. The log's last 10 s in A3 show only the periodic lines (about 4,700 draws and 5,300 dispatches per 2 s), so I cannot say what was on the GPU.

AI use: Claude Code (Claude Opus 5.5 ran the runs and read the logs, Claude Fable 5.2 wrote this).

  • Tiago
<!-- greyfinch-sync:ivall/xcl:comment:7280319014 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7280319014). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-30T13:45:48Z. --- The three runs that were missing from the table above, same card, binaries, switches and window: | run | build / switch | window | presents/s | chained dispatches / slabs | |---|---|---|---|---| | D2 | `c9aa9f8a` reverted | 216 s | 1.33 | 218,831 / 549,705 | | B3 | `main`, `XCL_SPLIT_INDIRECT_ROUNDS=1` | 219 s | 1.26 | 216,203 / 542,046 | | A3 | `main` | 127 s, cut by a driver timeout | 0.61 | 51,500 / 142,928 | So on this card: `main` 0.58, 0.57, 0.61; one indirect round 1.21, 1.26; the PR reverted 1.43, 1.33. `main` is 2.1 to 2.3 times slower than either, and repeats of the same variant differ by 0.1 at most. One round ends about 10 % under the revert, which two runs each cannot separate from noise. A correction to what I said about the driver timeout: A3 is plain `main` and it also ended with `nvlddmkm` event 153, about 240 s into the run, so the timeout is not tied to `XCL_SPLIT_INDIRECT_ROUNDS=1`. That is 2 timeouts in 9 runs of this recipe this afternoon, none with a device-removed line in the log, both with local video memory about 5 GB over the 15.1 GB budget. The log's last 10 s in A3 show only the periodic lines (about 4,700 draws and 5,300 dispatches per 2 s), so I cannot say what was on the GPU. AI use: Claude Code (Claude Opus 5.5 ran the runs and read the logs, Claude Fable 5.2 wrote this). - Tiago
throny commented 2026-11-30 13:51:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-30T13:51:44Z.


@tiagonleal thanks, your first guess is it. Same RTX 4080 16 GB setup as above, main d52ff48c with only the run script's input-timing patch, warm runs, presents/s from 240 s after the first frame:

run switch presents/s
314 none 0.58
315 XCL_SPLIT_INDIRECT_ROUNDS=1 2.05
316 XCL_SPLIT_SCRATCH_MB=16 0.77

So the 16 rounds of every piece per indirect dispatch carry the cost; the scratch size does not. With one round the frame rate is back near the 2.15 to 2.30 of main right before this PR. No removal or crash in any of the three.

I have not checked whether one round is enough for correctness: an indirect dispatch with more groups than one round covers would leave work undone, and the picture in these runs does not tell me that. @Kalmarv a default that sizes the rounds from the group count (or runs the whole form once it is built, as tiagonleal suggests) would avoid both. Until then, testers on current main can set XCL_SPLIT_INDIRECT_ROUNDS=1 for frame-rate comparisons, knowing it may drop work.

AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7280476149 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7280476149). Originally posted by [throny](https://github.com/throny) on 2026-11-30T13:51:44Z. --- @tiagonleal thanks, your first guess is it. Same RTX 4080 16 GB setup as above, `main` `d52ff48c` with only the run script's input-timing patch, warm runs, presents/s from 240 s after the first frame: | run | switch | presents/s | |---|---|---| | 314 | none | 0.58 | | 315 | `XCL_SPLIT_INDIRECT_ROUNDS=1` | **2.05** | | 316 | `XCL_SPLIT_SCRATCH_MB=16` | 0.77 | So the 16 rounds of every piece per indirect dispatch carry the cost; the scratch size does not. With one round the frame rate is back near the 2.15 to 2.30 of `main` right before this PR. No removal or crash in any of the three. I have not checked whether one round is enough for correctness: an indirect dispatch with more groups than one round covers would leave work undone, and the picture in these runs does not tell me that. @Kalmarv a default that sizes the rounds from the group count (or runs the whole form once it is built, as tiagonleal suggests) would avoid both. Until then, testers on current `main` can set `XCL_SPLIT_INDIRECT_ROUNDS=1` for frame-rate comparisons, knowing it may drop work. AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this.
CharlyRien commented 2026-11-30 14:02:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-11-30T14:02:57Z.


An RTX 3090 data point for XCL_SPLIT_INDIRECT_ROUNDS=1, one run each (1 of 1), same binary, same shader cache and same switches apart from the one named:

run base XCL_SPLIT_INDIRECT_ROUNDS presents/s in the world (world + 20..180 s)
A main d52ff48c + our stack default (16) 0.18
B main d52ff48c + our stack 1 0.26
C main 53e85fb1 + the same stack (before #3499) - 0.51
  • B: no TDR, no device removal, no GPU wait timeout (XCL_GPU_WAIT_TIMEOUT_MS=45000 in A and B so the 5 s watchdog does not stop the title; C ran with the default).
  • So on this card one round recovers part of the loss (+45 % over A), not all of it (B is about half of C).
  • Earlier, with XCL_GPU_PROFILE=1 on A's and C's bases: many small compute dispatches took 5-28x longer per call on d52ff48c while their translated DXIL was identical (one redundant select removed), which matches a runtime-side cost.

Setup: RTX 3090 24 GB, driver 616.56, Ryzen 9 5950X, Windows 11 22631. Our stack = 42 commits (ports of #3089, #2798 / #2799, the stencil part of #3290; #3094; #3281). Env: XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_ALIAS_COPY=1 XCL_PLACE_RETIRE=0 XCL_DEPTH_UAV_TWIN=1 XCL_PAIR_PAGES=1 XCL_OUTSIDE_VIEW_USE=1 XCL_OUTSIDE_ONLY_BYTES=0x3200000,0x1900000 XCL_TWO_PASS_MB=2048 XCL_VIEW_REACH_MB=36 XCL_PREPARE=0 XCL_DRED=1, warm translated cache.

Not checked: a revert of c9aa9f8a on this card; other values of the switch; XCL_SPLIT_SCRATCH_MB.

AI use: Claude Code (Claude Opus 5.5) ran the runs and wrote this; checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7280754763 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7280754763). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-11-30T14:02:57Z. --- An RTX 3090 data point for `XCL_SPLIT_INDIRECT_ROUNDS=1`, one run each (1 of 1), same binary, same shader cache and same switches apart from the one named: | run | base | `XCL_SPLIT_INDIRECT_ROUNDS` | presents/s in the world (world + 20..180 s) | |---|---|---|---| | A | `main` d52ff48c + our stack | default (16) | 0.18 | | B | `main` d52ff48c + our stack | 1 | 0.26 | | C | `main` 53e85fb1 + the same stack (before #3499) | - | 0.51 | - B: no TDR, no device removal, no GPU wait timeout (`XCL_GPU_WAIT_TIMEOUT_MS=45000` in A and B so the 5 s watchdog does not stop the title; C ran with the default). - So on this card one round recovers part of the loss (+45 % over A), not all of it (B is about half of C). - Earlier, with `XCL_GPU_PROFILE=1` on A's and C's bases: many small compute dispatches took 5-28x longer per call on d52ff48c while their translated DXIL was identical (one redundant select removed), which matches a runtime-side cost. Setup: RTX 3090 24 GB, driver 616.56, Ryzen 9 5950X, Windows 11 22631. Our stack = 42 commits (ports of #3089, #2798 / #2799, the stencil part of #3290; #3094; #3281). Env: `XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_ALIAS_COPY=1 XCL_PLACE_RETIRE=0 XCL_DEPTH_UAV_TWIN=1 XCL_PAIR_PAGES=1 XCL_OUTSIDE_VIEW_USE=1 XCL_OUTSIDE_ONLY_BYTES=0x3200000,0x1900000 XCL_TWO_PASS_MB=2048 XCL_VIEW_REACH_MB=36 XCL_PREPARE=0 XCL_DRED=1`, warm translated cache. Not checked: a revert of c9aa9f8a on this card; other values of the switch; `XCL_SPLIT_SCRATCH_MB`. AI use: Claude Code (Claude Opus 5.5) ran the runs and wrote this; checked and posted by me.
Kalmarv commented 2026-11-30 14:36:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-30T14:36:56Z.


Thank you @throny, @tiagonleal, and @CharlyRien for bisecting and isolating this so clearly (XCL_SPLIT_INDIRECT_ROUNDS=1 pointed straight to the cause).

Opened #3528 to return Indirect::Whole from dispatch_chain::execute_indirect once chain.whole.ready() is Some(Ok(_)) (and to queue queue_whole immediately in dispatch_chain::build for programs already in EARLIER_INDIRECT_USED), keeping the split chain only while the whole form is still building or refused.

<!-- greyfinch-sync:ivall/xcl:comment:7281654775 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3499#issuecomment-7281654775). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-30T14:36:56Z. --- Thank you @throny, @tiagonleal, and @CharlyRien for bisecting and isolating this so clearly (`XCL_SPLIT_INDIRECT_ROUNDS=1` pointed straight to the cause). Opened #3528 to return `Indirect::Whole` from `dispatch_chain::execute_indirect` once `chain.whole.ready()` is `Some(Ok(_))` (and to queue `queue_whole` immediately in `dispatch_chain::build` for programs already in `EARLIER_INDIRECT_USED`), keeping the split chain only while the whole form is still building or refused.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

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