Recompiler: NVIDIA compute programs take flat heap windows by default #2418
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2428"
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?
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T18:37:31Z.
Part of #2088. Stacked on #2427; only the top commit belongs here.
On NVIDIA, this PR turns #2427's flat heap windows on by default, for compute programs only. Graphics stages, mesh, GS, other vendors and the HLSL path keep the switch over root UAVs, as they do today.
What it changes for compute programs on NVIDIA, compared with
main's form (#2368's select over root UAVs):GetCachedBlob) was 41.11 MB with this form and 51.17 MB with root UAVs, a ratio of 0.803 (0.465–0.922 per record). NVIDIA removes the device when a title's compiled shader code reaches about 448 MB in total (#2403). I have not measured how much this moves that point for a whole title.main's form (#2368's select) this form built 22–48 % faster (geomean 7.67 vs 12.72 s, 0.603), with native code 0.877 times the size in that job. Against the switch from before #2368 it built 1.5–3.6 times as fast. Tables are in #2427. The gain is shown only for those few large programs. Under Wine and vkd3d-proton, @Royalflamejlh's times did not separate from the spread between runs (see Tested by others).How it decides:
XCL_HEAP_WINDOWSset:1gives heap windows to every stage, as before;0turns them off.0x10DE), and only for the compute programs the direct translator makes (compute_mem_windows).XCL_HEAP_FLAT=0brings back the guarded form.with_switch_fallback). Only builds that had heap windows are rebuilt that way. A graphics or mesh build without them is not built twice (@bmjask's review).XCL_HEAP_WINDOWS=1did. This applies to every list, graphics included, although graphics shaders still take the switch.Why only compute, and not the HLSL path:
XCL_HEAP_WINDOWSwas opt-in because two NVIDIA setups failed with it in #187's review:927adcc0). A view that some D3D12 runtimes refused, removing the device, is now capped (deb4b92b).What is in it
gpu/recomp/pso.rs:heap_windowswith the vendor default,set_adapter_vendor,heap_windows_everywhere,compute_mem_windows/compute_windowsandhlsl_windows.console_to_dxil_fortakes the compute windows for a compute program.XCL_HEAP_FLATis on by default.hle/d3d12x/real.rs:with_switch_fallbacktakes whether the build has heap windows: the compute windows for a compute build, the graphics windows for graphics and mesh.driver_psoretries E_OUTOFMEMORY in the switch form only for such a build.switch_fallback_tests: an E_OUTOFMEMORY without heap windows is not retried, one with heap windows is built again once, and a driver call outside a translated build is not a heap-window build.shaders.rs,gpu/adapter.rs: the--precompile/--export-hlsl/--measure-psowindows are the runtime's, per stage, for the bench's adapter. Compute programs takepso::compute_windows, ascompute_mem_windowsdoes. VS, PS and mesh programs takepso::graphics_windows, asmem_windowsdoes. So by default on NVIDIA only the compute programs are precompiled with heap windows. Before, every stage got the compute count, so precompiled VS, PS and mesh entries missed at run time (found by @pvfreis, comment 7181439405).gpu/uma.rs:XCL_UMA_WINDOWS=8|16still needsXCL_HEAP_WINDOWS=1, since graphics need the heap for more than 4 windows.tests/gpu_compute_e2e.rs: the switch-form fallback test checks the compute windows.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on this head,775c1018(on #2427'sbfb136cfandmain6089122a): 1474 passed, 0 failed, 47 ignored.V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32).heap_window_out_of_memory_falls_back_to_the_switch_formruns, because heap windows are on by default on this NVIDIA card, and passes: a refused heap-window pipeline is rebuilt in the switch form and runs correctly.switch_fallback_testspass, and so do #2427'sgpu_heap_flat_reads_match_the_switch_form,only_compute_programs_read_heap_windows_flatandprecompile_windows_are_the_runtimes. The last checks the precompile's windows per stage against the runtime's: withXCL_HEAP_WINDOWS=1, and with it unset on an NVIDIA and an AMD vendor, each in a new process. With the old single count it fails on NVIDIA's default: VS, PS and mesh got 772 where the runtime uses 4.xcl shaders --precompile --only vswith default settings; then the same withXCL_HEAP_WINDOWS=0, whose VS keys are the runtime's default ones. The second run's already-cached count is what the runtime finds.970823e4(before): the second run compiled 542 again and found only the 12 that repeat within the pack. None of the 542 precompiled VS entries are found.c6e5af86: the second run compiled none and found all 554.precompile, PS and mesh programs take the same count as VS.Tested by others
970823e, one push beforec6e5af86(which changes only the precompile's VS, PS and mesh windows), as is:cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 1422 passed, 0 failed, 46 ignored. The 16 heap-window tests ran, none skipped, with no device removal. 25 SKIPPED lines (no wave64 and the like).ab2855f: 1417 passed, 0 failed, 46 ignored; ondbf54bf: 1350 passed, 0 failed, 46 ignored.c6e5af86(this PR's head before the rebase), debug, Ryzen 7 9800X3D, Windows 11.XCL_REQUIRE_GPU=mesh: 1419 passed, 0 failed, 44 ignored. All 8 new tests ran and passed.heap_window_out_of_memory_falls_back_to_the_switch_formskipped there with "no heap windows", as it should off NVIDIA.--skiplist on NVIDIA includesheap_window_out_of_memory_falls_back_to_the_switch_form, so that run does not cover it (@thehollowedone's run below does). Its other skips aremain's tests, which this PR does not change.c6e5af86(this PR's head before the rebase).heap_window_out_of_memory_falls_back_to_the_switch_formwithXCL_HEAP_WINDOWSunset andXCL_REQUIRE_GPU=mesh: 1 passed, 0 failed, 0 ignored. It ran on the real adapter with the heap views made by default, and the injected out-of-memory gave one switch-form rebuild.af825308. Since then only the precompile's windows changed (shaders.rs, andpso::graphics_windowswith the same rule as before); the fallback path is the same.heap_window_out_of_memory_falls_back_to_the_switch_formpasses 1/1, and the forced out-of-memory fires on the real adapter: the pipeline is built again in the switch form.ab2855fwith #2496 onmaine1d84b7d.presentstest, also fails on thatmain(1422 passed, 1 failed, 46 ignored).ab2855fwith #684 on6d12f58a,XCL_DIRECT_DXIL=1.XCL_HEAP_WINDOWS=0.Create*PipelineStatetime.=0run lost its device at 77.9 s in vkd3d-proton and is left out.c6e5af86itself.CreateComputePipelineStatetime over 26 large programs.Regression run
main6089122a(#2427's commit under it is nowbfb136cf; #2427's own branch is unchanged).scripts/smoke.ps1through our run script, 120 s, release builds,XCL_DIRECT_DXIL=1, same data root, XCL cache and learned coherent-window state asmain's run.main's block is theb49be18run from before; only this head was run again.main's run started from a warm cache. The two runs are not timed alike before the title's first frame.main's frames (3411 against 1593) and 58 % of its peak commit (16601 against 28787 MB), and still presented 60 frames per 2 s at the end, wheremainpresented none. One run each; I have not looked into why the two differ this much.mainb49be18:This PR (
775c1018):Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T19:41:32Z.
Update, head
c6e5af8(pushed 03:30Z), same 8 GB RTX 3070, driver 616.56, Windows 11, debug, head as is:cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 1422 passed, 0 failed, 46 ignored. The 16 heap-window tests ran (none skipped); no device removal; 25SKIPPEDlines (no wave64 etc.). The same counts as on970823e. Lib and workspace tests only; still no title run on an 8 GB card.NVIDIA test report for
dbf54bfon an 8 GB card, which Not tested lists. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, head as is (base3f27770), aftercargo build --workspace:cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2 --skip gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: 1350 passed, 0 failed, 46 ignored. No device removal and no compiler exit in the run, and the end-to-end title tests pass.no heap windowsSKIPPED line thatmainshows here is gone, andheap_window_out_of_memory_falls_back_to_the_switch_form,heap_windows_by_default_on_nvidia_only,default_heap_windows_are_flat_and_for_the_direct_form_only,gpu_raw_window_view_reaches_its_topandgpu_heap_windows_reject_out_of_uma_aliasingpass.a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: this head's base has that test but not its fix (#2420), so it fails there onmaintoo. Skippedhle::xaudio2, because its tests fail or hang on this machine onmaintoo. The PR touches neither.no wave64, 3 f16/f32 forms the per-lane path refuses, 1 PSO measurement that needs Developer Mode.Added 21:32Z: re-run at the current head
ab2855f(as is, base6d12f58), same RTX 3070 8 GB, same command but without the bridged-test skip (the base now has #2420's fix): 1417 passed, 0 failed, 46 ignored. No device removal, and the end-to-end title tests pass. The heap-window tests run rather than skip (12 pass, includingheap_windows_by_default_on_nvidia_onlyandheap_window_out_of_memory_falls_back_to_the_switch_form), and nono heap windowsSKIPPED line appears. SKIPPED lines: 25 (21no wave64, 3 f16/f32 per-lane refusals, 1 PSO measurement that needs Developer Mode).AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:46:05Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1 real failure —gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(group-barrier assertion, lower_dxil.rs). Same failure as #2371 and the rest of this stacked series.— Devin
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:03:23Z.
Review: COMMENTED
P2: driver_pso uses compute_mem_windows() for every PSO. On NVIDIA defaults compute is heap-windowed but graphics remains switch-form; nevertheless translated_graphics_pso runs under with_switch_fallback, so any unrelated graphics E_OUTOFMEMORY is misclassified as heap-window failure and retries the identical graphics pipeline. Restrict heap-OOM fallback to the actual translated stage/form and add graphics-E_OOM/no-retry coverage. This draft also lacks regression pair, reruns of prior NVIDIA failure scenarios, and 8 GB-card validation.
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-25T23:25:05Z.
Test report for
ab2855f(includes #2427d356a74) with #249678bba5conmaine1d84b7d(tree76fc443d): outputs and driver code size.Tested
--test-threads=4, NVIDIA 32-lane waves only. One run each.b39fd905: plus our test arms and a test-only break switch): 1429 passed, 1 failed, 46 ignored, 24 SKIPPED lines.main: 1422 / 1 / 46, 25 (heap_window_out_of_memory_falls_back_to_the_switch_formskips there). Both fail e2epresentsonly.XCL_WINDOW_NO_CARRY, wave32 and split wave64, in #2408's two tests and a new one (offsets, window edges, out of range, null, inactive lanes, halfword, typed,s_load): all expected values met. Three arms in #2427's test, one flat, agree with its root UAV run. Three one-line breaks of the flat read are caught.GetCachedBlobbytes, 60 compute records (30 largest, 30 sampled, chosen beforehand), unsplit, at opt-level 3 without debug assertions; plain debug gives the same DXIL and root signatures (60/60, 0 validator errors).XCL_HEAP_WINDOWS=0) 51.17 MB, guarded heap (XCL_HEAP_FLAT=0) 42.19, flat (new default) 41.11Not tested: what the 60 programs compute, a title, build time, split chains, GS, mesh, graphics, other GPUs.
AI use: Claude Code. Claude Opus 5.5 wrote the test, ran it and wrote this; Claude Fable 5.2 rechecked it.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:59:33Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-26T01:38:59Z.
Linux (Wine + vkd3d-proton) + NVIDIA,
ab2855f, the title withXCL_DIRECT_DXIL=1, cold, 2 runs with heap windows by default and 2 withXCL_HEAP_WINDOWS=0: the heap form's DXIL was 11 to 21 % smaller (median 18 %), but its creation times did not separate from the spread between runs. The 18 programs whose DXIL changed took 73.0 s per run against 96.9 s, nearly all of it8994bb33…anddd51cdee…. Six programs with the same DXIL either way were also faster in the heap-window runs, by as much asdd51cdee….Setup:
6d12f58a(this pull request's base) + #684e56dbc3+ #2427d356a74+ #2428ab2855f, one build, the two settings in turn. RTX 4070 12 GB (615.71.09), Fedora 44, Wine 11.21 Staging, vkd3d-protonv3.1-90-g30b0eb9bwith XCL's relaxed-vtable patch and dxil-spirve084e35cplus four patches, release, Series X profile, 200 s, A at 16.0 to 16.2 s,XCL_PSO_PRELOAD=0,XCL_PSO_DISK_CACHE=0, fresh NVIDIA and vkd3d-proton caches per run. Times are thedriver compile finishlines: vkd3d-proton's whole creation under Wine (dxil-spirv, then the driver), not nativeCreate*PipelineStatetime.XCL_HEAP_WINDOWS=0: DXIL, two runs8994bb33444988e6dd51cdeedc76d3a744d832b4bdbd5ef8a74706fb8f96ade9=0. Over the 18, the median was 0.98; without the two largest, 56.8 s against 51.7 s. The 6 unchanged had a median of 0.43.=0run lost its device at 77.9 s (0x887a0005, vkd3d-protonFailed to wait for Vulkan timeline semaphore, vr -4, no NVIDIA kernel message); it is left out.af82530. Read: its changes limit flat reads to compute entries and retry E_OUTOFMEMORY only for heap-window builds; neither touches these programs, and no run logged an E_OUTOFMEMORY.Not tested:
af82530itself; the default path's direct programs (not reached in 200 s withoutXCL_DIRECT_DXIL=1); graphics; the suite; Windows.AI use: Claude Code (Claude Opus 5.5) ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T01:50:07Z.
@Royalflamejlh thank you for the runs and the careful write-up.
Under Wine and vkd3d-proton, the compile-time gain doesn't separate from the spread between runs except in the two largest programs, and the six programs with unchanged DXIL show how large that spread is. I've scoped the description's compile-time claim to what it was measured on: native Windows, an RTX 5070 Ti on 610.74, and five large compute programs, timed against the switch from before #2368. Those five are all the native compile-time evidence there is, so the description now says the gain is shown only for a few large programs, and not natively against #2368's form. Your result is under Tested by others, with your caveat that the times are vkd3d-proton's whole creation path rather than native
Create*PipelineState. The 11–21 % DXIL reduction is cited there as well.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T01:55:37Z.
@bmjask thank you, the P2 was right.
Fallback scope.
driver_psotook "heap windows" fromcompute_mem_windows()for every pipeline. With NVIDIA's default, compute is heap-windowed and graphics stays in the switch form. So a graphics E_OUTOFMEMORY was taken for a heap-window refusal, andwith_switch_fallbackbuilt the same graphics pipeline again. Fixed, now inc6e5af86:with_switch_fallback(heap, build)now takes whether the stage being built took heap windows:compute_mem_windows()for compute,mem_windows()for graphics and mesh (heap only withXCL_HEAP_WINDOWS=1).driver_psonotes E_OUTOFMEMORY only while that is set, and only for the first attempt. A driver call outside a translated build never counts.Tests,
real.rsswitch_fallback_tests:an_out_of_memory_without_heap_windows_is_not_retried: one attempt, E_OUTOFMEMORY returned;an_out_of_memory_with_heap_windows_is_built_again_once: two attempts, nothing left noted;a_driver_call_outside_a_translated_build_is_not_a_heap_window_build.The end-to-end
heap_window_out_of_memory_falls_back_to_the_switch_formstill runs and passes on this head. Suite onc6e5af86(on #2427 andmain6d12f58a): 1431 passed, 0 failed, 46 ignored.Regression pair (in the body), on
c6e5af86againstmainb49be18, 120 s,XCL_DIRECT_DXIL=1: no removal or crash, 140 % ofmain's frames (2227 against 1593) and 50 % of its peak commit.Earlier NVIDIA failures and 8 GB.
ab2855f, with the heap-window tests running and no device removal. They have since rerun it on970823e, after the fallback fix: 1422 passed, 0 failed, 46 ignored, with all 16 heap-window tests running. There is no title run on an 8 GB card.927adcc0, scoped above), and the view that removed the device on some runtimes is capped (deb4b92b). This card shows no removals. Whether that covers both failures is not confirmed, and the body says so.AI use: Claude Code (Claude Opus 5.5) made the fix and the tests and wrote this reply.
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T03:08:59Z.
By reading only, not run, at
970823e4: on NVIDIA with default settings,xcl shaders --precompilemakes VS, PS and mesh compute-pass entries that the runtime never looks up.precompilegets one window count for every stage:shaders.rs:978takes it fromruntime_windows, which ispso::compute_windows(n)(shaders.rs:996). On NVIDIA that isn | HEAP_WINDOWS | HEAP_FLAT(pso.rs:92,:146).shaders.rs:1695), sotranslateemits the heap form (recomp/mod.rs:1506), andcompile_cachedkeys on that HLSL (dxc.rs:575).mem_windows()(pso.rs:204for VS/PS,pso.rs:1229for mesh), which has heap windows only withXCL_HEAP_WINDOWS=1(pso.rs:79,:151). Their HLSL is the root-UAV form, so each of those precompiled entries is a cache miss and the title compiles them cold. Nothing wrong is loaded. Onmainand on #2427 alone the two counts are the same.--only cs,--windows 1,XCL_HEAP_WINDOWS=0or=1and other vendors are not affected.precompile_windows_are_the_runtimesruns withXCL_HEAP_WINDOWS=1, so it does not see this.A fix could give
precompileboth counts:compute_windows(n)for compute containers and the rulemem_windowsuses for the rest, with the test also run withXCL_HEAP_WINDOWSunset and an NVIDIA vendor. #2613 and #2246 pass the same single count on to VS/PS and to the mesh pass, so they do not change this.AI use: Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T04:23:44Z.
@pvfreis thank you, that was right, and it would have cost exactly what this PR is for: VS, PS and mesh programs compiling in play after a precompile.
Checked against the code at
970823e4:precompiletranslated every stage withpso::compute_windows(n), which on NVIDIA by default isn | HEAP_WINDOWS | HEAP_FLAT. VS, PS and mesh programs takepso::mem_windows()at run time, which has heap windows only withXCL_HEAP_WINDOWS=1.Fixed in
c6e5af86, as you suggested:runtime_windowsinshaders.rsgives two counts. Compute programs takepso::compute_windows, ascompute_mem_windowsdoes. VS, PS and mesh programs take the newpso::graphics_windows, whichmem_windowsnow uses too.precompile_windows_are_the_runtimesnow also runs withXCL_HEAP_WINDOWSunset on an NVIDIA and an AMD vendor, each in a new process. With the old single count it fails on the NVIDIA case: VS, PS and mesh got 772 where the runtime uses 4.c6e5af86: 1431 passed, 0 failed, 46 ignored.Offline count, the first 4,000 records of the title's shader pack, release: a fresh DXIL cache,
xcl shaders --precompile --only vswith default settings, then the same withXCL_HEAP_WINDOWS=0, whose VS keys are the runtime's default ones.970823e4: the second run compiled all 542 again, so none of the precompiled VS entries would have been found in play. The 12 it found are programs that repeat within the pack.c6e5af86: the second run compiled none and found all 554.I did not count PS. The first 6,000 records hold none, and a full-pack count takes close to an hour. PS and mesh take the same count as VS in
precompile.AI use: Claude Code (Claude Opus 5.5) made the fix, the test and the count and wrote this reply.
Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-26T05:00:52Z.
The GPU leg now runs and passes on a relaxed diagnostic stack — and the fallback genuinely fires. Head
af825308(policy tests previously verified 2/2 under Wine on this host), RTX 4060 Laptop GPU 8 GiB, Wine 11.0, NVIDIA 590.48.1,--locked --target x86_64-pc-windows-msvc, one test thread, freshCompiling xcl .../xcl-pr2428/...provenance.On stock vkd3d-proton 3.2.0 this integration test aborted before its body:
Assertion failed: iface->lpVtbl == &d3d12_root_signature_vtbl (vkd3d_private.h:2111)afterID3D12RootSignature – 8 PC methods, 33 internal slots under the guard— the #175 identity wall, which is why the earlier report here carried only the policy-test result.On the relaxed diagnostic build of the same provenance commit our stock DLL reports (
2576c0b4adfae4a,-Db_ndebug=true+ the two #175from_ifacerelaxations, local-only):heap_window_out_of_memory_falls_back_to_the_switch_formpasses 1/1 (0.91 s). Not a skip: the log shows the forced OOM hitting on the real adapter —the driver ran out of memory on a pipeline with heap windows – building it in the switch form (1 so far)— followed by a translated console CS PSO build and full Queue/Fence/Resource/Allocator/List adoption through the guards. The #1651 concern about this test's opt-in GPU skip did not apply here; the fallback path executed.Scope: relaxed stack = identity checks compiled out, so this verifies the fixture's assertions, not XCL's vtable patching against a stock runtime; no title run. Log:
.compat-xcl/logs/verify-pr2428-wine-heap-oom-relaxed.log(local). AI-assisted verification and report (OpenAI Codex).Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T05:06:19Z.
@pickles976 thank you, especially for showing that the fallback really fired on the adapter and wasn't skipped. Your run is under Tested by others in the description, with your caveats: the relaxed diagnostic build with the identity checks compiled out, and no title run. It was on
af825308. The head is nowc6e5af86, which changes only the precompile's windows, not the fallback path.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T08:43:44Z.
NVIDIA and AMD full-suite run, to go with the reports above by pickles976, upipibi, since none of them covers AMD. Tested exact head
c6e5af86(on its base6d12f58).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1419 passed, 0 failed, 44 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,dispatch_chain_native_wave64_builds_whole,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.only_compute_programs_read_heap_windows_flat,heap_windows_by_default_on_nvidia_only,default_heap_windows_are_flat_and_for_the_direct_form_only,gpu_heap_flat_reads_match_the_switch_form,an_out_of_memory_without_heap_windows_is_not_retried,an_out_of_memory_with_heap_windows_is_built_again_once,a_driver_call_outside_a_translated_build_is_not_a_heap_window_build,precompile_windows_are_the_runtimes.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1430 passed, 0 failed, 46 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on mainb49be183too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T08:46:36Z.
@futurepro62 thank you for the full suite on
c6e5af86, and on the Radeon iGPU too. Both runs are now under Tested by others in the description.One test in your NVIDIA
--skiplist is one this PR changes:heap_window_out_of_memory_falls_back_to_the_switch_form. Onmainit skips on NVIDIA, because heap windows are opt-in there, andXCL_REQUIRE_GPU=meshturns that skip into the #1651 failure. On this head, heap windows are on by default on NVIDIA, so the test does not skip: it forces an out-of-memory and checks the switch-form rebuild. On my RTX 5070 Ti (610.74) it ran and passed in the suite onc6e5af86(1431 passed, 0 failed, 46 ignored, no--skip). If you have a minute,cargo test -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_formon 621.40 would cover it on your driver. On the iGPU it skipped with "no heap windows", which is the intended default off NVIDIA.The rest of the list are
main's tests, which this PR does not touch.AI use: Claude Code (Claude Opus 5.5) drafted this reply from your comment and my suite log.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T09:38:50Z.
Independent RTX 3080 Ti check of PR head
c6e5af86, following the request to cover the fallback test. NVIDIA driver 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC/DXIL 1.8.2502.11; debug build.With
XCL_HEAP_WINDOWSunset andXCL_REQUIRE_GPU=mesh:cargo test --offline --locked -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --nocapture --test-threads=1passed 1/0/0. It ran on the real RTX adapter, made the shared heap views by default, logged the injected heap-window out-of-memory condition and one switch-form rebuild, then completed the compute fixture. No skip or device removal occurred.With
XCL_HEAP_WINDOWSandXCL_REQUIRE_GPUunset:cargo build --offline --locked --workspace: passed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,431 passed, 0 failed, 46 ignored across 37 test executables; 24 GPUSKIPPEDnotices (mainly unsupported wave64). Skips are not GPU coverage.An initial suite invocation before the workspace build failed three e2e tests because the test title binaries were missing. The documented build step and full rerun above passed.
Not tested: a retail title or paired smoke run, an actual driver out-of-memory event rather than the test injection, other GPU vendors, or release performance. This confirms the fallback fixture on Ampere driver 621.35; it does not establish the whole-title code-size or compile-time gain.
AI use: Codex (GPT-6.2 Sol) checked out the exact head, ran the tests, checked the log for the real GPU and actual fallback, and drafted this report.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T09:43:41Z.
@thehollowedone thank you. Your run covers the fallback test that the earlier run left out:
heap_window_out_of_memory_falls_back_to_the_switch_formran on a real RTX 3080 Ti (621.35) with heap windows on by default, and the injected out-of-memory gave one switch-form rebuild. Your 1431/0/46 workspace run is also under Tested by others in the description, with your caveat that the out-of-memory was the test's injection, not a real driver event.AI use: Claude Code (Claude Opus 5.5) drafted this reply from your comment.
Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-26T15:35:11Z.
By reading only, not run, at
c6e5af86againstmainat8b957bec:mainnow has #2555's startup preparation, and once this is rebased it would key compute programs differently from the title on NVIDIA unless the preparation learns the vendor first.mainalone is fine (itsheap_windows()reads only the env,pso.rs:116-118).main,prepare_for_launchbuilds one window count frompso::heap_windows()(shaders.rs:1646-1647) and passes it toprecompile(:1650) for compute (:1730) and VS/PS/mesh (:1768). The rebase has to touch that call:precompiletakesgraphics_windowshere (shaders.rs:1606atc6e5af86).host.rs:39onmain), so beforereal::init, the onlyset_adapter_vendoron that path at this head (real.rs:526). WithXCL_HEAP_WINDOWSunset the vendor is still 0,heap_windows()is false (pso.rs:147-154), andruntime_windows(n)givesnfor compute too. The title then translates compute withcompute_mem_windows()=n | HEAP_WINDOWS | HEAP_FLAT(pso.rs:92-104,:210).ShaderKeyand in the translation cache's file name as is (pso.rs:227-237,:354-358), so the title finds none of the prepared compute translations. On the HLSL path the source is the same (hlsl_windows,pso.rs:682), so DXC and driver caches still hit and only the translation is redone.pso.rs:659,:687), so for enormous programs, and for all compute withXCL_DIRECT_DXIL=1, the DXIL differs: the startup pass builds root-UAV pipelines the title never loads (pieces and whole, uncapped:shaders.rs:1660,:1733-1735onmain), and the title compiles the heap form cold.XCL_HEAP_WINDOWS=0or=1and other vendors are not affected.precompile_windows_are_the_runtimessets the vendor itself, so it does not see this.A fix could set the vendor in
prepare_for_launchbefore the windows are computed, from the adapter the preparation uses (progress.adapter, the config's selector as inreal::init,real.rs:516;note_adapter_vendoruses"auto"), and passruntime_windows(n)'s two values.AI use: Claude Code (Claude Opus 5.5) found this; Claude Fable 5.2 rechecked it; checked by a person before posting.
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:41:01Z.
A detail for the rebase onto #2555, adding to pvfreis's comment above (by reading,
c6e5af86against main8b957bec, not run):main's prepare_for_launch adds only HEAP_WINDOWS (shaders.rs:1646-1647); main has no HEAP_FLAT. At this head with_heap (pso.rs, compute_windows / graphics_windows) adds HEAP_FLAT by default to every stage that takes heap windows, so with XCL_HEAP_WINDOWS=1 VS, PS and mesh keys carry it too. If the conflict keeps main's line, the prepared keys miss with =1 as well, not only with the variable unset. Setting the vendor from progress.adapter first and passing runtime_windows(n)'s two counts, as pvfreis suggests, covers both. A check of precompile_windows_are_the_runtimes through prepare_for_launch (vendor 0x10DE, variable unset, and =1) would catch it.
The prepared pipelines are not wrong, only unused: the ABI root signature is the same for both forms (heap directly indexed, pso.rs:1431) and the driver cache is keyed on the DXIL.
AI-assisted (Claude Code, Claude Opus 5.5): found this by reading; not run.
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T20:30:41Z.
Another 8 GB NVIDIA run on the current head
c6e5af86(basemain6d12f58a, merge-base6d12f58a): RTX 3070 8 GB (Ampere, wave32, driver 616.56), Windows 11 26100, rustc 1.100.0, debug. Ryzen 9 5950X, 32 GB RAM.cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2(no XCL_* env): 1422 passed, 0 failed, 46 ignored. 25 SKIPPED: 21 no wave64, 3 wave32 per-lane f16 forms, 1pso_measurement_compiles_an_exact_synthetic_record(needs Developer Mode to disable the driver cache).gpu_heap_flat_reads_match_the_switch_form,an_out_of_memory_with_heap_windows_is_built_again_once, andheap_window_out_of_memory_falls_back_to_the_switch_form(heap windows on by default here).Tests only: no title run, no compile timing (driver cache cannot be disabled here).
AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:56:27Z.
Tested: Clean
60287fe493e7a37a130da18ea92ec88994c32796, Windows 11 build 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug. Built withcargo test -j 2 -p xcl --lib --no-runandcargo test --locked -j 2 -p xcl --test gpu_compute_e2e --no-run. Three exact CPU tests for vendor policy and precompile/runtime selection passed. On Arc A770,shaders::tests::launch_windows_are_the_titleswithXCL_TEST_LAUNCH_WINDOWS=1passed withXCL_HEAP_WINDOWSboth unset and1. With the override unset,heap_window_out_of_memory_falls_back_to_the_switch_forminitialized the Arc backend and emittedSKIPPED … no heap windowsbefore the OOM injection. Five exercised passes, zero failures or ignores, one capability/selection skip.Not tested: NVIDIA/AMD hardware, driver fallback execution on Arc, full suite and retail smoke.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and wrote this report.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T12:42:20Z.
Corrected exact-head Windows/NVIDIA report. My earlier full-suite failure count came from this test environment's unwritable default DXIL cache. I reran the suite at the same clean #2428 head
60287fe4withXCL_DXIL_CACHEset to a writable scratch folder. The previously failing mesh-cache test passes under that setting; it also passes on current main06f90c1with a writable cache. Please use these corrected counts.Windows 11 build 26300, RTX 3080 Ti / NVIDIA 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, DXC 1.8.2502.11:
cargo build --locked --workspace: passed.cargo test --locked -p xcl --lib launch_windows_are_the_titles -- --nocapture --test-threads=1withXCL_TEST_LAUNCH_WINDOWS=1: 1 passed, 0 failed, 0 ignored, 0 skipped withXCL_HEAP_WINDOWSunset; the same result withXCL_HEAP_WINDOWS=1.XCL_HEAP_FLATwas unset in both separate processes.XCL_REQUIRE_GPU=mesh,cargo test --locked -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 skipped on the real D3D12 path. This setting would fail this test if it skipped for a missing GPU or heap windows.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --quietwith writableXCL_DXIL_CACHE: 1,455 passed, 0 failed, 47 ignored across 38 targets, with 24 skip notices (21 no native wave64, three refused per-lane cases). Skips are not GPU coverage.The launch-key and injected-OOM fallback paths passed at this exact PR head. I did not run a clean-head paired title smoke, whole-title shader preparation, or AMD/Intel/Wine. The description still needs smoke blocks for
60287fe4before this is merge-ready.AI use: Codex (GPT-6.2 Sol) ran and reran the build and tests, checked counts and skips, and drafted this correction.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T15:38:10Z.
Triage note (from https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7222291116, a check from the outside against CONTRIBUTING.md, not a code review):
this PR conflicts with
main, andPR descriptionis red: thexcl-smokeblock for the PR does not seem to name the current head, so it needs a rerun after the rebase.AI use: Claude Code (Claude Fable 5.2).
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-27T17:40:23Z.
8 GB NVIDIA run on the new head
775c1018(rebased, merge-base =main6089122a), with heap windows now on by default for NVIDIA: RTX 3070 8 GB (Ampere, wave32, driver 616.56), Windows 11 26100, rustc 1.100.0, debug. Ryzen 9 5950X, 32 GB RAM.cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2(no XCL_* env): 1465 passed, 0 failed, 47 ignored. In the first pass the 3 title tests intests/e2e.rsfailed with "missing xcl_testtitle.exe – build first" because the target dir was fresh. Aftercargo build --workspaceall 4 e2e tests passed. 25 SKIPPED, as onc6e5af86: 21 no wave64, 3 wave32 per-lane f16 forms, andpso_measurement_compiles_an_exact_synthetic_record(needs Developer Mode).--test-threads=1: 3 of 3 runs passed (18 passed, 0 failed each), none skipped. They includeheap_windows_by_default_on_nvidia_only,default_heap_windows_are_flat_and_for_the_direct_form_only,only_compute_programs_read_heap_windows_flat,gpu_heap_flat_reads_match_the_switch_form, thegpu_heap_windows_*atomics/divergent-lanes checks andan_out_of_memory_with_heap_windows_is_built_again_once.heap_window_out_of_memory_falls_back_to_the_switch_formpassed in the workspace run.Tests only: no title run, no compile timing.
AI-assisted (Claude Code, Claude Opus 5.5 ran the tests and posted).
Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-27T23:56:26Z.
A retail data point on NVIDIA where #2427 + #2428 come out worse, apparently because the flat heap form pushes many compute programs over the direct-DXIL split threshold.
Setup: RTX 3080 10 GB, 31 GB RAM, Series S mode. Base: main
6089122aplus #3074/#3075 withXCL_PAGE_ALIAS=1, and default-off local diagnostics. #2428's head (775c1018, which includes #2427) merged on top. DefaultXCL_DIRECT_SPLIT_INSTRUCTIONS. Each build had its own warm shader cache, and both runs used the same scripted path into the world for 720 s. These are single runs.Without the PRs, no compute program was split in this run. With them, 2,300+ pieces were built and the DXIL handed to the driver grew by about 70 %. My guess is that the one-path read form makes the large programs longer in instructions (the thing the split threshold counts), even though it has fewer blocks. That would turn the smaller-per-program win from your measurements into more programs being split here. I haven't checked this per program. The shader prep for this build was also much slower on this card.
Happy to rerun with a higher
XCL_DIRECT_SPLIT_INSTRUCTIONStogether with your PRs if that's useful.Imported from ivall/xcl. Originally posted by gefydev on 2026-11-28T01:27:07Z.
I tested
775c1018(including #2427) against its base6089122aon a GTX 1650 4 GB, using a retail Series X title. The order was main, PR, PR, main. Both builds used the same local telemetry andXCL_DIRECT_DXIL=1,XCL_PREPARE=0,XCL_TEXTURE_LEVEL_PAGES=1, andXCL_PSO_DISK_CACHE=0. The NVIDIA driver cache was left in its normal state. Both PR runs logged the shared descriptor heap. All four passed the profile selector and showed loading artwork after Enter.For 106 compute records with an unambiguous and reproducible DXIL size in all four runs, the driver input totaled 7,750,160 bytes on main and 6,715,724 bytes on the PR (−13.35%). These are DXIL sizes from the compile log. I measured private commit for the title host and, separately, commit in the large
VirtualAllocarenas attributed tonvgpucomp64.dll.CloseCreateHeapCreateHeapCreateHeapAt the common cut all four runs had 3392 MiB in texture-page pools. The smaller DXIL did not translate into lower local video usage or lower peak commit on this setup. The PR delayed the first OOM in the first pair and reached it slightly earlier in the second pair. All four stopped during loading, before gameplay. The first main run finished about three hours before the rest of the sequence. There were no intervening XCL runs on this PC.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T19:32:39Z.
Test report: cold driver compile time of the flat heap-window form on an 8 GB NVIDIA card (RTX 2070 SUPER). One run per record, so read it as a direction.
This PR does not merge into current
main(conflicts inlower.rs,pso.rs,real.rs,shaders.rs), so I measured the form it turns on by default:main0fe06eb0withXCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1, againstmainwithout them. This is not a test of this PR's code or of its NVIDIA detection.Setup
xcl shaders <retail game's shaders.rpf> --measure-pso <record> --repeat 1: the driver's shader caches are turned off (ShaderCacheControl, Developer Mode), so every build is cold. One compile at a time, through a local exclusive queue (nothing else running).Results (DXIL bytes, cold
CreateComputePipelineStates)95cc13288a27a96e2e1d03fbed9d95eb958400d2caf0724456c0cd3b82a00c6e1d4ecf4cb407d4fe2e1d…,1d4e…), about the same on the others, +7 % on95cc…(which takes the compact form).E_OUTOFMEMORY, no device removal. This was a pipeline build only: no title ran with heap windows, so the earlier device removal when the views are made at runtime is not covered here.Not tested: this PR's own head; a title run with heap windows on this card; graphics stages; AMD.
AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the queued job and wrote this report.
Context: why DXIL size matters for cold compilation. On this title, compute programs whose whole DXIL is 512 KiB or larger are 27 % of the 2,730 compute programs but about 95 % of a cold full preparation's compute driver work (driver time weighted as size^1.6, fitted to 1,340 cold compiles on this card). So size reductions count almost only on those programs. Breakdown by size band: https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7262349510
Imported from ivall/xcl. Originally posted by lucsoft on 2026-11-30T17:58:08Z.
AMD data point for making flat the default there too.
amd-devhas run with flat heap reads on by default for every stage since its heap-window work (pso.rs: "XCL_HEAP_FLAT(default on with heap windows;=0to disable)"), and its retail world runs on RDNA3/RDNA4 were made with that form. While mergingmainintoamd-dev(#3444) we tookmain's opt-in, compute-only setting, so that branch now runs the guarded form by default — which is how we noticed.The compile-side numbers for AMD are already in #2427: on an RX 9070 XT, @bielfreedom measured
CreateComputePipelineStateabout 11 % faster over 26 large retail compute programs (91.6/100.2 s → 85.8/86.9 s), driver peak memory 1.62 → 1.27–1.34 GB, and 3.7 % less DXIL over all 2,689 compute programs. So the case for compute on AMD looks at least as good as on NVIDIA.Would you consider covering AMD in this PR (compute only, like NVIDIA), or should that be a separate follow-up? Graphics stages are a different question;
amd-devruns them flat too, but there are no cross-vendor numbers for those yet.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:10:40Z.
Review (head
775c1018, diff read, not a merge-check; it conflicts with main, so not built or run). Stacked on #2427 (its first commit,bfb136cf); this covers775c1018.pso.rs~189-203), but the rebase is a rewrite. Dropbfb136cf(#2427 is on main as2f523330), then fit compute vs graphics windows into main'smem_windows(TITLE_WINDOWS,windows_for_mode,windows_for_stage) and all its callers:compute_build_key.rs~79,real.rs~5128 (driver_pso) and ~6212,pso_corpus.rs~132, and the preparation / history windows inshaders.rs(~1154, ~3298, ~3374, ~3660, ~3943). Preparation workers create no device, soADAPTER_VENDORwould be 0 there and NVIDIA compute keys would come out wrong.hlsl_windows(~685) strips the heap flags: the heap views are still made at startup and every list binds the shared heap (real.rs~380) without any shader reading through them, and #187's failure on an 8 GB card came when the views were made. The smoke run usedXCL_DIRECT_DXIL=1; main now routes compute through direct DXIL by default, so it needs redoing without that variable.b5973e3eand644b5188, which none of the timings or title runs cover; a vendor default needs fresh numbers, the two #187 setups rerun, and an 8 GB title run.heap_flat()(~185) flips the default for every vendor: AMD / Intel users who setXCL_HEAP_WINDOWS=1silently get the flat form and new cache keys, while the description says other vendors are unchanged.Fine: scoping the out-of-memory retry to builds that used heap windows (
HEAP_WINDOW_BUILD, ~3824) with tests, the vendor-rule test and the per-stage precompile test.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T19:37:49Z.
Closing: first commit (#2427) is already on
main(2f523330), and the default-on policy needs a rewrite againstmain'smem_windows/preparation windows; will re-open small after #3633 if still wanted.Pull request closed