Recompiler: memory windows from the descriptor heap (no per-access switch) #680
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!680
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/680/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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 UTCWith more than one memory window every memory access of a translated shader is a
switchover 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 oneResourceDescriptorHeapload or store.Opt-in:
XCL_HEAP_WINDOWS=1turns the heap form on. Unset, a run is as onmain: the shared heap is not made early, no window views are written, shaders are translated in the switch form undermain'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(#187c3fb89e,864ce8e,33c92dd) –gpu/recomp/emit.rs(the accessors),mod.rs/pso.rs(Options::heap_windows, theHEAP_WINDOWSflag in the cache keys, opt-in: on withXCL_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(--precompileuses 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 fileheap_window_tests.rs).D3D12.X: SetDescriptorHeaps(0, NULL) clears the list's record of bound heaps(#1878b4e398) –list_x.rs, with its test.D3D12.X: a pipeline the driver refuses with heap windows is built in the switch form(#18741d4506) –real.rs,pso.rs, test intests/gpu_compute_e2e.rs. NVIDIA refuses a few big programs in the heap form withE_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_topchecks up to the new end.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 testwindow_views_do_not_hold_global_during_device_calls; folded into the first commit with aCo-Authored-By.main's range check of the windows (f9e5ee9, merged after this PR was opened): in the heap form anxcl_woutside the windows reads 0, drops its store and zeroes an atomic'soutby one comparison before the heap access, as the switch'sdefaultdoes.main's test of that rule runs in both forms now (gpu_heap_windows_reject_out_of_uma_aliasing).list_x.rsandconsole_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 – throughskip_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 one999741onmain1ec4c98; 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.main)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 onmaincb868b2(13dcab8), release; the switch form is the same executable withXCL_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--pipelineson 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.main)Tested
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=4ondeb4b92(rebased ontomainb7aa9f3), 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).XCL_HEAP_WINDOWS=1in 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.XCL_NETWORK=0, pad script throughXCL_PRESS_AT, empty DXIL cache; an earlier head of this change (onmain9ce2070, beforemain'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 theCopyFromSubresourcefix 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 withE_OUTOFMEMORY; they were built in the switch form (the third commit at work) and the run went on.Regression run
main:
PR (default: the switch form, as
main):PR with
XCL_HEAP_WINDOWS=1: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 ontob7aa9f3, 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 namingCreateUnorderedAccessView; 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
AI use
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
main9ce2070, Gate B 03:22 UTC on91f9a5e, again 03:54, 04:39, 08:05 and 08:47 UTC,main077ce40; again 17:03 UTC onb7aa9f3b): 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
@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
--pipelinesmade 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_HUNGand 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.
@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
dd2ae9awith #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,TdrDelay60.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
0xc0000409and one of these on stderr: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:
DXCache, same abort.Create*PipelineStateat a time under a global lock, same abort at the same point.29fb6b7andda28099, and reverted #335; neither was conclusive.What stops it:
XCL_HEAP_WINDOWS=0: no abort in any run.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.@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_viewson1ad93431f1420e273ea7dc7b3a4a15f246aa10c9.It holds
GLOBALwhile callings.dev.CreateUnorderedAccessView. Once that device is adopted, the UAV hook callsconsole_heap::slot, which takesHEAPS. Slot/page allocation takes the locks in the opposite order,HEAPSthenGLOBAL. 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.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 as87b1afd.gpu_raw_window_view_reaches_its_top,gpu_memory_windows_from_the_heapandheap_window_out_of_memory_falls_back_to_the_switch_formpassed on the GPU.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
STATEis held. Mainf4ce27calready 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_queueas 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-diffreports all four patches unchanged, and the original commit authors are preserved.Tested and pushed
42fe3caontest/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, withXCL_HEAP_WINDOWS=1and the same RTX 3060/MSVC/DXC/Agility setup as above.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.
@imnicho on GitHub · 2026-11-24 04:40 UTC · original
Thanks both – head is now
2c1a521(rebased ontomain64b3f35; suite 706 passed / 0 failed / 41 ignored here, regression pair in the description).@anes66 – confirmed:
slottakesHEAPSand thenGLOBAL, andset_window_viewscalled the device withGLOBALheld. Your change is in, folded into the first commit with aCo-Authored-By(the PR's commits are kept one per logical change), and your testwindow_views_do_not_hold_global_during_device_callswith it; it passes here. The rebase also brings inmain'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:
xcl shaders <pack> --precompile --only cs --pipelinesmade over 550 compute pipelines; 5 were refused with an error code, none ended the process;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.
@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
2c1a521, nothing else applied.xcl shaders <retail pack>\shaders.rpf --precompile --only cs --pipelineswithXCL_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.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 gotCS_RaytracingResolve_ae7b7f3c(733 KB of DXIL), and the driver printed on stderr: Skipping that family, the next one wasindirect_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 throughStart-Process).XCL_HEAP_WINDOWS=0, same local tree with per-program logging, 12 driver threads): 24CS_RaytracingResolve_ae7b7f3cvariants (~920 KB each in this form) andCS_FinalGather_1_0_0_1went 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_fallbackcatches 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
dxil.dllvalidation: it came out of DXC without an error, and I did not run the validator on it by hand.AI use: Claude Code with Claude Opus 5.5 ran the builds and the runs above and wrote this report.
@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
2c1a521does 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):
No draw has run yet (0 presents); the first sparse-pool
CreateHeapcomes 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:
2c1a521withXCL_HEAP_WINDOWS=0(switch form): clean — 2442 frames, 60 presents / 2 s, 0 removals, peak commit 14473 MB.mainbuilds (beaa245-era and earlier): clean every run tonight (several 90 s smokes on other PRs' heads, all based on main).e9705bbinherits this: default andXCL_UMA_WINDOWS=8both 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
CreateHeapon 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 aroundshared_heap/set_window_views, or test a smallercap.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.
@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
mainthe 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:capfor the shared heap (if the device survives, it is the 1 000 000-descriptor heap that early), orshared_heapand eachCreateUnorderedAccessViewinset_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_OUTOFMEMORYrefusals 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 withmainagain. 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.
@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/xclnv680-probe(c583e10, one commit on this PR's head, local tooling, not for merging). It is QemmHD'spso156generator (#156) withheap_windowsadded. 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 extraatomic: a returning 32-bit atomic add each roundatomic64: a returningGLOBAL_ATOMIC_UMAX_X2each round, plus aGLOBAL_ATOMIC_CMPSWAP_X2every 2nd round (in the heap form,InterlockedMax64/InterlockedCompareExchange64on aResourceDescriptorHeapbuffer)loop: a uniform 4-trip backward-branch loop every 8th roundwave: av_readlaneeach roundEach 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 withnv680_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):For
atomic64, DXC 1.8 matched within 5 % wherever both ran. On the other shapes, heap form only:base87 KB → 0.41 s up to 642 KB → 10.5 s;wave1.3 MB → 43 s.Not tested
AI use
@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:
XCL_HEAP_WINDOWS=0)mainbeaa245+ #684, nothing elsemain64b3f35+ #266 + #684 + this PR's head2c1a521, switch formThe nine runs without my diagnostics all end the way
maindoes 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 withmain.(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 08:06 UTC · original
Rebased onto
main1ec4c98: head is nowe999741(heads-up @broccolize, #822 is stacked on this).maingot 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, andmain's test of that rule runs in both forms (gpu_heap_windows_reject_out_of_uma_aliasing).e999741: 721 passed, 0 failed, 41 ignored; regression pair 1374 (main) / 1370 frames.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:31 UTC · original · edited 2026-11-24 08:48 UTC
This is opt-in now (head
95f34c1, onmain09940bb), as I said I would do if the two NVIDIA reports could not be resolved.XCL_HEAP_WINDOWS=1turns the heap form on. Unset (or anything else), a run is as onmain: the shared heap is not made early, no window views are written into it, shaders are translated in the switch form undermain's cache keys.E_OUTOFMEMORYfallback 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_formgoes through the runtime switch, so it reportsSKIPPEDunless the variable is set.95f34c1: 722 passed, 0 failed, 41 ignored, both as it is and withXCL_HEAP_WINDOWS=1(with it, that test runs).main1344 frames, this head 1376, this head withXCL_HEAP_WINDOWS=11369; a second round 1358 / 1328 / 1376. No crash or device removal in any.XCL_HEAP_WINDOWS=1.shared_heapand 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.
@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
2c1a521Seven 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_OUTOFMEMORYafter the lazy stand-in was created and just beforeresolve_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 xclwith--lib <filter> -- --nocapture --test-threads=1forgpu_raw_window_view_reaches_its_top,gpu_memory_windows,window_views_do_not_hold_global_during_device_calls, andunbinding_all_heaps_lets_the_shared_heap_be_bound_again. The integration runs used--test gpu_compute_e2e <filter> -- --exact --nocapture --test-threads=1forheap_window_out_of_memory_falls_back_to_the_switch_formandasync_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
e999741On 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=1withgpu_memory_windows_above_4_gib,gpu_memory_windows_from_the_heap,gpu_raw_window_view_reaches_its_top, and the tworeject_out_of_uma_aliasingfilters. AI use: Codex (GPT-6, exact variant unavailable) ran the checks and drafted this update.Opt-in routing on
95f34c1On 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=0selected the switch path.XCL_HEAP_WINDOWS=1selected 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 --workspacepassed.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=1passed 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.
@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.
@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-inXCL_HEAP_WINDOWS=1descriptor-heap UMA windows are off by default, so safe to land while NVIDIA reports are investigated. Recommend merging, @ivall.@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.95f34c195f34c12c1a521Every 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.
@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 ontomain47efa2eAMD 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
95f34c1as it is (base09940bb)cargo test --workspace --no-fail-fast -- --test-threads=4: 719 passed, 3 failed, 41 ignored, both without and withXCL_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.placed_title_textures_share_vram_and_preserve_pixels("cubemap extra_pages must be reused at same va", as in #718), thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memoryon the poisoned lock. Not this PR's:cargo test -p xcl --libon the base09940bbfails the same three, and onmain47efa2eit passes (698 passed, 0 failed). Run alone, the first one passes 5 of 5 on the head.main's frames, and so does its base. Something merged since09940bbdoubled 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).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
main47efa2e(no conflicts; local commit52fe798, not pushed anywhere)XCL_HEAP_WINDOWS=1.main1091 frames; this, default 1087; this withXCL_HEAP_WINDOWS=11106 (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.0xc0000005write at 0 atgame_scarlett_master.exe+0x23cf683(#534 / #675), with the same registers: heap form at 194 s, switch form at 164 s. The log hasmemory windows from the shared descriptor heapin the heap run only. No device removal orDEVICE_HUNGin either, and noE_OUTOFMEMORYor 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 emptyXCL_DXIL_CACHE, then--pipelinesunder an executable name the driver had not seen; the head's release build; times fromxcl's owntimeline)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
Claude Code (Claude Opus 5.5), from runs on the hardware above.
@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 waveThis head (
95f34c1) merged without conflicts ontomain930e8b4. It is the card from @tycosnh's report, with an older driver (621.01 here, 621.24 there) and the same DXC.Tested
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_HEAP_WINDOWS=1, played by hand to the end. The log saysmemory 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.0xc0000409and noInvalid record/Never resolved valueon stderr.maindoes 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
cargo test --workspace, a regression smoke pair, and the offline--precompile --pipelinespass in the heap form.AI use
@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
95f34c1d1a24f644d0c4895810a7c36910b123e8The 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
7.3.5-2-cachyos.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.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, andunbinding_all_heaps_lets_the_shared_heap_be_bound_again.XCL_HEAP_WINDOWS=1,heap_window_out_of_memory_falls_back_to_the_switch_formlogged the switch-form retry after the injected OOM, then exited with code 3 on vkd3d-proton's root-signature vtable assertion. The existingconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_backcontrol withXCL_HEAP_WINDOWS=0exited with code 3 on the fence vtable assertion. With the vkd3d-proton build0bb64c56c8f0dccfrom Proton-CachyOS11.0.20261015, both tests got to dispatch and failed there with0x80070057(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
c583e10on the PR head withcargo xwin build --locked --target x86_64-pc-windows-msvc -p xcl --example nv680. The commands werewine nv680.exe gen --out DIR --name TAG --shape base --rounds R --heap H --seeds S..N --dxc-arg -O1andwine 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 setVKD3D_SHADER_CACHE_PATH=0and__GL_SHADER_DISK_CACHE=0. All 12 calls toCreateComputePipelineStatesucceeded.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-spirv8b48f0e) and upstreamec20719452e916b(dxil-spirv7c04863). Each call ran in a fresh process with both disk caches disabled as above. I setVKD3D_CONFIG=pipeline_library_logto collect Vulkan pipeline creation feedback alongside the D3D12 wall time, and sampled user-space CPU time withperf record -e cpu-clock:u -F 199. All 12 follow-up PSOs were created successfully. Upstream buildec207194ec207194The 500-round rows show medians across seeds 1 and 2. Across those four runs per build,
d3d12core.dllaccounted for 63.5–63.9% of CPU samples on 3.1.0 and 8.7–15.2% onec207194. 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.
@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 descriptorMEM_HEAP_BASE + N. The null view reads 0 and drops stores, and atomics return 0, the same as the switch'sdefault.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):min+ null viewAlso measured:
MEM_HEAP_BASEmade the driver ~30% slower, so the constant is the right call.NonUniformResourceIndexchanged 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_aliasingand the other windowed GPU tests (6/6) pass in that form here, and the full lib suite passes (713 passed, 0 failed, on currentmain930e8b4plus 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.
@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
95f34c1is 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
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:XCL_HEAP_WINDOWS=1: 719 passed, 3 failed, 41 ignored;heap_window_out_of_memory_falls_back_to_the_switch_formruns and passes (it is SKIPPED in the default run)PoisonErrors), as @srcamarda found on base09940bb.gpu_raw_window_view_reaches_its_toppasses on this card and driver, so theNumElements 0x3FFFFFFFraw view @CharlyRien traced on the RTX 3090 / 616.56 is accepted here.Not tested
AI use
@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 (throughXCL_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 (withFirstElement 0x3FFFFFF4it asks forNumElements"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_topfails here atheap_window_tests.rs:28with0x887A0005;GetDeviceRemovedReasongives0x887A0001(DXGI_ERROR_INVALID_CALL).CreateUnorderedAccessViewwithraw_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.XCL_HEAP_WINDOWS=1it is the same: the device is gone at 1.9 s, before the first frame. The first line in the log is aCreateHeap … 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)
MaxGPUVirtualAddressBitsPerResource40, binding tier 3, heap tier 2, tiled resources tier 3, so it is not an address limit.A change that makes it work here
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
341b209,a0c6676) onmain47efa2ewith #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.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
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.
@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
95f34c1as is, and a local merge of it ontomain930e8b4(clean, merge commit383008e).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_WINDOWSunset /=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.2. Whole pack, heap form (partial)
--precompile --only cs --pipelinesover all 26 503 records with the local merge383008e,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)main930e8b40xc0000005write at 0 in+0x23cf683at 126.5 s95f34c195f34c1memory windows from the shared descriptor heapin the log, no switch-form retry).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.95f34c1, heap form) has four of the title's threads intranslated_compute_pso→dxc::compile, one inset_pipeline_state→resolve_wait, and three DXC workers held inwait_for_memory. That is what9a272d4and25c6f7eonmainaddress; this head does not have them. I am following that up on #505.4. Suite (
cargo test --workspace --no-fail-fast -- --test-threads=4)95f34c1as is: 719 passed, 3 failed, 41 ignored, with and withoutXCL_HEAP_WINDOWS=1. The failures areplaced_title_textures_share_vram_and_preserve_pixels("cubemap extra_pages must be reused at same va"), thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memorywith a poisoned lock. All three pass alone.mainchangedtitle_textures.rs/vram.rsafter this PR's base (712bbbe,38ea451,24d8b92).main930e8b4: 757 passed, 0 failed, 41 ignored, both withXCL_HEAP_WINDOWSunset and with=1. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware; when unset alsoheap_window_out_of_memory_falls_back_to_the_switch_form. So a rebase onto currentmainclears the three.Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands above on this machine and wrote this report. No code changes.
@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, againstmain47efa2e.Tested
CreateComputePipelineStateon the 5 largest compute programs of the retail shader pack that the driver accepts (19.8k to 24.5k console instructions: 3 guardedpc ==, 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.Not tested
Regression run (same title, 180 s each, cold DXIL and NVIDIA driver caches before each run)
main:
this PR (
XCL_HEAP_WINDOWS=1):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_ATto get past the menus into the world load)XCL_HEAP_WINDOWS=1), ray-tracing acceleration structures get GPU addresses above 2^40, for exampleCreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at 0x1c0ec380000and0x22f8c460000in two runs. Onmain47efa2e, the same views are at0x19xxxxxxx.XDXR Error: DestAccelerationStructureData can not have more than 40b of address setand 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.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.AI use
Claude Code (claude-opus-4-6) wrote the local benchmark harness, ran it on the hardware above, and drafted this report.
@brothernog on GitHub · 2026-11-24 15:40 UTC · original
Follow-up to my comment above, on the instant
0x8007000Erefusals (#756) that @psuedo-tty traced to a GVN-madephi %dx.types.Handlein #1269: the branch-free form does not produce thatphi, 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
fnv64of the console blob), translated as the runtime does here (split wave64, 4 windows), DXC at the runtime's default level for their size. Handlephis counted indxc -dumpbin, then coldCreateComputePipelineStatewith the runtime's root signature:95f34c1heap formmin(xcl_w, N)+ null viewa3c0b8a98beee431phis, refused (0x8007000E, 0.1 s)c9579f1bea53bccaf7016de4c088c4be4549529853faf5fdf377ca6830935314phiexactly.phis in it arei32,floatori1; no handlephiorselect.[branch] if (xcl_w >= windows)guard gives each access two paths that GVN can join. Withminthere is one path per access, and the out-of-range case goes to the null view atbase + 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
AtomicInt64OnDescriptorHeapResourceSupportedbefore using the heap. Onmain930e8b4plus 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.
@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 ontomain930e8b4, 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) andCreateComputePipelineStatewith 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.E_OUTOFMEMORYfrom the description. That fits these programs being smaller than the ones that hit it (they are ≤ 3 MB of HLSL).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=1on 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.
@jessenic on GitHub · 2026-11-24 16:12 UTC · original
Test report for
95f34c1in the retail title's story load, together with #1288, on native Windows.Tested
main930e8b4+ #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"). NoXCL_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.Result
Driver time per compute pipeline compiled in the run (blobs from earlier runs left out), by DXIL size:
Not tested
scripts/smoke.ps1on this tree.xcl pipelinespass. 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.
@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 --lockedandcargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4. Separate scratch/cache directories per run.09940bb, default95f34c1,XCL_HEAP_WINDOWSunset95f34c1,XCL_HEAP_WINDOWS=1All three runs reproduced #718:
placed_title_textures_share_vram_and_preserve_pixelsfails at the cubemap page-reuse assertion, followed byPoisonErrorintransitions_apply_when_their_list_is_submittedandd32s8_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 skippedgpu_geometry_wave32_prefix_count_over_a_maskandgpu_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=1the real RTX 5060 D3D12 integration test injectedE_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.
@t4l03 on GitHub · 2026-11-24 16:39 UTC · original
RTX 4070 Ti, four windows:
ActivateRayswith #1448 + #680This adds an Ada result next to the RTX 5090 comparison in #1269. I used #1448
6c7bb05baa6f3bcb278f156e3473d377e42163b7with the three commits through #68095f34c1d1a24f644d0c4895810a7c36910b123e8applied in a scratch checkout. The one conflict moved heap-window flag normalization into the sharedprepare()entry point. The emitted HLSL differed from #1448 only in the memory accessors, with the same 2,516 cases and static samplers.cs_6_6 -HV 2021 -O1. Heap-window emission compiled in 16.91 s to 2,560,312 B DXIL and passed validation.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.@Creaa on GitHub · 2026-11-24 16:59 UTC · original
Test report:
95f34c1on 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--pipelineson the same cache, so the second run is the driver; the NVIDIA shader cache folder emptied before every run, a newXCL_DXIL_CACHEper run,XCL_PIPELINE_THREADS=1; times are the process's wall time and include its start; runs in A-B-B-A order)billboard_nobump:CS_RaytracingResolve(6e3fd903765f4376, 16 414 instructions, wave32),main930e8b4XCL_HEAP_WINDOWS=1mainXCL_HEAP_WINDOWS=1InstanceCulling(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 onmain, 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
main930e8b4+ this PR + #1316ee904f1,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
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 withXCL_HEAP_WINDOWS=1. The same three fail on its merge base09940bb(two alternated runs each) and pass on currentmain, so they look like the base, not this PR; a rebase should clear them.main+ this PR + #1316; the one conflict, ingpu/recomp/mod.rs, resolved by keeping #1316'spreparesplit and putting this PR'sHEAP_WINDOWSnormalisation at the top of bothtranslateandtranslate_as): 779 passed, 0 failed, 41 ignored, both without and withXCL_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.
@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 ontomainb7aa9f3.raw_window_uavcaps at 4 GiB − 32 bytes, andgpu_raw_window_view_reaches_its_topchecks up to the new end (lanes 0 to 55 of the last 256 bytes).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.XCL_HEAP_WINDOWS=1once, that would settle it.@brothernog yes, gladly, with your authorship kept. Either way works: a PR against
imnicho/xclrecomp-heap-windows(now atdeb4b92), or a branch I can cherry-pick from. The cap is already there, so your patch would carry the branch-freemin(xcl_w, N)+ null view form and theAtomicInt64OnDescriptorHeapResourceSupportedcheck. 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 andmain'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.
@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
930e8b4and 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.
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.
@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
deb4b92intomainb7aa9f3(AMD RDNA4, native wave64, Windows, DXC 1.8.2502.11, debug),cargo test --workspace --no-fail-fast -- --test-threads=4:XCL_HEAP_WINDOWSunset: 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:
xboxbvhbuilder's "can not have more than 40b of address set" exception (onmainthey are at0x19xxxxxxx). 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?@brothernog: your branch-free form (
minand a null view) and theAtomicInt64OnDescriptorHeapResourceSupportedcheck are welcome as a PR againstmainnow.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.
@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=1on an RTX 3060 12 GB (581.80, wave32), Windows 11 26200, 64 GB RAM,main9e3831e, 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.compute PSO … mslines 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 onmaincbea872(switch form, same settings plusXCL_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).+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.
@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
mainb8b1f49/930e8b4with this PR, the option off and on)window 0 buffer at VA 0x3e0400000in 4 runs with the option off and 4 with it on. The windows are at the same title addresses too (16 GiB from0x400000000here).CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) … is not in unified memoryline and noxboxbvhbuildererror. 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.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
res_gpu_va_x. For a buffer thatplace_console_bufferput 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'sGetGPUVirtualAddress, which nothing keeps under 40 bits.place_console_buffergives up whensparse::allochas no room in the sparse windows or cannot commit the CPU pages, whenCreateReservedResourcerefuses, and then when the coherent window has no room orCreatePlacedResourcerefuses (only that last case is logged:console buffer in UMA: CreatePlacedResource … keeping a separate resource, once).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.0x19xxxxxxxof themainrun was read from the same warning, it was one onmaintoo. 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):CreateShaderResourceView(RAYTRACING_ACCELERATION_STRUCTURE) at …line or lines of each, or how the0x19xxxxxxxwas read onmain;UMA: … coherent window at 0x…line (the windows are the 16 GiB from there), to see whether0x19xxxxxxxlies inside them;memory:line before it (committed,sparse pools), and whether aconsole buffer in UMA: CreatePlacedResourceline 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.
@Filip722 on GitHub · 2026-11-24 13:39 UTC · original · edited 2026-11-24 17:30 UTC
Tested
4522cc1and dxil-spirv1dc543f.95f34c1d1a24f644d0c4895810a7c36910b123e8integrated with #759 on base47efa2e, with local Series X loading changes. The integrated tree wasa32268ef4c5c654a16d8857671d74ba84f2b7b34. Ten focused CPU or mocked-device tests passed under Proton. The GPU test binary cross-built.XCL_HEAP_WINDOWS=0reached 2,296 sampled presents with 12 timeout warnings.XCL_HEAP_WINDOWS=1confirmed 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
930e8b4I used
xcl shaders folder --precompile --only cs --windows 4 --pipelineson 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 andXCL_HEAP_WINDOWS=1compiled 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
9e3831eBoth new focused regressions ran on the RTX 5060 Laptop GPU under Proton Experimental 11.0-20261112.
gpu_raw_window_view_reaches_its_toppassed in 0.97 s, andheap_window_out_of_memory_falls_back_to_the_switch_formpassed 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.
@tiagonleal on GitHub · 2026-11-24 17:48 UTC · original
An NVIDIA data point for the default-off decision:
XCL_HEAP_WINDOWS=1on an RTX 5070 Ti 16 GB (32-lane waves, driver 32.0.16.1742), Ryzen 7 9800X3D, Windows 11 Pro 26300,main9e3831e, release, the newer retail game,XCL_NETWORK=0 XCL_PSO_PRELOAD=0, 300 s runs into world loading, alternated with the default:+0x23cf683, 111.6 sXCL_HEAP_WINDOWS=1+0x23cf683, 120.6 s+0x23cf683, 109.6 sXCL_HEAP_WINDOWS=1+0x23cf683, 110.6 sheap_windowscomment).Not tested: more runs, a warm heap-window cache, an 8 GB card.
Run and written with Claude Code (Claude Opus 5.5).
@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:main9e3831eplus 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 heapat 1.7 s), noCreateHeap ... refused, no0x887a0005, 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 valueabort. The offline passxcl 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.
@rGillyazanov on GitHub · 2026-11-24 18:45 UTC · original
PR #680 follow-up. Tested merge commit
9e3831eon 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 #6801 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.
@LocranKing on GitHub · 2026-11-24 18:50 UTC · original
Clean-
main8 GB NVIDIA Ampere data point on9e3831ecovering the three open points from the merge comment.Setup
8024 MiB VRAM, Ampere, wave32), driver32.0.16.2101(621.01)31.8 GBRAM26200main9e3831e1f570d3646e53ab753b19ec07eb8f1485,--release,rustc 1.100.0, DXC1.9.2602.17(Windows SDK10.0.26100.0)1. Workspace tests (
cargo test --workspace --release --no-fail-fast -- --test-threads=4)XCL_HEAP_WINDOWSunset: 776 passed, 0 failed, 41 ignored (SKIPPED: 2no wave64, 2no 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_formran and passed; only the 2no wave64and 2no D3D12 debug layerskips remained)2. 60 s retail smoke A/B (
scripts/smoke.ps1,XCL_NETWORK=0, no input)XCL_HEAP_WINDOWSunset): exit0x0, 1566 frames (60 60 60),0device removals,0crashes, peak commit14715 MB,6147 MBlocal /4876 MBnon-local VRAM.XCL_HEAP_WINDOWS=1: exit0x0, 1570 frames (60 60 60),0device removals,0crashes, peak commit14718 MB,6144 MBlocal /4876 MBnon-local VRAM (11DXIL cache compiles,0failures;1fresh compute PSO81,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_ATevery 4 s from 20 s to 80 s + 90, 100)>= 5 s)XCL_PSO_WAIT_MSunset)0x887a0006device removed at 133.8 sXCL_HEAP_WINDOWS=1(XCL_PSO_WAIT_MSunset)+0x23cf683(0xc0000005) at 195.8 sXCL_PSO_WAIT_MS=50+0x23cf683(0xc0000005) at 204.8 sXCL_HEAP_WINDOWS=1+XCL_PSO_WAIT_MS=500x887a0006device removed at 89.8 sFindings on the three open points
window 0 buffer at VA 0x3e0000000was identical withXCL_HEAP_WINDOWSoff and on in every run (UMA: 3 sparse VRAM window(s) (12 GiB VA) + 4095 MB coherent window at 0x400000000). Noxboxbvhbuildererror orRAYTRACING_ACCELERATION_STRUCTURElog line appeared, though these runs stopped before acceleration-structure builds were logged so that path was not directly exercised.621.01(32.0.16.2101) across all tests, smokes, and 39 fresh heap-window compute PSO builds (up to409,812 B DXIL / 7,477 ms,0refused,0Invalid record/Never resolved value,0switch-form fallbacks). For scale on this card, the longest switch-form compute builds reached38.9 s(829 KB DXIL) and26.5 s(610 KB DXIL) with7builds>= 10 s, vs max7.5 s(410 KB DXIL) and0>= 10 swith heap windows.XCL_HEAP_WINDOWS=1runs enabledmemory windows from the shared descriptor heap (no per-access switch)cleanly at~1.5–1.6 swith0CreateHeaprefusals and0switch-form fallbacks, and the first world-load run streamed up to14,008 MBlocal video memory (195.8 s) with0device removals. Note that0x887a0006(DXGI_ERROR_DEVICE_HUNG) did occur once in each mode during heavy 8 GB VRAM overcommit (11,007 MBlocal in default at133.8 s;12,429 MBlocal inXCL_HEAP_WINDOWS=1 + XCL_PSO_WAIT_MS=50at89.8 s), while the other run in each mode reached+0x23cf683with0device removals.Not tested: driver
621.24, offlinexcl 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.@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
main6c89285plus theretail_pipeline_costtest from #1529 (bbfc99e).How:
retail_pipeline_costtranslates a record the way the title does and times DXC andCreateComputePipelineState.XCL_RECOMP_WINDOWS=260) and once in the switch form (=4), with a 120 s / 8 GB cap,XCL_TRANSLATED_CACHE=0and an emptyXCL_DXIL_CACHE.0xC0000409or 127,Never resolved valueorInvalid recordin the output, or no test result line.Programs (seed 1269):
indirect_diffuse_lighting:CS_FinalGather_*, includingCS_FinalGather_1_0_0_1from the 3080 Ti report;CS_RaytracingResolve_ae7b7f3cvariants;Result:
Never resolved value, noInvalid recordand nothing refused. The largest heap DXIL was 1098 KB, more than the 733 KBae7b7f3cfrom the 3080 Ti report.ped_standard_muv_blendshape_cutout:CS_RaytracingResolve_ae7b7f3candprop_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.Driver time, on the programs that built in both forms:
CS_FinalGather_*CS_RaytracingResolve_ae7b7f3cIn the heap form, DXIL was 14–21 % smaller per group and DXC took 11–22 % less time.
CS_FinalGather_1_0_0_1had 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:
XCL_HEAP_WINDOWS=1, and #1695.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: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 onmaindd2ae9awith #187 (headc74b03a), and LeonardoS11's on this PR's head2c1a521, both with DXC 1.8.2502.11. The merged form (deb4b92, in9e3831e) indexes withMEM_HEAP_BASE + xcl_wbehind[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):icmpplus aselect i32that feeds the index of everycreateHandleFromHeap;select; the index can still reach the handle through ani32phiwhere the blocks join. brothernog showed above that this form can also produce a handlephi, which NVIDIA refuses at once with0x8007000E, andwith_switch_fallbackcatches that.Since the merge, nobody has reported the fast-fail:
9e3831eon the same RTX 4090 with 621.24 in #1269: 1 318 cold builds and one silent exit that remains unexplained;So the fast-fail may follow the
selectindex 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:
N == MAX_WINDOWS:min(xcl_w, N), which DXIL turns intoUMinwith noselect. The usual layout (3 sparse VRAM windows plus the coherent one) gives N = 4, so the retail title takes this path;N < MAX_WINDOWS:select(xcl_w < N, xcl_w, null), the sameselect i32into 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:
xcl shaders <pack> --precompile --only cs --pipelineson currentmainwith DXC 1.8.2502.11, keeping the full exit code;2c1a521as the control.If
mainbuilds through and2c1a521still 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.