Recompiler: memory windows from the descriptor heap (no per-access switch) #680

Manually merged
github merged 4 commits from gh-pr/680/head into gh-pr/680/base 2026-11-26 04:29:12 +00:00
Owner

@⁠imnicho on GitHub · 2026-11-24 03:23 UTC · original
imnicho:recomp-heap-windows → main · +623 −22 · 13 files · 4 commits · merged 2026-11-24 17:07 UTC

With more than one memory window every memory access of a translated shader is a switch over the windows' root UAVs, inlined once per window. That is what makes the big compute programs of a retail title slow to compile, in DXC and in the driver (#156, #346). Here window k is also a raw UAV in the shared descriptor heap and an access is one ResourceDescriptorHeap load or store.

Opt-in: XCL_HEAP_WINDOWS=1 turns the heap form on. Unset, a run is as on main: the shared heap is not made early, no window views are written, shaders are translated in the switch form under main's cache keys. It is off by default because of two NVIDIA reports in the comments, of which one is not explained yet (Why it is opt-in, below).

This is the heap-window part of #187 by @⁠RemingtonWilcox, which was closed without being merged; in #186 the maintainer wrote that memory windows from the descriptor heap "fit where this should go - a PR on current main is welcome". The three commits keep their author; I carried them onto current main, left out that PR's physical-page change and its aperture experiments and compile-time bench, and measured them on a retail title. If the author would rather reopen their own, I will close this one.

What is in it

  • Recompiler: memory windows from the descriptor heap, no per-access switch (#187 c3fb89e, 864ce8e, 33c92dd) – gpu/recomp/emit.rs (the accessors), mod.rs / pso.rs (Options::heap_windows, the HEAP_WINDOWS flag in the cache keys, opt-in: on with XCL_HEAP_WINDOWS=1), hle/d3d12x/console_heap.rs (the windows' raw views are the first 4 descriptors of the shared heap), bind.rs / list_x.rs / console_list.rs (a list that set no heap gets the shared one before an ABI draw or dispatch), shaders.rs (--precompile uses the same key), runner.rs (raw_window_uav, the test runner binds the heap). Tests: gpu_memory_windows_from_the_heap, gpu_raw_window_view_reaches_its_top (new file heap_window_tests.rs).
  • D3D12.X: SetDescriptorHeaps(0, NULL) clears the list's record of bound heaps (#187 8b4e398) – list_x.rs, with its test.
  • D3D12.X: a pipeline the driver refuses with heap windows is built in the switch form (#187 41d4506) – real.rs, pso.rs, test in tests/gpu_compute_e2e.rs. NVIDIA refuses a few big programs in the heap form with E_OUTOFMEMORY; they are built as before.
  • Recompiler: a heap window's view ends 32 bytes below 4 GiB (new; found and measured by @⁠CharlyRien, https://github.com/ivall/xcl/pull/680#issuecomment-7134810068) – runner.rs (raw_window_uav), heap_window_tests.rs. The D3D12 runtime of Windows 11 23H2 (D3D12Core 10.0.22621) refuses a raw view that ends more than 4 GiB − 32 bytes from the start of its resource and removes the device; newer runtimes take the larger one. The view is capped there: in the heap form the last 32 bytes of a 4 GiB window read 0 and drop their stores (it was the last 4). The HLSL and the cache keys stay the same; gpu_raw_window_view_reaches_its_top checks up to the new end.
  • From review: the windows' views are made after the shared heap's lock is released (console_heap::set_window_views) – the device may be an adopted one whose UAV hook takes the heaps' lock, which other paths take first. Found and fixed by @⁠anes66, with the test window_views_do_not_hold_global_during_device_calls; folded into the first commit with a Co-Authored-By.
  • On main's range check of the windows (f9e5ee9, merged after this PR was opened): in the heap form an xcl_w outside the windows reads 0, drops its store and zeroes an atomic's out by one comparison before the heap access, as the switch's default does. main's test of that rule runs in both forms now (gpu_heap_windows_reject_out_of_uma_aliasing).
  • Size: 623 lines added, 22 removed in 13 files; 232 of the added lines are the three test files and about 95 more the two tests in list_x.rs and console_heap.rs. Changed against #187: the view's cap above, the test file holds only the raw-view test (and reports a missing GPU / DXC, or an adapter that makes no 4 GiB reserved buffer – the CI's – through skip_test), commit subjects carry their area.

Measured (this PC, hardware below; a retail title's shader pack, numbers only)

After main's range check of the windows, which changed both forms (measured on e999741 on main 1ec4c98; the head now differs from that by the opt-in default and a rebase over commits that do not touch the recompiler): the same 83 programs and method as below, 3 rounds, the forms in turn.

switch form (as main) heap form
step 1: DXC, empty cache 40.2 · 40.6 · 40.8 s 36.2 · 35.7 · 35.2 s
step 2: the driver, 83 pipelines it has not seen (83 made, 0 refused in every run) 238.3 · 219.9 · 234.8 s 59.6 · 63.6 · 65.8 s
DXIL of the 83 programs 8.3 MB, largest 1 066 KB 6.9 MB, largest 846 KB

Without the 5.8 s of reading the pack: the driver's part is 214 – 233 s against 54 – 60 s, about 4 times less, DXC's 34 – 35 s against 29 – 30 s. Before the range check it was 9 – 10 times (next table): the switch form got cheaper with it, and the heap form now pays one comparison an access.

As first opened (before main's range check; kept for the record):

xcl shaders <pack> --precompile --only cs --limit 22240: the first 83 compute programs of a retail title's pack, this change on main cb868b2 (13dcab8), release; the switch form is the same executable with XCL_HEAP_WINDOWS=0. 3 rounds, the two forms in turn, every run on an empty DXIL cache and under an executable name the driver had not seen (its shader cache is per executable). Step 2 is the same command with --pipelines on the DXIL cache step 1 filled (4 driver compiles at once). Seconds of the whole command; 5.6 – 5.9 s of each is reading the pack.

switch form (as main) heap form
step 1: DXC, empty cache 40.0 · 37.2 · 36.9 s 29.9 · 30.4 · 31.9 s
step 2: the driver, 83 pipelines it has not seen (83 made, 0 refused in every run) 329.9 · 363.0 · 341.8 s 41.7 · 40.3 · 40.5 s
DXIL of the 83 programs 7.6 MB, largest 975 KB 5.9 MB, largest 696 KB
  • Without the reading: the driver's part falls from 324 – 357 s to 35 – 36 s (9 – 10 times less), DXC's from 31 – 34 s to 24 – 26 s.
  • Step 2 run again answers from the driver's own cache in both forms (5.6 – 5.9 s), once that cache is complete. In 4 of the 6 cases it took one more run to be complete (25 s three times in the heap form, 257 s once in the switch form): the driver's doing, in both forms.

Tested

  • The generated HLSL changes for every program with more than one memory window, so the GPU tests matter here: they ran in the suite below on this card.
  • hardware: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0 stable-x86_64-pc-windows-msvc; debug for the tests, release for the title and the timings.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on deb4b92 (rebased onto main b7aa9f3), as it is: 776 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu_wave32_program_in_wave64_hardware, gpu_geometry_wave32_prefix_count_over_a_mask – no wave64; heap_window_out_of_memory_falls_back_to_the_switch_form – it goes through the runtime switch, which is off).
  • The same with XCL_HEAP_WINDOWS=1 in the environment: 776 passed, 0 failed, 41 ignored (that test runs; the two wave64 ones are SKIPPED as above). The recompiler-level GPU tests of the heap form (gpu_memory_windows_from_the_heap, gpu_heap_windows_reject_out_of_uma_aliasing, gpu_raw_window_view_reaches_its_top) set the option themselves and run in both.
  • game checked: the newer retail title of the README, XCL_NETWORK=0, pad script through XCL_PRESS_AT, empty DXIL cache; an earlier head of this change (on main 9ce2070, before main's range check, the heap form on) in a local stack that gets the title to its world's graphics set-up on this PC (#266, #435, #490, #267 and the CopyFromSubresource fix of #539). The title's screens are drawn as before; the set-up starts at 132 s and its compute dispatches run (up to 212 in a 2 s window). In the first 217 s 125 compute pipelines were built at their first bind, 212.9 s in all, the longest 12.6 s (DXC and driver together, both cold). The driver refused 2 of them with E_OUTOFMEMORY; they were built in the switch form (the third commit at work) and the run went on.
  • What it does not do: on an empty cache the title's own stall exit (#232) still came, at 175 s (stepped over locally to let the run go on). Heap windows make each compile cheaper; they do not take the compiles out of the title's threads (#533, #539, #267 are about that).

Regression run

main:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1378 (PresentX 1379)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14314 MB

PR (default: the switch form, as main):

xcl-smoke v1
commit: deb4b92b4a0ec8436a73c0683a9a0bd54f38985d
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1388 (PresentX 1388)
presents per 2 s (last 3): 60 60 59
device removals: 0
crashes: 0
peak commit: 14316 MB

PR with XCL_HEAP_WINDOWS=1:

xcl-smoke v1
commit: deb4b92b4a0ec8436a73c0683a9a0bd54f38985d
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1401 (PresentX 1401)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14325 MB

Each block was made after one run of that build and form that filled its DXIL cache (the heap form has its own cache entries); the log of the third block's run has the line memory windows from the shared descriptor heap, the second's does not. A second round of the three: 1392 (main), 1377 (PR), 1407 (PR with the form on). The head is rebased onto b7aa9f3, the commit of the main block.

Why it is opt-in: two reports below of NVIDIA setups where the heap form fails, neither of which this machine shows – @⁠tycosnh: RTX 4090, driver 621.24, DXC 1.8.2502, #187's branch: the driver's compiler ends the process on compute programs when the title's world submits its first large compute batch; @⁠ryosen0: RTX 3060 Ti 8 GB, this PR's earlier head: the device is removed at boot, right after the shared heap and the windows' views are made (the switch form is clean there). Against that, @⁠milesah3ad's synthetic probe on an RTX 5080 (driver 621.14) had no abort with DXC 1.8 or 1.9, and this RTX 5080 (driver 610.47, DXC 1.9.2602.17) went through that compute batch in every run and made over 550 compute pipelines in the heap form with xcl shaders --pipelines (5 refused with an error code, none ending the process). For the second there is now a cause that fits (@⁠CharlyRien, RTX 3090 on Windows 11 23H2, https://github.com/ivall/xcl/pull/680#issuecomment-7134810068): there the device removal at boot reproduces, and it is that system's D3D12 runtime refusing the windows' 4 GiB − 4 raw view, with the debug layer naming CreateUnorderedAccessView; it is not the driver. The fourth commit caps the view at 4 GiB − 32 bytes, the change they ran there (no device removal in two title runs, the heap tests pass). Whether @⁠ryosen0's machine has that runtime is not confirmed. I cannot reproduce the removal on this PC (its runtime takes the larger view), so on my side the commit is checked only for doing no harm here: the suite and the three blocks above. The first report, the driver's compiler ending the process, is still neither reproduced nor explained (it did not come on an RTX 5090 or an RTX 5080 with that driver, nor on an RTX 4090 with an older one, in the comments below), so the form stays off by default; the default can change later, with more reports.

Not tested

  • AMD and Intel GPUs, and 64-lane hardware, on this head (on #187's head its author reported the suite on an RTX 3090, and another contributor the two heap tests on an RX 6800).
  • The graphics side in the world: the title's first screens are drawn by translated VS / PS built with this change, the world's pipelines are not reached on this PC yet.
  • A title whose own lists bind their own descriptor heaps in unusual ways beyond what the two list tests cover.

AI use

  • The commits are #187's: written by its author with Claude Opus 5.5 (their trailers are kept).
  • Claude Code with Claude Fable 5.2: carried them onto main, trimmed the tests, ran the suite, the timings and the title runs on the machine named, and wrote this description. The fourth commit is the one-line change @⁠CharlyRien found and measured, applied with the test's new end by Claude Code with Claude Fable 5.2.

Duplicate check (Gate A 02:15 UTC on main 9ce2070, Gate B 03:22 UTC on 91f9a5e, again 03:54, 04:39, 08:05 and 08:47 UTC, main 077ce40; again 17:03 UTC on b7aa9f3b): no open PR makes the windows come from the heap; read #187 (closed), #174 (links the accessors: DXC time only, the DXIL stays the same), #346 (docs: collects the measurements), #533 / #539 / #267 (schedule around slow compiles, do not change them), #573; opened since, other ways to cut the switch's cost: #1380 (big compute programs read all windows and select, the root UAVs stay) and #1439 (one switch for a multi-dword access).

🤖 Generated with Claude Code

**@⁠imnicho** on GitHub · 2026-11-24 03:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/680) `imnicho:recomp-heap-windows` → `main` · +623 −22 · 13 files · 4 commits · merged 2026-11-24 17:07 UTC With more than one memory window every memory access of a translated shader is a `switch` over the windows' root UAVs, inlined once per window. That is what makes the big compute programs of a retail title slow to compile, in DXC and in the driver (#156, #346). Here window k is also a raw UAV in the shared descriptor heap and an access is one `ResourceDescriptorHeap` load or store. **Opt-in**: `XCL_HEAP_WINDOWS=1` turns the heap form on. Unset, a run is as on `main`: the shared heap is not made early, no window views are written, shaders are translated in the switch form under `main`'s cache keys. It is off by default because of two NVIDIA reports in the comments, of which one is not explained yet (*Why it is opt-in*, below). This is the heap-window part of #187 by @⁠RemingtonWilcox, which was closed without being merged; in #186 the maintainer wrote that memory windows from the descriptor heap "fit where this should go - a PR on current main is welcome". The three commits keep their author; I carried them onto current `main`, left out that PR's physical-page change and its aperture experiments and compile-time bench, and measured them on a retail title. If the author would rather reopen their own, I will close this one. **What is in it** - `Recompiler: memory windows from the descriptor heap, no per-access switch` (#187 `c3fb89e`, `864ce8e`, `33c92dd`) – `gpu/recomp/emit.rs` (the accessors), `mod.rs` / `pso.rs` (`Options::heap_windows`, the `HEAP_WINDOWS` flag in the cache keys, opt-in: on with `XCL_HEAP_WINDOWS=1`), `hle/d3d12x/console_heap.rs` (the windows' raw views are the first 4 descriptors of the shared heap), `bind.rs` / `list_x.rs` / `console_list.rs` (a list that set no heap gets the shared one before an ABI draw or dispatch), `shaders.rs` (`--precompile` uses the same key), `runner.rs` (`raw_window_uav`, the test runner binds the heap). Tests: `gpu_memory_windows_from_the_heap`, `gpu_raw_window_view_reaches_its_top` (new file `heap_window_tests.rs`). - `D3D12.X: SetDescriptorHeaps(0, NULL) clears the list's record of bound heaps` (#187 `8b4e398`) – `list_x.rs`, with its test. - `D3D12.X: a pipeline the driver refuses with heap windows is built in the switch form` (#187 `41d4506`) – `real.rs`, `pso.rs`, test in `tests/gpu_compute_e2e.rs`. NVIDIA refuses a few big programs in the heap form with `E_OUTOFMEMORY`; they are built as before. - `Recompiler: a heap window's view ends 32 bytes below 4 GiB` (new; found and measured by @⁠CharlyRien, https://github.com/ivall/xcl/pull/680#issuecomment-7134810068) – `runner.rs` (`raw_window_uav`), `heap_window_tests.rs`. The D3D12 runtime of Windows 11 23H2 (D3D12Core 10.0.22621) refuses a raw view that ends more than 4 GiB − 32 bytes from the start of its resource and removes the device; newer runtimes take the larger one. The view is capped there: in the heap form the last 32 bytes of a 4 GiB window read 0 and drop their stores (it was the last 4). The HLSL and the cache keys stay the same; `gpu_raw_window_view_reaches_its_top` checks up to the new end. - From review: the windows' views are made after the shared heap's lock is released (`console_heap::set_window_views`) – the device may be an adopted one whose UAV hook takes the heaps' lock, which other paths take first. Found and fixed by @⁠anes66, with the test `window_views_do_not_hold_global_during_device_calls`; folded into the first commit with a `Co-Authored-By`. - On `main`'s range check of the windows (`f9e5ee9`, merged after this PR was opened): in the heap form an `xcl_w` outside the windows reads 0, drops its store and zeroes an atomic's `out` by one comparison before the heap access, as the switch's `default` does. `main`'s test of that rule runs in both forms now (`gpu_heap_windows_reject_out_of_uma_aliasing`). - Size: 623 lines added, 22 removed in 13 files; 232 of the added lines are the three test files and about 95 more the two tests in `list_x.rs` and `console_heap.rs`. Changed against #187: the view's cap above, the test file holds only the raw-view test (and reports a missing GPU / DXC, or an adapter that makes no 4 GiB reserved buffer – the CI's – through `skip_test`), commit subjects carry their area. **Measured** (this PC, hardware below; a retail title's shader pack, numbers only) **After `main`'s range check of the windows**, which changed both forms (measured on `e999741` on `main` `1ec4c98`; the head now differs from that by the opt-in default and a rebase over commits that do not touch the recompiler): the same 83 programs and method as below, 3 rounds, the forms in turn. | | switch form (as `main`) | heap form | |---|---|---| | step 1: DXC, empty cache | 40.2 · 40.6 · 40.8 s | 36.2 · 35.7 · 35.2 s | | step 2: the driver, 83 pipelines it has not seen (83 made, 0 refused in every run) | **238.3 · 219.9 · 234.8 s** | **59.6 · 63.6 · 65.8 s** | | DXIL of the 83 programs | 8.3 MB, largest 1 066 KB | 6.9 MB, largest 846 KB | Without the 5.8 s of reading the pack: the driver's part is 214 – 233 s against 54 – 60 s, about 4 times less, DXC's 34 – 35 s against 29 – 30 s. Before the range check it was 9 – 10 times (next table): the switch form got cheaper with it, and the heap form now pays one comparison an access. **As first opened** (before `main`'s range check; kept for the record): `xcl shaders <pack> --precompile --only cs --limit 22240`: the first 83 compute programs of a retail title's pack, this change on `main` `cb868b2` (`13dcab8`), release; the switch form is the same executable with `XCL_HEAP_WINDOWS=0`. 3 rounds, the two forms in turn, every run on an empty DXIL cache and under an executable name the driver had not seen (its shader cache is per executable). Step 2 is the same command with `--pipelines` on the DXIL cache step 1 filled (4 driver compiles at once). Seconds of the whole command; 5.6 – 5.9 s of each is reading the pack. | | switch form (as `main`) | heap form | |---|---|---| | step 1: DXC, empty cache | 40.0 · 37.2 · 36.9 s | 29.9 · 30.4 · 31.9 s | | step 2: the driver, 83 pipelines it has not seen (83 made, 0 refused in every run) | **329.9 · 363.0 · 341.8 s** | **41.7 · 40.3 · 40.5 s** | | DXIL of the 83 programs | 7.6 MB, largest 975 KB | 5.9 MB, largest 696 KB | - Without the reading: the driver's part falls from 324 – 357 s to 35 – 36 s (9 – 10 times less), DXC's from 31 – 34 s to 24 – 26 s. - Step 2 run again answers from the driver's own cache in both forms (5.6 – 5.9 s), once that cache is complete. In 4 of the 6 cases it took one more run to be complete (25 s three times in the heap form, 257 s once in the switch form): the driver's doing, in both forms. **Tested** - The generated HLSL changes for every program with more than one memory window, so the GPU tests matter here: they ran in the suite below on this card. - hardware: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), DXC 1.9.2602.17, rustc 1.100.0 `stable-x86_64-pc-windows-msvc`; debug for the tests, release for the title and the timings. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `deb4b92` (rebased onto `main` `b7aa9f3`), as it is: 776 passed, 0 failed, 41 ignored (SKIPPED GPU tests: `gpu_wave32_program_in_wave64_hardware`, `gpu_geometry_wave32_prefix_count_over_a_mask` – no wave64; `heap_window_out_of_memory_falls_back_to_the_switch_form` – it goes through the runtime switch, which is off). - The same with `XCL_HEAP_WINDOWS=1` in the environment: 776 passed, 0 failed, 41 ignored (that test runs; the two wave64 ones are SKIPPED as above). The recompiler-level GPU tests of the heap form (`gpu_memory_windows_from_the_heap`, `gpu_heap_windows_reject_out_of_uma_aliasing`, `gpu_raw_window_view_reaches_its_top`) set the option themselves and run in both. - game checked: the newer retail title of the README, `XCL_NETWORK=0`, pad script through `XCL_PRESS_AT`, empty DXIL cache; an earlier head of this change (on `main` `9ce2070`, before `main`'s range check, the heap form on) in a local stack that gets the title to its world's graphics set-up on this PC (#266, #435, #490, #267 and the `CopyFromSubresource` fix of #539). The title's screens are drawn as before; the set-up starts at 132 s and its compute dispatches run (up to 212 in a 2 s window). In the first 217 s 125 compute pipelines were built at their first bind, 212.9 s in all, the longest 12.6 s (DXC and driver together, both cold). The driver refused 2 of them with `E_OUTOFMEMORY`; they were built in the switch form (the third commit at work) and the run went on. - What it does not do: on an empty cache the title's own stall exit (#232) still came, at 175 s (stepped over locally to let the run go on). Heap windows make each compile cheaper; they do not take the compiles out of the title's threads (#533, #539, #267 are about that). **Regression run** main: ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: NVIDIA GeForce RTX 5080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1378 (PresentX 1379) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14314 MB ``` PR (default: the switch form, as `main`): ``` xcl-smoke v1 commit: deb4b92b4a0ec8436a73c0683a9a0bd54f38985d gpu: NVIDIA GeForce RTX 5080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1388 (PresentX 1388) presents per 2 s (last 3): 60 60 59 device removals: 0 crashes: 0 peak commit: 14316 MB ``` PR with `XCL_HEAP_WINDOWS=1`: ``` xcl-smoke v1 commit: deb4b92b4a0ec8436a73c0683a9a0bd54f38985d gpu: NVIDIA GeForce RTX 5080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1401 (PresentX 1401) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14325 MB ``` Each block was made after one run of that build and form that filled its DXIL cache (the heap form has its own cache entries); the log of the third block's run has the line `memory windows from the shared descriptor heap`, the second's does not. A second round of the three: 1392 (`main`), 1377 (PR), 1407 (PR with the form on). The head is rebased onto `b7aa9f3`, the commit of the main block. **Why it is opt-in**: two reports below of NVIDIA setups where the heap form fails, neither of which this machine shows – @⁠tycosnh: RTX 4090, driver 621.24, DXC 1.8.2502, #187's branch: the driver's compiler ends the process on compute programs when the title's world submits its first large compute batch; @⁠ryosen0: RTX 3060 Ti 8 GB, this PR's earlier head: the device is removed at boot, right after the shared heap and the windows' views are made (the switch form is clean there). Against that, @⁠milesah3ad's synthetic probe on an RTX 5080 (driver 621.14) had no abort with DXC 1.8 or 1.9, and this RTX 5080 (driver 610.47, DXC 1.9.2602.17) went through that compute batch in every run and made over 550 compute pipelines in the heap form with `xcl shaders --pipelines` (5 refused with an error code, none ending the process). **For the second there is now a cause that fits** (@⁠CharlyRien, RTX 3090 on Windows 11 23H2, https://github.com/ivall/xcl/pull/680#issuecomment-7134810068): there the device removal at boot reproduces, and it is that system's D3D12 runtime refusing the windows' 4 GiB − 4 raw view, with the debug layer naming `CreateUnorderedAccessView`; it is not the driver. The fourth commit caps the view at 4 GiB − 32 bytes, the change they ran there (no device removal in two title runs, the heap tests pass). Whether @⁠ryosen0's machine has that runtime is not confirmed. I cannot reproduce the removal on this PC (its runtime takes the larger view), so on my side the commit is checked only for doing no harm here: the suite and the three blocks above. The first report, the driver's compiler ending the process, is still neither reproduced nor explained (it did not come on an RTX 5090 or an RTX 5080 with that driver, nor on an RTX 4090 with an older one, in the comments below), so the form stays off by default; the default can change later, with more reports. **Not tested** - AMD and Intel GPUs, and 64-lane hardware, on this head (on #187's head its author reported the suite on an RTX 3090, and another contributor the two heap tests on an RX 6800). - The graphics side in the world: the title's first screens are drawn by translated VS / PS built with this change, the world's pipelines are not reached on this PC yet. - A title whose own lists bind their own descriptor heaps in unusual ways beyond what the two list tests cover. **AI use** - The commits are #187's: written by its author with Claude Opus 5.5 (their trailers are kept). - Claude Code with Claude Fable 5.2: carried them onto `main`, trimmed the tests, ran the suite, the timings and the title runs on the machine named, and wrote this description. The fourth commit is the one-line change @⁠CharlyRien found and measured, applied with the test's new end by Claude Code with Claude Fable 5.2. Duplicate check (Gate A 02:15 UTC on `main` `9ce2070`, Gate B 03:22 UTC on `91f9a5e`, again 03:54, 04:39, 08:05 and 08:47 UTC, `main` `077ce40`; again 17:03 UTC on `b7aa9f3b`): no open PR makes the windows come from the heap; read #187 (closed), #174 (links the accessors: DXC time only, the DXIL stays the same), #346 (docs: collects the measurements), #533 / #539 / #267 (schedule around slow compiles, do not change them), #573; opened since, other ways to cut the switch's cost: #1380 (big compute programs read all windows and select, the root UAVs stay) and #1439 (one switch for a multi-dword access). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With more than one memory window every memory access of a translated shader was
inlined once per window: a switch over the root UAVs mem, mem1.. Now window k is
also a raw UAV at MEM_HEAP_BASE + k of the shared shader-visible heap, and an access
is one ResourceDescriptorHeap load or store.

- Options::heap_windows, and the HEAP_WINDOWS flag in the windows count, so that the
  translation and DXIL cache keys differ. Opt-in: on with XCL_HEAP_WINDOWS=1, unless the
  views could not be made (then the switch, as before). Off by default: two NVIDIA
  setups failed with it in review (the driver's compiler ending the process; a device
  removal when the views are made on an 8 GB card) that other machines do not show.
- console_heap: the first 4 descriptors of the shared heap are the windows' raw
  views, 2^30 - 1 dwords at most: a sparse window's last 64 KiB tile is reachable,
  only the window's last dword is not.
- Lists bind the shared heap before an ABI dispatch or draw when they set none.
- xcl shaders --precompile uses the same key.
- Tests: gpu_memory_windows_from_the_heap (the windows test in the heap form),
  gpu_raw_window_view_reaches_its_top (the view on a 4 GiB reserved buffer); the
  runner and the fake draw list bind the heap.
- The windows' views are made after the shared heap's lock is released: the device may be
  an adopted one whose UAV hook takes the heaps' lock, which other paths take first
  (found and fixed by anes66 in review; test window_views_do_not_hold_global_during_device_calls).

From #187 by Remington Wilcox (c3fb89e, 864ce8e, 33c92dd), closed without being
merged: carried onto current main without that PR's aperture experiments and
compile-time bench.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: anes66 <[email protected]>
Unbinding every heap left the list's record of bound heaps as it was, so
ensure_view_heap saw a heap and did not bind the shared one: the next translated
draw or dispatch read the memory windows (ResourceDescriptorHeap[0..3]) with no
heap bound.

Test: unbinding_all_heaps_lets_the_shared_heap_be_bound_again.

From #187 by Remington Wilcox (8b4e398).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
NVIDIA 616.92 (RTX 5070 Ti, reported in #156) refuses some big programs whose
descriptor-heap index depends on the memory window with E_OUTOFMEMORY, and builds
the same programs in the switch form. A translated compute, graphics, mesh or GS
pipeline whose driver call fails that way with heap windows is now translated again
in the switch form (other cache keys; same root signature and binds) and built from
that before the stand-in or the error path.

Test: heap_window_out_of_memory_falls_back_to_the_switch_form injects the refusals
through the CreateComputePipelineState hook, then dispatches the rebuilt pipeline
and checks every thread's output.

From #187 by Remington Wilcox (41d4506).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A memory window in the heap form is a raw view of up to 4 GiB less one dword. The
D3D12 runtime of Windows 11 23H2 (D3D12Core 10.0.22621) refuses a raw view that ends
more than 4 GiB - 32 bytes from the start of its resource and removes the device: a
title with XCL_HEAP_WINDOWS=1 lost its device at start there, before the first frame.
Newer runtimes take the larger view. Found and measured by CharlyRien on PR #680
(threshold table, debug-layer message 345, the fix and its test run on an RTX 3090).

raw_window_uav now caps the view at 4 GiB - 32 bytes: the last 32 bytes of a 4 GiB
window read 0 and drop their stores in the heap form, where it was the last 4. The
HLSL and the cache keys stay the same. gpu_raw_window_view_reaches_its_top checks up
to the new end.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:29:11 +00:00
github manually merged commit deb4b92b4a into gh-pr/680/base 2026-11-26 04:29:12 +00:00
Author
Owner

@⁠crosettiremi on GitHub · 2026-11-24 03:42 UTC · original

A single-program hardware result on RX 7900 XT, Windows 11 build 26100, AMD 32.0.32029.2010, SDK DXC 1.9.2602.17. I used the retail 1.0.2.1 tree-batch-cull compute program that previously occupied the AMD compiler during the world-loading watchdog (#505). Four memory windows, native wave64, zero static samplers.

On the local #680 stack, the descriptor-heap form produced 265,368 bytes of DXIL. The previously captured switch form was 346,956 bytes for the same input. The release precompiler with --pipelines made 1/1 GPU pipeline in 31.5 s including translation. An earlier switch-form run took 38.2 s on another build. The driver caches and build identities differ, so the timings are not a controlled speed comparison. The #680 stack passed 716 workspace tests with 41 ignored.

On a saved-profile game run with the heap form enabled and that one pipeline prebuilt, the last loading frames still showed artwork. At 213.511 s the driver reported DXGI_ERROR_DEVICE_HUNG and the title stopped at a breakpoint. Wait64 timeouts were still present. This was a local stack including #150, #267, #533 and #574, without the cross-queue bridge from #539. That run alone does not attribute the GPU hang to #680.

AI disclosure: Codex ran the tests and prepared this report.

**@⁠crosettiremi** on GitHub · 2026-11-24 03:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7121338536) A single-program hardware result on RX 7900 XT, Windows 11 build 26100, AMD 32.0.32029.2010, SDK DXC 1.9.2602.17. I used the retail 1.0.2.1 tree-batch-cull compute program that previously occupied the AMD compiler during the world-loading watchdog (#505). Four memory windows, native wave64, zero static samplers. On the local #680 stack, the descriptor-heap form produced 265,368 bytes of DXIL. The previously captured switch form was 346,956 bytes for the same input. The release precompiler with `--pipelines` made 1/1 GPU pipeline in 31.5 s including translation. An earlier switch-form run took 38.2 s on another build. The driver caches and build identities differ, so the timings are not a controlled speed comparison. The #680 stack passed 716 workspace tests with 41 ignored. On a saved-profile game run with the heap form enabled and that one pipeline prebuilt, the last loading frames still showed artwork. At 213.511 s the driver reported `DXGI_ERROR_DEVICE_HUNG` and the title stopped at a breakpoint. Wait64 timeouts were still present. This was a local stack including #150, #267, #533 and #574, without the cross-queue bridge from #539. That run alone does not attribute the GPU hang to #680. AI disclosure: Codex ran the tests and prepared this report.
Author
Owner

@⁠tycosnh on GitHub · 2026-11-24 04:10 UTC · original

Test report: heap-window form on NVIDIA (RTX 4090) with the newer retail title. The driver's compiler ends the process on compute programs.

Not a test of this PR's head. It is main dd2ae9a with #187's branch (the same heap-window form), #203 and #533 merged locally, release build. AI-assisted: found and written up with Claude Code (Claude Fable 5.2), from real runs on the hardware below.

Setup: RTX 4090 24 GB, driver 621.24 (32.0.16.2124), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, DXC 1.8.2502.11, Rust 1.100.0. XCL_NETWORK=0, TdrDelay 60.

What happens: the title gets through its menus, intro and loading art. When world loading submits its first large compute batch (about 7,100 dispatches in one 2 s window; 118 to 121 s on this base, 230 to 380 s on bases from a few hours earlier), the process ends with 0xc0000409 and one of these on stderr:

Program aborted due to an unhandled Error:
Invalid record (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1')
Never resolved value found in function (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1')

It is a fast-fail inside the driver's compiler, so no handler sees it and there is no XCL crash line. It reproduced in more than 10 runs across four bases.

Ruled out:

  • The driver's on-disk shader cache: emptied DXCache, same abort.
  • A race at pipeline creation: one Create*PipelineState at a time under a global lock, same abort at the same point.
  • One upstream commit: bisected main between 29fb6b7 and da28099, and reverted #335; neither was conclusive.

What stops it:

  • XCL_HEAP_WINDOWS=0: no abort in any run.
  • A local switch that builds only compute programs in the switch form and leaves VS/PS in the heap-window form: also no abort. So on this driver the problem is compute programs in the heap-window form. Draw shaders are fine.

A single 381 KB compute program sent through the switch-form fallback got one run past the abort, but a different program aborted in the next run, so it is not just one shader.

Not tested: this PR's exact head, AMD, other NVIDIA generations, DXC 1.9.

Suggestion: on wave32-only NVIDIA adapters, build compute programs in the switch form up front, since the existing E_OUTOFMEMORY fallback cannot catch a fast-fail.

Past the abort, the run reaches the title's GPU watchdog (+0x23cf683) about 30 s into world loading, as in #505.

**@⁠tycosnh** on GitHub · 2026-11-24 04:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7121776637) **Test report: heap-window form on NVIDIA (RTX 4090) with the newer retail title. The driver's compiler ends the process on compute programs.** Not a test of this PR's head. It is main `dd2ae9a` with #187's branch (the same heap-window form), #203 and #533 merged locally, release build. AI-assisted: found and written up with Claude Code (Claude Fable 5.2), from real runs on the hardware below. **Setup:** RTX 4090 24 GB, driver 621.24 (32.0.16.2124), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, DXC 1.8.2502.11, Rust 1.100.0. `XCL_NETWORK=0`, `TdrDelay` 60. **What happens:** the title gets through its menus, intro and loading art. When world loading submits its first large compute batch (about 7,100 dispatches in one 2 s window; 118 to 121 s on this base, 230 to 380 s on bases from a few hours earlier), the process ends with `0xc0000409` and one of these on stderr: ``` Program aborted due to an unhandled Error: Invalid record (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1') ``` ``` Never resolved value found in function (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1') ``` It is a fast-fail inside the driver's compiler, so no handler sees it and there is no XCL crash line. It reproduced in more than 10 runs across four bases. **Ruled out:** - The driver's on-disk shader cache: emptied `DXCache`, same abort. - A race at pipeline creation: one `Create*PipelineState` at a time under a global lock, same abort at the same point. - One upstream commit: bisected main between `29fb6b7` and `da28099`, and reverted #335; neither was conclusive. **What stops it:** - `XCL_HEAP_WINDOWS=0`: no abort in any run. - A local switch that builds only compute programs in the switch form and leaves VS/PS in the heap-window form: also no abort. So on this driver the problem is compute programs in the heap-window form. Draw shaders are fine. A single 381 KB compute program sent through the switch-form fallback got one run past the abort, but a different program aborted in the next run, so it is not just one shader. **Not tested:** this PR's exact head, AMD, other NVIDIA generations, DXC 1.9. **Suggestion:** on wave32-only NVIDIA adapters, build compute programs in the switch form up front, since the existing E_OUTOFMEMORY fallback cannot catch a fast-fail. Past the abort, the run reaches the title's GPU watchdog (`+0x23cf683`) about 30 s into world loading, as in #505.
Author
Owner

@⁠anes66 on GitHub · 2026-11-24 04:25 UTC · original · edited 2026-11-24 04:30 UTC

I found a lock-order issue in set_window_views on 1ad93431f1420e273ea7dc7b3a4a15f246aa10c9.

It holds GLOBAL while calling s.dev.CreateUnorderedAccessView. Once that device is adopted, the UAV hook calls console_heap::slot, which takes HEAPS. Slot/page allocation takes the locks in the opposite order, HEAPS then GLOBAL. Keeping device calls outside the guard avoids that inversion.

Patch: 87b1afd, directly on top of this PR's head. It snapshots the device/base/increment under the lock, then creates the views after releasing it. A child-process fake-device test checks that every UAV callback can acquire GLOBAL; it fails before the change and passes after it. The child isolates the shared heap state from the rest of the suite. No separate upstream PR opened.

Tested
Windows 10 Pro 19045, Ryzen 7 9800X3D, RTX 3060 12 GB / 32.0.16.2114, Rust 1.100.0 MSVC, DXC 1.9.2602.17, Agility SDK 1.620.2, debug, XCL_HEAP_WINDOWS=1.

  • Workspace build passed.
  • New regression: 1 failed before, 1 passed after.
  • cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output: 697 passed, 0 failed, 41 ignored, with the patch committed unchanged as 87b1afd.
  • gpu_raw_window_view_reaches_its_top, gpu_memory_windows_from_the_heap and heap_window_out_of_memory_falls_back_to_the_switch_form passed on the GPU.
  • Two SKIPPED tests: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no native wave64). Sample variables were unset; early returns and skips remain included in the passed count.

Parallel-run blocker
The four-thread suite stalled both before and after this patch. A debugger stack from the patched run identifies a separate path:
sparse::init -> drop<State> -> real::res_release -> sparse::forget_buffer -> STATE.lock.
The old state is being dropped while STATE is held. Main f4ce27c already drops that state after releasing the guard; this PR's head still has the older assignment. Rebase onto that main before judging parallel-suite results. This patch does not fix the sparse-state deadlock.

The first parallel run also reported writes_land_after_the_queue as failed before stalling; the failure detail was not emitted before termination. It passed in the patched serial run. I have not established its cause.

Not tested
Retail smoke runs, large retail compute programs, release builds, AMD/Intel or native-wave64 hardware. This does not establish that the NVIDIA compiler fast-fail reported above is resolved, or that the PR is ready to merge.

AI use
Codex (GPT-6; exact variant unavailable) inspected the code and debugger stacks, wrote the patch/test, ran validation and drafted this report.

Current-main integration check
I rebased the three commits from this PR plus the lock fix onto main 64b3f35599bb7102f55d640e1a791e7d6dd3b175. The rebase needed no conflict resolution; git range-diff reports all four patches unchanged, and the original commit authors are preserved.

Tested and pushed 42fe3ca on test/pr680-current-main:

  • cargo build --locked --workspace -j 4: passed.
  • cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=4 --show-output: 706 passed, 0 failed, 41 ignored, exit 0, with XCL_HEAP_WINDOWS=1 and the same RTX 3060/MSVC/DXC/Agility setup as above.
  • The same two native-wave64 tests reported SKIPPED. Sample variables were unset.
  • gpu_uma_import_check_at_init, the_sparse_state_is_replaced_outside_its_lock, writes_land_after_the_queue, the new lock regression and the heap-window OOM fallback all passed.

The four-thread stall was not reproduced on this main-based tree. This result is for the integration branch, not the unchanged PR head. No retail smoke run or large-shader/compiler-fast-fail validation was performed; those limitations remain. Codex performed this integration and validation as well.

**@⁠anes66** on GitHub · 2026-11-24 04:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7122004314) · edited 2026-11-24 04:30 UTC I found a lock-order issue in `set_window_views` on `1ad93431f1420e273ea7dc7b3a4a15f246aa10c9`. It holds `GLOBAL` while calling `s.dev.CreateUnorderedAccessView`. Once that device is adopted, the UAV hook calls `console_heap::slot`, which takes `HEAPS`. Slot/page allocation takes the locks in the opposite order, `HEAPS` then `GLOBAL`. Keeping device calls outside the guard avoids that inversion. Patch: [87b1afd](https://github.com/anes66/xcl/commit/87b1afd8cd94525271f05dd4162894cc1cfb225d), directly on top of this PR's head. It snapshots the device/base/increment under the lock, then creates the views after releasing it. A child-process fake-device test checks that every UAV callback can acquire `GLOBAL`; it fails before the change and passes after it. The child isolates the shared heap state from the rest of the suite. No separate upstream PR opened. **Tested** Windows 10 Pro 19045, Ryzen 7 9800X3D, RTX 3060 12 GB / 32.0.16.2114, Rust 1.100.0 MSVC, DXC 1.9.2602.17, Agility SDK 1.620.2, debug, `XCL_HEAP_WINDOWS=1`. - Workspace build passed. - New regression: 1 failed before, 1 passed after. - `cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output`: **697 passed, 0 failed, 41 ignored**, with the patch committed unchanged as `87b1afd`. - `gpu_raw_window_view_reaches_its_top`, `gpu_memory_windows_from_the_heap` and `heap_window_out_of_memory_falls_back_to_the_switch_form` passed on the GPU. - Two SKIPPED tests: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no native wave64). Sample variables were unset; early returns and skips remain included in the passed count. **Parallel-run blocker** The four-thread suite stalled both before and after this patch. A debugger stack from the patched run identifies a separate path: `sparse::init -> drop<State> -> real::res_release -> sparse::forget_buffer -> STATE.lock`. The old state is being dropped while `STATE` is held. Main `f4ce27c` already drops that state after releasing the guard; this PR's head still has the older assignment. Rebase onto that main before judging parallel-suite results. This patch does not fix the sparse-state deadlock. The first parallel run also reported `writes_land_after_the_queue` as failed before stalling; the failure detail was not emitted before termination. It passed in the patched serial run. I have not established its cause. **Not tested** Retail smoke runs, large retail compute programs, release builds, AMD/Intel or native-wave64 hardware. This does not establish that the NVIDIA compiler fast-fail reported above is resolved, or that the PR is ready to merge. **AI use** Codex (GPT-6; exact variant unavailable) inspected the code and debugger stacks, wrote the patch/test, ran validation and drafted this report. **Current-main integration check** I rebased the three commits from this PR plus the lock fix onto main `64b3f35599bb7102f55d640e1a791e7d6dd3b175`. The rebase needed no conflict resolution; `git range-diff` reports all four patches unchanged, and the original commit authors are preserved. Tested and pushed [`42fe3ca`](https://github.com/anes66/xcl/commit/42fe3caecaa9bff3b8d0feb5fc1da5761aff17a0) on [`test/pr680-current-main`](https://github.com/anes66/xcl/tree/test/pr680-current-main): - `cargo build --locked --workspace -j 4`: passed. - `cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=4 --show-output`: **706 passed, 0 failed, 41 ignored**, exit 0, with `XCL_HEAP_WINDOWS=1` and the same RTX 3060/MSVC/DXC/Agility setup as above. - The same two native-wave64 tests reported SKIPPED. Sample variables were unset. - `gpu_uma_import_check_at_init`, `the_sparse_state_is_replaced_outside_its_lock`, `writes_land_after_the_queue`, the new lock regression and the heap-window OOM fallback all passed. The four-thread stall was not reproduced on this main-based tree. This result is for the integration branch, not the unchanged PR head. No retail smoke run or large-shader/compiler-fast-fail validation was performed; those limitations remain. Codex performed this integration and validation as well.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 04:40 UTC · original

Thanks both – head is now 2c1a521 (rebased onto main 64b3f35; suite 706 passed / 0 failed / 41 ignored here, regression pair in the description).

@⁠anes66 – confirmed: slot takes HEAPS and then GLOBAL, and set_window_views called the device with GLOBAL held. Your change is in, folded into the first commit with a Co-Authored-By (the PR's commits are kept one per logical change), and your test window_views_do_not_hold_global_during_device_calls with it; it passes here. The rebase also brings in main's sparse-state fix you point at.

@⁠tycosnh – that is a blocker if it happens on this form in general, so the PR stays a draft and the description now says so. What I have from this machine (RTX 5080, driver 610.47, DXC 1.9.2602.17, Windows 10 19045), compute programs in the heap form, same title:

  • four runs went through the world's first large compute batch with no abort: 6 422, 7 293 and 7 206 dispatches in a 2 s window in three of them (the fourth had part of that batch skipped by #533);
  • xcl shaders <pack> --precompile --only cs --pipelines made over 550 compute pipelines; 5 were refused with an error code, none ended the process;
  • in the title runs the driver refused 1 – 2 pipelines a run with E_OUTOFMEMORY, which the fallback built in the switch form.

The two messages are the bitcode reader's, so the DXC version is my first suspect: yours is 1.8.2502, mine 1.9.2602.17 – and the driver differs too (621.24 against 610.47). If you can run once with DXC 1.9 beside xcl.exe (or tell me a program size that aborts, for a count of that size here), that would separate the two. I cannot change the driver on this machine. If it turns out to be the driver generation, building compute programs in the switch form where it happens – as you suggest – is the way; I would rather key that on what is measured than on "wave32-only NVIDIA", since this card is that too and does not abort.

AI use: Claude Code with Claude Fable 5.2 wrote this reply; the numbers are from runs on the machine named.

**@⁠imnicho** on GitHub · 2026-11-24 04:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7122227919) Thanks both – head is now `2c1a521` (rebased onto `main` `64b3f35`; suite 706 passed / 0 failed / 41 ignored here, regression pair in the description). @⁠anes66 – confirmed: `slot` takes `HEAPS` and then `GLOBAL`, and `set_window_views` called the device with `GLOBAL` held. Your change is in, folded into the first commit with a `Co-Authored-By` (the PR's commits are kept one per logical change), and your test `window_views_do_not_hold_global_during_device_calls` with it; it passes here. The rebase also brings in `main`'s sparse-state fix you point at. @⁠tycosnh – that is a blocker if it happens on this form in general, so the PR stays a draft and the description now says so. What I have from this machine (RTX 5080, driver 610.47, DXC 1.9.2602.17, Windows 10 19045), compute programs in the heap form, same title: - four runs went through the world's first large compute batch with no abort: 6 422, 7 293 and 7 206 dispatches in a 2 s window in three of them (the fourth had part of that batch skipped by #533); - `xcl shaders <pack> --precompile --only cs --pipelines` made over 550 compute pipelines; 5 were refused with an error code, none ended the process; - in the title runs the driver refused 1 – 2 pipelines a run with `E_OUTOFMEMORY`, which the fallback built in the switch form. The two messages are the bitcode reader's, so the DXC version is my first suspect: yours is 1.8.2502, mine 1.9.2602.17 – and the driver differs too (621.24 against 610.47). If you can run once with DXC 1.9 beside `xcl.exe` (or tell me a program size that aborts, for a count of that size here), that would separate the two. I cannot change the driver on this machine. If it turns out to be the driver generation, building compute programs in the switch form where it happens – as you suggest – is the way; I would rather key that on what is measured than on "wave32-only NVIDIA", since this card is that too and does not abort. AI use: Claude Code with Claude Fable 5.2 wrote this reply; the numbers are from runs on the machine named.
Author
Owner

@⁠LeonardoS11 on GitHub · 2026-11-24 05:47 UTC · original

Test report: on NVIDIA, some compute programs in the heap-window form make the driver's compiler end the process instead of refusing the pipeline.

Setup

  • NVIDIA GeForce RTX 3080 Ti (12 GB, 32-lane waves), driver 621.24; Ryzen 9 5900X, 64 GB; Windows 11 Pro 26200; Rust stable-x86_64-pc-windows-msvc, release; DXC 1.8.2502.11 (Windows SDK 10.0.26100).
  • A clean release build of this PR's head 2c1a521, nothing else applied.
  • Command: xcl shaders <retail pack>\shaders.rpf --precompile --only cs --pipelines with XCL_PIPELINE_THREADS=12 (on the earlier head below it also happened with 1 and 6 threads).

What happens

  • 2c1a521: pipelines: 1300 made, 50 refused, then the process exits with code 127 at about 23,400 of the pack's 26,503 programs, with no XCL message.
  • On the earlier head 351a2b2 (in a local tree that also had other changes, so only as a pointer) I logged each program before it went to the driver. With one driver thread the process ended right after the driver got CS_RaytracingResolve_ae7b7f3c (733 KB of DXIL), and the driver printed on stderr:
    Program aborted due to an unhandled Error:
    Never resolved value found in function (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1')
    
    Skipping that family, the next one was indirect_diffuse_lighting:CS_FinalGather_1_0_0_1 (111 KB), same message. So it is not only the biggest programs. The exit code was 127 there too (0xC0000409 when run through Start-Process).
  • Switch form (XCL_HEAP_WINDOWS=0, same local tree with per-program logging, 12 driver threads): 24 CS_RaytracingResolve_ae7b7f3c variants (~920 KB each in this form) and CS_FinalGather_1_0_0_1 went through the driver, and the run went on to 625 pipelines made, 0 refused, no abort, when I stopped it.

So in the heap form, with_switch_fallback catches the pipelines the driver refuses, but not these: NVIDIA's DXIL reader aborts the process, and there is nothing to fall back from. A title that creates one of these pipelines at run time would end the same way.

Not tested

  • AMD and Intel; other NVIDIA drivers.
  • Whether the DXIL passes dxil.dll validation: it came out of DXC without an error, and I did not run the validator on it by hand.
  • I did not try to narrow which heap-window accessor pattern the reader chokes on.

AI use: Claude Code with Claude Opus 5.5 ran the builds and the runs above and wrote this report.

**@⁠LeonardoS11** on GitHub · 2026-11-24 05:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7123275332) Test report: on NVIDIA, some compute programs in the heap-window form make the driver's compiler end the process instead of refusing the pipeline. **Setup** - NVIDIA GeForce RTX 3080 Ti (12 GB, 32-lane waves), driver 621.24; Ryzen 9 5900X, 64 GB; Windows 11 Pro 26200; Rust stable-x86_64-pc-windows-msvc, release; DXC 1.8.2502.11 (Windows SDK 10.0.26100). - A clean release build of this PR's head `2c1a521`, nothing else applied. - Command: `xcl shaders <retail pack>\shaders.rpf --precompile --only cs --pipelines` with `XCL_PIPELINE_THREADS=12` (on the earlier head below it also happened with 1 and 6 threads). **What happens** - `2c1a521`: `pipelines: 1300 made, 50 refused`, then the process exits with code 127 at about 23,400 of the pack's 26,503 programs, with no XCL message. - On the earlier head `351a2b2` (in a local tree that also had other changes, so only as a pointer) I logged each program before it went to the driver. With one driver thread the process ended right after the driver got `CS_RaytracingResolve_ae7b7f3c` (733 KB of DXIL), and the driver printed on stderr: ``` Program aborted due to an unhandled Error: Never resolved value found in function (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1') ``` Skipping that family, the next one was `indirect_diffuse_lighting:CS_FinalGather_1_0_0_1` (111 KB), same message. So it is not only the biggest programs. The exit code was 127 there too (0xC0000409 when run through `Start-Process`). - Switch form (`XCL_HEAP_WINDOWS=0`, same local tree with per-program logging, 12 driver threads): 24 `CS_RaytracingResolve_ae7b7f3c` variants (~920 KB each in this form) and `CS_FinalGather_1_0_0_1` went through the driver, and the run went on to 625 pipelines made, 0 refused, no abort, when I stopped it. So in the heap form, `with_switch_fallback` catches the pipelines the driver refuses, but not these: NVIDIA's DXIL reader aborts the process, and there is nothing to fall back from. A title that creates one of these pipelines at run time would end the same way. **Not tested** - AMD and Intel; other NVIDIA drivers. - Whether the DXIL passes `dxil.dll` validation: it came out of DXC without an error, and I did not run the validator on it by hand. - I did not try to narrow which heap-window accessor pattern the reader chokes on. AI use: Claude Code with Claude Opus 5.5 ran the builds and the runs above and wrote this report.
Author
Owner

@⁠ryosen0 on GitHub · 2026-11-24 06:36 UTC · original

Data point for the open point: on RTX 3060 Ti 8 GB (driver 32.0.16.1742, Windows 11, DXC from SDK 10.0.26100) the heap form of 2c1a521 does not reach the world at all — the retail title dies at t≈2.5 s, during boot, reproducibly (4 of 4 default runs across two builds). This is earlier and a different signature than the warm-cache access violations above, so possibly a separate NVIDIA issue.

Sequence from the log (same in every failing run):

[0.69] UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000
[2.49] console descriptor heaps: one shader-visible PC heap of 1000000 view descriptors for all of them
[2.49] D3D12.X: memory windows from the shared descriptor heap (no per-access switch)
[2.54] D3D12.X: CreateHeap(0x4000000 bytes, type 1, alignment 0x0, flags 0xc0) refused (0x887a0005)
[2.54] sparse windows: no video memory for more tiles (0x887A0005)
[4.5]  D3D12 device removed: 0x887a0001 (invalid call/state)
[4.5]  unhandled exception 0x80000003 in game_scarlett_master.exe+0x2474606 (rsi=0x887a0005)

No draw has run yet (0 presents); the first sparse-pool CreateHeap comes back with the device already suspended. CheckFeatureSupport(OPTIONS19) on this driver reports no max, so the shared heap is made at the fallback 1,000,000 descriptors.

Controls on the same machine, same title, same session:

  • 2c1a521 with XCL_HEAP_WINDOWS=0 (switch form): clean — 2442 frames, 60 presents / 2 s, 0 removals, peak commit 14473 MB.
  • main builds (beaa245-era and earlier): clean every run tonight (several 90 s smokes on other PRs' heads, all based on main).
  • The stacked #822 head e9705bb inherits this: default and XCL_UMA_WINDOWS=8 both die the same way at ~2.5 s; its switch form is clean.

So on this card the heap-window form breaks the device before any translated draw — the first thing after "memory windows from the shared descriptor heap" is a refused CreateHeap on an already-removed device. Whether the 1M-descriptor shared heap creation itself is what suspends the device on this driver, or the window-view creation right after, I can't tell without the debug layer (not installed here). If it helps I can run a build with extra logging around shared_heap/set_window_views, or test a smaller cap.

AI use: GPT-6.2 Astra (API model selector) in DSH built both heads, ran the smokes and controls, and drafted this comment; the human contributor reviewed the logs before posting.

**@⁠ryosen0** on GitHub · 2026-11-24 06:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7124104236) Data point for the open point: on **RTX 3060 Ti 8 GB (driver 32.0.16.1742, Windows 11, DXC from SDK 10.0.26100)** the heap form of `2c1a521` does not reach the world at all — the retail title dies at **t≈2.5 s**, during boot, reproducibly (4 of 4 default runs across two builds). This is earlier and a different signature than the warm-cache access violations above, so possibly a separate NVIDIA issue. Sequence from the log (same in every failing run): ``` [0.69] UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000 [2.49] console descriptor heaps: one shader-visible PC heap of 1000000 view descriptors for all of them [2.49] D3D12.X: memory windows from the shared descriptor heap (no per-access switch) [2.54] D3D12.X: CreateHeap(0x4000000 bytes, type 1, alignment 0x0, flags 0xc0) refused (0x887a0005) [2.54] sparse windows: no video memory for more tiles (0x887A0005) [4.5] D3D12 device removed: 0x887a0001 (invalid call/state) [4.5] unhandled exception 0x80000003 in game_scarlett_master.exe+0x2474606 (rsi=0x887a0005) ``` No draw has run yet (0 presents); the first sparse-pool `CreateHeap` comes back with the device already suspended. `CheckFeatureSupport(OPTIONS19)` on this driver reports no max, so the shared heap is made at the fallback 1,000,000 descriptors. Controls on the same machine, same title, same session: - `2c1a521` with `XCL_HEAP_WINDOWS=0` (switch form): clean — 2442 frames, 60 presents / 2 s, 0 removals, peak commit 14473 MB. - `main` builds (`beaa245`-era and earlier): clean every run tonight (several 90 s smokes on other PRs' heads, all based on main). - The stacked #822 head `e9705bb` inherits this: default and `XCL_UMA_WINDOWS=8` both die the same way at ~2.5 s; its switch form is clean. So on this card the heap-window form breaks the device before any translated draw — the first thing after "memory windows from the shared descriptor heap" is a refused `CreateHeap` on an already-removed device. Whether the 1M-descriptor shared heap creation itself is what suspends the device on this driver, or the window-view creation right after, I can't tell without the debug layer (not installed here). If it helps I can run a build with extra logging around `shared_heap`/`set_window_views`, or test a smaller `cap`. **AI use:** GPT-6.2 Astra (API model selector) in DSH built both heads, ran the smokes and controls, and drafted this comment; the human contributor reviewed the logs before posting.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 06:43 UTC · original

@⁠ryosen0 – thank you, that is a clear one, and it is this PR's: on main the shared heap is made when the title makes its first descriptor heap, with this PR it is made (and four raw views of the 4 GiB windows written into it) when unified memory is opened, before anything else. I cannot reproduce it on 16 GB of video memory, so yes please, either of the two you offer would tell them apart:

  • a smaller cap for the shared heap (if the device survives, it is the 1 000 000-descriptor heap that early), or
  • the log between shared_heap and each CreateUnorderedAccessView in set_window_views (if the heap is made and the device goes at a view, it is the raw view of a 4 GiB reserved buffer on an 8 GB card).

Where this PR stands, so nobody has to piece it together: three NVIDIA reports are open against the heap form – the compiler's fast-fail on an RTX 4090 with a newer driver and DXC 1.8 (@⁠tycosnh), this device removal at boot on an 8 GB RTX 3060 Ti, and the E_OUTOFMEMORY refusals every NVIDIA card shows (covered by the fallback). The access violations I reported from this machine are not among them (see the update in my comment above: the switch form has them too). It also conflicts with main again. I am leaving it a draft; if the two reports cannot be resolved quickly I will turn it into an opt-in (XCL_HEAP_WINDOWS=1) so that it can be tested without touching anyone's default, and say so here before I push.

AI use: Claude Code with Claude Fable 5.2.

**@⁠imnicho** on GitHub · 2026-11-24 06:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7124218744) @⁠ryosen0 – thank you, that is a clear one, and it is this PR's: on `main` the shared heap is made when the title makes its first descriptor heap, with this PR it is made (and four raw views of the 4 GiB windows written into it) when unified memory is opened, before anything else. I cannot reproduce it on 16 GB of video memory, so yes please, either of the two you offer would tell them apart: - a smaller `cap` for the shared heap (if the device survives, it is the 1 000 000-descriptor heap that early), or - the log between `shared_heap` and each `CreateUnorderedAccessView` in `set_window_views` (if the heap is made and the device goes at a view, it is the raw view of a 4 GiB reserved buffer on an 8 GB card). Where this PR stands, so nobody has to piece it together: three NVIDIA reports are open against the heap form – the compiler's fast-fail on an RTX 4090 with a newer driver and DXC 1.8 (@⁠tycosnh), this device removal at boot on an 8 GB RTX 3060 Ti, and the `E_OUTOFMEMORY` refusals every NVIDIA card shows (covered by the fallback). The access violations I reported from this machine are **not** among them (see the update in my comment above: the switch form has them too). It also conflicts with `main` again. I am leaving it a draft; if the two reports cannot be resolved quickly I will turn it into an opt-in (`XCL_HEAP_WINDOWS=1`) so that it can be tested without touching anyone's default, and say so here before I push. AI use: Claude Code with Claude Fable 5.2.
Author
Owner

@⁠milesah3ad on GitHub · 2026-11-24 07:06 UTC · original

Synthetic numbers for the heap-window form on an RTX 5080 (Blackwell), no game files. On this driver neither DXC 1.8 nor DXC 1.9 makes the driver abort, and the heap form builds 9–19× faster than the switch form.

Setup: RTX 5080 16 GB, driver 621.14 (32.0.16.2114), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.100.0, release. This PR's head 2c1a521. AtomicInt64OnDescriptorHeapResourceSupported = true on this adapter.

Probe: milesah3ad/xcl nv680-probe (c583e10, one commit on this PR's head, local tooling, not for merging). It is QemmHD's pso156 generator (#156) with heap_windows added. It assembles RDNA2 compute programs (128 threads, wave64 + split_wave64, 4 memory windows, a load + store every round, a divergent if every 4th) and adds one of these shapes:

  • base: nothing extra
  • atomic: a returning 32-bit atomic add each round
  • atomic64: a returning GLOBAL_ATOMIC_UMAX_X2 each round, plus a GLOBAL_ATOMIC_CMPSWAP_X2 every 2nd round (in the heap form, InterlockedMax64 / InterlockedCompareExchange64 on a ResourceDescriptorHeap buffer)
  • loop: a uniform 4-trip backward-branch loop every 8th round
  • wave: a v_readlane each round

Each pipeline is built in its own process (CreateComputePipelineState, ABI root signature), so a fast-fail inside the driver shows up as an exit code instead of ending the run.

1. Aborts: none. Heap form, 4 shapes × 4 sizes × 2 seeds, 87 KB to 1.3 MB of DXIL: 32/32 built with DXC 1.9.2609.5 and 32/32 with DXC 1.8.2502.11 (the SDK's, the version in both abort reports). atomic64, heap and switch forms, 139 KB to 1.66 MB: 16/16 with DXC 1.9, and 14/14 with DXC 1.8. The last two DXC 1.8 switch-form programs were cut off by my time limit, not by an abort. Exit code 0 every time and nothing on stderr. I confirmed DXC 1.8 was the one loaded (xcl: DXC: dxcompiler 1.8.2502.11) and that its DXIL differs from 1.9's.

So on 621.14, DXC 1.8 alone does not trigger the abort for these patterns. That leaves the driver (621.24 in both abort reports; 610.47 and 621.14 don't abort) or a pattern these shapes lack: textures and samplers from the heap next to the window buffer, LDS, ray-tracing BVH instructions, or the much more irregular control flow of CS_RaytracingResolve / CS_FinalGather. Someone on 621.24 could settle the driver question with nv680_run.ps1 -Shapes atomic64,base -Heap 1.

2. Driver build time, heap form vs switch form (atomic64, same program in both forms, DXC 1.9, mean of 2 seeds, fresh seeds so the driver cache can't help):

rounds switch form heap form (this PR) speedup
250 211 KB, 7.0 s 139 KB, 0.76 s 9.2×
500 420 KB, 26.9 s 275 KB, 2.56 s 10.5×
1000 885 KB, 135.2 s 578 KB, 9.50 s 14.2×
1800 1664 KB, 568.3 s 1071 KB, 30.1 s 18.9×

For atomic64, DXC 1.8 matched within 5 % wherever both ran. On the other shapes, heap form only: base 87 KB → 0.41 s up to 642 KB → 10.5 s; wave 1.3 MB → 43 s.

Not tested

  • Driver 621.24 (the one that aborts), AMD, Intel.
  • Any retail program or title. These are synthetic shapes only, so they can't rule out a trigger in the retail programs.
  • Several creator threads at once (one per process here).

AI use

  • Claude Code (Claude Opus 5.5) wrote the probe and ran it on the machine above, and drafted this report. I checked the numbers against the run logs.
**@⁠milesah3ad** on GitHub · 2026-11-24 07:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7124616548) Synthetic numbers for the heap-window form on an RTX 5080 (Blackwell), no game files. On this driver neither DXC 1.8 nor DXC 1.9 makes the driver abort, and the heap form builds 9–19× faster than the switch form. **Setup:** RTX 5080 16 GB, driver 621.14 (32.0.16.2114), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.100.0, release. This PR's head `2c1a521`. `AtomicInt64OnDescriptorHeapResourceSupported` = true on this adapter. **Probe:** [`milesah3ad/xcl` `nv680-probe`](https://github.com/milesah3ad/xcl/tree/nv680-probe) (`c583e10`, one commit on this PR's head, local tooling, not for merging). It is QemmHD's `pso156` generator (#156) with `heap_windows` added. It assembles RDNA2 compute programs (128 threads, wave64 + split_wave64, 4 memory windows, a load + store every round, a divergent if every 4th) and adds one of these shapes: - `base`: nothing extra - `atomic`: a returning 32-bit atomic add each round - `atomic64`: a returning `GLOBAL_ATOMIC_UMAX_X2` each round, plus a `GLOBAL_ATOMIC_CMPSWAP_X2` every 2nd round (in the heap form, `InterlockedMax64` / `InterlockedCompareExchange64` on a `ResourceDescriptorHeap` buffer) - `loop`: a uniform 4-trip backward-branch loop every 8th round - `wave`: a `v_readlane` each round Each pipeline is built in **its own process** (`CreateComputePipelineState`, ABI root signature), so a fast-fail inside the driver shows up as an exit code instead of ending the run. **1. Aborts: none.** Heap form, 4 shapes × 4 sizes × 2 seeds, 87 KB to 1.3 MB of DXIL: 32/32 built with DXC 1.9.2609.5 and 32/32 with DXC 1.8.2502.11 (the SDK's, the version in both abort reports). `atomic64`, heap and switch forms, 139 KB to 1.66 MB: 16/16 with DXC 1.9, and 14/14 with DXC 1.8. The last two DXC 1.8 switch-form programs were cut off by my time limit, not by an abort. Exit code 0 every time and nothing on stderr. I confirmed DXC 1.8 was the one loaded (`xcl: DXC: dxcompiler 1.8.2502.11`) and that its DXIL differs from 1.9's. So on 621.14, DXC 1.8 alone does not trigger the abort for these patterns. That leaves the driver (621.24 in both abort reports; 610.47 and 621.14 don't abort) or a pattern these shapes lack: textures and samplers from the heap next to the window buffer, LDS, ray-tracing BVH instructions, or the much more irregular control flow of `CS_RaytracingResolve` / `CS_FinalGather`. Someone on 621.24 could settle the driver question with `nv680_run.ps1 -Shapes atomic64,base -Heap 1`. **2. Driver build time, heap form vs switch form** (`atomic64`, same program in both forms, DXC 1.9, mean of 2 seeds, fresh seeds so the driver cache can't help): | rounds | switch form | heap form (this PR) | speedup | |---|---|---|---| | 250 | 211 KB, 7.0 s | 139 KB, 0.76 s | 9.2× | | 500 | 420 KB, 26.9 s | 275 KB, 2.56 s | 10.5× | | 1000 | 885 KB, 135.2 s | 578 KB, 9.50 s | 14.2× | | 1800 | 1664 KB, 568.3 s | 1071 KB, 30.1 s | 18.9× | For `atomic64`, DXC 1.8 matched within 5 % wherever both ran. On the other shapes, heap form only: `base` 87 KB → 0.41 s up to 642 KB → 10.5 s; `wave` 1.3 MB → 43 s. **Not tested** - Driver 621.24 (the one that aborts), AMD, Intel. - Any retail program or title. These are synthetic shapes only, so they can't rule out a trigger in the retail programs. - Several creator threads at once (one per process here). **AI use** - Claude Code (Claude Opus 5.5) wrote the probe and ran it on the machine above, and drafted this report. I checked the numbers against the run logs.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 05:54 UTC · original · edited 2026-11-24 07:12 UTC

Final update, 07:15 UTC – please disregard the access violations I reported here: they come from my own local diagnostics build, not from this PR and not from main. Sorry for the noise.

What settles it, all on the same machine and the same warm caches, 3.5-minute runs:

build runs access violation other than the title's own stall exit (#232)
my diagnostics build (this PR's head + local logging and a changed lazy-commit handler), heap form 14 7
the same build, switch form (XCL_HEAP_WINDOWS=0) 5 3
main beaa245 + #684, nothing else 3 0
main 64b3f35 + #266 + #684 + this PR's head 2c1a521, switch form 3 0
the same, heap form (the default) 3 0

The nine runs without my diagnostics all end the way main does on this card: the title's own exit 31 – 61 s after its world's set-up begins. So for this PR the title result is what the description says, and the open points are the two NVIDIA reports above (the compiler's fast-fail on an RTX 4090, the device removal at boot on an 8 GB RTX 3060 Ti) plus the conflict with main.

(The earlier versions of this comment, for the record: first "it may or may not be this PR", then "the switch form has them too, so it is not this PR" – both written before I had run a build without the diagnostics.)

AI use: Claude Code with Claude Fable 5.2; the numbers are from runs on the machine named.

**@⁠imnicho** on GitHub · 2026-11-24 05:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7123386266) · edited 2026-11-24 07:12 UTC **Final update, 07:15 UTC – please disregard the access violations I reported here: they come from my own local diagnostics build, not from this PR and not from `main`.** Sorry for the noise. What settles it, all on the same machine and the same warm caches, 3.5-minute runs: | build | runs | access violation other than the title's own stall exit (#232) | |---|---|---| | my diagnostics build (this PR's head + local logging and a changed lazy-commit handler), heap form | 14 | 7 | | the same build, switch form (`XCL_HEAP_WINDOWS=0`) | 5 | 3 | | `main` `beaa245` + #684, nothing else | 3 | 0 | | `main` `64b3f35` + #266 + #684 + this PR's head `2c1a521`, switch form | 3 | 0 | | the same, heap form (the default) | 3 | 0 | The nine runs without my diagnostics all end the way `main` does on this card: the title's own exit 31 – 61 s after its world's set-up begins. So for this PR the title result is what the description says, and the open points are the two NVIDIA reports above (the compiler's fast-fail on an RTX 4090, the device removal at boot on an 8 GB RTX 3060 Ti) plus the conflict with `main`. (The earlier versions of this comment, for the record: first "it may or may not be this PR", then "the switch form has them too, so it is not this PR" – both written before I had run a build without the diagnostics.) AI use: Claude Code with Claude Fable 5.2; the numbers are from runs on the machine named.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 08:06 UTC · original

Rebased onto main 1ec4c98: head is now e999741 (heads-up @⁠broccolize, #822 is stacked on this).

  • main got a range check of the memory windows meanwhile (f9e5ee9: an address outside the windows reads 0 and drops its stores instead of landing in a live window). The heap form does the same now, with one comparison before the heap access, and main's test of that rule runs in both forms (gpu_heap_windows_reject_out_of_uma_aliasing).
  • Re-measured, because both forms changed: for the same 83 compute programs the driver now takes 220 – 238 s in the switch form and 60 – 66 s in the heap form (3 rounds; table in the description). That is about 4 times less, not the 9 – 10 times of the PR as first opened – the switch form got cheaper with the range check and the heap form pays the comparison.
  • Suite on e999741: 721 passed, 0 failed, 41 ignored; regression pair 1374 (main) / 1370 frames.
  • Still a draft, for the two NVIDIA reports above (RTX 4090 compiler abort, 8 GB RTX 3060 Ti device removal at boot). @⁠ryosen0, if you rerun, this head is the one to take.

AI use: Claude Code with Claude Fable 5.2; the numbers are from runs on the RTX 5080 machine named in the description.

**@⁠imnicho** on GitHub · 2026-11-24 08:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7125727245) Rebased onto `main` `1ec4c98`: head is now `e999741` (heads-up @⁠broccolize, #822 is stacked on this). - `main` got a range check of the memory windows meanwhile (`f9e5ee9`: an address outside the windows reads 0 and drops its stores instead of landing in a live window). The heap form does the same now, with one comparison before the heap access, and `main`'s test of that rule runs in both forms (`gpu_heap_windows_reject_out_of_uma_aliasing`). - Re-measured, because both forms changed: for the same 83 compute programs the driver now takes 220 – 238 s in the switch form and 60 – 66 s in the heap form (3 rounds; table in the description). That is about 4 times less, not the 9 – 10 times of the PR as first opened – the switch form got cheaper with the range check and the heap form pays the comparison. - Suite on `e999741`: 721 passed, 0 failed, 41 ignored; regression pair 1374 (`main`) / 1370 frames. - Still a draft, for the two NVIDIA reports above (RTX 4090 compiler abort, 8 GB RTX 3060 Ti device removal at boot). @⁠ryosen0, if you rerun, this head is the one to take. AI use: Claude Code with Claude Fable 5.2; the numbers are from runs on the RTX 5080 machine named in the description.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 08:31 UTC · original · edited 2026-11-24 08:48 UTC

This is opt-in now (head 95f34c1, on main 09940bb), as I said I would do if the two NVIDIA reports could not be resolved.

  • XCL_HEAP_WINDOWS=1 turns the heap form on. Unset (or anything else), a run is as on main: the shared heap is not made early, no window views are written into it, shaders are translated in the switch form under main's cache keys.
  • Why: @⁠tycosnh's compiler fast-fail (RTX 4090, driver 621.24) and @⁠ryosen0's device removal at boot (RTX 3060 Ti 8 GB) are neither reproduced nor explained on the machines that have run this, and a default that takes two setups down is not worth the compile time it saves on others. As an opt-in it can be tested without touching anyone's default, and the default can change later with more reports.
  • What stays: the measurements in the description (they compare the two forms), the E_OUTOFMEMORY fallback to the switch form, the lock-order fix, and the tests. The recompiler-level GPU tests set the option themselves and run as before; heap_window_out_of_memory_falls_back_to_the_switch_form goes through the runtime switch, so it reports SKIPPED unless the variable is set.
  • Suite on 95f34c1: 722 passed, 0 failed, 41 ignored, both as it is and with XCL_HEAP_WINDOWS=1 (with it, that test runs).
  • Regression runs (blocks in the description): main 1344 frames, this head 1376, this head with XCL_HEAP_WINDOWS=1 1369; a second round 1358 / 1328 / 1376. No crash or device removal in any.
  • @⁠broccolize: #822 is stacked on this – the heap form it builds on now needs XCL_HEAP_WINDOWS=1.
  • @⁠ryosen0, @⁠tycosnh: nothing changes for your setups unless you set the variable; if either of you has the time for the checks discussed above (a smaller cap for the shared heap; the log between shared_heap and each view), they are still the way to tell the causes apart.

AI use: Claude Code with Claude Fable 5.2 wrote the change and this note; the numbers are from runs on the RTX 5080 machine named in the description.

**@⁠imnicho** on GitHub · 2026-11-24 08:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7126236635) · edited 2026-11-24 08:48 UTC **This is opt-in now** (head `95f34c1`, on `main` `09940bb`), as I said I would do if the two NVIDIA reports could not be resolved. - `XCL_HEAP_WINDOWS=1` turns the heap form on. Unset (or anything else), a run is as on `main`: the shared heap is not made early, no window views are written into it, shaders are translated in the switch form under `main`'s cache keys. - Why: @⁠tycosnh's compiler fast-fail (RTX 4090, driver 621.24) and @⁠ryosen0's device removal at boot (RTX 3060 Ti 8 GB) are neither reproduced nor explained on the machines that have run this, and a default that takes two setups down is not worth the compile time it saves on others. As an opt-in it can be tested without touching anyone's default, and the default can change later with more reports. - What stays: the measurements in the description (they compare the two forms), the `E_OUTOFMEMORY` fallback to the switch form, the lock-order fix, and the tests. The recompiler-level GPU tests set the option themselves and run as before; `heap_window_out_of_memory_falls_back_to_the_switch_form` goes through the runtime switch, so it reports `SKIPPED` unless the variable is set. - Suite on `95f34c1`: 722 passed, 0 failed, 41 ignored, both as it is and with `XCL_HEAP_WINDOWS=1` (with it, that test runs). - Regression runs (blocks in the description): `main` 1344 frames, this head 1376, this head with `XCL_HEAP_WINDOWS=1` 1369; a second round 1358 / 1328 / 1376. No crash or device removal in any. - @⁠broccolize: #822 is stacked on this – the heap form it builds on now needs `XCL_HEAP_WINDOWS=1`. - @⁠ryosen0, @⁠tycosnh: nothing changes for your setups unless you set the variable; if either of you has the time for the checks discussed above (a smaller cap for the shared heap; the log between `shared_heap` and each view), they are still the way to tell the causes apart. AI use: Claude Code with Claude Fable 5.2 wrote the change and this note; the numbers are from runs on the RTX 5080 machine named in the description.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 03:59 UTC · original · edited 2026-11-24 09:15 UTC

Tested

On 1ad9343, I translated the same synthetic pixel shader with both memory-window paths. The shader read a distinct value from each of two windows. A scratch extension to the native D3D12 draw fixture bound both test windows as root UAVs and raw heap descriptors.

All 1,024 pixels matched the expected values across four draws: red 0.25 for window 0 and red 0.75 for window 1, with identical readbacks between the switch-based and descriptor-heap paths. The focused test passed 1/1. D3D12 validation was enabled, with no reported errors.

cargo test --offline --locked -p xcl --lib scratch_graphics_memory_windows_match -- --nocapture --test-threads=1. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug.

Not tested

The title’s descriptor-heap rebinding path, additional memory windows, and retail graphics.

AI use

Codex with GPT-6.2 Sol wrote the scratch fixture, ran the test, and drafted this report.

Update on 2c1a521

Seven stock synthetic tests passed with zero failed, ignored or skipped, using the same hardware and toolchain in release mode. The sparse 4 GiB UAV test, both memory-window readbacks, and the descriptor heap lock and rebind tests passed. In the stock OOM test, the injected error refused the stand-in first. The synchronous switch-form retry then passed its GPU readback.

I extended the stock async compute test in a scratch copy to inject one E_OUTOFMEMORY after the lazy stand-in was created and just before resolve_wait. It passed 1/1 with zero failures, ignores or skips. The deferred build retried exactly once, returned a registered real pipeline with its ABI root signature, and cleared the registration when the stand-in was released. Runtime code was unchanged from the PR. Driver process termination and retail loading were outside this test.

Commands used cargo test --release --offline --locked -p xcl with --lib <filter> -- --nocapture --test-threads=1 for gpu_raw_window_view_reaches_its_top, gpu_memory_windows, window_views_do_not_hold_global_during_device_calls, and unbinding_all_heaps_lets_the_shared_heap_be_bound_again. The integration runs used --test gpu_compute_e2e <filter> -- --exact --nocapture --test-threads=1 for heap_window_out_of_memory_falls_back_to_the_switch_form and async_compute_pso_registers_real_pso_and_not_standin.

AI use for this update: Codex (GPT-6, exact variant unavailable) ran the tests, extended the scratch fixture and drafted the update.

Rebase retest on e999741

On the same RTX 3080 Ti / 621.35 setup, both memory-window forms and the last-tile raw UAV fixture passed on DXC 1.8.2502.11 and 1.6.2112.16 (3/3 each). The two stock range-check controls also passed with DXC 1.8 (2/2). Zero failures or skips in these runs. This covers the small synthetic workloads only.

I ran cargo test --offline --locked --release -p xcl --lib -- --nocapture --test-threads=1 with gpu_memory_windows_above_4_gib, gpu_memory_windows_from_the_heap, gpu_raw_window_view_reaches_its_top, and the two reject_out_of_uma_aliasing filters. AI use: Codex (GPT-6, exact variant unavailable) ran the checks and drafted this update.

Opt-in routing on 95f34c1

On the same RTX 3080 Ti / 621.35, Windows 11 build 26300, Rust 1.99.1 MSVC and DXC 1.8.2502.11, I ran the synthetic compute fixture in three fresh processes with four memory windows. Unset and XCL_HEAP_WINDOWS=0 selected the switch path. XCL_HEAP_WINDOWS=1 selected the shared descriptor heap, with zero switch retries. All 1,536 GPU readback values matched in each run. The D3D12 debug layer reported live-object warnings at process exit, with no reported errors or device removal.

cargo build --release --offline --locked --workspace passed. cargo test --release --offline --locked -p xcl --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --exact --nocapture --test-threads=1 passed 1/1 for each setting, with zero failures, ignores or skips. I added routing assertions to the test only. Retail loading and the full suite remain untested on this revision here.

AI use for this update — Codex (GPT-6, exact variant unavailable) added the scratch assertions, ran the tests, and drafted the update.

**@⁠thehollowedone** on GitHub · 2026-11-24 03:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7121607575) · edited 2026-11-24 09:15 UTC **Tested** On [`1ad9343`](https://github.com/ivall/xcl/commit/1ad93431f1420e273ea7dc7b3a4a15f246aa10c9), I translated the same synthetic pixel shader with both memory-window paths. The shader read a distinct value from each of two windows. A scratch extension to the native D3D12 draw fixture bound both test windows as root UAVs and raw heap descriptors. All 1,024 pixels matched the expected values across four draws: red 0.25 for window 0 and red 0.75 for window 1, with identical readbacks between the switch-based and descriptor-heap paths. The focused test passed 1/1. D3D12 validation was enabled, with no reported errors. `cargo test --offline --locked -p xcl --lib scratch_graphics_memory_windows_match -- --nocapture --test-threads=1`. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug. **Not tested** The title’s descriptor-heap rebinding path, additional memory windows, and retail graphics. **AI use** Codex with GPT-6.2 Sol wrote the scratch fixture, ran the test, and drafted this report. **Update on [`2c1a521`](https://github.com/ivall/xcl/commit/2c1a521248a89ef96a80c244df13017dd55c94ad)** Seven stock synthetic tests passed with zero failed, ignored or skipped, using the same hardware and toolchain in release mode. The sparse 4 GiB UAV test, both memory-window readbacks, and the descriptor heap lock and rebind tests passed. In the stock OOM test, the injected error refused the stand-in first. The synchronous switch-form retry then passed its GPU readback. I extended the stock async compute test in a scratch copy to inject one `E_OUTOFMEMORY` after the lazy stand-in was created and just before `resolve_wait`. It passed 1/1 with zero failures, ignores or skips. The deferred build retried exactly once, returned a registered real pipeline with its ABI root signature, and cleared the registration when the stand-in was released. Runtime code was unchanged from the PR. Driver process termination and retail loading were outside this test. Commands used `cargo test --release --offline --locked -p xcl` with `--lib <filter> -- --nocapture --test-threads=1` for `gpu_raw_window_view_reaches_its_top`, `gpu_memory_windows`, `window_views_do_not_hold_global_during_device_calls`, and `unbinding_all_heaps_lets_the_shared_heap_be_bound_again`. The integration runs used `--test gpu_compute_e2e <filter> -- --exact --nocapture --test-threads=1` for `heap_window_out_of_memory_falls_back_to_the_switch_form` and `async_compute_pso_registers_real_pso_and_not_standin`. AI use for this update: Codex (GPT-6, exact variant unavailable) ran the tests, extended the scratch fixture and drafted the update. **Rebase retest on [`e999741`](https://github.com/ivall/xcl/commit/e999741b894b6a67cfdb80ab8ad698b0a2f67402)** On the same RTX 3080 Ti / 621.35 setup, both memory-window forms and the last-tile raw UAV fixture passed on DXC 1.8.2502.11 and 1.6.2112.16 (3/3 each). The two stock range-check controls also passed with DXC 1.8 (2/2). Zero failures or skips in these runs. This covers the small synthetic workloads only. I ran `cargo test --offline --locked --release -p xcl --lib -- --nocapture --test-threads=1` with `gpu_memory_windows_above_4_gib`, `gpu_memory_windows_from_the_heap`, `gpu_raw_window_view_reaches_its_top`, and the two `reject_out_of_uma_aliasing` filters. AI use: Codex (GPT-6, exact variant unavailable) ran the checks and drafted this update. **Opt-in routing on [`95f34c1`](https://github.com/ivall/xcl/commit/95f34c1d1a24f644d0c4895810a7c36910b123e8)** On the same RTX 3080 Ti / 621.35, Windows 11 build 26300, Rust 1.99.1 MSVC and DXC 1.8.2502.11, I ran the synthetic compute fixture in three fresh processes with four memory windows. Unset and `XCL_HEAP_WINDOWS=0` selected the switch path. `XCL_HEAP_WINDOWS=1` selected the shared descriptor heap, with zero switch retries. All 1,536 GPU readback values matched in each run. The D3D12 debug layer reported live-object warnings at process exit, with no reported errors or device removal. `cargo build --release --offline --locked --workspace` passed. `cargo test --release --offline --locked -p xcl --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --exact --nocapture --test-threads=1` passed 1/1 for each setting, with zero failures, ignores or skips. I added routing assertions to the test only. Retail loading and the full suite remain untested on this revision here. AI use for this update — Codex (GPT-6, exact variant unavailable) added the scratch assertions, ran the tests, and drafted the update.
Author
Owner

@⁠broccolize on GitHub · 2026-11-24 09:27 UTC · original

Thanks for the heads-up, @⁠imnicho. I’ll use XCL_HEAP_WINDOWS=1 when retesting #822 on the updated base.

**@⁠broccolize** on GitHub · 2026-11-24 09:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7127444355) Thanks for the heads-up, @⁠imnicho. I’ll use XCL_HEAP_WINDOWS=1 when retesting #822 on the updated base.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:40 UTC · original

Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (Build and test + PR description). Opt-in XCL_HEAP_WINDOWS=1 descriptor-heap UMA windows are off by default, so safe to land while NVIDIA reports are investigated. Recommend merging, @⁠ivall.

**@⁠raylitebull** on GitHub · 2026-11-24 10:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7129087717) Code/CI review only (not independently runtime-tested by me): clean merge with both checks green (`Build and test` + `PR description`). Opt-in `XCL_HEAP_WINDOWS=1` descriptor-heap UMA windows are off by default, so safe to land while NVIDIA reports are investigated. Recommend merging, @⁠ivall.
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-24 13:38 UTC · original

Test report: the NVIDIA compiler abort does not reproduce on an RTX 5090 with the same driver (621.24), with either DXC 1.8 or 1.9, on this head or on 2c1a521.

Setup: RTX 5090 32 GB, driver 621.24; i9-14900KF, 64 GB; Windows 11 Pro 26200; release builds; XCL_HEAP_WINDOWS=1, XCL_PIPELINE_THREADS=4, XCL_NETWORK=0, empty DXIL cache for each run. Command: xcl shaders <retail pack>\shaders.rpf --precompile --only cs --pipelines. To keep each run short I added a local-only filter that skips programs whose name does not match, and one log line before and after each program goes to the driver. The translation itself is unchanged. Neither is part of this PR.

Head DXC Programs (DXIL size) Result
95f34c1 1.8.2502.8 1020 from the two program families in @⁠LeonardoS11's report (80–1101 KB) 1020 made, 0 refused, no abort
95f34c1 1.9.2609.5 same 1020 (80–1101 KB) 1020 made, 0 refused, no abort
2c1a521 1.8.2502.8 247: the two programs named in that report, with their variants (108–879 KB) 245 made, 2 refused, no abort

Every program reached the driver and came back (the before/after lines pair up in all three runs). The run summary says "4 memory windows from the descriptor heap" each time, so the heap form was in use.

Reading: on Blackwell with 621.24, neither the DXC version nor the head brings back the abort. That agrees with @⁠milesah3ad's 5080 numbers, and the two abort reports are a 4090 and a 3080 Ti. The difference seems to be the GPU generation, not DXC. My DXC 1.8 is the GitHub release build (1.8.2502.8), not the SDK build (1.8.2502.11) in both abort reports, so that one gap is still open.

Not tested: the full pack in the heap form, a title run with XCL_HEAP_WINDOWS=1, Ada/Ampere/Turing, DXC 1.8.2502.11.

AI use: Claude Code with Claude Opus 5.5 ran the builds and runs above and wrote this report.

**@⁠JRamos1993** on GitHub · 2026-11-24 13:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7133111017) **Test report: the NVIDIA compiler abort does not reproduce on an RTX 5090 with the same driver (621.24), with either DXC 1.8 or 1.9, on this head or on `2c1a521`.** **Setup:** RTX 5090 32 GB, driver 621.24; i9-14900KF, 64 GB; Windows 11 Pro 26200; release builds; `XCL_HEAP_WINDOWS=1`, `XCL_PIPELINE_THREADS=4`, `XCL_NETWORK=0`, empty DXIL cache for each run. Command: `xcl shaders <retail pack>\shaders.rpf --precompile --only cs --pipelines`. To keep each run short I added a local-only filter that skips programs whose name does not match, and one log line before and after each program goes to the driver. The translation itself is unchanged. Neither is part of this PR. | Head | DXC | Programs (DXIL size) | Result | |---|---|---|---| | `95f34c1` | 1.8.2502.8 | 1020 from the two program families in @⁠LeonardoS11's report (80–1101 KB) | 1020 made, 0 refused, no abort | | `95f34c1` | 1.9.2609.5 | same 1020 (80–1101 KB) | 1020 made, 0 refused, no abort | | `2c1a521` | 1.8.2502.8 | 247: the two programs named in that report, with their variants (108–879 KB) | 245 made, 2 refused, no abort | Every program reached the driver and came back (the before/after lines pair up in all three runs). The run summary says "4 memory windows from the descriptor heap" each time, so the heap form was in use. **Reading:** on Blackwell with 621.24, neither the DXC version nor the head brings back the abort. That agrees with @⁠milesah3ad's 5080 numbers, and the two abort reports are a 4090 and a 3080 Ti. The difference seems to be the GPU generation, not DXC. My DXC 1.8 is the GitHub release build (1.8.2502.8), not the SDK build (1.8.2502.11) in both abort reports, so that one gap is still open. **Not tested:** the full pack in the heap form, a title run with `XCL_HEAP_WINDOWS=1`, Ada/Ampere/Turing, DXC 1.8.2502.11. AI use: Claude Code with Claude Opus 5.5 ran the builds and runs above and wrote this report.
Author
Owner

@⁠srcamarda on GitHub · 2026-11-24 14:11 UTC · original

Tested on AMD RDNA3 (RX 7800 XT, native wave64): head 95f34c1, and the same three commits cherry-picked onto main 47efa2e

AMD Radeon RX 7800 XT 16 GB, driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; rustc 1.100.0; DXC 1.8.2502.11 (Windows SDK 10.0.26100, the version in both NVIDIA abort reports). Debug for the tests, release for the timings and the title. Retail title 1.0.2.1, XCL_NETWORK=0.

1. Head 95f34c1 as it is (base 09940bb)

  • cargo test --workspace --no-fail-fast -- --test-threads=4: 719 passed, 3 failed, 41 ignored, both without and with XCL_HEAP_WINDOWS=1 (twice each). SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows) in the default run only.
  • The three: placed_title_textures_share_vram_and_preserve_pixels ("cubemap extra_pages must be reused at same va", as in #718), then transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory on the poisoned lock. Not this PR's: cargo test -p xcl --lib on the base 09940bb fails the same three, and on main 47efa2e it passes (698 passed, 0 failed). Run alone, the first one passes 5 of 5 on the head.
  • Regression run: the head shows about half of main's frames, and so does its base. Something merged since 09940bb doubled the frame rate of these first screens on this card. So it is the base, not this PR, but as it stands the head is under the 80 % rule. A rebase fixes it (point 2).
xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 60
exit: 0x0
frames shown: 1091 (PresentX 1092)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16525 MB
xcl-smoke v1
commit: 95f34c1d1a24f644d0c4895810a7c36910b123e8
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 60
exit: 0x0
frames shown: 544 (PresentX 544)
presents per 2 s (last 3): 20 26 21
device removals: 0
crashes: 0
peak commit: 16532 MB
xcl-smoke v1
commit: 09940bb87fa11bc394fd9e5de570c2b7cfd16323
gpu: AMD Radeon RX 7800 XT
title: RetailGame_Dump
seconds: 60
exit: 0x0
frames shown: 542 (PresentX 542)
presents per 2 s (last 3): 24 24 22
device removals: 0
crashes: 0
peak commit: 16523 MB

Interleaved repeats: base 547, head 490. Head with XCL_HEAP_WINDOWS=1: 570 and 551. No crash or device removal in any.

2. The three commits cherry-picked onto main 47efa2e (no conflicts; local commit 52fe798, not pushed anywhere)

  • Suite: 747 passed, 0 failed, 41 ignored, both without and with XCL_HEAP_WINDOWS=1.
  • Smoke, 60 s: main 1091 frames; this, default 1087; this with XCL_HEAP_WINDOWS=1 1106 (after one warm-up run of that form, which made 1103). All at 60 presents per 2 s, no crash or device removal, peak commit 16.52–16.54 GB.
  • World load, 300 s, Enter at the account prompt, once in each form: both end in the title's known 0xc0000005 write at 0 at game_scarlett_master.exe+0x23cf683 (#534 / #675), with the same registers: heap form at 194 s, switch form at 164 s. The log has memory windows from the shared descriptor heap in the heap run only. No device removal or DEVICE_HUNG in either, and no E_OUTOFMEMORY or switch-form fallback. The only refused pipelines are the known MS-in-AS-slot ones, the same in both. The large world compute batch was not reached before the crash: at most 228 (heap) and 398 (switch) dispatches in a 2 s window.

3. Compile time on AMD (method of the description: the first 83 compute programs, --precompile --only cs --limit 22240, an empty XCL_DXIL_CACHE, then --pipelines under an executable name the driver had not seen; the head's release build; times from xcl's own time line)

switch form heap form
step 1: DXC, empty cache 31.5 · 30.7 s 26.6 · 25.2 s
step 2: the driver (83 made, 0 refused in every run) 246.6 · 229.5 s 209.9 · 195.2 s
DXIL of the 83 programs 8.0 MB, largest 1065 KB 6.6 MB, largest 845 KB

On this AMD driver the heap form saves about 15 % of the driver's time and about 17 % of DXC's, not the ~4× of the RTX 5080. No driver abort with DXC 1.8.2502 here: 83/83 in both forms, two rounds each.

Not tested

  • The world's large compute batch, which the title's own crash at +0x23cf683 comes before on this machine.
  • More than two timing rounds, and the whole pack.
  • RDNA2 / RDNA4 and 8 GB AMD cards.

Claude Code (Claude Opus 5.5), from runs on the hardware above.

**@⁠srcamarda** on GitHub · 2026-11-24 14:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7133968283) **Tested on AMD RDNA3 (RX 7800 XT, native wave64): head `95f34c1`, and the same three commits cherry-picked onto `main` `47efa2e`** AMD Radeon RX 7800 XT 16 GB, driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; rustc 1.100.0; DXC 1.8.2502.11 (Windows SDK 10.0.26100, the version in both NVIDIA abort reports). Debug for the tests, release for the timings and the title. Retail title 1.0.2.1, `XCL_NETWORK=0`. **1. Head `95f34c1` as it is (base `09940bb`)** - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 719 passed, **3 failed**, 41 ignored, both without and with `XCL_HEAP_WINDOWS=1` (twice each). SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) in the default run only. - The three: `placed_title_textures_share_vram_and_preserve_pixels` ("cubemap extra_pages must be reused at same va", as in #718), then `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory` on the poisoned lock. **Not this PR's:** `cargo test -p xcl --lib` on the base `09940bb` fails the same three, and on `main` `47efa2e` it passes (698 passed, 0 failed). Run alone, the first one passes 5 of 5 on the head. - Regression run: the head shows about half of `main`'s frames, and **so does its base**. Something merged since `09940bb` doubled the frame rate of these first screens on this card. So it is the base, not this PR, but as it stands the head is under the 80 % rule. A rebase fixes it (point 2). ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 7800 XT title: RetailGame_Dump seconds: 60 exit: 0x0 frames shown: 1091 (PresentX 1092) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16525 MB ``` ``` xcl-smoke v1 commit: 95f34c1d1a24f644d0c4895810a7c36910b123e8 gpu: AMD Radeon RX 7800 XT title: RetailGame_Dump seconds: 60 exit: 0x0 frames shown: 544 (PresentX 544) presents per 2 s (last 3): 20 26 21 device removals: 0 crashes: 0 peak commit: 16532 MB ``` ``` xcl-smoke v1 commit: 09940bb87fa11bc394fd9e5de570c2b7cfd16323 gpu: AMD Radeon RX 7800 XT title: RetailGame_Dump seconds: 60 exit: 0x0 frames shown: 542 (PresentX 542) presents per 2 s (last 3): 24 24 22 device removals: 0 crashes: 0 peak commit: 16523 MB ``` Interleaved repeats: base 547, head 490. Head with `XCL_HEAP_WINDOWS=1`: 570 and 551. No crash or device removal in any. **2. The three commits cherry-picked onto `main` `47efa2e`** (no conflicts; local commit `52fe798`, not pushed anywhere) - Suite: **747 passed, 0 failed, 41 ignored**, both without and with `XCL_HEAP_WINDOWS=1`. - Smoke, 60 s: `main` 1091 frames; this, default 1087; this with `XCL_HEAP_WINDOWS=1` 1106 (after one warm-up run of that form, which made 1103). All at 60 presents per 2 s, no crash or device removal, peak commit 16.52–16.54 GB. - World load, 300 s, Enter at the account prompt, once in each form: both end in the title's known `0xc0000005` write at 0 at `game_scarlett_master.exe+0x23cf683` (#534 / #675), with the same registers: heap form at 194 s, switch form at 164 s. The log has `memory windows from the shared descriptor heap` in the heap run only. **No device removal or `DEVICE_HUNG` in either**, and no `E_OUTOFMEMORY` or switch-form fallback. The only refused pipelines are the known MS-in-AS-slot ones, the same in both. The large world compute batch was not reached before the crash: at most 228 (heap) and 398 (switch) dispatches in a 2 s window. **3. Compile time on AMD** (method of the description: the first 83 compute programs, `--precompile --only cs --limit 22240`, an empty `XCL_DXIL_CACHE`, then `--pipelines` under an executable name the driver had not seen; the head's release build; times from `xcl`'s own `time` line) | | switch form | heap form | |---|---|---| | step 1: DXC, empty cache | 31.5 · 30.7 s | 26.6 · 25.2 s | | step 2: the driver (83 made, 0 refused in every run) | 246.6 · 229.5 s | 209.9 · 195.2 s | | DXIL of the 83 programs | 8.0 MB, largest 1065 KB | 6.6 MB, largest 845 KB | On this AMD driver the heap form saves about 15 % of the driver's time and about 17 % of DXC's, not the ~4× of the RTX 5080. No driver abort with DXC 1.8.2502 here: 83/83 in both forms, two rounds each. **Not tested** - The world's large compute batch, which the title's own crash at +0x23cf683 comes before on this machine. - More than two timing rounds, and the whole pack. - RDNA2 / RDNA4 and 8 GB AMD cards. _Claude Code (Claude Opus 5.5), from runs on the hardware above._
Author
Owner

@⁠yous0serious on GitHub · 2026-11-24 14:34 UTC · original

Test report on an RTX 4090 with XCL_HEAP_WINDOWS=1: the driver's compiler did not abort here, through the retail title's world-load compute wave

This head (95f34c1) merged without conflicts onto main 930e8b4. It is the card from @⁠tycosnh's report, with an older driver (621.01 here, 621.24 there) and the same DXC.

Tested

  • NVIDIA GeForce RTX 4090 24 GB, driver 621.01 (32.0.16.2101); Intel Core i7-13700KF; 32 GB RAM, 32 GB page file; Windows 11 Pro 26200; rustc 1.100.0; DXC 1.8.2502.11 (Windows SDK 10.0.26100); release.
  • Retail title 1.0.2.1, Series X profile, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_HEAP_WINDOWS=1, played by hand to the end. The log says memory windows from the shared descriptor heap (no per-access switch). The heap form's DXIL cache keys were new, so every compute program went through DXC again.
  • 372 compute pipelines made, 369 of them compiled by the driver (3 from earlier blobs), up to 665 KB of DXIL, 22 of them 256 KB or more. None was refused and none went to the switch form.
  • The world load's first big compute batch ran: 7 073 dispatches in the 2 s window ending at 178 s. No 0xc0000409 and no Invalid record / Never resolved value on stderr.
  • The run then ended as main does on this PC: the title's own null write at +0x23cf683 (#232 / #505), 28.5 s after the last present, at 206.6 s.

Not tested

  • Driver 621.24, which @⁠tycosnh's report used. So this does not rule out a driver-version difference.
  • cargo test --workspace, a regression smoke pair, and the offline --precompile --pipelines pass in the heap form.
  • Driver compile time against the switch form on this card: the switch-form runs here had warm driver caches, so they are not comparable.

AI use

  • GitHub Copilot app with Claude Opus 5.5: built the merge, read the log and wrote this report. The run itself was played by me.
**@⁠yous0serious** on GitHub · 2026-11-24 14:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7134603917) **Test report on an RTX 4090 with `XCL_HEAP_WINDOWS=1`: the driver's compiler did not abort here, through the retail title's world-load compute wave** This head (`95f34c1`) merged without conflicts onto `main` `930e8b4`. It is the card from @⁠tycosnh's report, with an older driver (621.01 here, 621.24 there) and the same DXC. **Tested** - NVIDIA GeForce RTX 4090 24 GB, driver 621.01 (32.0.16.2101); Intel Core i7-13700KF; 32 GB RAM, 32 GB page file; Windows 11 Pro 26200; rustc 1.100.0; DXC 1.8.2502.11 (Windows SDK 10.0.26100); release. - Retail title 1.0.2.1, Series X profile, `XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_HEAP_WINDOWS=1`, played by hand to the end. The log says `memory windows from the shared descriptor heap (no per-access switch)`. The heap form's DXIL cache keys were new, so every compute program went through DXC again. - 372 compute pipelines made, 369 of them compiled by the driver (3 from earlier blobs), up to 665 KB of DXIL, 22 of them 256 KB or more. None was refused and none went to the switch form. - The world load's first big compute batch ran: 7 073 dispatches in the 2 s window ending at 178 s. No `0xc0000409` and no `Invalid record` / `Never resolved value` on stderr. - The run then ended as `main` does on this PC: the title's own null write at `+0x23cf683` (#232 / #505), 28.5 s after the last present, at 206.6 s. **Not tested** - Driver 621.24, which @⁠tycosnh's report used. So this does not rule out a driver-version difference. - `cargo test --workspace`, a regression smoke pair, and the offline `--precompile --pipelines` pass in the heap form. - Driver compile time against the switch form on this card: the switch-form runs here had warm driver caches, so they are not comparable. **AI use** - GitHub Copilot app with Claude Opus 5.5: built the merge, read the log and wrote this report. The run itself was played by me.
Author
Owner

@⁠vitor127wt on GitHub · 2026-11-24 14:28 UTC · original · edited 2026-11-24 14:41 UTC

Test report — RTX 5070 Ti on Wine, head 95f34c1d1a24f644d0c4895810a7c36910b123e8

The heap form cut DXIL size by about one third. On vkd3d-proton 3.1.0, pipeline creation was 12% faster in the 250-round sample and 27% slower in the 500-round sample. The follow-up below shows a reversal for the 500-round sample on upstream build ec207194.

Tested

  • GeForce RTX 5070 Ti (16,303 MiB reported by NVIDIA), Linux driver 620.73.04. Ryzen 7 9700X, 30 GiB RAM visible to Linux. CachyOS x86-64, kernel 7.3.5-2-cachyos.
  • Wine 11.22, DXVK v2.7.1-498-ga6764047e587178, upstream vkd3d-proton 3.1.0 (4522cc1a8b1347f), Windows DXC 1.9.2609.5 (01b62ad4). Rust 1.100.0, cargo-xwin 0.24.1, x86_64-pc-windows-msvc, debug builds.
  • Cross-built with cargo xwin test --locked --target x86_64-pc-windows-msvc -p xcl --lib --test gpu_compute_e2e --no-run. Under Wine with --nocapture --test-threads=1, the five focused tests passed (0 failed, 0 ignored, 0 skipped): gpu_memory_windows_from_the_heap, gpu_heap_windows_reject_out_of_uma_aliasing, gpu_raw_window_view_reaches_its_top, window_views_do_not_hold_global_during_device_calls, and unbinding_all_heaps_lets_the_shared_heap_be_bound_again.
  • With XCL_HEAP_WINDOWS=1, heap_window_out_of_memory_falls_back_to_the_switch_form logged the switch-form retry after the injected OOM, then exited with code 3 on vkd3d-proton's root-signature vtable assertion. The existing console_wave64_compute_through_the_pso_hook_dispatch_and_read_back control with XCL_HEAP_WINDOWS=0 exited with code 3 on the fence vtable assertion. With the vkd3d-proton build 0bb64c56c8f0dcc from Proton-CachyOS 11.0.20261015, both tests got to dispatch and failed there with 0x80070057 (each 0 passed, 1 failed, 0 ignored, 0 skipped). The vtable behavior is tracked in #175.

Synthetic A/B

I built the existing nv680 probe at c583e10 on the PR head with cargo xwin build --locked --target x86_64-pc-windows-msvc -p xcl --example nv680. The commands were wine nv680.exe gen --out DIR --name TAG --shape base --rounds R --heap H --seeds S..N --dxc-arg -O1 and wine nv680.exe create FILE.dxil. I used R=250 and 500, H=0 and 1, and one seed per generation call (S=1, 2, or 3 and N=S+1). I alternated the mode order and timed each create call in a fresh Wine process. The probe uses four memory windows and split wave64. I set VKD3D_SHADER_CACHE_PATH=0 and __GL_SHADER_DISK_CACHE=0. All 12 calls to CreateComputePipelineState succeeded.

Rounds per shader DXC, switch → heap DXIL, switch → heap PSO creation, switch → heap
250 0.60 → 0.50 s 147 → 98 KiB 3.38 → 2.98 s
500 1.60 → 1.20 s 294 → 196 KiB 21.13 → 26.74 s

The table shows medians across the three seeds. In seed order, PSO creation at 250 rounds was 3.56 / 3.35 / 3.38 s in switch mode and 2.98 / 3.00 / 2.95 s in heap mode. At 500 rounds it was 24.09 / 21.13 / 21.12 s and 33.27 / 26.74 / 25.36 s, respectively.

Follow-up on vkd3d-proton builds

I reused the same DXIL files on the same RTX 5070 Ti, driver 620.73.04, Wine and DXVK. The two vkd3d-proton builds were 3.1.0 (4522cc1a8b1347f, dxil-spirv 8b48f0e) and upstream ec20719452e916b (dxil-spirv 7c04863). Each call ran in a fresh process with both disk caches disabled as above. I set VKD3D_CONFIG=pipeline_library_log to collect Vulkan pipeline creation feedback alongside the D3D12 wall time, and sampled user-space CPU time with perf record -e cpu-clock:u -F 199. All 12 follow-up PSOs were created successfully. Upstream build

vkd3d-proton Rounds Paired seeds D3D12 PSO creation, switch → heap Vulkan pipeline feedback, switch → heap
3.1.0 250 1 3.27 → 2.92 s 2.07 → 1.54 s
ec207194 250 1 3.37 → 0.61 s 3.02 → 0.54 s
3.1.0 500 2 21.16 → 24.93 s 7.57 → 8.88 s
ec207194 500 2 17.06 → 1.79 s 15.52 → 1.47 s

The 500-round rows show medians across seeds 1 and 2. Across those four runs per build, d3d12core.dll accounted for 63.5–63.9% of CPU samples on 3.1.0 and 8.7–15.2% on ec207194. The comparison covers the complete vkd3d-proton builds. On the upstream build, the heap form was about 9.6× faster in total PSO creation for this sample.

Not tested

Native Windows, retail shaders or gameplay, the full test suite, and timing outside this synthetic compute family.

AI use

Codex (GPT-6, exact variant unavailable) set up the cross-build, ran the tests, benchmarks and CPU profiling, and drafted this report.

**@⁠vitor127wt** on GitHub · 2026-11-24 14:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7134433823) · edited 2026-11-24 14:41 UTC **Test report — RTX 5070 Ti on Wine, head `95f34c1d1a24f644d0c4895810a7c36910b123e8`** The heap form cut DXIL size by about one third. On vkd3d-proton 3.1.0, pipeline creation was 12% faster in the 250-round sample and 27% slower in the 500-round sample. The follow-up below shows a reversal for the 500-round sample on upstream build `ec207194`. **Tested** - GeForce RTX 5070 Ti (16,303 MiB reported by NVIDIA), Linux driver 620.73.04. Ryzen 7 9700X, 30 GiB RAM visible to Linux. CachyOS x86-64, kernel `7.3.5-2-cachyos`. - Wine 11.22, DXVK `v2.7.1-498-ga6764047e587178`, upstream vkd3d-proton 3.1.0 (`4522cc1a8b1347f`), Windows DXC 1.9.2609.5 (`01b62ad4`). Rust 1.100.0, cargo-xwin 0.24.1, `x86_64-pc-windows-msvc`, debug builds. - Cross-built with `cargo xwin test --locked --target x86_64-pc-windows-msvc -p xcl --lib --test gpu_compute_e2e --no-run`. Under Wine with `--nocapture --test-threads=1`, the five focused tests passed (0 failed, 0 ignored, 0 skipped): `gpu_memory_windows_from_the_heap`, `gpu_heap_windows_reject_out_of_uma_aliasing`, `gpu_raw_window_view_reaches_its_top`, `window_views_do_not_hold_global_during_device_calls`, and `unbinding_all_heaps_lets_the_shared_heap_be_bound_again`. - With `XCL_HEAP_WINDOWS=1`, `heap_window_out_of_memory_falls_back_to_the_switch_form` logged the switch-form retry after the injected OOM, then exited with code 3 on vkd3d-proton's root-signature vtable assertion. The existing `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back` control with `XCL_HEAP_WINDOWS=0` exited with code 3 on the fence vtable assertion. With the vkd3d-proton build `0bb64c56c8f0dcc` from Proton-CachyOS `11.0.20261015`, both tests got to dispatch and failed there with `0x80070057` (each 0 passed, 1 failed, 0 ignored, 0 skipped). The vtable behavior is tracked in #175. **Synthetic A/B** I built the existing [nv680 probe at `c583e10`](https://github.com/milesah3ad/xcl/blob/c583e10/crates/xcl/examples/nv680.rs) on the PR head with `cargo xwin build --locked --target x86_64-pc-windows-msvc -p xcl --example nv680`. The commands were `wine nv680.exe gen --out DIR --name TAG --shape base --rounds R --heap H --seeds S..N --dxc-arg -O1` and `wine nv680.exe create FILE.dxil`. I used R=250 and 500, H=0 and 1, and one seed per generation call (S=1, 2, or 3 and N=S+1). I alternated the mode order and timed each create call in a fresh Wine process. The probe uses four memory windows and split wave64. I set `VKD3D_SHADER_CACHE_PATH=0` and `__GL_SHADER_DISK_CACHE=0`. All 12 calls to `CreateComputePipelineState` succeeded. | Rounds per shader | DXC, switch → heap | DXIL, switch → heap | PSO creation, switch → heap | | --- | ---: | ---: | ---: | | 250 | 0.60 → 0.50 s | 147 → 98 KiB | 3.38 → 2.98 s | | 500 | 1.60 → 1.20 s | 294 → 196 KiB | 21.13 → 26.74 s | The table shows medians across the three seeds. In seed order, PSO creation at 250 rounds was 3.56 / 3.35 / 3.38 s in switch mode and 2.98 / 3.00 / 2.95 s in heap mode. At 500 rounds it was 24.09 / 21.13 / 21.12 s and 33.27 / 26.74 / 25.36 s, respectively. **Follow-up on vkd3d-proton builds** I reused the same DXIL files on the same RTX 5070 Ti, driver 620.73.04, Wine and DXVK. The two vkd3d-proton builds were 3.1.0 (`4522cc1a8b1347f`, dxil-spirv `8b48f0e`) and upstream `ec20719452e916b` (dxil-spirv `7c04863`). Each call ran in a fresh process with both disk caches disabled as above. I set `VKD3D_CONFIG=pipeline_library_log` to collect Vulkan pipeline creation feedback alongside the D3D12 wall time, and sampled user-space CPU time with `perf record -e cpu-clock:u -F 199`. All 12 follow-up PSOs were created successfully. [Upstream build](https://github.com/HansKristian-Work/vkd3d-proton/actions/runs/45389706791) | vkd3d-proton | Rounds | Paired seeds | D3D12 PSO creation, switch → heap | Vulkan pipeline feedback, switch → heap | | --- | ---: | ---: | ---: | ---: | | 3.1.0 | 250 | 1 | 3.27 → 2.92 s | 2.07 → 1.54 s | | `ec207194` | 250 | 1 | 3.37 → 0.61 s | 3.02 → 0.54 s | | 3.1.0 | 500 | 2 | 21.16 → 24.93 s | 7.57 → 8.88 s | | `ec207194` | 500 | 2 | 17.06 → 1.79 s | 15.52 → 1.47 s | The 500-round rows show medians across seeds 1 and 2. Across those four runs per build, `d3d12core.dll` accounted for 63.5–63.9% of CPU samples on 3.1.0 and 8.7–15.2% on `ec207194`. The comparison covers the complete vkd3d-proton builds. On the upstream build, the heap form was about 9.6× faster in total PSO creation for this sample. **Not tested** Native Windows, retail shaders or gameplay, the full test suite, and timing outside this synthetic compute family. **AI use** Codex (GPT-6, exact variant unavailable) set up the cross-build, ran the tests, benchmarks and CPU profiling, and drafted this report.
Author
Owner

@⁠brothernog on GitHub · 2026-11-24 14:47 UTC · original

Tested 95f34c1 (heap form, heap_windows: true) on Windows 11, RTX 3050 Laptop / driver 610.88, DXC 1.9.2602.17, with game files (3 compute programs of the retail pack; numbers only):

The per-access [branch] if (xcl_w >= windows) guard costs driver time. A branch-free form compiled faster on the same programs: ResourceDescriptorHeap[NonUniformResourceIndex(min(xcl_w, N))], with a null raw UAV written at descriptor MEM_HEAP_BASE + N. The null view reads 0 and drops stores, and atomics return 0, the same as the switch's default.

Cold CreateComputePipelineState, same root signature and static samplers as the runtime, two fresh DXIL builds each (DXC -O1 / -O2, the runtime's level at these sizes):

Program (console instructions) this PR min + null view
18.7k, guarded 23.0 / 22.4 s 17.5 / 18.1 s
18.3k, structured 20.7 / 20.1 s 19.3 / 18.7 s
4.4k, guarded 4.6 / 4.5 s 3.8 / 3.3 s
  • DXC was also 5–15% faster, and the DXIL ~9% smaller.
  • For reference, the switch form took ~100 s / ~98 s / 8.9 s on these programs.
  • On this laptop, identical DXIL varies up to ±25% between runs, so the 18.3k row is within noise.

Also measured:

  • A heap base loaded from the io buffer instead of the constant MEM_HEAP_BASE made the driver ~30% slower, so the constant is the right call.
  • Dropping NonUniformResourceIndex changed nothing, and it is needed anyway, since lanes can pick different windows.

In the branch-free form, the out-of-range rule then rests on null-descriptor behaviour, CAS loops included. gpu_memory_windows_reject_out_of_uma_aliasing and the other windowed GPU tests (6/6) pass in that form here, and the full lib suite passes (713 passed, 0 failed, on current main 930e8b4 plus this form).

A separate gap: 64-bit atomics on heap views need D3D12_FEATURE_DATA_D3D12_OPTIONS11::AtomicInt64OnDescriptorHeapResourceSupported, and I don't see the heap form checking it. A device without it should probably keep the switch form. I haven't checked whether this relates to the NVIDIA reports above. Happy to share the patch for either point.

This review was AI-assisted.

**@⁠brothernog** on GitHub · 2026-11-24 14:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7134958285) Tested `95f34c1` (heap form, `heap_windows: true`) on Windows 11, RTX 3050 Laptop / driver 610.88, DXC 1.9.2602.17, with game files (3 compute programs of the retail pack; numbers only): The per-access `[branch] if (xcl_w >= windows)` guard costs driver time. A branch-free form compiled faster on the same programs: `ResourceDescriptorHeap[NonUniformResourceIndex(min(xcl_w, N))]`, with a null raw UAV written at descriptor `MEM_HEAP_BASE + N`. The null view reads 0 and drops stores, and atomics return 0, the same as the switch's `default`. Cold `CreateComputePipelineState`, same root signature and static samplers as the runtime, two fresh DXIL builds each (DXC `-O1` / `-O2`, the runtime's level at these sizes): | Program (console instructions) | this PR | `min` + null view | |---|---|---| | 18.7k, guarded | 23.0 / 22.4 s | 17.5 / 18.1 s | | 18.3k, structured | 20.7 / 20.1 s | 19.3 / 18.7 s | | 4.4k, guarded | 4.6 / 4.5 s | 3.8 / 3.3 s | - DXC was also 5–15% faster, and the DXIL ~9% smaller. - For reference, the switch form took ~100 s / ~98 s / 8.9 s on these programs. - On this laptop, identical DXIL varies up to ±25% between runs, so the 18.3k row is within noise. Also measured: - A heap base loaded from the io buffer instead of the constant `MEM_HEAP_BASE` made the driver ~30% slower, so the constant is the right call. - Dropping `NonUniformResourceIndex` changed nothing, and it is needed anyway, since lanes can pick different windows. In the branch-free form, the out-of-range rule then rests on null-descriptor behaviour, CAS loops included. `gpu_memory_windows_reject_out_of_uma_aliasing` and the other windowed GPU tests (6/6) pass in that form here, and the full lib suite passes (713 passed, 0 failed, on current `main` `930e8b4` plus this form). A separate gap: 64-bit atomics on heap views need `D3D12_FEATURE_DATA_D3D12_OPTIONS11::AtomicInt64OnDescriptorHeapResourceSupported`, and I don't see the heap form checking it. A device without it should probably keep the switch form. I haven't checked whether this relates to the NVIDIA reports above. Happy to share the patch for either point. This review was AI-assisted.
Author
Owner

@⁠milesah3ad on GitHub · 2026-11-24 14:57 UTC · original

Follow-up to my synthetic numbers above, now on driver 621.24 (the driver in the abort report): still no abort, on an RTX 5080. The suite on 95f34c1 is clean apart from the #718 trio. The raw-view device removal doesn't happen on this card.

Setup: RTX 5080 16 GB, driver 621.24 (32.0.16.2124), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.100.0.

Tested

  • Synthetic probe (nv680-probe, heap form, one process per pipeline, fresh seeds), all 5 shapes × 4 sizes × 2 seeds, 87 KB to 1.3 MB of DXIL: 40/40 built with DXC 1.8.2502.11 and 40/40 with DXC 1.9.2609.5, exit 0, nothing on stderr. Timings within a few percent of 621.14. Together with @⁠JRamos1993's RTX 5090 run on the same driver with the real programs, this points away from "621.24 + DXC 1.8" alone as the trigger.
  • 95f34c1, cargo test --workspace --no-fail-fast -- --test-threads=4, debug, DXC 1.9.2609.5:
    • default: 719 passed, 3 failed, 41 ignored
    • XCL_HEAP_WINDOWS=1: 719 passed, 3 failed, 41 ignored; heap_window_out_of_memory_falls_back_to_the_switch_form runs and passes (it is SKIPPED in the default run)
    • The 3 failures are the #718 trio in both runs (the cubemap check, then the two PoisonErrors), as @⁠srcamarda found on base 09940bb.
    • SKIPPED (both runs): the two wave64-only tests.
  • gpu_raw_window_view_reaches_its_top passes on this card and driver, so the NumElements 0x3FFFFFFF raw view @⁠CharlyRien traced on the RTX 3090 / 616.56 is accepted here.

Not tested

  • Any retail program or title, AMD, 8 GB cards.

AI use

  • Claude Code (Claude Opus 5.5) ran the probe and the suite on the machine above and wrote this report. I checked it against the logs.
**@⁠milesah3ad** on GitHub · 2026-11-24 14:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7135226259) Follow-up to my synthetic numbers above, now on **driver 621.24** (the driver in the abort report): still no abort, on an RTX 5080. The suite on `95f34c1` is clean apart from the #718 trio. The raw-view device removal doesn't happen on this card. **Setup:** RTX 5080 16 GB, driver 621.24 (32.0.16.2124), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.100.0. **Tested** - Synthetic probe ([`nv680-probe`](https://github.com/milesah3ad/xcl/tree/nv680-probe), heap form, one process per pipeline, fresh seeds), all 5 shapes × 4 sizes × 2 seeds, 87 KB to 1.3 MB of DXIL: **40/40 built with DXC 1.8.2502.11 and 40/40 with DXC 1.9.2609.5**, exit 0, nothing on stderr. Timings within a few percent of 621.14. Together with @⁠JRamos1993's RTX 5090 run on the same driver with the real programs, this points away from "621.24 + DXC 1.8" alone as the trigger. - `95f34c1`, `cargo test --workspace --no-fail-fast -- --test-threads=4`, debug, DXC 1.9.2609.5: - default: 719 passed, 3 failed, 41 ignored - `XCL_HEAP_WINDOWS=1`: 719 passed, 3 failed, 41 ignored; `heap_window_out_of_memory_falls_back_to_the_switch_form` runs and passes (it is SKIPPED in the default run) - The 3 failures are the #718 trio in both runs (the cubemap check, then the two `PoisonError`s), as @⁠srcamarda found on base `09940bb`. - SKIPPED (both runs): the two wave64-only tests. - `gpu_raw_window_view_reaches_its_top` passes on this card and driver, so the `NumElements 0x3FFFFFFF` raw view @⁠CharlyRien traced on the RTX 3090 / 616.56 is accepted here. **Not tested** - Any retail program or title, AMD, 8 GB cards. **AI use** - Claude Code (Claude Opus 5.5) ran the probe and the suite on the machine above and wrote this report. I checked it against the logs.
Author
Owner

@⁠CharlyRien on GitHub · 2026-11-24 14:42 UTC · original · edited 2026-11-24 14:59 UTC

Test report: the device removal at boot reproduces on an RTX 3090 (driver 616.56), and it has a cause: a raw view that ends above 2^32 − 32 bytes

Edit: it is not the driver. With the D3D12 debug layer installed, the runtime itself rejects the view: message id 345 (CreateUnorderedAccessView: The Dimensions of the View are invalid …), then id 232 (RemoveDevice … DXGI_ERROR_INVALID_CALL). This machine has the inbox D3D12 of Windows 11 23H2 (D3D12Core 10.0.22621.5415). With the same GPU and driver and D3D12Core 1.618.1 from the Agility SDK (through XCL_D3D12_DIR), views of 0x3FFFFFF9 and 0x3FFFFFFF dwords are accepted and the device stays. So the limit belongs to this D3D12 runtime version, and machines on Windows builds 26100 and later probably do not have it (not checked on each). The message does not match what it refuses (with FirstElement 0x3FFFFFF4 it asks for NumElements "between 1 and 12" and refuses 5), which looks like a 32-bit overflow in the check. The threshold is the same with and without the debug layer. The PR's three heap tests pass under the debug layer with the cap, with no error about the heap form.

This looks like @⁠ryosen0's report (device removed right after the windows' views are made). It does not explain the compiler abort.

What fails

  • gpu_raw_window_view_reaches_its_top fails here at heap_window_tests.rs:28 with 0x887A0005; GetDeviceRemovedReason gives 0x887A0001 (DXGI_ERROR_INVALID_CALL).
  • The call is CreateUnorderedAccessView with raw_window_uav(4 GiB): R32_TYPELESS, RAW, FirstElement 0, NumElements 0x3FFFFFFF. With DRED on there is no breadcrumb and no page fault: the view is refused when it is made.
  • In a retail title with XCL_HEAP_WINDOWS=1 it is the same: the device is gone at 1.9 s, before the first frame. The first line in the log is a CreateHeap … refused (0x887a0005), which is only the first call after it that returns an HRESULT.

The threshold (one process per try, 4 GiB and 8 GiB buffers)

Resource FirstElement NumElements View ends at Result
reserved 4 GiB 0 0x3FFFFFF8 0xFFFFFFE0 ok
reserved 4 GiB 0 0x3FFFFFF9 0xFFFFFFE4 removed
committed 4 GiB 0 0x3FFFFFF8 / 0x3FFFFFF9 same ok / removed
reserved 4 GiB 0x3FFFFFF0 8 / 9 0xFFFFFFE0 / E4 ok / removed
reserved 8 GiB 0x10000000 0x100 0x40000400 ok
reserved 8 GiB 0x40000000 0x100 0x100000400 removed
structured, stride 4 0 0x3FFFFFFF 0xFFFFFFFC ok
  • So it is the view's end from the start of the resource that counts, not its size, and only for raw views. A structured view of the same range is accepted.
  • The adapter reports MaxGPUVirtualAddressBitsPerResource 40, binding tier 3, heap tier 2, tiled resources tier 3, so it is not an address limit.
  • I found no such limit in the D3D12 documentation (see the edit above: it is this D3D12 runtime version, not the driver).

A change that makes it work here

-    let bytes = bytes.min((1u64 << 32) - 4);
+    let bytes = bytes.min((1u64 << 32) - 32);

in runner::raw_window_uav. The HLSL and the cache keys stay the same. The cost: the last 32 bytes of a 4 GiB window are not reached in the heap form (they read 0 and drop their stores), where it is the last 4 today. The test's last-dwords assertion has to follow (lanes 56 to 62 are past the view's end).

Tested with that change

  • NVIDIA GeForce RTX 3090 24 GB, driver 616.56 (32.0.16.1656), wave32 only; Ryzen 9 5950X, 32 GB, 32 GB page file; Windows 11 Pro 23H2 build 22631; rustc 1.100.0; DXC 1.9.2602.17; release.
  • Tree: this PR's first two commits (341b209, a0c6676) on main 47efa2e with #688, #744, #759, #820 and #684. The third commit (95f34c1) conflicts with #759 and was left out, so the switch-form fallback was not there.
  • cargo test -p xcl --release --lib window -- --test-threads=1: 17 passed, 0 failed, 0 ignored (718 filtered out). Before the change: 16 passed, 1 failed.
  • A retail title, XCL_HEAP_WINDOWS=1 XCL_NETWORK=0, two runs: no device removal, menus at 30 fps, 300 and 331 compute pipelines made (up to 722 KB of DXIL), 0 failed. Both runs end at the title's own watchdog during world loading, as the switch form does here.

Not tested

  • The whole suite with this change, and a regression pair.
  • The PR's head as it is (see the tree above), a newer NVIDIA driver, a newer Windows build, the 8 GB card of the original report.
  • Whether the last 32 bytes of a window matter to a title.

AI use: Claude Code with Claude Fable 5.2 ran the tests, the bisection and the title runs on my machine and wrote this report.

**@⁠CharlyRien** on GitHub · 2026-11-24 14:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7134810068) · edited 2026-11-24 14:59 UTC **Test report: the device removal at boot reproduces on an RTX 3090 (driver 616.56), and it has a cause: a raw view that ends above 2^32 − 32 bytes** **Edit:** it is not the driver. With the D3D12 debug layer installed, the runtime itself rejects the view: message id 345 (`CreateUnorderedAccessView: The Dimensions of the View are invalid …`), then id 232 (`RemoveDevice … DXGI_ERROR_INVALID_CALL`). This machine has the inbox D3D12 of Windows 11 23H2 (D3D12Core 10.0.22621.5415). With the same GPU and driver and D3D12Core 1.618.1 from the Agility SDK (through `XCL_D3D12_DIR`), views of 0x3FFFFFF9 and 0x3FFFFFFF dwords are accepted and the device stays. So the limit belongs to this D3D12 runtime version, and machines on Windows builds 26100 and later probably do not have it (not checked on each). The message does not match what it refuses (with `FirstElement 0x3FFFFFF4` it asks for `NumElements` "between 1 and 12" and refuses 5), which looks like a 32-bit overflow in the check. The threshold is the same with and without the debug layer. The PR's three heap tests pass under the debug layer with the cap, with no error about the heap form. This looks like @⁠ryosen0's report (device removed right after the windows' views are made). It does not explain the compiler abort. **What fails** - `gpu_raw_window_view_reaches_its_top` fails here at `heap_window_tests.rs:28` with `0x887A0005`; `GetDeviceRemovedReason` gives `0x887A0001` (`DXGI_ERROR_INVALID_CALL`). - The call is `CreateUnorderedAccessView` with `raw_window_uav(4 GiB)`: `R32_TYPELESS`, `RAW`, `FirstElement 0`, `NumElements 0x3FFFFFFF`. With DRED on there is no breadcrumb and no page fault: the view is refused when it is made. - In a retail title with `XCL_HEAP_WINDOWS=1` it is the same: the device is gone at 1.9 s, before the first frame. The first line in the log is a `CreateHeap … refused (0x887a0005)`, which is only the first call after it that returns an HRESULT. **The threshold** (one process per try, 4 GiB and 8 GiB buffers) | Resource | FirstElement | NumElements | View ends at | Result | |---|---|---|---|---| | reserved 4 GiB | 0 | 0x3FFFFFF8 | 0xFFFFFFE0 | ok | | reserved 4 GiB | 0 | 0x3FFFFFF9 | 0xFFFFFFE4 | removed | | committed 4 GiB | 0 | 0x3FFFFFF8 / 0x3FFFFFF9 | same | ok / removed | | reserved 4 GiB | 0x3FFFFFF0 | 8 / 9 | 0xFFFFFFE0 / E4 | ok / removed | | reserved 8 GiB | 0x10000000 | 0x100 | 0x40000400 | ok | | reserved 8 GiB | 0x40000000 | 0x100 | 0x100000400 | removed | | structured, stride 4 | 0 | 0x3FFFFFFF | 0xFFFFFFFC | ok | - So it is the view's end from the start of the resource that counts, not its size, and only for raw views. A structured view of the same range is accepted. - The adapter reports `MaxGPUVirtualAddressBitsPerResource` 40, binding tier 3, heap tier 2, tiled resources tier 3, so it is not an address limit. - I found no such limit in the D3D12 documentation (see the edit above: it is this D3D12 runtime version, not the driver). **A change that makes it work here** ```diff - let bytes = bytes.min((1u64 << 32) - 4); + let bytes = bytes.min((1u64 << 32) - 32); ``` in `runner::raw_window_uav`. The HLSL and the cache keys stay the same. The cost: the last 32 bytes of a 4 GiB window are not reached in the heap form (they read 0 and drop their stores), where it is the last 4 today. The test's last-dwords assertion has to follow (lanes 56 to 62 are past the view's end). **Tested** with that change - NVIDIA GeForce RTX 3090 24 GB, driver 616.56 (32.0.16.1656), wave32 only; Ryzen 9 5950X, 32 GB, 32 GB page file; Windows 11 Pro 23H2 build 22631; rustc 1.100.0; DXC 1.9.2602.17; release. - Tree: this PR's first two commits (`341b209`, `a0c6676`) on `main` `47efa2e` with #688, #744, #759, #820 and #684. The third commit (`95f34c1`) conflicts with #759 and was left out, so the switch-form fallback was not there. - `cargo test -p xcl --release --lib window -- --test-threads=1`: 17 passed, 0 failed, 0 ignored (718 filtered out). Before the change: 16 passed, 1 failed. - A retail title, `XCL_HEAP_WINDOWS=1 XCL_NETWORK=0`, two runs: no device removal, menus at 30 fps, 300 and 331 compute pipelines made (up to 722 KB of DXIL), 0 failed. Both runs end at the title's own watchdog during world loading, as the switch form does here. **Not tested** - The whole suite with this change, and a regression pair. - The PR's head as it is (see the tree above), a newer NVIDIA driver, a newer Windows build, the 8 GB card of the original report. - Whether the last 32 bytes of a window matter to a title. **AI use:** Claude Code with Claude Fable 5.2 ran the tests, the bisection and the title runs on my machine and wrote this report.
Author
Owner

@⁠guinpereira on GitHub · 2026-11-24 15:07 UTC · original

Test report: RTX 5060 Ti (Blackwell, 32-lane waves), driver 617.14, DXC 1.8. The heap form cuts the driver's part ~3.3× on the same 83 compute programs; 0 refused, no abort. Merged onto current main, the suite passes in both forms. The retail title's watchdog (+0x23cf683) still fires in both forms.

Tested

  • NVIDIA GeForce RTX 5060 Ti 16 GB, driver 617.14 (32.0.16.1714); Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200.9974; Rust 1.99.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100). Release builds for timings and title runs, debug for the suite.
  • This PR's head 95f34c1 as is, and a local merge of it onto main 930e8b4 (clean, merge commit 383008e).

1. Driver and DXC time, the same 83 compute programs as the description
xcl shaders <pack>\shaders.rpf --precompile --only cs --limit 22240, then the same with --pipelines (4 driver compiles at once). One executable (95f34c1), one variable: XCL_HEAP_WINDOWS unset / =1. Every run: an empty DXIL cache and an executable path the driver had not seen. 3 rounds, order alternated. Seconds of the whole command; 6–10 s of each is reading the pack.

switch form (default) heap form
step 1: DXC 27.6 · 28.5 · 30.5 s 24.5 · 23.5 · 24.5 s
step 2: driver, 83 pipelines 118.9 · 126.3 · 131.2 s 42.4 · 39.4 · 46.5 s
made / refused 83 / 0 every run 83 / 0 every run
DXIL 8.28 MB, p50 35 KB, max 1 065 KB 6.86 MB, p50 33 KB, max 845 KB
  • Without the reading, the driver's part is about 110–121 s against 31–38 s: ≈3.3× less. DXC is about 15 % less.
  • The DXIL sizes match the description's (8.3 / 6.9 MB, largest 1 066 / 846 KB), so it is the same set of programs.

2. Whole pack, heap form (partial)
--precompile --only cs --pipelines over all 26 503 records with the local merge 383008e, XCL_HEAP_WINDOWS=1, empty caches. Stopped by hand after 21 min, at record 22 600–23 000: 500 pipelines made, 0 refused, no abort (@⁠LeonardoS11's exit 127 did not happen up to there). The rate fell from ~50 to ~5 pipelines a minute in the tail. Peak private bytes of the process: 53.9 GB (on 32 GB of RAM).

3. The retail title (1.0.2.1), scripts/smoke.ps1, 180 s (XCL_NETWORK=0, no input; each run a new DXIL cache and a new executable path)

build form end last presents
main 930e8b4 – 0xc0000005 write at 0 in +0x23cf683 at 126.5 s 96–98 s window
95f34c1 switch (default) same, 124.9 s 94–96 s window
95f34c1 heap same, 123.9 s 92–94 s window
  • So this PR does not change that stop, in either form. No device removal at boot in the heap form on this 16 GB card (memory windows from the shared descriptor heap in the log, no switch-form retry).
  • Before the watchdog the title waits on one big compute pipeline. Its driver call took 12 429 ms on main (384 860 B DXIL) and 6 300 ms in the heap form (347 432 B). It is likely the same program (same point of the load, the heap form's DXIL is ~10 % smaller), not proven.
  • The watchdog still fires when that wait is gone: a heap-form run where the driver answered that pipeline from its own cache in 27 ms still stopped at 115.0 s (last presents in the 84–86 s window, no draws or dispatches after 100 s).
  • A thread dump at the stop (95f34c1, heap form) has four of the title's threads in translated_compute_pso → dxc::compile, one in set_pipeline_state → resolve_wait, and three DXC workers held in wait_for_memory. That is what 9a272d4 and 25c6f7e on main address; this head does not have them. I am following that up on #505.

4. Suite (cargo test --workspace --no-fail-fast -- --test-threads=4)

  • Head 95f34c1 as is: 719 passed, 3 failed, 41 ignored, with and without XCL_HEAP_WINDOWS=1. The failures are placed_title_textures_share_vram_and_preserve_pixels ("cubemap extra_pages must be reused at same va"), then transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory with a poisoned lock. All three pass alone. main changed title_textures.rs / vram.rs after this PR's base (712bbbe, 38ea451, 24d8b92).
  • Merged onto main 930e8b4: 757 passed, 0 failed, 41 ignored, both with XCL_HEAP_WINDOWS unset and with =1. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware; when unset also heap_window_out_of_memory_falls_back_to_the_switch_form. So a rebase onto current main clears the three.

Not tested

  • The rest of the pack (the last ~3 500 records); DXC 1.9; AMD / Intel; an 8 GB card.

AI use: Claude Code (Claude Opus 5.5) ran the commands above on this machine and wrote this report. No code changes.

**@⁠guinpereira** on GitHub · 2026-11-24 15:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7135507057) **Test report: RTX 5060 Ti (Blackwell, 32-lane waves), driver 617.14, DXC 1.8. The heap form cuts the driver's part ~3.3× on the same 83 compute programs; 0 refused, no abort. Merged onto current `main`, the suite passes in both forms. The retail title's watchdog (`+0x23cf683`) still fires in both forms.** **Tested** - NVIDIA GeForce RTX 5060 Ti 16 GB, driver 617.14 (32.0.16.1714); Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200.9974; Rust 1.99.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100). Release builds for timings and title runs, debug for the suite. - This PR's head `95f34c1` as is, and a local merge of it onto `main` `930e8b4` (clean, merge commit `383008e`). **1. Driver and DXC time, the same 83 compute programs as the description** `xcl shaders <pack>\shaders.rpf --precompile --only cs --limit 22240`, then the same with `--pipelines` (4 driver compiles at once). One executable (`95f34c1`), one variable: `XCL_HEAP_WINDOWS` unset / `=1`. Every run: an empty DXIL cache and an executable path the driver had not seen. 3 rounds, order alternated. Seconds of the whole command; 6–10 s of each is reading the pack. | | switch form (default) | heap form | |---|---|---| | step 1: DXC | 27.6 · 28.5 · 30.5 s | 24.5 · 23.5 · 24.5 s | | step 2: driver, 83 pipelines | **118.9 · 126.3 · 131.2 s** | **42.4 · 39.4 · 46.5 s** | | made / refused | 83 / 0 every run | 83 / 0 every run | | DXIL | 8.28 MB, p50 35 KB, max 1 065 KB | 6.86 MB, p50 33 KB, max 845 KB | - Without the reading, the driver's part is about 110–121 s against 31–38 s: **≈3.3× less**. DXC is about 15 % less. - The DXIL sizes match the description's (8.3 / 6.9 MB, largest 1 066 / 846 KB), so it is the same set of programs. **2. Whole pack, heap form (partial)** `--precompile --only cs --pipelines` over all 26 503 records with the local merge `383008e`, `XCL_HEAP_WINDOWS=1`, empty caches. Stopped by hand after 21 min, at record 22 600–23 000: **500 pipelines made, 0 refused, no abort** (@⁠LeonardoS11's exit 127 did not happen up to there). The rate fell from ~50 to ~5 pipelines a minute in the tail. Peak private bytes of the process: 53.9 GB (on 32 GB of RAM). **3. The retail title (1.0.2.1), `scripts/smoke.ps1`, 180 s** (`XCL_NETWORK=0`, no input; each run a new DXIL cache and a new executable path) | build | form | end | last presents | |---|---|---|---| | `main` `930e8b4` | – | `0xc0000005` write at 0 in `+0x23cf683` at 126.5 s | 96–98 s window | | `95f34c1` | switch (default) | same, 124.9 s | 94–96 s window | | `95f34c1` | heap | same, 123.9 s | 92–94 s window | - So this PR does not change that stop, in either form. No device removal at boot in the heap form on this 16 GB card (`memory windows from the shared descriptor heap` in the log, no switch-form retry). - Before the watchdog the title waits on one big compute pipeline. Its driver call took 12 429 ms on `main` (384 860 B DXIL) and 6 300 ms in the heap form (347 432 B). It is likely the same program (same point of the load, the heap form's DXIL is ~10 % smaller), not proven. - The watchdog still fires when that wait is gone: a heap-form run where the driver answered that pipeline from its own cache in 27 ms still stopped at 115.0 s (last presents in the 84–86 s window, no draws or dispatches after 100 s). - A thread dump at the stop (`95f34c1`, heap form) has four of the title's threads in `translated_compute_pso` → `dxc::compile`, one in `set_pipeline_state` → `resolve_wait`, and three DXC workers held in `wait_for_memory`. That is what `9a272d4` and `25c6f7e` on `main` address; this head does not have them. I am following that up on #505. **4. Suite** (`cargo test --workspace --no-fail-fast -- --test-threads=4`) - Head `95f34c1` as is: 719 passed, 3 failed, 41 ignored, with and without `XCL_HEAP_WINDOWS=1`. The failures are `placed_title_textures_share_vram_and_preserve_pixels` ("cubemap extra_pages must be reused at same va"), then `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory` with a poisoned lock. All three pass alone. `main` changed `title_textures.rs` / `vram.rs` after this PR's base (`712bbbe`, `38ea451`, `24d8b92`). - Merged onto `main` `930e8b4`: **757 passed, 0 failed, 41 ignored**, both with `XCL_HEAP_WINDOWS` unset and with `=1`. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`; when unset also `heap_window_out_of_memory_falls_back_to_the_switch_form`. So a rebase onto current `main` clears the three. **Not tested** - The rest of the pack (the last ~3 500 records); DXC 1.9; AMD / Intel; an 8 GB card. **AI use:** Claude Code (Claude Opus 5.5) ran the commands above on this machine and wrote this report. No code changes.
Author
Owner

@⁠Natakout on GitHub · 2026-11-24 13:38 UTC · original · edited 2026-11-24 15:08 UTC

Test report: driver compile time with this PR, RTX 3060 (NVIDIA, wave32)

Commit tested: this PR's head 95f34c1 with XCL_HEAP_WINDOWS=1, against main 47efa2e.

Tested

  • Hardware: RTX 3060 12 GB, NVIDIA driver 621.14, Windows 11 25H2, DXC 1.9.2609.5, rustc 1.94.1, release build.
  • What was measured: cold CreateComputePipelineState on the 5 largest compute programs of the retail shader pack that the driver accepts (19.8k to 24.5k console instructions: 3 guarded pc ==, 2 structured). Same root signature and static samplers as the runtime, at the runtime's default DXC level. Only sizes and timings below; no shader content.
Program Console instr. Form Driver, main Driver, this PR Change
A 24 530 guarded 125.5 s 22.8 s -82 %
B 21 896 guarded 74.7 s 16.2 s -78 %
C 21 784 guarded 78.6 s 15.8 s -80 %
D 19 815 structured 50.5 s 11.3 s -78 %
E 19 760 structured 54.6 s 10.9 s -80 %
  • Average: 4.9x less driver time. The DXIL is 15-20 % smaller.
  • The driver accepted all 5 programs with this PR. I did not reproduce the NVIDIA failures reported earlier in this thread on this card.
  • Programs above ~25k instructions (DXIL > 20 MB) are refused by the driver, with or without this PR.

Not tested

  • AMD GPUs.
  • The big compute programs above inside a title run: the smoke runs below stay in the menus (no input), where only 12 programs get compiled, so they check for regressions but do not reach that code.
  • Other NVIDIA drivers or cards.
  • Each point is a single cold compile, with no repeated runs.

Regression run (same title, 180 s each, cold DXIL and NVIDIA driver caches before each run)

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3060
seconds: 180
exit: 0x0
frames shown: 5141 (PresentX 5141)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14689 MB

this PR (XCL_HEAP_WINDOWS=1):

xcl-smoke v1
commit: 95f34c1d1a24f644d0c4895810a7c36910b123e8
gpu: NVIDIA GeForce RTX 3060
seconds: 180
exit: 0x0
frames shown: 5147 (PresentX 5147)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14697 MB

No regression: same frames (+0.1 %), no device removal or crash, same peak commit, same pipeline counts (6 translated, 0 failed, 40 mesh refused as on main).

Update: a likely regression on a title run (RTX 3060, cold caches, 300 s, XCL_PRESS_AT to get past the menus into the world load)

  • With this PR (95f34c1, XCL_HEAP_WINDOWS=1), ray-tracing acceleration structures get GPU addresses above 2^40, for example CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at 0x1c0ec380000 and 0x22f8c460000 in two runs. On main 47efa2e, the same views are at 0x19xxxxxxx.
  • In one of the two runs, the title's own console BVH builder then reported XDXR Error: DestAccelerationStructureData can not have more than 40b of address set and threw an unhandled C++ exception at 273.8 s (0xe06d7363, xboxbvhbuilder.dll on the stack). The other run lasted the 300 s without a crash.
  • On main, the same run ends in the known #505 null write (game+0x23cf683) at 268.8 s instead, so these runs cannot say whether this PR changes #505.
  • So heap windows seem to need acceleration-structure buffers (or the whole window range) to stay below 40 bits of address.

AI use
Claude Code (claude-opus-4-6) wrote the local benchmark harness, ran it on the hardware above, and drafted this report.

**@⁠Natakout** on GitHub · 2026-11-24 13:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7133129009) · edited 2026-11-24 15:08 UTC **Test report: driver compile time with this PR, RTX 3060 (NVIDIA, wave32)** Commit tested: this PR's head 95f34c1 with `XCL_HEAP_WINDOWS=1`, against `main` 47efa2e. **Tested** - Hardware: RTX 3060 12 GB, NVIDIA driver 621.14, Windows 11 25H2, DXC 1.9.2609.5, rustc 1.94.1, release build. - What was measured: cold `CreateComputePipelineState` on the 5 largest compute programs of the retail shader pack that the driver accepts (19.8k to 24.5k console instructions: 3 guarded `pc ==`, 2 structured). Same root signature and static samplers as the runtime, at the runtime's default DXC level. Only sizes and timings below; no shader content. | Program | Console instr. | Form | Driver, main | Driver, this PR | Change | |---|---|---|---|---|---| | A | 24 530 | guarded | 125.5 s | 22.8 s | -82 % | | B | 21 896 | guarded | 74.7 s | 16.2 s | -78 % | | C | 21 784 | guarded | 78.6 s | 15.8 s | -80 % | | D | 19 815 | structured | 50.5 s | 11.3 s | -78 % | | E | 19 760 | structured | 54.6 s | 10.9 s | -80 % | - Average: 4.9x less driver time. The DXIL is 15-20 % smaller. - The driver accepted all 5 programs with this PR. I did not reproduce the NVIDIA failures reported earlier in this thread on this card. - Programs above ~25k instructions (DXIL > 20 MB) are refused by the driver, with or without this PR. **Not tested** - AMD GPUs. - The big compute programs above inside a title run: the smoke runs below stay in the menus (no input), where only 12 programs get compiled, so they check for regressions but do not reach that code. - Other NVIDIA drivers or cards. - Each point is a single cold compile, with no repeated runs. **Regression run** (same title, 180 s each, cold DXIL and NVIDIA driver caches before each run) main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3060 seconds: 180 exit: 0x0 frames shown: 5141 (PresentX 5141) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14689 MB ``` this PR (`XCL_HEAP_WINDOWS=1`): ``` xcl-smoke v1 commit: 95f34c1d1a24f644d0c4895810a7c36910b123e8 gpu: NVIDIA GeForce RTX 3060 seconds: 180 exit: 0x0 frames shown: 5147 (PresentX 5147) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14697 MB ``` No regression: same frames (+0.1 %), no device removal or crash, same peak commit, same pipeline counts (6 translated, 0 failed, 40 mesh refused as on main). **Update: a likely regression on a title run (RTX 3060, cold caches, 300 s, `XCL_PRESS_AT` to get past the menus into the world load)** - With this PR (95f34c1, `XCL_HEAP_WINDOWS=1`), ray-tracing acceleration structures get GPU addresses above 2^40, for example `CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at 0x1c0ec380000` and `0x22f8c460000` in two runs. On `main` 47efa2e, the same views are at `0x19xxxxxxx`. - In one of the two runs, the title's own console BVH builder then reported `XDXR Error: DestAccelerationStructureData can not have more than 40b of address set` and threw an unhandled C++ exception at 273.8 s (0xe06d7363, xboxbvhbuilder.dll on the stack). The other run lasted the 300 s without a crash. - On `main`, the same run ends in the known #505 null write (`game+0x23cf683`) at 268.8 s instead, so these runs cannot say whether this PR changes #505. - So heap windows seem to need acceleration-structure buffers (or the whole window range) to stay below 40 bits of address. **AI use** Claude Code (claude-opus-4-6) wrote the local benchmark harness, ran it on the hardware above, and drafted this report.
Author
Owner

@⁠brothernog on GitHub · 2026-11-24 15:40 UTC · original

Follow-up to my comment above, on the instant 0x8007000E refusals (#756) that @⁠psuedo-tty traced to a GVN-made phi %dx.types.Handle in #1269: the branch-free form does not produce that phi, and the refused programs build in it.

RTX 3050 Laptop, driver 610.88, Windows 11 build 26300, DXC 1.9.2602.17. The five programs listed in #1269 (by fnv64 of the console blob), translated as the runtime does here (split wave64, 4 windows), DXC at the runtime's default level for their size. Handle phis counted in dxc -dumpbin, then cold CreateComputePipelineState with the runtime's root signature:

Program 95f34c1 heap form branch-free: min(xcl_w, N) + null view
a3c0b8a98beee431 2 handle phis, refused (0x8007000E, 0.1 s) 0, built (2.9 s)
c9579f1bea53bcca 1, refused 0, built (3.1 s)
f7016de4c088c4be 2, refused 0, built (2.5 s)
4549529853faf5fd 0, built (2.8 s) 0, built (3.1 s)
f377ca6830935314 0, built (0.4 s) 0, built (0.3 s)
  • The refusal reproduces on 610.88 too, not only 621.x, and it follows the handle phi exactly.
  • The branch-free DXIL is 9–22 % smaller on these five. All other phis in it are i32, float or i1; no handle phi or select.
  • Why (inference): the [branch] if (xcl_w >= windows) guard gives each access two paths that GVN can join. With min there is one path per access, and the out-of-range case goes to the null view at base + N, which reads 0 and drops stores and atomics.

So the branch-free form may remove the need for a no-GVN retry on refusal. The patch I have also caps the raw views at 2^32 − 32 bytes for @⁠CharlyRien's 23H2 limit, and checks AtomicInt64OnDescriptorHeapResourceSupported before using the heap. On main 930e8b4 plus the patch (and #640, #759, #1321 in my tree), the lib suite passes (714 passed, 0 failed). @⁠imnicho, would you take it as a commit on this PR, or should I open a PR against your branch?

This review was AI-assisted.

**@⁠brothernog** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7136419596) Follow-up to my comment above, on the instant `0x8007000E` refusals (#756) that @⁠psuedo-tty traced to a GVN-made `phi %dx.types.Handle` in #1269: the branch-free form does not produce that `phi`, and the refused programs build in it. RTX 3050 Laptop, driver 610.88, Windows 11 build 26300, DXC 1.9.2602.17. The five programs listed in #1269 (by `fnv64` of the console blob), translated as the runtime does here (split wave64, 4 windows), DXC at the runtime's default level for their size. Handle `phi`s counted in `dxc -dumpbin`, then cold `CreateComputePipelineState` with the runtime's root signature: | Program | `95f34c1` heap form | branch-free: `min(xcl_w, N)` + null view | |---|---|---| | `a3c0b8a98beee431` | 2 handle `phi`s, **refused** (`0x8007000E`, 0.1 s) | 0, built (2.9 s) | | `c9579f1bea53bcca` | 1, **refused** | 0, built (3.1 s) | | `f7016de4c088c4be` | 2, **refused** | 0, built (2.5 s) | | `4549529853faf5fd` | 0, built (2.8 s) | 0, built (3.1 s) | | `f377ca6830935314` | 0, built (0.4 s) | 0, built (0.3 s) | - The refusal reproduces on 610.88 too, not only 621.x, and it follows the handle `phi` exactly. - The branch-free DXIL is 9–22 % smaller on these five. All other `phi`s in it are `i32`, `float` or `i1`; no handle `phi` or `select`. - Why (inference): the `[branch] if (xcl_w >= windows)` guard gives each access two paths that GVN can join. With `min` there is one path per access, and the out-of-range case goes to the null view at `base + N`, which reads 0 and drops stores and atomics. So the branch-free form may remove the need for a no-GVN retry on refusal. The patch I have also caps the raw views at 2^32 − 32 bytes for @⁠CharlyRien's 23H2 limit, and checks `AtomicInt64OnDescriptorHeapResourceSupported` before using the heap. On `main` `930e8b4` plus the patch (and #640, #759, #1321 in my tree), the lib suite passes (714 passed, 0 failed). @⁠imnicho, would you take it as a commit on this PR, or should I open a PR against your branch? This review was AI-assisted.
Author
Owner

@⁠requiemsnkrp on GitHub · 2026-11-24 15:42 UTC · original

Measurement: the heap form cuts the NVIDIA driver's compile time of retail compute programs by 43 % (switch form 175.9 s → 100.9 s over 25 programs). I have not run the title with it, so this says nothing yet about the two NVIDIA reports that keep it opt-in.

What I ran: this PR's head (95f34c1) merged onto main 930e8b4, clean merge (c5a484f), release. 25 compute programs of a retail pack, taken from every 10th of its 2,689 and kept between 200 KB and 3 MB of HLSL. Each one translated three ways as a 32-lane GPU gets it (split wave64): the switch form (4 windows, heap_windows: false), the heap form (4 windows, heap_windows: true), and as a bound 1 window. Then each was compiled with DXC (dxc::compile, default levels) and CreateComputePipelineState with the ABI root signature, one at a time, on an RTX 3060 12 GB, driver 621.24. Each variant got a unique never-taken store, so the driver's disk cache never had it. Compile only, nothing ran on the GPU. A local test, not for a PR.

25 programs switch form heap form (this PR) 1 window (bound)
HLSL 24,296 KB 24,169 KB 22,268 KB
DXC 135.0 s 134.8 s 112.0 s
DXIL 7,045 KB 5,853 KB (−17 %) 5,127 KB
driver 175.9 s 100.9 s (−43 %) 80.0 s
  • Per program, the driver time with the heap form is 0.29 to 1.0 times the switch form's: faster for 24 of 25, the same for one 0.7 s program. The slowest of the set goes from 55.4 s to 15.9 s (880 → 658 KB of DXIL).
  • No pipeline was refused in either form; I did not see the E_OUTOFMEMORY from the description. That fits these programs being smaller than the ones that hit it (they are ≤ 3 MB of HLSL).
  • The heap form gets three quarters of what removing the window choice altogether gives (1 window: −55 %).

Context: on #1269 I measured that dropping the per-write EXEC selects changes the driver time by nothing (+1 %). The window switch is what the driver pays for on this card. Given how much of #505's stall on NVIDIA is the driver's compute builds, this looks like the change with the biggest effect on it so far.

Not tested: a title run with XCL_HEAP_WINDOWS=1 on this tree; the GPU tests of this PR on this machine; AMD; programs over 3 MB of HLSL; more than one measurement per variant.

AI use: Claude Code (Claude Opus 5.5) wrote the measurement harness, ran it and wrote this comment. No shader code or names are included.

**@⁠requiemsnkrp** on GitHub · 2026-11-24 15:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7136464665) **Measurement: the heap form cuts the NVIDIA driver's compile time of retail compute programs by 43 % (switch form 175.9 s → 100.9 s over 25 programs).** I have not run the title with it, so this says nothing yet about the two NVIDIA reports that keep it opt-in. **What I ran:** this PR's head (`95f34c1`) merged onto `main` `930e8b4`, clean merge (`c5a484f`), release. 25 compute programs of a retail pack, taken from every 10th of its 2,689 and kept between 200 KB and 3 MB of HLSL. Each one translated three ways as a 32-lane GPU gets it (split wave64): the switch form (4 windows, `heap_windows: false`), the heap form (4 windows, `heap_windows: true`), and as a bound 1 window. Then each was compiled with DXC (`dxc::compile`, default levels) and `CreateComputePipelineState` with the ABI root signature, one at a time, on an **RTX 3060 12 GB, driver 621.24**. Each variant got a unique never-taken store, so the driver's disk cache never had it. Compile only, nothing ran on the GPU. A local test, not for a PR. | 25 programs | switch form | **heap form (this PR)** | 1 window (bound) | |---|---|---|---| | HLSL | 24,296 KB | 24,169 KB | 22,268 KB | | DXC | 135.0 s | 134.8 s | 112.0 s | | DXIL | 7,045 KB | **5,853 KB (−17 %)** | 5,127 KB | | driver | 175.9 s | **100.9 s (−43 %)** | 80.0 s | - Per program, the driver time with the heap form is 0.29 to 1.0 times the switch form's: faster for 24 of 25, the same for one 0.7 s program. The slowest of the set goes from **55.4 s to 15.9 s** (880 → 658 KB of DXIL). - No pipeline was refused in either form; I did not see the `E_OUTOFMEMORY` from the description. That fits these programs being smaller than the ones that hit it (they are ≤ 3 MB of HLSL). - The heap form gets three quarters of what removing the window choice altogether gives (1 window: −55 %). Context: on #1269 I measured that dropping the per-write EXEC selects changes the driver time by nothing (+1 %). The window switch is what the driver pays for on this card. Given how much of #505's stall on NVIDIA is the driver's compute builds, this looks like the change with the biggest effect on it so far. **Not tested:** a title run with `XCL_HEAP_WINDOWS=1` on this tree; the GPU tests of this PR on this machine; AMD; programs over 3 MB of HLSL; more than one measurement per variant. AI use: Claude Code (Claude Opus 5.5) wrote the measurement harness, ran it and wrote this comment. No shader code or names are included.
Author
Owner

@⁠jessenic on GitHub · 2026-11-24 16:12 UTC · original

Test report for 95f34c1 in the retail title's story load, together with #1288, on native Windows.

Tested

  • RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB RAM, Windows 11 Pro 26300, rustc 1.97.0, release build.
  • Tree: main 930e8b4 + #1288 (95299f4) + #684 (e56dbc3) + this PR (95f34c1), merged locally without conflicts.
  • XCL_HEAP_WINDOWS=1 (the log confirms "memory windows from the shared descriptor heap"). No XCL_PSO_WAIT_MS, so binds wait. XCL_NETWORK=0. Scripted input, save past the first-run menus. 420 s per run, two runs back to back.
  • The comparison is the same tree without this PR (#1288 only), from an earlier run on the same day with warm caches.
  • No offline pipeline pass. The test suite was not run.

Result

  • Both runs went the full 420 s and exited normally. 0 draws or dispatches skipped. No device removal, and no refused pipeline: no "switch form" fallback lines.
  • No frame after the intro in any of the three runs. The last present was at 114 s and 100 s with this PR, and ~102 s without it. The title waits in binds for compute pipelines the driver is building.

Driver time per compute pipeline compiled in the run (blobs from earlier runs left out), by DXIL size:

DXIL size without this PR with it, run 1 (cold: new cache keys) with it, run 2
< 64 KB 188 builds, 6.3 s 255 builds, 33.6 s 268 builds, 9.4 s
64–256 KB 18 builds, 46.9 s (max 7.4 s) 113 builds, 176.8 s (max 5.9 s) 17 builds, 19.8 s (max 2.4 s)
256 KB – 1 MB 23 builds, 514.1 s (avg 22.4 s, max 40.3 s) 43 builds, 436.0 s (avg 10.1 s, max 39.3 s) 34 builds, 249.0 s (avg 7.3 s, max 26.2 s)
≥ 1 MB 1 build, 93.5 s – 3 builds, 336.1 s (max 173.0 s)
all 230 builds, 660.8 s 411 builds, 646.3 s 322 builds, 614.4 s
  • The programs differ between runs: the heap form changes the DXIL, and each run reaches a different part of the world load. So this compares size classes, not program by program.
  • In the 256 KB – 1 MB class the average build is 2.2–3× shorter, and the title got further through its programs: 34 of these built after 100 s, against 18 without the PR.
  • The total stays about the same because the title then reaches programs of 1 MB and more. Three of them took 336 s, one alone 173 s. Those are now what keeps it from presenting again here (#1269, #1316).

Not tested

  • The test suite and scripts/smoke.ps1 on this tree.
  • Longer runs, so whether frames resume once the ≥ 1 MB programs are built.
  • Combined with an offline xcl pipelines pass. AMD.

AI use: Claude Code (Claude Opus 5.5) built the tree, ran the title on this PC, took the counts from XCL's logs and wrote this report.

**@⁠jessenic** on GitHub · 2026-11-24 16:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7137279333) Test report for `95f34c1` in the retail title's story load, together with #1288, on native Windows. **Tested** - RTX 5070 Ti 16 GB (driver 610.88), Ryzen 7 9700X, 32 GB RAM, Windows 11 Pro 26300, rustc 1.97.0, release build. - Tree: `main` `930e8b4` + #1288 (`95299f4`) + #684 (`e56dbc3`) + this PR (`95f34c1`), merged locally without conflicts. - `XCL_HEAP_WINDOWS=1` (the log confirms "memory windows from the shared descriptor heap"). No `XCL_PSO_WAIT_MS`, so binds wait. `XCL_NETWORK=0`. Scripted input, save past the first-run menus. 420 s per run, two runs back to back. - The comparison is the same tree without this PR (#1288 only), from an earlier run on the same day with warm caches. - No offline pipeline pass. The test suite was not run. **Result** - Both runs went the full 420 s and exited normally. 0 draws or dispatches skipped. No device removal, and no refused pipeline: no "switch form" fallback lines. - No frame after the intro in any of the three runs. The last present was at 114 s and 100 s with this PR, and ~102 s without it. The title waits in binds for compute pipelines the driver is building. Driver time per compute pipeline compiled in the run (blobs from earlier runs left out), by DXIL size: | DXIL size | without this PR | with it, run 1 (cold: new cache keys) | with it, run 2 | |---|---|---|---| | < 64 KB | 188 builds, 6.3 s | 255 builds, 33.6 s | 268 builds, 9.4 s | | 64–256 KB | 18 builds, 46.9 s (max 7.4 s) | 113 builds, 176.8 s (max 5.9 s) | 17 builds, 19.8 s (max 2.4 s) | | 256 KB – 1 MB | 23 builds, 514.1 s (avg 22.4 s, max 40.3 s) | 43 builds, 436.0 s (avg 10.1 s, max 39.3 s) | 34 builds, 249.0 s (avg 7.3 s, max 26.2 s) | | ≥ 1 MB | 1 build, 93.5 s | – | 3 builds, 336.1 s (max 173.0 s) | | all | 230 builds, 660.8 s | 411 builds, 646.3 s | 322 builds, 614.4 s | - The programs differ between runs: the heap form changes the DXIL, and each run reaches a different part of the world load. So this compares size classes, not program by program. - In the 256 KB – 1 MB class the average build is 2.2–3× shorter, and the title got further through its programs: 34 of these built after 100 s, against 18 without the PR. - The total stays about the same because the title then reaches programs of 1 MB and more. Three of them took 336 s, one alone 173 s. Those are now what keeps it from presenting again here (#1269, #1316). **Not tested** - The test suite and `scripts/smoke.ps1` on this tree. - Longer runs, so whether frames resume once the ≥ 1 MB programs are built. - Combined with an offline `xcl pipelines` pass. AMD. *AI use: Claude Code (Claude Opus 5.5) built the tree, ran the title on this PC, took the counts from XCL's logs and wrote this report.*
Author
Owner

@⁠Razen114514 on GitHub · 2026-11-24 16:25 UTC · original

RTX 5060 8 GB / native Windows: independent #680 test report

Tested — unchanged worktrees, PR head 95f34c1 and its merge-base 09940bb. Windows 11 26200.9974, inbox D3D12Core 10.0.26100.9818, desktop RTX 5060 8 GB driver 621.01 (32.0.16.2101), i5-13490F, 32 GB RAM, DXC 1.9.2602.17, Rust/Cargo 1.100.0 MSVC, debug. XCL_ADAPTER=RTX 5060, no private samples; network disabled in XCL.

Commands: cargo build --workspace --offline --locked and cargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4. Separate scratch/cache directories per run.

Commit / mode Cargo passed Failed Ignored Explicit skips counted as passed by Cargo
Merge-base 09940bb, default 713 3 41 2
PR 95f34c1, XCL_HEAP_WINDOWS unset 719 3 41 3
PR 95f34c1, XCL_HEAP_WINDOWS=1 719 3 41 2

All three runs reproduced #718: placed_title_textures_share_vram_and_preserve_pixels fails at the cubemap page-reuse assertion, followed by PoisonError in transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory. No additional failing test was observed on this PR head relative to the merge-base in these runs. All three skipped gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64). The PR's fallback test additionally skipped when heap windows were off (expected) and passed when enabled.

The separately targeted run on the PR head passed the switch/heap memory-window checks, the out-of-UMA alias check, and raw-view readback at the top of the sparse 4 GiB window. With XCL_HEAP_WINDOWS=1 the real RTX 5060 D3D12 integration test injected E_OUTOFMEMORY, logged one retry in switch form, and built and exercised the translated compute pipeline. No real driver OOM was observed by that test; the failure was injected.

Not tested — retail input, world-load performance, large-pipeline compiler aborts, or gameplay. This is not a clean suite: all three Cargo runs exited 101 for the failures above.

AI use — OpenAI Codex assisted with running and summarizing the tests; the exact model identifier was not exposed in the session.

**@⁠Razen114514** on GitHub · 2026-11-24 16:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7137652974) ### RTX 5060 8 GB / native Windows: independent #680 test report **Tested** — unchanged worktrees, PR head [95f34c1](https://github.com/ivall/xcl/commit/95f34c1d1a24f644d0c4895810a7c36910b123e8) and its merge-base [09940bb](https://github.com/ivall/xcl/commit/09940bb87fa11bc394fd9e5de570c2b7cfd16323). Windows 11 26200.9974, inbox D3D12Core 10.0.26100.9818, desktop RTX 5060 8 GB driver 621.01 (32.0.16.2101), i5-13490F, 32 GB RAM, DXC 1.9.2602.17, Rust/Cargo 1.100.0 MSVC, debug. `XCL_ADAPTER=RTX 5060`, no private samples; network disabled in XCL. Commands: `cargo build --workspace --offline --locked` and `cargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4`. Separate scratch/cache directories per run. | Commit / mode | Cargo passed | Failed | Ignored | Explicit skips counted as passed by Cargo | |---|---:|---:|---:|---:| | Merge-base `09940bb`, default | 713 | 3 | 41 | 2 | | PR `95f34c1`, `XCL_HEAP_WINDOWS` unset | 719 | 3 | 41 | 3 | | PR `95f34c1`, `XCL_HEAP_WINDOWS=1` | 719 | 3 | 41 | 2 | All three runs reproduced [#718](https://github.com/ivall/xcl/issues/718): `placed_title_textures_share_vram_and_preserve_pixels` fails at the cubemap page-reuse assertion, followed by `PoisonError` in `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory`. No additional failing test was observed on this PR head relative to the merge-base in these runs. All three skipped `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). The PR's fallback test additionally skipped when heap windows were off (expected) and passed when enabled. The separately targeted run on the PR head passed the switch/heap memory-window checks, the out-of-UMA alias check, and raw-view readback at the top of the sparse 4 GiB window. With `XCL_HEAP_WINDOWS=1` the real RTX 5060 D3D12 integration test injected `E_OUTOFMEMORY`, logged one retry in switch form, and built and exercised the translated compute pipeline. No real driver OOM was observed by that test; the failure was injected. **Not tested** — retail input, world-load performance, large-pipeline compiler aborts, or gameplay. This is not a clean suite: all three Cargo runs exited 101 for the failures above. **AI use** — OpenAI Codex assisted with running and summarizing the tests; the exact model identifier was not exposed in the session.
Author
Owner

@⁠t4l03 on GitHub · 2026-11-24 16:39 UTC · original

RTX 4070 Ti, four windows: ActivateRays with #1448 + #680

This adds an Ada result next to the RTX 5090 comparison in #1269. I used #1448 6c7bb05baa6f3bcb278f156e3473d377e42163b7 with the three commits through #680 95f34c1d1a24f644d0c4895810a7c36910b123e8 applied in a scratch checkout. The one conflict moved heap-window flag normalization into the shared prepare() entry point. The emitted HLSL differed from #1448 only in the memory accessors, with the same 2,516 cases and static samplers.

  • RTX 4070 Ti 617.14, Ryzen 7 7800X3D, Windows 11 26300, DXC/validator 1.9.2609.5, cs_6_6 -HV 2021 -O1. Heap-window emission compiled in 16.91 s to 2,560,312 B DXIL and passed validation.
  • Two standalone pipeline runs completed in 81.49 s / 78.11 s, at 4.340 / 4.338 GiB peak process commit. Both saved a 1,824,718 B driver blob.
  • The same #1448 output with switch windows hit the 6 GiB cap twice. #1380's root-UAV load selection finished in 128.66 s / 113.77 s at 4.688 / 4.707 GiB.
  • Runs were serial, with distinct helper names, empty XCL caches and NVIDIA global DXCache enabled. This measures standalone PSO creation through the same compute ABI probe. Heap binding, retail dispatch and the full-title behavior remain untested.

AI use: GLM-5.3 via T3 Code prepared the scratch emitter stacks. Codex via T3 Code (gpt-6.2-sol) ran the DXIL validation and driver measurements and wrote this report.

**@⁠t4l03** on GitHub · 2026-11-24 16:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138009098) **RTX 4070 Ti, four windows: `ActivateRays` with #1448 + #680** This adds an Ada result next to the RTX 5090 comparison in #1269. I used #1448 `6c7bb05baa6f3bcb278f156e3473d377e42163b7` with the three commits through #680 `95f34c1d1a24f644d0c4895810a7c36910b123e8` applied in a scratch checkout. The one conflict moved heap-window flag normalization into the shared `prepare()` entry point. The emitted HLSL differed from #1448 only in the memory accessors, with the same 2,516 cases and static samplers. - RTX 4070 Ti 617.14, Ryzen 7 7800X3D, Windows 11 26300, DXC/validator 1.9.2609.5, `cs_6_6 -HV 2021 -O1`. Heap-window emission compiled in 16.91 s to 2,560,312 B DXIL and passed validation. - Two standalone pipeline runs completed in **81.49 s / 78.11 s**, at **4.340 / 4.338 GiB** peak process commit. Both saved a 1,824,718 B driver blob. - The [same #1448 output with switch windows](https://github.com/ivall/xcl/pull/1448#issuecomment-7137576773) hit the 6 GiB cap twice. [#1380's root-UAV load selection](https://github.com/ivall/xcl/pull/1380#issuecomment-7137941390) finished in 128.66 s / 113.77 s at 4.688 / 4.707 GiB. - Runs were serial, with distinct helper names, empty XCL caches and NVIDIA global DXCache enabled. This measures standalone PSO creation through the same compute ABI probe. Heap binding, retail dispatch and the full-title behavior remain untested. **AI use:** GLM-5.3 via T3 Code prepared the scratch emitter stacks. Codex via T3 Code (`gpt-6.2-sol`) ran the DXIL validation and driver measurements and wrote this report.
Author
Owner

@⁠Creaa on GitHub · 2026-11-24 16:59 UTC · original

Test report: 95f34c1 on an RTX 4070 (32-lane waves). The heap form roughly halves the NVIDIA driver's compile time of the compute programs a cutscene waits on, and cuts the slowest one from 48.6 s to 11.0 s; the driver refused nothing.

Setup: RTX 4070 12 GB (driver 617.14), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2602.17. Release builds for the measurements, split wave64 and 4 memory windows as the runtime picks them on this card.

Driver compile time, cold (xcl shaders <folder> --precompile --only cs, then --pipelines on the same cache, so the second run is the driver; the NVIDIA shader cache folder emptied before every run, a new XCL_DXIL_CACHE per run, XCL_PIPELINE_THREADS=1; times are the process's wall time and include its start; runs in A-B-B-A order)

DXIL DXC driver
billboard_nobump:CS_RaytracingResolve (6e3fd903765f4376, 16 414 instructions, wave32), main 930e8b4 1 092 324 B 12.8 / 12.7 s 48.4 / 48.8 s
same, this PR, XCL_HEAP_WINDOWS=1 866 248 B 9.7 / 9.0 s 10.6 / 11.3 s
31 compute programs a cutscene waited on in two title runs (below), main 12 234 380 B 23.3 / 24.8 s 198.6 / 210.4 s
same 31, this PR, XCL_HEAP_WINDOWS=1 10 396 596 B 19.7 / 21.2 s 106.4 / 101.8 s
  • Pipelines refused by the driver: 0 in every run, in both forms.
  • For scale, the same RaytracingResolve translated for a single window (not a valid translation, only to see what the switch costs): 697 600 B, driver 9.3 / 9.1 s. So on this card the per-access window switch is most of that program's driver time, and this PR gets nearly all of it back.
  • The 31: InstanceCulling (6), cascadeshadows_rendering (10), billboard_nobump:CS_RaytracingResolve (3), bvh_skinning (2), ped_skinning (2), hair_resolve (3), compute_graph_ops (2), tiled_lighting:CS_ClusterLightsWorldSpace, vfx_proj_decal_vbuffer (2). In a title run with #1316 on main, the scene stopped presenting while the driver built these, 2–55 s each, and the title's watchdog (+0x23cf683) ended it about 29 s later.

Title run with a local merge of main 930e8b4 + this PR + #1316 ee904f1, XCL_HEAP_WINDOWS=1, NVIDIA shader cache empty (colder than the two runs it is compared with): no compute pipeline refused and no switch-form fallback in the log; the slowest compute build was 11.4 s. The scene presented up to about 104 s (about 90 and 96 s in the two runs without this PR) and the watchdog ended it at 132.8 s (119.7 and 124.8 s): it got further, but new compute programs still came faster than the cold driver built them. One run each, so no more than that.

Tests

  • This PR as it is, cargo test --workspace -- --test-threads=4: the lib binary 677 passed, 3 failed, 21 ignored (title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, title_textures::tests::transitions_apply_when_their_list_is_submitted, vram::tests::d32s8_targets_take_their_own_size_of_video_memory), the same with XCL_HEAP_WINDOWS=1. The same three fail on its merge base 09940bb (two alternated runs each) and pass on current main, so they look like the base, not this PR; a rebase should clear them.
  • The local merge above (main + this PR + #1316; the one conflict, in gpu/recomp/mod.rs, resolved by keeping #1316's prepare split and putting this PR's HEAP_WINDOWS normalisation at the top of both translate and translate_as): 779 passed, 0 failed, 41 ignored, both without and with XCL_HEAP_WINDOWS=1. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, gpu_compact_native_wave64_form (no wave64).

Not tested: AMD; other NVIDIA drivers (the refusals reported on driver 32.0.16.2101 did not happen on 617.14 here); scripts/smoke.ps1; a title run of this PR alone, or with warm caches.

AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and measurements on my machine and drafted this comment; I checked it before posting.

**@⁠Creaa** on GitHub · 2026-11-24 16:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138513069) **Test report: `95f34c1` on an RTX 4070 (32-lane waves). The heap form roughly halves the NVIDIA driver's compile time of the compute programs a cutscene waits on, and cuts the slowest one from 48.6 s to 11.0 s; the driver refused nothing.** Setup: RTX 4070 12 GB (driver 617.14), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2602.17. Release builds for the measurements, split wave64 and 4 memory windows as the runtime picks them on this card. **Driver compile time, cold** (`xcl shaders <folder> --precompile --only cs`, then `--pipelines` on the same cache, so the second run is the driver; the NVIDIA shader cache folder emptied before every run, a new `XCL_DXIL_CACHE` per run, `XCL_PIPELINE_THREADS=1`; times are the process's wall time and include its start; runs in A-B-B-A order) | | DXIL | DXC | driver | |---|---|---|---| | `billboard_nobump:CS_RaytracingResolve` (`6e3fd903765f4376`, 16 414 instructions, wave32), `main` `930e8b4` | 1 092 324 B | 12.8 / 12.7 s | **48.4 / 48.8 s** | | same, this PR, `XCL_HEAP_WINDOWS=1` | 866 248 B | 9.7 / 9.0 s | **10.6 / 11.3 s** | | 31 compute programs a cutscene waited on in two title runs (below), `main` | 12 234 380 B | 23.3 / 24.8 s | **198.6 / 210.4 s** | | same 31, this PR, `XCL_HEAP_WINDOWS=1` | 10 396 596 B | 19.7 / 21.2 s | **106.4 / 101.8 s** | - Pipelines refused by the driver: 0 in every run, in both forms. - For scale, the same RaytracingResolve translated for a single window (not a valid translation, only to see what the switch costs): 697 600 B, driver 9.3 / 9.1 s. So on this card the per-access window switch is most of that program's driver time, and this PR gets nearly all of it back. - The 31: `InstanceCulling` (6), `cascadeshadows_rendering` (10), `billboard_nobump:CS_RaytracingResolve` (3), `bvh_skinning` (2), `ped_skinning` (2), `hair_resolve` (3), `compute_graph_ops` (2), `tiled_lighting:CS_ClusterLightsWorldSpace`, `vfx_proj_decal_vbuffer` (2). In a title run with #1316 on `main`, the scene stopped presenting while the driver built these, 2–55 s each, and the title's watchdog (`+0x23cf683`) ended it about 29 s later. **Title run** with a local merge of `main` `930e8b4` + this PR + #1316 `ee904f1`, `XCL_HEAP_WINDOWS=1`, NVIDIA shader cache empty (colder than the two runs it is compared with): no compute pipeline refused and no switch-form fallback in the log; the slowest compute build was 11.4 s. The scene presented up to about 104 s (about 90 and 96 s in the two runs without this PR) and the watchdog ended it at 132.8 s (119.7 and 124.8 s): it got further, but new compute programs still came faster than the cold driver built them. One run each, so no more than that. **Tests** - This PR as it is, `cargo test --workspace -- --test-threads=4`: the lib binary 677 passed, 3 failed, 21 ignored (`title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels`, `title_textures::tests::transitions_apply_when_their_list_is_submitted`, `vram::tests::d32s8_targets_take_their_own_size_of_video_memory`), the same with `XCL_HEAP_WINDOWS=1`. The same three fail on its merge base `09940bb` (two alternated runs each) and pass on current `main`, so they look like the base, not this PR; a rebase should clear them. - The local merge above (`main` + this PR + #1316; the one conflict, in `gpu/recomp/mod.rs`, resolved by keeping #1316's `prepare` split and putting this PR's `HEAP_WINDOWS` normalisation at the top of both `translate` and `translate_as`): 779 passed, 0 failed, 41 ignored, both without and with `XCL_HEAP_WINDOWS=1`. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `gpu_compact_native_wave64_form` (no wave64). **Not tested:** AMD; other NVIDIA drivers (the refusals reported on driver 32.0.16.2101 did not happen on 617.14 here); `scripts/smoke.ps1`; a title run of this PR alone, or with warm caches. AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and measurements on my machine and drafted this comment; I checked it before posting.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 17:03 UTC · original

@⁠CharlyRien thank you – the view's cap is in as a fourth commit (deb4b92, "Recompiler: a heap window's view ends 32 bytes below 4 GiB"), with your report named in the commit and in the description. The branch is also rebased onto main b7aa9f3.

  • raw_window_uav caps at 4 GiB − 32 bytes, and gpu_raw_window_view_reaches_its_top checks up to the new end (lanes 0 to 55 of the last 256 bytes).
  • On this PC (Windows 10 19045 with the Agility SDK, RTX 5080) the larger view was never refused, so here the commit is only checked for doing no harm: suite 776 passed, 0 failed, 41 ignored, as it is and with XCL_HEAP_WINDOWS=1; regression blocks 1378 (main), 1388 (PR), 1401 (PR with the form on). That the removal is gone on a 23H2 runtime rests on your two title runs with the same change.
  • The description no longer calls the device removal unexplained. It says a cause that fits was found on your machine, and that it is not confirmed for @⁠ryosen0's. @⁠ryosen0, if you can run this head with XCL_HEAP_WINDOWS=1 once, that would settle it.

@⁠brothernog yes, gladly, with your authorship kept. Either way works: a PR against imnicho/xcl recomp-heap-windows (now at deb4b92), or a branch I can cherry-pick from. The cap is already there, so your patch would carry the branch-free min(xcl_w, N) + null view form and the AtomicInt64OnDescriptorHeapResourceSupported check. I will then run the suite both ways and the three regression blocks on the new head, time the same 83 programs as in the description against the current heap form, and update the description with your numbers and mine. Since the form changes the heap-form HLSL, its cache entries change with it; the switch form and main's keys stay as they are.

AI use: Claude Code with Claude Fable 5.2 made the commit, ran the tests and wrote this reply.

**@⁠imnicho** on GitHub · 2026-11-24 17:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138628713) @⁠CharlyRien thank you – the view's cap is in as a fourth commit (`deb4b92`, "Recompiler: a heap window's view ends 32 bytes below 4 GiB"), with your report named in the commit and in the description. The branch is also rebased onto `main` `b7aa9f3`. - `raw_window_uav` caps at 4 GiB − 32 bytes, and `gpu_raw_window_view_reaches_its_top` checks up to the new end (lanes 0 to 55 of the last 256 bytes). - On this PC (Windows 10 19045 with the Agility SDK, RTX 5080) the larger view was never refused, so here the commit is only checked for doing no harm: suite 776 passed, 0 failed, 41 ignored, as it is and with `XCL_HEAP_WINDOWS=1`; regression blocks 1378 (`main`), 1388 (PR), 1401 (PR with the form on). That the removal is gone on a 23H2 runtime rests on your two title runs with the same change. - The description no longer calls the device removal unexplained. It says a cause that fits was found on your machine, and that it is not confirmed for @⁠ryosen0's. @⁠ryosen0, if you can run this head with `XCL_HEAP_WINDOWS=1` once, that would settle it. @⁠brothernog yes, gladly, with your authorship kept. Either way works: a PR against `imnicho/xcl` `recomp-heap-windows` (now at `deb4b92`), or a branch I can cherry-pick from. The cap is already there, so your patch would carry the branch-free `min(xcl_w, N)` + null view form and the `AtomicInt64OnDescriptorHeapResourceSupported` check. I will then run the suite both ways and the three regression blocks on the new head, time the same 83 programs as in the description against the current heap form, and update the description with your numbers and mine. Since the form changes the heap-form HLSL, its cache entries change with it; the switch form and `main`'s keys stay as they are. AI use: Claude Code with Claude Fable 5.2 made the commit, ran the tests and wrote this reply.
Author
Owner

@⁠dreakthebot on GitHub · 2026-11-24 16:59 UTC · original · edited 2026-11-24 17:04 UTC

RTX 3060: DXIL shape measurement for heap windows

I applied #680's patch locally to main 930e8b4 and compared the switch and heap-window forms on the same 83 compute programs selected by xcl shaders --precompile --only cs --limit 22240. Setup: Windows 11, RTX 3060 12 GB (split wave64), 16 GB RAM, DXC 1.9.2602.0, four memory windows, release builds, separate DXIL caches.

I disassembled each resulting DXIL file with DXC and counted lines containing a block label's preds = annotation and lines defining an SSA value (%... =). The last row sums labels × definitions per program; it is not the product of the two column totals.

Sum across 83 programs Switch Heap windows Change
DXIL bytes 8,586,036 7,101,992 −17.3%
Annotated block labels 92,043 67,373 −26.8%
SSA definition lines 1,001,891 917,165 −8.5%
Sum of labels × definitions per program 3.89B 2.16B −44.5%

For a clean repeat of the pipeline pass, no other XCL process was running. I used fresh executable paths, populated DXIL caches, XCL_PIPELINE_THREADS=1, and XCL_PSO_DISK_CACHE=0. The whole --pipelines command took 145.2 s with switches and 91.5 s with heap windows (−37.0%). Both made 83 pipelines, refused 0, and loaded 0 from XCL's driver-blob cache. This is one clean pass per form; the command time includes reading and scanning the pack and is not pure driver compile time.

These are DXIL disassembly counts, not NVIDIA's internal block or live-variable counts. The direction is consistent with the block × variable cost reported in #1269 (https://github.com/ivall/xcl/issues/1269#issuecomment-7135639473), but this measurement does not establish that the driver's memory use fell by 44.5%. In separate 45-second title smoke runs, both forms exited normally with no crash or device removal; neither run built a translated pipeline, so those runs cover startup only.

AI use: Codex (GPT-6 Sol, highest reasoning effort) wrote the local measurement tool, verified the runs, and drafted this report.

**@⁠dreakthebot** on GitHub · 2026-11-24 16:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138528758) · edited 2026-11-24 17:04 UTC RTX 3060: DXIL shape measurement for heap windows I applied #680's patch locally to main 930e8b4 and compared the switch and heap-window forms on the same 83 compute programs selected by xcl shaders <pack> --precompile --only cs --limit 22240. Setup: Windows 11, RTX 3060 12 GB (split wave64), 16 GB RAM, DXC 1.9.2602.0, four memory windows, release builds, separate DXIL caches. I disassembled each resulting DXIL file with DXC and counted lines containing a block label's preds = annotation and lines defining an SSA value (%... =). The last row sums labels × definitions per program; it is not the product of the two column totals. | Sum across 83 programs | Switch | Heap windows | Change | |---|---:|---:|---:| | DXIL bytes | 8,586,036 | 7,101,992 | −17.3% | | Annotated block labels | 92,043 | 67,373 | −26.8% | | SSA definition lines | 1,001,891 | 917,165 | −8.5% | | Sum of labels × definitions per program | 3.89B | 2.16B | −44.5% | For a clean repeat of the pipeline pass, no other XCL process was running. I used fresh executable paths, populated DXIL caches, XCL_PIPELINE_THREADS=1, and XCL_PSO_DISK_CACHE=0. The whole --pipelines command took 145.2 s with switches and 91.5 s with heap windows (−37.0%). Both made 83 pipelines, refused 0, and loaded 0 from XCL's driver-blob cache. This is one clean pass per form; the command time includes reading and scanning the pack and is not pure driver compile time. These are DXIL disassembly counts, not NVIDIA's internal block or live-variable counts. The direction is consistent with the block × variable cost reported in #1269 (https://github.com/ivall/xcl/issues/1269#issuecomment-7135639473), but this measurement does not establish that the driver's memory use fell by 44.5%. In separate 45-second title smoke runs, both forms exited normally with no crash or device removal; neither run built a translated pipeline, so those runs cover startup only. AI use: Codex (GPT-6 Sol, highest reasoning effort) wrote the local measurement tool, verified the runs, and drafted this report.
Author
Owner

@⁠ivall on GitHub · 2026-11-24 17:08 UTC · original

Merged as 9e3831e, opt-in as it is (XCL_HEAP_WINDOWS=1). Thank you, and thanks to everyone who measured it.

Tested on the merge of deb4b92 into main b7aa9f3 (AMD RDNA4, native wave64, Windows, DXC 1.8.2502.11, debug), cargo test --workspace --no-fail-fast -- --test-threads=4:

  • XCL_HEAP_WINDOWS unset: 776 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • XCL_HEAP_WINDOWS=1: 776 passed, 0 failed, 41 ignored, no SKIPPED.

Open before this can be a default anywhere:

  1. @⁠Natakout's title run: acceleration structures at addresses above 2^40 with the heap form, and in one of two runs xboxbvhbuilder's "can not have more than 40b of address set" exception (on main they are at 0x19xxxxxxx). It has no answer yet. @⁠imnicho, can you look at which addresses the buffers get with the option on and off, and why it would change them? @⁠Natakout, is it there again on this commit, and does it stay away with the variable unset?
  2. The compiler fast-fail on an RTX 4090 and a 3080 Ti with 621.24 (@⁠tycosnh, @⁠LeonardoS11). It was not seen on a 5080 and a 5090 with that driver, nor on a 4090 with 621.01.
  3. @⁠ryosen0's 8 GB card with the new cap of the views.

@⁠brothernog: your branch-free form (min and a null view) and the AtomicInt64OnDescriptorHeapResourceSupported check are welcome as a PR against main now.

Not tested: a title run, compile times on this card.

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

**@⁠ivall** on GitHub · 2026-11-24 17:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138740853) Merged as 9e3831e, opt-in as it is (`XCL_HEAP_WINDOWS=1`). Thank you, and thanks to everyone who measured it. **Tested** on the merge of `deb4b92` into `main` `b7aa9f3` (AMD RDNA4, native wave64, Windows, DXC 1.8.2502.11, debug), `cargo test --workspace --no-fail-fast -- --test-threads=4`: - `XCL_HEAP_WINDOWS` unset: 776 passed, 0 failed, 41 ignored. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `XCL_HEAP_WINDOWS=1`: 776 passed, 0 failed, 41 ignored, no SKIPPED. **Open before this can be a default anywhere:** 1. @⁠Natakout's title run: acceleration structures at addresses above 2^40 with the heap form, and in one of two runs `xboxbvhbuilder`'s "can not have more than 40b of address set" exception (on `main` they are at `0x19xxxxxxx`). It has no answer yet. @⁠imnicho, can you look at which addresses the buffers get with the option on and off, and why it would change them? @⁠Natakout, is it there again on this commit, and does it stay away with the variable unset? 2. The compiler fast-fail on an RTX 4090 and a 3080 Ti with 621.24 (@⁠tycosnh, @⁠LeonardoS11). It was not seen on a 5080 and a 5090 with that driver, nor on a 4090 with 621.01. 3. @⁠ryosen0's 8 GB card with the new cap of the views. @⁠brothernog: your branch-free form (`min` and a null view) and the `AtomicInt64OnDescriptorHeapResourceSupported` check are welcome as a PR against `main` now. **Not tested:** a title run, compile times on this card. AI use: Claude Code (Claude Opus 5.5) read the changes, ran the tests and wrote this.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 17:21 UTC · original

A data point for the opt-in after merge, since two NVIDIA setups had trouble with it: XCL_HEAP_WINDOWS=1 on an RTX 3060 12 GB (581.80, wave32), Windows 11 26200, 64 GB RAM, main 9e3831e, release, retail title's world loading, 300 s runs with A pressed every 4 s from 20 s, XCL_PSO_PRELOAD=0, XCL_NETWORK=0.

  • No driver crash and no device removal in two runs (the first with a cold DXIL cache for the heap form, the second warm).
  • Compute pipelines built fresh in the driver (compute PSO … ms lines without "the driver's blob"): run 1: 42, 17 s in all, 2 over 3 s; run 2: 124, 54 s, 5 over 3 s. The run just before on main cbea872 (switch form, same settings plus XCL_PSO_WAIT_MS=1000) had 80 fresh builds after 75 s alone, 108 s of driver time, 10 over 3 s (up to 17.6 s).
  • Peak commit 28.1 / 28.6 GB.
  • The title still stops: presents 0 from 74–84 s, its own watchdog (+0x23cf683) at 113 s and 102 s, against 105 s with the switch form. So on this card the heap form cuts the driver's share a lot, but not enough to get through the world load.

One or two runs per setting.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 17:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7139081622) A data point for the opt-in after merge, since two NVIDIA setups had trouble with it: `XCL_HEAP_WINDOWS=1` on an RTX 3060 12 GB (581.80, wave32), Windows 11 26200, 64 GB RAM, `main` `9e3831e`, release, retail title's world loading, 300 s runs with A pressed every 4 s from 20 s, `XCL_PSO_PRELOAD=0`, `XCL_NETWORK=0`. - No driver crash and no device removal in two runs (the first with a cold DXIL cache for the heap form, the second warm). - Compute pipelines built fresh in the driver (`compute PSO … ms` lines without "the driver's blob"): run 1: 42, 17 s in all, 2 over 3 s; run 2: 124, 54 s, 5 over 3 s. The run just before on `main` `cbea872` (switch form, same settings plus `XCL_PSO_WAIT_MS=1000`) had 80 fresh builds after 75 s alone, 108 s of driver time, 10 over 3 s (up to 17.6 s). - Peak commit 28.1 / 28.6 GB. - The title still stops: presents 0 from 74–84 s, its own watchdog (`+0x23cf683`) at 113 s and 102 s, against 105 s with the switch form. So on this card the heap form cuts the driver's share a lot, but not enough to get through the world load. One or two runs per setting. Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 17:13 UTC · original · edited 2026-11-24 17:23 UTC

@⁠ivall thank you for merging it. On point 1 (@⁠Natakout's acceleration structures above 2^40), here is what I can say from this machine and from the code, and what would settle it.

Measured here (RTX 5080 16 GB, driver 610.47, Windows 10 19045; stacks on main b8b1f49 / 930e8b4 with this PR, the option off and on)

  • The windows' buffers get the same GPU address either way: window 0 buffer at VA 0x3e0400000 in 4 runs with the option off and 4 with it on. The windows are at the same title addresses too (16 GiB from 0x400000000 here).
  • Four runs with the option on went 759 to 793 s past the world's set-up (binds waiting, nothing skipped). Their logs have no CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) … is not in unified memory line and no xboxbvhbuilder error. But on this CPU the title is still waiting for pipelines then and has not built an acceleration structure yet, so these runs do not test the report. I cannot reproduce it here.
  • Added after a probe on this GPU: a buffer in the acceleration-structure state (with ALLOW_UNORDERED_ACCESS) can be made here in every way the placement tries: as a reserved resource, placed in a buffer heap, placed in a shared cross-adapter heap, and committed. So on this runtime (Agility SDK 1.620, Windows 10) the state itself is not what makes a placement fail; an older D3D12 runtime may differ, as with the raw view.

From the code

  • The address a title gets for a buffer comes from res_gpu_va_x. For a buffer that place_console_buffer put in a window it is the window's address, a console address far below 2^40. A buffer it did not place is a plain PC resource, and the title gets the driver's GetGPUVirtualAddress, which nothing keeps under 40 bits.
  • place_console_buffer gives up when sparse::alloc has no room in the sparse windows or cannot commit the CPU pages, when CreateReservedResource refuses, and then when the coherent window has no room or CreatePlacedResource refuses (only that last case is logged: console buffer in UMA: CreatePlacedResource … keeping a separate resource, once).
  • The option is not on that path. It is read in pso.rs (the form and the cache keys), once in the windows' set-up (set_window_views: four views in the shared descriptor heap, which is then made at start instead of at first use) and where a list gets the shared heap bound. It makes no buffer and changes no placement.
  • The line Natakout quotes is printed only for a view whose address is outside the windows. So in the runs with the option on, the structure's buffer was a PC resource. If the 0x19xxxxxxx of the main run was read from the same warning, it was one on main too. Then both forms hand the title a driver address, and the difference is how high the driver's addresses are at that moment. That would make this a placement problem that the option only shifts (the run is further along at the same second, with other things allocated), not something the heap form does to the buffers.

What would settle it: @⁠Natakout, from the two logs (option on, and main):

  1. the full CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at … line or lines of each, or how the 0x19xxxxxxx was read on main;
  2. the UMA: … coherent window at 0x… line (the windows are the 16 GiB from there), to see whether 0x19xxxxxxx lies inside them;
  3. the last memory: line before it (committed, sparse pools), and whether a console buffer in UMA: CreatePlacedResource line is there.

If it is the unplaced-buffer case, the fix belongs in the placement, not in the heap form: a buffer made in the acceleration-structure state has to end up in a window like the others, or the log has to say why it did not. I can write that once the lines confirm it. I would rather not guess at it blind.

AI use: Claude Code with Claude Fable 5.2 read the code and the logs of this machine's runs and wrote this.

**@⁠imnicho** on GitHub · 2026-11-24 17:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7138884517) · edited 2026-11-24 17:23 UTC @⁠ivall thank you for merging it. On point 1 (@⁠Natakout's acceleration structures above 2^40), here is what I can say from this machine and from the code, and what would settle it. **Measured here** (RTX 5080 16 GB, driver 610.47, Windows 10 19045; stacks on `main` `b8b1f49` / `930e8b4` with this PR, the option off and on) - The windows' buffers get the same GPU address either way: `window 0 buffer at VA 0x3e0400000` in 4 runs with the option off and 4 with it on. The windows are at the same title addresses too (16 GiB from `0x400000000` here). - Four runs with the option on went 759 to 793 s past the world's set-up (binds waiting, nothing skipped). Their logs have no `CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) … is not in unified memory` line and no `xboxbvhbuilder` error. But on this CPU the title is still waiting for pipelines then and has not built an acceleration structure yet, so these runs do not test the report. I cannot reproduce it here. - Added after a probe on this GPU: a buffer in the acceleration-structure state (with `ALLOW_UNORDERED_ACCESS`) can be made here in every way the placement tries: as a reserved resource, placed in a buffer heap, placed in a shared cross-adapter heap, and committed. So on this runtime (Agility SDK 1.620, Windows 10) the state itself is not what makes a placement fail; an older D3D12 runtime may differ, as with the raw view. **From the code** - The address a title gets for a buffer comes from `res_gpu_va_x`. For a buffer that `place_console_buffer` put in a window it is the window's address, a console address far below 2^40. A buffer it did not place is a plain PC resource, and the title gets the driver's `GetGPUVirtualAddress`, which nothing keeps under 40 bits. - `place_console_buffer` gives up when `sparse::alloc` has no room in the sparse windows or cannot commit the CPU pages, when `CreateReservedResource` refuses, and then when the coherent window has no room or `CreatePlacedResource` refuses (only that last case is logged: `console buffer in UMA: CreatePlacedResource … keeping a separate resource`, once). - The option is not on that path. It is read in `pso.rs` (the form and the cache keys), once in the windows' set-up (`set_window_views`: four views in the shared descriptor heap, which is then made at start instead of at first use) and where a list gets the shared heap bound. It makes no buffer and changes no placement. - The line Natakout quotes is printed only for a view whose address is outside the windows. So in the runs with the option on, the structure's buffer was a PC resource. If the `0x19xxxxxxx` of the `main` run was read from the same warning, it was one on `main` too. Then both forms hand the title a driver address, and the difference is how high the driver's addresses are at that moment. That would make this a placement problem that the option only shifts (the run is further along at the same second, with other things allocated), not something the heap form does to the buffers. **What would settle it**: @⁠Natakout, from the two logs (option on, and `main`): 1. the full `CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at …` line or lines of each, or how the `0x19xxxxxxx` was read on `main`; 2. the `UMA: … coherent window at 0x…` line (the windows are the 16 GiB from there), to see whether `0x19xxxxxxx` lies inside them; 3. the last `memory:` line before it (committed, `sparse pools`), and whether a `console buffer in UMA: CreatePlacedResource` line is there. If it is the unplaced-buffer case, the fix belongs in the placement, not in the heap form: a buffer made in the acceleration-structure state has to end up in a window like the others, or the log has to say why it did not. I can write that once the lines confirm it. I would rather not guess at it blind. AI use: Claude Code with Claude Fable 5.2 read the code and the logs of this machine's runs and wrote this.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-24 13:39 UTC · original · edited 2026-11-24 17:30 UTC

Tested

  • RTX 5060 Laptop GPU with 8 GB VRAM, NVIDIA 615.78.08, Intel Core 7 240H, 16 GB RAM, Bazzite 44 Testing, Proton Experimental 11.0-20261112. Windows MSVC release build with our local vkd3d-proton 3.1.0 runtime based on 4522cc1 and dxil-spirv 1dc543f.
  • #680 head 95f34c1d1a24f644d0c4895810a7c36910b123e8 integrated with #759 on base 47efa2e, with local Series X loading changes. The integrated tree was a32268ef4c5c654a16d8857671d74ba84f2b7b34. Ten focused CPU or mocked-device tests passed under Proton. The GPU test binary cross-built.
  • Same executable and runtime for both retail runs, with copied title data, matching previously-used shader keys and fresh compilation caches. With a 5 s bind budget and two large compile slots, XCL_HEAP_WINDOWS=0 reached 2,296 sampled presents with 12 timeout warnings. XCL_HEAP_WINDOWS=1 confirmed descriptor-heap windows in the log and reached 2,370 sampled presents with 14 timeout warnings. Both reached loading artwork and reproduced the title GPU watchdog. Both had zero D3D12 device removals or kernel Xids.

For the combined #680/#759 experiment, I preserved the heap-mode bit in the journal header. #759's one-byte window field would otherwise drop bit 0x100, so replay would select switch-form DXIL for a heap-form record. The focused journal tests include the heap-mode round trip and switch-mode key compatibility.

Follow-up on XCL main 930e8b4

I used xcl shaders folder --precompile --only cs --windows 4 --pipelines on the same seven compute shaders selected from prior bind timeouts. Both runs used the same GPU, installed runtime, two DXC workers and one pipeline worker, with vkd3d-proton's application cache enabled for this offline measurement. The switch-form build compiled all seven in 136.5 seconds. The build with #680 and XCL_HEAP_WINDOWS=1 compiled all seven in 77.3 seconds, about 43% less elapsed time. The latter build also includes #1295, which affects frame-dump target selection. The timing covers translation, DXC and pipeline creation together.

A separate heap-window retail run on the same machine captured loading artwork in both the presented frame and the busiest live render target. Host memory pressure limited that run to the loading milestone.

Validation after merge at 9e3831e

Both new focused regressions ran on the RTX 5060 Laptop GPU under Proton Experimental 11.0-20261112. gpu_raw_window_view_reaches_its_top passed in 0.97 s, and heap_window_out_of_memory_falls_back_to_the_switch_form passed in 0.86 s. The second test observed the switch retry after the injected error and verified the resulting GPU output.

With the same release on the merged main, local Series X loading changes and matching cache/data seeds, the heap-window run confirmed the shared descriptor heap, reached loading artwork, and then the title GPU watchdog (2,480 presents). The switch-form run reached a 240 s test stop and presented black by the last manual capture (2,754 presents). One bind timeout warning and zero storage failures, device removals and kernel GPU faults occurred in each run. Neither run verified world entry.

Not tested

Native Windows, AMD, or rendered gameplay. This paired retail run measures the loading milestone and timeout warnings. It does not isolate driver compile times.

AI use

OpenAI Codex with GPT-6.2-Sol high integrated the local build, ran the tests, and prepared this report.

**@⁠Filip722** on GitHub · 2026-11-24 13:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7133144694) · edited 2026-11-24 17:30 UTC **Tested** - RTX 5060 Laptop GPU with 8 GB VRAM, NVIDIA 615.78.08, Intel Core 7 240H, 16 GB RAM, Bazzite 44 Testing, Proton Experimental 11.0-20261112. Windows MSVC release build with our local vkd3d-proton 3.1.0 runtime based on `4522cc1` and dxil-spirv `1dc543f`. - #680 head `95f34c1d1a24f644d0c4895810a7c36910b123e8` integrated with #759 on base `47efa2e`, with local Series X loading changes. The integrated tree was `a32268ef4c5c654a16d8857671d74ba84f2b7b34`. Ten focused CPU or mocked-device tests passed under Proton. The GPU test binary cross-built. - Same executable and runtime for both retail runs, with copied title data, matching previously-used shader keys and fresh compilation caches. With a 5 s bind budget and two large compile slots, `XCL_HEAP_WINDOWS=0` reached 2,296 sampled presents with 12 timeout warnings. `XCL_HEAP_WINDOWS=1` confirmed descriptor-heap windows in the log and reached 2,370 sampled presents with 14 timeout warnings. Both reached loading artwork and reproduced the title GPU watchdog. Both had zero D3D12 device removals or kernel Xids. For the combined #680/#759 experiment, I preserved the heap-mode bit in the journal header. #759's one-byte window field would otherwise drop bit `0x100`, so replay would select switch-form DXIL for a heap-form record. The focused journal tests include the heap-mode round trip and switch-mode key compatibility. **Follow-up on XCL main `930e8b4`** I used `xcl shaders folder --precompile --only cs --windows 4 --pipelines` on the same seven compute shaders selected from prior bind timeouts. Both runs used the same GPU, installed runtime, two DXC workers and one pipeline worker, with vkd3d-proton's application cache enabled for this offline measurement. The switch-form build compiled all seven in 136.5 seconds. The build with #680 and `XCL_HEAP_WINDOWS=1` compiled all seven in 77.3 seconds, about 43% less elapsed time. The latter build also includes #1295, which affects frame-dump target selection. The timing covers translation, DXC and pipeline creation together. A separate heap-window retail run on the same machine captured loading artwork in both the presented frame and the busiest live render target. Host memory pressure limited that run to the loading milestone. **Validation after merge at `9e3831e`** Both new focused regressions ran on the RTX 5060 Laptop GPU under Proton Experimental 11.0-20261112. `gpu_raw_window_view_reaches_its_top` passed in 0.97 s, and `heap_window_out_of_memory_falls_back_to_the_switch_form` passed in 0.86 s. The second test observed the switch retry after the injected error and verified the resulting GPU output. With the same release on the merged main, local Series X loading changes and matching cache/data seeds, the heap-window run confirmed the shared descriptor heap, reached loading artwork, and then the title GPU watchdog (2,480 presents). The switch-form run reached a 240 s test stop and presented black by the last manual capture (2,754 presents). One bind timeout warning and zero storage failures, device removals and kernel GPU faults occurred in each run. Neither run verified world entry. **Not tested** Native Windows, AMD, or rendered gameplay. This paired retail run measures the loading milestone and timeout warnings. It does not isolate driver compile times. **AI use** OpenAI Codex with GPT-6.2-Sol high integrated the local build, ran the tests, and prepared this report.
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-24 17:48 UTC · original

An NVIDIA data point for the default-off decision: XCL_HEAP_WINDOWS=1 on an RTX 5070 Ti 16 GB (32-lane waves, driver 32.0.16.1742), Ryzen 7 9800X3D, Windows 11 Pro 26300, main 9e3831e, release, the newer retail game, XCL_NETWORK=0 XCL_PSO_PRELOAD=0, 300 s runs into world loading, alternated with the default:

presents end end compute PSO builds over 5 s longest
default 82 s +0x23cf683, 111.6 s 317 1 17.2 s
XCL_HEAP_WINDOWS=1 92 s +0x23cf683, 120.6 s 47 1 5.6 s
default 80 s +0x23cf683, 109.6 s 356 1 20.3 s
XCL_HEAP_WINDOWS=1 82 s +0x23cf683, 110.6 s 132 4 11.0 s
  • No driver-compiler exit and no device removal with heap windows here (neither of the two NVIDIA failures in the heap_windows comment).
  • The longest driver builds are shorter with it; the runs end at the same watchdog stop. The heap-window runs started from a cold DXIL cache for that form, so their build counts are not comparable to the default's.

Not tested: more runs, a warm heap-window cache, an 8 GB card.

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

**@⁠tiagonleal** on GitHub · 2026-11-24 17:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7139736585) An NVIDIA data point for the default-off decision: `XCL_HEAP_WINDOWS=1` on an RTX 5070 Ti 16 GB (32-lane waves, driver 32.0.16.1742), Ryzen 7 9800X3D, Windows 11 Pro 26300, `main` `9e3831e`, release, the newer retail game, `XCL_NETWORK=0 XCL_PSO_PRELOAD=0`, 300 s runs into world loading, alternated with the default: | | presents end | end | compute PSO builds | over 5 s | longest | |---|---|---|---|---|---| | default | 82 s | `+0x23cf683`, 111.6 s | 317 | 1 | 17.2 s | | `XCL_HEAP_WINDOWS=1` | 92 s | `+0x23cf683`, 120.6 s | 47 | 1 | 5.6 s | | default | 80 s | `+0x23cf683`, 109.6 s | 356 | 1 | 20.3 s | | `XCL_HEAP_WINDOWS=1` | 82 s | `+0x23cf683`, 110.6 s | 132 | 4 | 11.0 s | - No driver-compiler exit and no device removal with heap windows here (neither of the two NVIDIA failures in the `heap_windows` comment). - The longest driver builds are shorter with it; the runs end at the same watchdog stop. The heap-window runs started from a cold DXIL cache for that form, so their build counts are not comparable to the default's. Not tested: more runs, a warm heap-window cache, an 8 GB card. Run and written with Claude Code (Claude Opus 5.5).
Author
Owner

@⁠ofc0urse on GitHub · 2026-11-24 17:55 UTC · original

Data on the three open points from the merge comment, from an 8 GB NVIDIA card on driver 621.24, for @⁠Pipodi's list in #1269.

Tested: RTX 4060 Ti 8 GB (Ada, 32-lane waves), driver 621.24, Core i5-14400F, 32 GB RAM, Windows 11 Pro 26300, DXC 1.9.2602.17 (Windows SDK 10.0.26100), release build, XCL_HEAP_WINDOWS=1. Not a clean head: main 9e3831e plus local test-only patches (the title's watchdog thread parked instead of its null write; a DXIL size cap that refused nothing in this run). The precompile below also has #1526 and a log-only patch for big DXC compiles.

3. The 8 GB card. The title run boots and goes on with the heap form: same layout as in @⁠ryosen0's log (UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000, memory windows from the shared descriptor heap at 1.7 s), no CreateHeap ... refused, no 0x887a0005, no device removal. Menus, account select and world loading, last present at 202 s, then a stall on pipeline builds until I stopped it at 560 s (a DXC compile of one of the >8 MB sources took the commit, see #1526). One run.

2. The 621.24 compiler fast-fail. Not seen so far on this card. In the title run, 155 compute builds took 1 s or more in the driver (largest 1,559,432 B of DXIL, 49.2 s), none refused, no Invalid record / Never resolved value abort. The offline pass xcl shaders <pack> --precompile --only cs --pipelines (4 driver threads, the default) is at 925 pipelines made, 0 refused and still running; I will edit this comment when it ends, since @⁠LeonardoS11's 3080 Ti stopped at ~23,400 of the 26,503 records.

1. Acceleration structures above 2^40. The xboxbvhbuilder "can not have more than 40b of address set" exception did not appear in the title run. I did not log the structures' addresses, so this says nothing about where they land.

For scale on this card: with the heap form, compute programs of 130–800 KB of DXIL took 1–15 s in the driver; in the switch form on the same machine (an earlier main, b7aa9f3), programs of 0.9–1.9 MB took 30–109 s each.

Not tested: a clean head, the switch form and the heap form A/B on the same commit, other drivers, a second title run.

AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and wrote this; I checked it before posting.

**@⁠ofc0urse** on GitHub · 2026-11-24 17:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7139893024) Data on the three open points from the merge comment, from an 8 GB NVIDIA card on driver 621.24, for @⁠Pipodi's list in #1269. **Tested:** RTX 4060 Ti 8 GB (Ada, 32-lane waves), driver 621.24, Core i5-14400F, 32 GB RAM, Windows 11 Pro 26300, DXC 1.9.2602.17 (Windows SDK 10.0.26100), release build, `XCL_HEAP_WINDOWS=1`. Not a clean head: `main` `9e3831e` plus local test-only patches (the title's watchdog thread parked instead of its null write; a DXIL size cap that refused nothing in this run). The precompile below also has #1526 and a log-only patch for big DXC compiles. **3. The 8 GB card.** The title run boots and goes on with the heap form: same layout as in @⁠ryosen0's log (`UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000`, `memory windows from the shared descriptor heap` at 1.7 s), no `CreateHeap ... refused`, no `0x887a0005`, no device removal. Menus, account select and world loading, last present at 202 s, then a stall on pipeline builds until I stopped it at 560 s (a DXC compile of one of the >8 MB sources took the commit, see #1526). One run. **2. The 621.24 compiler fast-fail.** Not seen so far on this card. In the title run, 155 compute builds took 1 s or more in the driver (largest 1,559,432 B of DXIL, 49.2 s), none refused, no `Invalid record` / `Never resolved value` abort. The offline pass `xcl shaders <pack> --precompile --only cs --pipelines` (4 driver threads, the default) is at 925 pipelines made, 0 refused and still running; I will edit this comment when it ends, since @⁠LeonardoS11's 3080 Ti stopped at ~23,400 of the 26,503 records. **1. Acceleration structures above 2^40.** The `xboxbvhbuilder` "can not have more than 40b of address set" exception did not appear in the title run. I did not log the structures' addresses, so this says nothing about where they land. For scale on this card: with the heap form, compute programs of 130–800 KB of DXIL took 1–15 s in the driver; in the switch form on the same machine (an earlier `main`, `b7aa9f3`), programs of 0.9–1.9 MB took 30–109 s each. **Not tested:** a clean head, the switch form and the heap form A/B on the same commit, other drivers, a second title run. AI use: Claude Code (Claude Opus 5.5) ran the builds and runs and wrote this; I checked it before posting.
Author
Owner

@⁠rGillyazanov on GitHub · 2026-11-24 18:45 UTC · original

PR #680 follow-up. Tested merge commit 9e3831e on an RTX 3060 Ti (8 GB, driver 621.40), Windows 11 build 26300, Rust 1.100.0 MSVC, and DXC 1.8.2505.32. PR #680

$env:XCL_ADAPTER = 'RTX 3060 Ti'
$env:XCL_HEAP_WINDOWS = '1'
$env:XCL_REQUIRE_GPU = 'wave64'
cargo test --locked -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --exact --nocapture --test-threads=1

1 passed, 0 failed, 0 skipped. XCL enabled heap windows and retried once in switch form after the test injected E_OUTOFMEMORY. GPU dispatch and readback passed. The run logged no device removal or Windows Display 4101 events. Coverage was limited to this synthetic test.

AI use — OpenAI Codex ran the test and drafted this report. Exact model version unavailable.

**@⁠rGillyazanov** on GitHub · 2026-11-24 18:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7141114589) **PR #680 follow-up.** Tested merge commit `9e3831e` on an RTX 3060 Ti (8 GB, driver 621.40), Windows 11 build 26300, Rust 1.100.0 MSVC, and DXC 1.8.2505.32. [PR #680](https://git.gtahub.st/github/xcl-dev--xcl/pulls/680) ```powershell $env:XCL_ADAPTER = 'RTX 3060 Ti' $env:XCL_HEAP_WINDOWS = '1' $env:XCL_REQUIRE_GPU = 'wave64' cargo test --locked -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --exact --nocapture --test-threads=1 ``` **1 passed, 0 failed, 0 skipped.** XCL enabled heap windows and retried once in switch form after the test injected `E_OUTOFMEMORY`. GPU dispatch and readback passed. The run logged no device removal or Windows Display 4101 events. Coverage was limited to this synthetic test. **AI use** — OpenAI Codex ran the test and drafted this report. Exact model version unavailable.
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 18:50 UTC · original

Clean-main 8 GB NVIDIA Ampere data point on 9e3831e covering the three open points from the merge comment.

Setup

  • GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, Ampere, wave32), driver 32.0.16.2101 (621.01)
  • CPU / RAM: AMD Ryzen 5 5500 (6C/12T), 31.8 GB RAM
  • OS: Windows 11 Home Single Language, build 26200
  • Build: clean main 9e3831e1f570d3646e53ab753b19ec07eb8f1485, --release, rustc 1.100.0, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0)

1. Workspace tests (cargo test --workspace --release --no-fail-fast -- --test-threads=4)

  • XCL_HEAP_WINDOWS unset: 776 passed, 0 failed, 41 ignored (SKIPPED: 2 no wave64, 2 no D3D12 debug layer, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)
  • XCL_HEAP_WINDOWS=1: 776 passed, 0 failed, 41 ignored (heap_window_out_of_memory_falls_back_to_the_switch_form ran and passed; only the 2 no wave64 and 2 no D3D12 debug layer skips remained)

2. 60 s retail smoke A/B (scripts/smoke.ps1, XCL_NETWORK=0, no input)

  • Default (XCL_HEAP_WINDOWS unset): exit 0x0, 1566 frames (60 60 60), 0 device removals, 0 crashes, peak commit 14715 MB, 6147 MB local / 4876 MB non-local VRAM.
  • XCL_HEAP_WINDOWS=1: exit 0x0, 1570 frames (60 60 60), 0 device removals, 0 crashes, peak commit 14718 MB, 6144 MB local / 4876 MB non-local VRAM (11 DXIL cache compiles, 0 failures; 1 fresh compute PSO 81,744 B DXIL, 562 ms).

3. World-loading runs (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=300, XCL_PRESS_A_AT every 4 s from 20 s to 80 s + 90, 100)

run heap DXIL cache last non-zero presents stop peak commit peak local / non-local VRAM fresh compute PSOs (sum / max / >= 5 s) driver blobs
default (XCL_PSO_WAIT_MS unset) warm 132.1 s 0x887a0006 device removed at 133.8 s 23198 MB 11007 / 4894 MB 5 (3.9 s / 2.46 s / 0) 1
XCL_HEAP_WINDOWS=1 (XCL_PSO_WAIT_MS unset) cold 168.1 s +0x23cf683 (0xc0000005) at 195.8 s 28579 MB 14008 / 4896 MB 39 (29.1 s / 7.48 s / 2) 1
default + XCL_PSO_WAIT_MS=50 warm 144.1 s +0x23cf683 (0xc0000005) at 204.8 s 30799 MB 14446 / 4929 MB 196 (379.6 s / 38.87 s / 23) 28
XCL_HEAP_WINDOWS=1 + XCL_PSO_WAIT_MS=50 warm 88.1 s 0x887a0006 device removed at 89.8 s 24395 MB 12429 / 4894 MB 5 (5 ms / 3 ms / 0) 5

Findings on the three open points

  1. Window VA / acceleration structures above 2^40: window 0 buffer at VA 0x3e0000000 was identical with XCL_HEAP_WINDOWS off and on in every run (UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000). No xboxbvhbuilder error or RAYTRACING_ACCELERATION_STRUCTURE log line appeared, though these runs stopped before acceleration-structure builds were logged so that path was not directly exercised.
  2. NVIDIA driver compiler fast-fail: Not seen on this Ampere card with driver 621.01 (32.0.16.2101) across all tests, smokes, and 39 fresh heap-window compute PSO builds (up to 409,812 B DXIL / 7,477 ms, 0 refused, 0 Invalid record / Never resolved value, 0 switch-form fallbacks). For scale on this card, the longest switch-form compute builds reached 38.9 s (829 KB DXIL) and 26.5 s (610 KB DXIL) with 7 builds >= 10 s, vs max 7.5 s (410 KB DXIL) and 0 >= 10 s with heap windows.
  3. 8 GB card with the new view cap: Both XCL_HEAP_WINDOWS=1 runs enabled memory windows from the shared descriptor heap (no per-access switch) cleanly at ~1.5–1.6 s with 0 CreateHeap refusals and 0 switch-form fallbacks, and the first world-load run streamed up to 14,008 MB local video memory (195.8 s) with 0 device removals. Note that 0x887a0006 (DXGI_ERROR_DEVICE_HUNG) did occur once in each mode during heavy 8 GB VRAM overcommit (11,007 MB local in default at 133.8 s; 12,429 MB local in XCL_HEAP_WINDOWS=1 + XCL_PSO_WAIT_MS=50 at 89.8 s), while the other run in each mode reached +0x23cf683 with 0 device removals.

Not tested: driver 621.24, offline xcl shaders --precompile --pipelines, multiple repeats per configuration, acceleration-structure build stage.

AI use: Antigravity (Gemini 4 Neon) built, ran, and parsed these tests and logs on this machine and drafted this comment; reviewed before posting. No game files attached.

**@⁠LocranKing** on GitHub · 2026-11-24 18:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7141236387) Clean-`main` 8 GB NVIDIA Ampere data point on `9e3831e` covering the three open points from the merge comment. **Setup** - GPU: NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, Ampere, wave32), driver `32.0.16.2101` (`621.01`) - CPU / RAM: AMD Ryzen 5 5500 (6C/12T), `31.8 GB` RAM - OS: Windows 11 Home Single Language, build `26200` - Build: clean `main` `9e3831e1f570d3646e53ab753b19ec07eb8f1485`, `--release`, `rustc 1.100.0`, DXC `1.9.2602.17` (Windows SDK `10.0.26100.0`) ### 1. Workspace tests (`cargo test --workspace --release --no-fail-fast -- --test-threads=4`) - `XCL_HEAP_WINDOWS` unset: **776 passed, 0 failed, 41 ignored** (`SKIPPED`: 2 `no wave64`, 2 `no D3D12 debug layer`, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`) - `XCL_HEAP_WINDOWS=1`: **776 passed, 0 failed, 41 ignored** (`heap_window_out_of_memory_falls_back_to_the_switch_form` ran and passed; only the 2 `no wave64` and 2 `no D3D12 debug layer` skips remained) ### 2. 60 s retail smoke A/B (`scripts/smoke.ps1`, `XCL_NETWORK=0`, no input) - Default (`XCL_HEAP_WINDOWS` unset): exit `0x0`, **1566 frames** (`60 60 60`), `0` device removals, `0` crashes, peak commit `14715 MB`, `6147 MB` local / `4876 MB` non-local VRAM. - `XCL_HEAP_WINDOWS=1`: exit `0x0`, **1570 frames** (`60 60 60`), `0` device removals, `0` crashes, peak commit `14718 MB`, `6144 MB` local / `4876 MB` non-local VRAM (`11` DXIL cache compiles, `0` failures; `1` fresh compute PSO `81,744 B DXIL, 562 ms`). ### 3. World-loading runs (`XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_PRELOAD=0 XCL_RUN_SECONDS=300`, `XCL_PRESS_A_AT` every 4 s from 20 s to 80 s + 90, 100) | run | heap DXIL cache | last non-zero presents | stop | peak commit | peak local / non-local VRAM | fresh compute PSOs (sum / max / `>= 5 s`) | driver blobs | |---|---|---|---|---:|---:|---|---:| | default (`XCL_PSO_WAIT_MS` unset) | warm | 132.1 s | `0x887a0006` device removed at 133.8 s | 23198 MB | 11007 / 4894 MB | 5 (3.9 s / 2.46 s / 0) | 1 | | `XCL_HEAP_WINDOWS=1` (`XCL_PSO_WAIT_MS` unset) | cold | 168.1 s | `+0x23cf683` (`0xc0000005`) at 195.8 s | 28579 MB | 14008 / 4896 MB | 39 (29.1 s / 7.48 s / 2) | 1 | | default + `XCL_PSO_WAIT_MS=50` | warm | 144.1 s | `+0x23cf683` (`0xc0000005`) at 204.8 s | 30799 MB | 14446 / 4929 MB | 196 (379.6 s / 38.87 s / 23) | 28 | | `XCL_HEAP_WINDOWS=1` + `XCL_PSO_WAIT_MS=50` | warm | 88.1 s | `0x887a0006` device removed at 89.8 s | 24395 MB | 12429 / 4894 MB | 5 (5 ms / 3 ms / 0) | 5 | ### Findings on the three open points 1. **Window VA / acceleration structures above 2^40:** `window 0 buffer at VA 0x3e0000000` was identical with `XCL_HEAP_WINDOWS` off and on in every run (`UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000`). No `xboxbvhbuilder` error or `RAYTRACING_ACCELERATION_STRUCTURE` log line appeared, though these runs stopped before acceleration-structure builds were logged so that path was not directly exercised. 2. **NVIDIA driver compiler fast-fail:** Not seen on this Ampere card with driver `621.01` (`32.0.16.2101`) across all tests, smokes, and 39 fresh heap-window compute PSO builds (up to `409,812 B DXIL / 7,477 ms`, `0` refused, `0` `Invalid record` / `Never resolved value`, `0` switch-form fallbacks). For scale on this card, the longest switch-form compute builds reached `38.9 s` (`829 KB DXIL`) and `26.5 s` (`610 KB DXIL`) with `7` builds `>= 10 s`, vs max `7.5 s` (`410 KB DXIL`) and `0` `>= 10 s` with heap windows. 3. **8 GB card with the new view cap:** Both `XCL_HEAP_WINDOWS=1` runs enabled `memory windows from the shared descriptor heap (no per-access switch)` cleanly at `~1.5–1.6 s` with `0` `CreateHeap` refusals and `0` switch-form fallbacks, and the first world-load run streamed up to `14,008 MB` local video memory (`195.8 s`) with `0` device removals. Note that `0x887a0006` (`DXGI_ERROR_DEVICE_HUNG`) did occur once in each mode during heavy 8 GB VRAM overcommit (`11,007 MB` local in default at `133.8 s`; `12,429 MB` local in `XCL_HEAP_WINDOWS=1 + XCL_PSO_WAIT_MS=50` at `89.8 s`), while the other run in each mode reached `+0x23cf683` with `0` device removals. **Not tested:** driver `621.24`, offline `xcl shaders --precompile --pipelines`, multiple repeats per configuration, acceleration-structure build stage. **AI use:** Antigravity (`Gemini 4 Neon`) built, ran, and parsed these tests and logs on this machine and drafted this comment; reviewed before posting. No game files attached.
Author
Owner

@⁠Retried on GitHub · 2026-11-24 22:03 UTC · original

Point 2 (the NVIDIA compiler fast-fail) on Turing with 621.35: not seen on 56 retail compute programs, including the two families from the 3080 Ti report. For Pipodi's list in #1269.

Tested: RTX 2070 SUPER 8 GB (Turing, 32-lane waves, so the split wave64 form), driver 621.35 (32.0.16.2135), Ryzen 7 5800X3D, 32 GB, Windows 11 Pro 26300, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), release build of main 6c89285 plus the retail_pipeline_cost test from #1529 (bbfc99e).

How:

  • retail_pipeline_cost translates a record the way the title does and times DXC and CreateComputePipelineState.
  • Each program was built in its own process, once in the heap form (XCL_RECOMP_WINDOWS=260) and once in the switch form (=4), with a 120 s / 8 GB cap, XCL_TRANSLATED_CACHE=0 and an empty XCL_DXIL_CACHE.
  • The driver's disk cache keys on the DXIL, so a local change to the test renamed the entry point for every run: every build was DXIL the driver had not seen. The same name built again in 0.00 s; a new name took the full time.
  • An abort was counted on exit 0xC0000409 or 127, Never resolved value or Invalid record in the output, or no test result line.

Programs (seed 1269):

  • all 16 indirect_diffuse_lighting:CS_FinalGather_*, including CS_FinalGather_1_0_0_1 from the 3080 Ti report;
  • 10 of the 246 CS_RaytracingResolve_ae7b7f3c variants;
  • 30 random other compute programs.

Result:

  • Heap form: 56 of 56 built. Exit 0 for all of them, with no Never resolved value, no Invalid record and nothing refused. The largest heap DXIL was 1098 KB, more than the 733 KB ae7b7f3c from the 3080 Ti report.
  • Switch form: 54 of 56 built. Two runs hit the 120 s cap before printing a result: ped_standard_muv_blendshape_cutout:CS_RaytracingResolve_ae7b7f3c and prop_2lyr_procedural_batch:CS_RaytracingResolve_18a17e12. Their heap forms took 15.7 s in DXC and 17.4 s in the driver, and 15.8 s and 13.0 s.
  • Peak private memory per process was at most 2.37 GB.

Driver time, on the programs that built in both forms:

programs n heap, sum switch, sum switch / heap, median (range)
CS_FinalGather_* 16 11.4 s 15.6 s 1.39× (1.27–1.58)
CS_RaytracingResolve_ae7b7f3c 9 102.6 s (max 18.4 s) 548.9 s (max 97.0 s) 5.09× (4.65–7.40)
random compute 29 92.3 s 420.8 s 1.39× (1.00–6.08)

In the heap form, DXIL was 14–21 % smaller per group and DXC took 11–22 % less time. CS_FinalGather_1_0_0_1 had 120 KB of heap DXIL (111 KB with DXC 1.8 in the 3080 Ti report) and took 0.82 s in the driver, against 1.14 s in the switch form.

Not tested:

  • DXC 1.8.2502.11, which both abort reports used. It may matter, since the abort comes from the driver's reader of the DXIL that DXC produced.
  • Driver 621.24, and Ada or Ampere cards.
  • The whole pack: the 3080 Ti stopped after about 23,400 records, and this ran 56 programs.
  • The title with XCL_HEAP_WINDOWS=1, and #1695.
  • One run per program and form, so the times are single samples.

AI use: Claude Code, Claude Opus 5.5 chose the programs, ran the builds, parsed the results and wrote this comment. The numbers come from those runs on the hardware above.

**@⁠Retried** on GitHub · 2026-11-24 22:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7145736789) **Point 2 (the NVIDIA compiler fast-fail) on Turing with 621.35: not seen on 56 retail compute programs, including the two families from the 3080 Ti report.** For Pipodi's list in #1269. **Tested:** RTX 2070 SUPER 8 GB (Turing, 32-lane waves, so the split wave64 form), driver 621.35 (32.0.16.2135), Ryzen 7 5800X3D, 32 GB, Windows 11 Pro 26300, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), release build of `main` `6c89285` plus the `retail_pipeline_cost` test from #1529 (`bbfc99e`). **How:** - `retail_pipeline_cost` translates a record the way the title does and times DXC and `CreateComputePipelineState`. - Each program was built in its own process, once in the heap form (`XCL_RECOMP_WINDOWS=260`) and once in the switch form (`=4`), with a 120 s / 8 GB cap, `XCL_TRANSLATED_CACHE=0` and an empty `XCL_DXIL_CACHE`. - The driver's disk cache keys on the DXIL, so a local change to the test renamed the entry point for every run: every build was DXIL the driver had not seen. The same name built again in 0.00 s; a new name took the full time. - An abort was counted on exit `0xC0000409` or 127, `Never resolved value` or `Invalid record` in the output, or no test result line. **Programs (seed 1269):** - all 16 `indirect_diffuse_lighting:CS_FinalGather_*`, including `CS_FinalGather_1_0_0_1` from the 3080 Ti report; - 10 of the 246 `CS_RaytracingResolve_ae7b7f3c` variants; - 30 random other compute programs. **Result:** - **Heap form: 56 of 56 built.** Exit 0 for all of them, with no `Never resolved value`, no `Invalid record` and nothing refused. The largest heap DXIL was 1098 KB, more than the 733 KB `ae7b7f3c` from the 3080 Ti report. - **Switch form: 54 of 56 built.** Two runs hit the 120 s cap before printing a result: `ped_standard_muv_blendshape_cutout:CS_RaytracingResolve_ae7b7f3c` and `prop_2lyr_procedural_batch:CS_RaytracingResolve_18a17e12`. Their heap forms took 15.7 s in DXC and 17.4 s in the driver, and 15.8 s and 13.0 s. - Peak private memory per process was at most 2.37 GB. Driver time, on the programs that built in both forms: | programs | n | heap, sum | switch, sum | switch / heap, median (range) | |---|---|---|---|---| | `CS_FinalGather_*` | 16 | 11.4 s | 15.6 s | 1.39× (1.27–1.58) | | `CS_RaytracingResolve_ae7b7f3c` | 9 | 102.6 s (max 18.4 s) | 548.9 s (max 97.0 s) | 5.09× (4.65–7.40) | | random compute | 29 | 92.3 s | 420.8 s | 1.39× (1.00–6.08) | In the heap form, DXIL was 14–21 % smaller per group and DXC took 11–22 % less time. `CS_FinalGather_1_0_0_1` had 120 KB of heap DXIL (111 KB with DXC 1.8 in the 3080 Ti report) and took 0.82 s in the driver, against 1.14 s in the switch form. **Not tested:** - DXC 1.8.2502.11, which both abort reports used. It may matter, since the abort comes from the driver's reader of the DXIL that DXC produced. - Driver 621.24, and Ada or Ampere cards. - The whole pack: the 3080 Ti stopped after about 23,400 records, and this ran 56 programs. - The title with `XCL_HEAP_WINDOWS=1`, and #1695. - One run per program and form, so the times are single samples. **AI use:** Claude Code, Claude Opus 5.5 chose the programs, ran the builds, parsed the results and wrote this comment. The numbers come from those runs on the hardware above.
Author
Owner

@⁠Retried on GitHub · 2026-11-24 22:09 UTC · original

Point 2: both fast-fail reports ran the heap form from before the merge, and its window index differs from the merged form and from #1695

Both reports built every memory accessor with ResourceDescriptorHeap[NonUniformResourceIndex(MEM_HEAP_BASE + (xcl_w < N ? xcl_w : 0u))]. tycosnh's ran on main dd2ae9a with #187 (head c74b03a), and LeonardoS11's on this PR's head 2c1a521, both with DXC 1.8.2502.11. The merged form (deb4b92, in 9e3831e) indexes with MEM_HEAP_BASE + xcl_w behind [branch] if (xcl_w >= N).

In DXIL, from a small probe with two accessors, compiled with DXC 1.9.2602.17 (cs_6_6, -O3):

  • the old form gives an icmp plus a select i32 that feeds the index of every createHandleFromHeap;
  • the merged form gives a branch with no select; the index can still reach the handle through an i32 phi where the blocks join. brothernog showed above that this form can also produce a handle phi, which NVIDIA refuses at once with 0x8007000E, and with_switch_fallback catches that.

Since the merge, nobody has reported the fast-fail:

  • tycosnh's rerun of 9e3831e on the same RTX 4090 with 621.24 in #1269: 1 318 cold builds and one silent exit that remains unexplained;
  • ofc0urse's 4060 Ti with 621.24, LocranKing's 3060 Ti with 621.01, and my 2070 SUPER with 621.35 above.

So the fast-fail may follow the select index rather than the card or the driver. This is an inference: nobody has built the old and the merged form on a machine that aborted, and the DXC version differs between some of these runs as well.

What this means for #1695. It builds the index in one of two ways:

  • with N == MAX_WINDOWS: min(xcl_w, N), which DXIL turns into UMin with no select. The usual layout (3 sparse VRAM windows plus the coherent one) gives N = 4, so the retail title takes this path;
  • with N < MAX_WINDOWS: select(xcl_w < N, xcl_w, null), the same select i32 into the index as the forms that aborted, with the null view in place of window 0.

If the inference holds, putting the null view in the unused window slots too would let both cases use min(xcl_w, MAX_WINDOWS).

A rerun that would settle it, if @⁠LeonardoS11 still has the RTX 3080 Ti with 621.24:

  • the same xcl shaders <pack> --precompile --only cs --pipelines on current main with DXC 1.8.2502.11, keeping the full exit code;
  • the same command on 2c1a521 as the control.

If main builds through and 2c1a521 still aborts, the merged form removed the fast-fail. If both abort, the cause is elsewhere.

Not tested: the old form on this machine (the 2070 SUPER did not abort with the merged form, so it could not tell the two forms apart), DXC 1.8, and #1695 on the retail programs.

AI use: Claude Code, Claude Opus 5.5 compared the three forms in the source, compiled the probe and wrote this comment.

**@⁠Retried** on GitHub · 2026-11-24 22:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/680#issuecomment-7145888792) **Point 2: both fast-fail reports ran the heap form from before the merge, and its window index differs from the merged form and from #1695** Both reports built every memory accessor with `ResourceDescriptorHeap[NonUniformResourceIndex(MEM_HEAP_BASE + (xcl_w < N ? xcl_w : 0u))]`. tycosnh's ran on `main` `dd2ae9a` with #187 (head `c74b03a`), and LeonardoS11's on this PR's head `2c1a521`, both with DXC 1.8.2502.11. The merged form (`deb4b92`, in `9e3831e`) indexes with `MEM_HEAP_BASE + xcl_w` behind `[branch] if (xcl_w >= N)`. In DXIL, from a small probe with two accessors, compiled with DXC 1.9.2602.17 (`cs_6_6`, `-O3`): - the old form gives an `icmp` plus a `select i32` that feeds the index of every `createHandleFromHeap`; - the merged form gives a branch with no `select`; the index can still reach the handle through an `i32` `phi` where the blocks join. brothernog showed above that this form can also produce a handle `phi`, which NVIDIA refuses at once with `0x8007000E`, and `with_switch_fallback` catches that. Since the merge, nobody has reported the fast-fail: - tycosnh's rerun of `9e3831e` on the same RTX 4090 with 621.24 in #1269: 1 318 cold builds and one silent exit that remains unexplained; - ofc0urse's 4060 Ti with 621.24, LocranKing's 3060 Ti with 621.01, and my 2070 SUPER with 621.35 above. So the fast-fail may follow the `select` index rather than the card or the driver. This is an inference: nobody has built the old and the merged form on a machine that aborted, and the DXC version differs between some of these runs as well. **What this means for #1695.** It builds the index in one of two ways: - with `N == MAX_WINDOWS`: `min(xcl_w, N)`, which DXIL turns into `UMin` with no `select`. The usual layout (3 sparse VRAM windows plus the coherent one) gives N = 4, so the retail title takes this path; - with `N < MAX_WINDOWS`: `select(xcl_w < N, xcl_w, null)`, the same `select i32` into the index as the forms that aborted, with the null view in place of window 0. If the inference holds, putting the null view in the unused window slots too would let both cases use `min(xcl_w, MAX_WINDOWS)`. **A rerun that would settle it**, if @⁠LeonardoS11 still has the RTX 3080 Ti with 621.24: - the same `xcl shaders <pack> --precompile --only cs --pipelines` on current `main` with DXC 1.8.2502.11, keeping the full exit code; - the same command on `2c1a521` as the control. If `main` builds through and `2c1a521` still aborts, the merged form removed the fast-fail. If both abort, the cause is elsewhere. **Not tested:** the old form on this machine (the 2070 SUPER did not abort with the merged form, so it could not tell the two forms apart), DXC 1.8, and #1695 on the retail programs. **AI use:** Claude Code, Claude Opus 5.5 compared the three forms in the source, compiled the probe and wrote this comment.
This discussion has been locked. Commenting is limited to contributors.
No description provided.