Recompiler: big compute programs read their memory windows without a switch #1380
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!1380
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1380"
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?
@wondercrash on GitHub · 2026-11-24 15:24 UTC · original
wondercrash:pr/flat-window-loads→main· +183 −55 · 2 files · 1 commits · openBig translated compute programs (HLSL of 1 MiB or more) read their memory windows without the per-load
switch (xcl_w). With 4 windows the NVIDIA driver spends 30–90 s on each ~1 MB-DXIL program of the retail title's CS_RaytracingResolve family, while a bind of the title waits for it; without the switch it is 3–4× faster. Part of #156.Each load now reads every window – the selected one at the address, the others at offset 0 – and picks the result with
select(xcl_w == k, …). The values are the same, including 0 for an out-of-rangexcl_w. Stores and atomics keep the switch. Smaller programs, VS and PS keep byte-identical HLSL, so their DXIL and driver-cache keys do not change (901 of the 2 689 compute programs and 164 of the 9 282 mesh-pass programs in the title'sshaders.rpfchange; no VS or PS).Rebased onto
maine9e94ce. Theemit.rschange is the same as before the rebase.mainnow has #680 and #1693 (memory windows from the descriptor heap, HLSL path and direct path), #1426 and #1748 (direct DXIL) and #1321 (oversized structured code falls back topcblocks). None of them changes which programs this PR touches (all 29 387 translations of the title'sshaders.rpfcompared, below).XCL_HEAP_WINDOWS=1) is off by default because of two NVIDIA reports.main's.927adcc; NVIDIA 616.92 refuses some big programs withE_OUTOFMEMORY, #156). Those are the big programs, and their switch form now gets the flat loads.XCL_DIRECT_DXIL=1for compute and the mesh pass,=allfor VS / PS too) is off by default. This PR changes only the HLSL path (gpu/recomp/emit.rs), so:switchon the window per memory operation, all dwords of the operation in one switch (with_mem_many_tys,gpu/dxil/lower_mem.rs), and withXCL_HEAP_WINDOWS=1(#1693) one guarded descriptor-heap access. So in the default switch form it still branches per access, and this PR does not change that;gpu/dxil, and this PR changes only the HLSL accessors.pcblocks, and that translation goes through the same size rule. In the title's pack it changes one program,95cc13288a27a96e(154.6 → 15.4 MB of HLSL in this PR's form). It is still over 1 MiB, so it is still flat.#174 (DXC linking) and #1043 (pruning accessors) are about DXC time and do not change the driver's time.
What is in it
Recompiler: big compute programs read their memory windows without a switch–crates/xcl/src/gpu/recomp/emit.rs(FLAT_WINDOW_LOADS_FROM= 1 MiB;windowed/mem_accessorstake #680'sheapand a newflat; the heap form returns first,flatchanges only the switch form's loads),crates/xcl/src/gpu/recomp/tests.rs:a_big_compute_program_reads_its_windows_without_a_switch(new; throughtranslateonly). Onmainit fails:xcl_loadx4of a 4 000-load program still has[branch] switch (xcl_w).big_programs_read_their_windows_without_a_switch(new): the shape of the flat accessors, stores and atomics unchanged, the size gate, and a big program with heap windows keeping one heap access per load (noselect).gpu_memory_windows_reject_out_of_uma_aliasingandgpu_sparse_vram_descriptors_buffers_and_xmem(extended): the switch form (or the heap form) and the flat form of the same program, with the same assertions (out-of-UMA reads give 0, canaries untouched,hi == 0reads window 0, 64-bit carry and borrow, sparse descriptors changed between submits). The switch / heap form still goes throughmain'sdirect_or(..)(the direct translator withXCL_DIRECT_DXIL=1), and the flat form through DXC.gpu_heap_windows_reject_out_of_uma_aliasing(#680's) runs the heap form as before.Tested
NVIDIA GeForce RTX 5090 (driver 621.14), AMD Ryzen 7 9800X3D, Windows 11 23H2 (10.0.22631), Rust 1.96.0
stable-x86_64-pc-windows-msvc.At
7d43a46(this head, onmaine9e94ce):cargo check -p xcl --all-targets: no warnings, no errors.cargo test -p xcl --lib --release -- gpu::recomp --test-threads=1(withXCL_SAMPLE_RPFset to the title'sshaders.rpf): 200 passed, 0 failed, 18 ignored.SKIPPED:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).XCL_DIRECT_DXIL=1:gpu_sparse_vram_descriptors_buffers_and_xmem,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_memory_windows_above_4_gib,gpu_memory_windows_from_the_heap,gpu_mesh_mode_reads_memory_windowsandgpu_bvh64_intersect_ray_across_memory_windows_and_grazingpass (6 passed, 0 failed, noneSKIPPED).cargo build --workspace && cargo test --workspace -- --test-threads=4: 894 passed, 0 failed, 42 ignored.SKIPPED:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).On
maine9e94ce:SKIPPED. The two more on this head are its two new tests.a_big_compute_program_reads_its_windows_without_a_switchFAILED (xcl_loadx4still has[branch] switch (xcl_w)).Translation of every program in the title's
shaders.rpf(split wave64, 4 windows; CS / VS / PS throughconsole_translation, and the ES / GS / CS / MS stages throughtranslate), HLSL compared withmaine9e94ce(29 387 translations). The same programs change as against the earlier bases (9e3831e,c160d86,6c89285).XCL_HEAP_WINDOWS=1(heap form)Driver time, one
CreateComputePipelineStatewith a cold driver cache (a fresh copy of the exe for each row, because the NVIDIA cache is keyed on the exe), RTX 5090. Measured on the first version of this PR (c2a1040, onmain930e8b4), not repeated on this head:DXC's optimisation level does not change it (bcca, switch form: -O0 39.1 s, -O1 32.4 s, -O3 35.5 s).
Retail title (the newer one in the README), the same pipelines with a bind waiting for each, while other compiles ran: switch form 31b81a7b 78.3 s and ef008c0f 85.8 s. Flat form 31b81a7b 21.0 s, ef008c0f 20.9 s and ab570963 16.9 s. These two runs were on our integration tree (the first version of this commit plus other open PRs), not on
mainplus this PR alone.Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 60, RTX 5090, no input (the title stays on its start screen),mainfirst, both builds with the same shared shader cache:maine9e94ce:This PR,
7d43a46:The pair of the previous head (
9e3831e/f925085) was run with a separate, empty shader cache per build holding the sameused-pipelines.txt, and a fresh copy of each exe: 1613 / 1655 frames, 17 651 / 16 132 MB peak commit, no removals or crashes.Two pairs of the previous head with one shared cache were not comparable then (this pair, also with one shared cache, shows no such gap):
main16 603 and 15 936 MB, and this PR 55 464 and 105 820 MB peak commit.main's. So only this PR's background preload went straight to the driver compiles of big programs. In the 105 820 MB run it made 253 compute pipelines from driver blobs (main: 66).main(presents, draws and dispatches per 2 s), and so was XCL's own memory (target pages, arenas, sparse pools).With the same shared cache and the preload off on both sides (
XCL_PSO_PRELOAD=0):main14 471 MB and 1 668 frames, this PR 14 478 MB and 1 669 frames.Not tested
XCL_DIRECT_DXIL=1in a title. The flat loads reach only its HLSL fallbacks; the programs it translates keep its own window switch per memory operation (gpu/dxil/lower_mem.rs,with_mem_many_tys). Driver times in that mode are not measured, and neither is whether a flat form would help there.real::open_umagives every window a buffer whenever the UMA opens at all.mainas well. The preload and its one-at-a-time slot aremain's code.main's log has no line for a compile in progress.mainwith a cache that holds its own forms of the same programs, so whethermaingrows the same way there is not measured. This change does not touch that code. With a warm cache it only makes these compiles start sooner.AI use
@WebIdentity1 on GitHub · 2026-11-24 16:21 UTC · original
Independent execution-cost check on
c2a1040dc891e395c3209cb0d9e30b94055619fbplus a local test-only harness.Tested
Synthetic RDNA2 -> production Compute translation -> DXC -> GPU:53,304-byte console program,1,519,964-byte HLSL, automatic flat-load gate active. The switch control replaces only the accessor functions; the rest of the HLSL is asserted identical. WaveSize32,1,024 threads x1,024 live GLOBAL_LOAD_DWORDX4 operations, four distinct4MiB DEFAULT-buffer ranges. CPU oracle checks uniform window3 and lane-varying windows0..7 (invalid reads zero).
Dispatch-only timestamps, switch/flat/flat/switch, nine samples after warmup per round. Per GPU:8,192 output words checked across eight final readbacks, zero mismatches;72 timed samples.
Windows10 19045,7800X3D,Rust1.98.1 MSVC,DXC1.8.2502.11,Agility1.620.2. Drivers:NVIDIA591.74;AMD32.0.21030.2001. Focused translated test:1/0/0 NVIDIA. AMD ran translated+small-helper tests:2/0/0. No skips/timeouts. A16-load negative control with all windows deliberately aliased fails736 outputs. Correct bindings restored for final runs. Small helper timings differed substantially; they are not a proxy for the translated shader.
Not tested
Retail programs/gameplay, sparse/imported UMA, wave64, other stages, cold driver compilation or a whole-workspace run with this scratch module. These workload-specific execution costs do not establish a retail regression or negate the reported driver-compile benefit. Exact fixture, patch, raw logs and SHA256 manifests are retained locally.
AI use: Codex (GPT-6) wrote the synthetic harness, ran the native tests and prepared this report. The PR implementation is unchanged.
Synthetic benchmark patch against c2a1040
Set
XCL_ADAPTER=3090orAMD,XCL_FLAT_PROBE_STEPS=1024; runcargo test --locked -p xcl --lib translated_flat_window_execution_cost -- --test-threads=1 --show-output.@t4l03 on GitHub · 2026-11-24 16:36 UTC · original
RTX 4070 Ti, four windows:
ActivateRayswith #1448 + #1380I applied this PR's
c2a1040dc891e395c3209cb0d9e30b94055619fbcleanly to #14486c7bb05baa6f3bcb278f156e3473d377e42163b7in a local checkout. The two emitters produced the same 2,516 cases and static samplers. The HLSL diff was confined to the load accessors.cs_6_6 -HV 2021 -O1produced 2,660,680 B DXIL in 17.05 s. Validation passed.AI use: GLM-5.3 via T3 Code assembled the scratch stack and emitted the HLSL. Codex via T3 Code (
gpt-6.2-sol) ran DXC, validation and the PSO comparisons and wrote this report.@DavidM1911 on GitHub · 2026-11-24 16:49 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@ahornerr on GitHub · 2026-11-24 16:14 UTC · original · edited 2026-11-24 17:48 UTC
AMD/RADV compile timings: On an RX 7900 XTX, the branch-free root-UAV form was about 9% slower than the switch for cold pipeline creation on one synthetic workload. This is a data point for #1269, not a recommendation against #1380 on AMD.
Tested: Same public
nv680-probeshader in all three forms (base, seed 1, 1,000 rounds, four memory windows, split wave64,cs_6_6, DXC-O1). I checked that the emitted HLSL used the intended accessors and that #1380 crossed its 1 MiB gate. Medians of three fresh-process runs per form, with Mesa and vkd3d shader caches disabled:CreateComputePipelineStatemain930e8b4— switch95f34c1— heap descriptorsc2a1040— branch-free root-UAV readsAll nine pipelines were created successfully. RX 7900 XTX, Mesa RADV 26.2.5, Wine 11.20, vkd3d-proton
b5cecb26d285420, DXC 1.9.2609.5.Not tested: Shader output or dispatch time, retail shaders or title runs, other shader shapes, or native Windows. Dispatch time would be useful to measure next because the branch-free form issues extra reads.
AI use: OpenCode assisted with the benchmark setup and runs; GPT-6.2 Sol checked the logs and drafted this report.
Follow-up: retail compilation and synthetic dispatch on the same AMD/RADV setup
The original one-shader synthetic result above did not carry over to the two retail compute shaders sampled here. These are the containers identified in this PR as
bcca7412e6c66279andef008c0f04b6261a. Median seconds, three serial fresh-process runs per case and form:CreateComputePipelineStatebcca7412e6c66279930e8b4)95f34c1)c2a1040)ef008c0f04b6261aAll 18 pipelines built. #1380 lowered cold pipeline creation time by 41% and 44% versus the switch, roughly matching #680 on these two cases. Same Wine/vkd3d-proton/RADV stack and DXC
-O1as above; four windows, detected wave32, no split wave64, matching static samplers, cache bypass/disable, and the intended accessor verified in memory for every build. These retail shaders were not dispatched.Dispatch microbenchmark: Same standalone compute body with each form’s emitted scalar load accessor, 2,048 threads × 128 dependent reads, 36 warmed GPU timestamp intervals per case (includes the output UAV barrier). All checked outputs matched the CPU reference. Median µs:
tid & 3)tid & 3)Branch-free reads took about half the time when lanes selected different windows, and were about 6–7% slower than the switch with a uniform selector. These are isolated load-accessor results, not full translated shader dispatch, gameplay, or native Windows data. No game files or shader dumps are attached.
AI use (follow-up): OpenCode assisted with the benchmark harnesses and runs; GPT-6.2 Sol verified the logs and drafted the report.
@MiharaxD on GitHub · 2026-11-24 18:59 UTC · original
Reposted: the earlier copy of this comment was deleted.
Test report on an 8 GB, 32-lane NVIDIA card, head
c2a1040(onmain930e8b4).Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) onc2a1040: 753 passed, 0 failed, 41 ignored (lib tests 709 / 0 / 21).a_big_compute_program_reads_its_windows_without_a_switchpasses.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60(release builds, start screen, no input) onmain930e8b4and this PR's headc2a1040.The two
xcl-smokeblocks are left out, because theirtitle:line named the game's folder. Both runs: exit 0x0, 0 device removals, 0 crashes, 60 60 60 presents per 2 s at the end; frames shown 1577 / 1577, peak commit 16050 MB / 16173 MB (main / this PR).Driver time on the story load (one run each, cold driver cache)
Both runs used the release build, a fresh copy of
xcl.exeunder a new name (for a cold NVIDIA cache), andXCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_DISK_CACHE=0. The DXIL cache was warm: 7 misses on main, 4 on the PR. A on the story was pressed by hand at 28.6 s (main) and 24.2 s (PR). The times are thecompute PSO with the translated console CS (… ms)lines; other builds ran in parallel.Programs with the same DXIL size in both runs (unchanged by the PR), 100 KB and up: 19 programs, 58.3 s on main and 53.5 s on the PR. That is −8 % with the same code, which gives the noise between runs.
Programs whose DXIL size changed. The log has no shader keys, so these are paired by size rank, with the PR's DXIL 1–6 % larger. The pairing is my guess:
Together that is 68.8 → 53.9 s (−22 %), against −8 % for the unchanged programs. That is far from the 3–4× on the RTX 5090.
No
CS_RaytracingResolve-sized program (~1 MB DXIL) was built in either run: the largest was 829 KB on main and 839 KB on the PR. Both runs ended first at the title's known0xc0000005write at+0x23cf683(#675), at 119 s on main and 117 s on the PR. So the programs your table measures were not reached here.The PR run's process did not exit after the crash. The black window stayed until I killed it. The main run and earlier runs on this machine exited by themselves. This happened once, and I cannot say whether the PR is related.
Not tested
CS_RaytracingResolveprograms on this card.AI use: Claude Code (Claude Opus 5.5) built both trees, ran the tests and title runs, compared the logs and wrote this report; I drove the title to the story and checked it before posting.
@wondercrash on GitHub · 2026-11-24 21:37 UTC · original
Rebased onto
maine9e94ce(GitHub showed a conflict). Still one commit:7d43a46.What changed since
028f3cb:emit.rs: nothing. The change is the same, and so is the commit message.tests.rs: one hunk. Inmemory_windows_reject_out_of_uma_aliasing, #1693 now builds the switch / heap form throughdirect_or(..). That stays for the switch / heap form, and the flat form is added through DXC, as ingpu_sparse_vram_descriptors_buffers_and_xmem.How it sits with what merged since:
switchper memory operation) change onlygpu/dxil. This PR changes only the HLSL accessors. So withXCL_DIRECT_DXIL=1the programs the direct translator takes keep its window switch, and only its HLSL fallbacks get the flat loads, as before. Nothing is duplicated, and an out-of-range window reads 0 in all forms.pcblocks): thepctranslation goes through the same 1 MiB rule. In the title's pack it changes one program,95cc13288a27a96e(154.6 → 15.4 MB of HLSL in this PR's form), which stays over 1 MiB and stays flat.Tested on RTX 5090 (driver 621.14), Windows 11 23H2, Rust 1.96.0, at
7d43a46:cargo check -p xcl --all-targets: clean.cargo test -p xcl --lib --release -- gpu::recomp --test-threads=1with the title'sshaders.rpfasXCL_SAMPLE_RPF: 200 passed, 0 failed, 18 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.With
XCL_DIRECT_DXIL=1: the 6 memory-window GPU tests pass (gpu_sparse_vram_descriptors_buffers_and_xmem,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_memory_windows_above_4_gib,gpu_memory_windows_from_the_heap,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing), none SKIPPED.Whole suite,
cargo build --workspace && cargo test --workspace -- --test-threads=4: 894 passed, 0 failed, 42 ignored. Onmaine9e94ce: 892 passed, 0 failed, 42 ignored (the difference is this PR's two new tests). SKIPPED on both:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).a_big_compute_program_reads_its_windows_without_a_switchadded alone toe9e94ce: FAILED.Translations of all 29 387 programs of the retail
shaders.rpf(split wave64, 4 windows) againste9e94ce: in the default form, 901 of 2 689 CS and 164 MS passes change (all now flat), and no VS / PS / ES / GS; withXCL_HEAP_WINDOWS=1, none change. The flat programs are the same as at028f3cb.Smoke pair (
scripts/smoke.ps1 -Seconds 60, no input, one shared shader cache):maine9e94ce1648 frames, 60/60/60 presents, 16 685 MB peak commit; this PR 1637 frames, 60/60/60, 16 152 MB; no removals or crashes on either. The description's regression section now has both blocks.AI use: omp with Claude Opus 5.5 (the rebase, the tests and translation comparison, this comment).
@DarkPanda69 on GitHub · 2026-11-24 15:31 UTC · original · edited 2026-11-24 22:41 UTC
AMD run, which this PR lists as not tested (its GPU tests ran on NVIDIA only). Updated for head
7d43a46(earlier runs onc2a1040and028f3cb, same result).Tested: pass, head
7d43a46applied onmain689f2db(applies cleanly now), debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.cargo test -p xcl --lib -- gpu::recomp --test-threads=4:main.main.Not tested: compile time and GPU run time of the flat form; the whole workspace suite; a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@b3IKK on GitHub · 2026-11-24 23:44 UTC · original
Test report on an RTX 5080 (16 GB, 32-lane waves): the driver's compile time of the same 58 compute programs in the retail title, switch form on
mainagainst this PR's flat form. The 16 programs of 700 KB of DXIL or more went from 992 s to 304 s in total (3.3×), none slower. Smaller ones gain less, and 5 of 42 got slower.Tested
stable-x86_64-pc-windows-msvc), release for the title runs, debug for the suite.7d43a46cherry-picked ontomain20cf130(localf4bd801, no conflicts)..\scripts\test.ps1on that tree (DXC 1.9.2609.5): 978 passed, 0 failed, 45 ignored.a_big_compute_program_reads_its_windows_without_a_switch,gpu_memory_windows_reject_out_of_uma_aliasingandgpu_sparse_vram_descriptors_buffers_and_xmemran and passed. SKIPPED, the same kinds as onmainhere: the wave64 tests (no wave64), per-lane f16 / f32 cases the adapter's mode refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required).xcl run <retail 1.0.2.1 folder>withXCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PRESS_AT=33:AandXCL_RUN_SECONDS, default settings otherwise (HLSL path, 4 memory windows as aswitch, noXCL_PSO_WAIT_MS, no heap windows). DXC in the title runs: 1.9.2602.17 from the Windows SDK.main689f2db, unmodified: four runs one after another on the same data folder (300 s from cold XCL caches, 300 s, 1500 s, 600 s).20cf130+ this PR: one run of 900 s.driver compile finish #n: compute PSO, … B DXIL, … mslines for records whosedriver compile startsaysdriver blob absent, that is, the first build of that DXIL on this machine. Records are matched by the hash in those lines.main's DXIL sizemain(switch)The sixteen big ones,
main→ this PR (driver time; DXIL size):main81fe677790c1299a742a41ceb422beb5cfd8542440a534bb753e8c2101ee64d099604bc99eb833eb381be88de4d74dc9ef008c0f04b6261aab570963c407e5c031b81a7b0427b16c33743bd6d1e4544344ca55bfefe67bd59144739038da8a66bd968d88fabf544f36353c66e9666102dd51cdeedc76d3a74585e350d1b864e32e0055c25f49848a8.6 → 10.6 s,6e148dbd563de20513.4 → 14.3 s,8aefa8ee06fa066310.0 → 10.7 s,03fdbf133bbf56a75.8 → 6.1 s,94f612c85468fb5b10.9 → 11.0 s. With one run each and other compiles going on next to them, I would not read more into those than "no gain".mainruns together (2700 s) first-built 16 programs of 700 KB or more. The one 900 s run with this PR rebuilt those 16 and built 15 more of that size that themainruns had not finished (13.3–29.7 s each, 329.7 s together; one of them,bc2a621ee6d3e652, had been started onmainand was cut off by the end of its run).ab570963c407e5c0in the 1500 smainrun was in the driver for 711 s on one of the title's threads without finishing (started at 788 s, while the 29 MB program below had been compiling for 13 minutes next to it). The 61.8 s above is from the next run, where it was built ahead at 5 s.queue.Waittimeout in any of the five runs. Peak commit 33.0 GB with this PR, 40.2 GB in the 1500 smainrun.Not tested
mainand this PR alike, the picture stops at 76–98 s (86 s with this PR) and no frame follows while the title's threads build compute pipelines, so these runs show the compile time and nothing about the result. The suite's GPU tests are the only check of that here.xcl shaders --measure-psoneeds Windows Developer Mode, which is off on this machine, so every number is from a running title with other compiles next to it: onmainmostly one or two of the title's threads, in this PR's run mostly the gated workers one at a time. One run per build.main's numbers are from689f2db, this PR's from20cf130; the two commits between them changegpu/dxil/lower_image.rsand its test only (direct DXIL), which these runs do not use.56c0cd3b82a00c6e(29.2 MB of DXIL onmain, 29.9 MB here): not finished in any run, 1494 s in the longest. This PR does not change that.XCL_HEAP_WINDOWS=1,XCL_DIRECT_DXIL=1, AMD, Linux / Wine.AI use
@voiceovarian1-max on GitHub · 2026-11-25 08:07 UTC · original
Linux + NVIDIA (Vulkan compiler) timing of
028f3cb(the head before the later pushes): about 1.5× on the same pipelines; heap windows about 1.65×.Setup: RTX 4070 Ti 12 GB (NVIDIA 620.73.04, 32-lane waves), i7-14700K, CachyOS kernel 7.3.5, Proton Experimental's Wine (wine-11.0), vkd3d-proton v3.1 +
scripts/linux/vkd3d-proton-xcl.patch. Release,x86_64-pc-windows-gnu. Tree:main9e3831e+ #1315/#1316 + #867 + #871 + #877 + #1321 + #684 + #640 + #605 + #495, with and without this PR's commit (its test hunk adapted: nodirect_oron that base).xcl shaders shaders.rpf --precompile --pipelines --only cson the retail records…:CS_RaytracingResolve_b1139868_Wrapped(about 0.9 MB of DXIL each), one pipeline at a time, XCL's blobs, vkd3d-proton's cache and NVIDIA's cache off. Time ofCreateComputePipelineState; dxil-spirv is 1–3 s of each.main's switchXCL_HEAP_WINDOWS=1(no PR)Same record in two forms:
cloth_normal_spec22.7 → 15.6 s,cpv_only21.9 → 14.2 s (this PR);emissive11.7 s (this PR) against 10.6 s (heap windows),cutout_fence_inst12.8 against 11.6 s.cargo test -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 window compactunder Wine: 42 passed, 0 failed (1 SKIPPED: no wave64).Not tested: the current head, a title run with it (picture), Windows, AMD.
AI use: Claude Code (Claude Fable 5.2) ran the runs and wrote this report; posted with the account owner's approval.
@b3IKK on GitHub · 2026-11-25 11:50 UTC · original
Refreshed numbers on current
main, since the report above was measured on689f2dband 170+ commits have landed. The 10 programs of 700 KB of DXIL or more that both runs reached went from 661 s to 301 s of driver time (2.2×), none slower.Tested
7d43a46cherry-picked ontomain426a5a7(local2ac2206, no conflicts).XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_DISK_CACHE=0, and an A press at 33 s throughXCL_PRESS_ATto take it into the world load.XCL_PSO_DISK_CACHE=0makes every driver compile cold in both runs, so the per-program figures are comparable without clearing anything else; the DXIL and translated caches were warm formain, and this PR's changed HLSL was translated during its run.driver compile start/finishlines; only records compiled (not blob-served, not still running) in both runs are compared.main's DXIL sizemain(switch)The ten big ones,
main→ this PR (DXIL size, driver time):main7946328b3e9a327e381be88de4d74dc97266c8ed623a1bfbd2668d53c97d300644ca55bfefe67bd5dd51cdeedc76d3a736353c66e9666102bd968d88fabf544f4585e350d1b864e395cc13288a27a96e95cc13288a27a96eis unchanged by this PR and is the one program of that size both runs spend ~150 s on; the log line says why onmain:15008 KB of HLSL would compile unoptimised - direct DXIL instead (2345 KB).d6e17680058782c57.2 → 9.2 s). With one run each and other compiles next to them, I would read that as "no gain".689f2dbbecausemainitself got faster on several of these since (e.g.dd51cdeedc76d3a7was 31.0 s, now 20.6 s).main) and ~102 s (this PR) in these runs, with no frame after; both titles then compile compute pipelines for the rest of the minute. Peak commit 31.7 GB (main) and 31.2 GB (this PR); no crash, no device removal, noqueue.Waittimeout in either.Not tested
XCL_HEAP_WINDOWS=1,XCL_DIRECT_DXIL=1, AMD, Linux / WineAI use
One more thing worth knowing from the same runs, although it is not this PR: on
main426a5a7the program that used to hold these runs up,56c0cd3b82a00c6e, is now 484,744 B of DXIL and compiles in 10.4 s (it was 29,215,780 B and never finished at689f2db). #2120's routing of enormous compute programs to the direct translator is what changed it.@thehollowedone on GitHub · 2026-11-25 12:36 UTC · original
Independent Windows/NVIDIA test on clean 7d43a46.
Tested
Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 894 passed, 0 failed, 42 ignored.The large-program HLSL selection tests passed. The window-addressing and sparse-VRAM fixtures ran on the RTX 3080 Ti and passed with both switch-based and switch-free loads. Cargo’s passed count includes four explicit skip notices (two wave64, one heap-window configuration, and one driver-cache control).
Not tested
Retail startup or world load, shader timings, and incomplete GPU window initialization.
AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
@zohaiblazuli on GitHub · 2026-11-25 14:32 UTC · original
Data for the cost this PR targets, measured on
main1a0bbe3(not on this PR's head): #2088 comment. RTX 3060 (NVIDIA 617.42), 8 compute programs, cold driver builds. Replacingswitch (xcl_w)withswitch (0u)(wrong results; an upper bound) makes the build 1.6–6.2× shorter.The largest gap left after the heap form is on the 5 MB outlier
219287eb2f6021fe: 819 s with the switch, 434 s heap, 133 s for the bound. A timing of this PR on that program would show how much of it this form recovers.AI use: Claude Code (Claude Opus 5.5) ran the measurements and wrote this.
@b3IKK on GitHub · 2026-11-25 15:15 UTC · original
Whole-run comparison on a warm cache, as a complement to the per-program table above.
Setup: both binaries run back to back on the same machine (RTX 5080, driver 32.0.16.1088), same retail data folder, 600 s each, A pressed at 33 s, default settings. The driver-blob cache held 863 blobs (490 MB) when the pair started: one built by
main(the previous runs) and, for this PR, only what its own earlier run at20cf130left — 20 of its 167 compiles were served from a blob against 204 of main's 246, so this PR ran largely cold whilemainran largely warm.main426a5a7main+ #13807d43a46main's warm cache already held, so I would take 4.2× as "at least as good", not as a refined number.maina dozen.Not tested: interleaving the two runs, AMD, Linux / Wine, and whether a fully warm cache of this PR still stops at 96 s (it should; that is the next run once the blobs exist).
AI use: OpenCode, Claude Fable 5.2 ran the pair on this machine and wrote this.
@b3IKK on GitHub · 2026-11-25 16:08 UTC · original
A measurement that changes the "warm cache never converges" picture, from the retail 1.0.2.1 title on
main426a5a7(RTX 5080 16 GB, 600 s runs,XCL_PRESS_AT=33:A).Counting, per run, the compute driver compiles that start after 96 s (where presents stop) and have no driver blob:
The sets are disjoint between runs (warm 4 ∩ warm 5 = 0), so the cache does advance: each run finishes the previous run's programs and reaches ~8 new ones. It is not the same programs being rebuilt.
What the last eight cost is the wall: they are 0.99–1.21 MB of DXIL each, every one built on a title thread ("huge, ungated here"), and they take 50–105 s each (warm 4: starts at 99.6, 158.8, 219.9, 286.5, 351.7, 425.3, 495.1 and 573.2 s; the last was still compiling when the 600 s run ended). Nothing presents after 96 s in that time.
A 3600 s warm run shows the same shape rather than convergence: 69 new cold compiles after 96 s, and zero presents after 96 s for the whole hour. So this is not a hang — compiles keep finishing and the title keeps asking for the next one — but the world transition wants a long serial chain of one-time ~1 MB compute compiles, and a 600 s run advances it by only ~8 programs.
The practical lever is therefore to get those blobs built outside the title's own load: the split-piece precompile path in #2338 (66 requested pieces supplied from offline blobs, 86.2 s → 2.87 s in the RTX 4090 check) is the right direction, but these programs are whole, unsplit ones (no
dispatch chainline in the logs), so they need the same offline treatment or a smaller DXIL form to come down in cost. ForcingXCL_DIRECT_COMPACT=1did not move the 96 s stop in a 3-minute trial (the run was cut short before it reached the wall).AI use: OpenCode, Claude Fable 5.2 parsed the logs of five 600 s runs and one 3600 s run on this machine and wrote this.
@b3IKK on GitHub · 2026-11-25 16:48 UTC · original
A negative result for the "build them earlier" idea, so it is not repeated: on a 300 s retail run, queuing the 247 big compute PSOs (>= 64 KiB shader container) on the preload workers at creation (4–9 s, instead of first bind at 91 s) did not move the wall.
06c9f55)The reason is capacity, not start time: the low-priority preload workers are already saturated by the earlier-used pipelines, and the driver gate allows 1–2 huge compiles at a time, so the new jobs do not add pre-91 completions. (The second run also started with a slightly warmer cache, so the difference is noise-level; neither run presents a world.) The measurement that PSOs exist 85 s before their bind is still in the latest comment; the change and its negative comparison are in #2364 (closed). The remaining levers are driver-compile capacity (commit headroom) or precompiling the set offline (#2338), not the submission point.
AI use: OpenCode, Claude Fable 5.2 measured both runs on this machine and wrote this.
@afpruivo on GitHub · 2026-11-25 21:32 UTC · original
RTX 3090 / NVIDIA 621.40: flat loads cut the eight-record cold driver total from 1,657.1 s to 802.4 s (2.07×).
RTX 3090 24 GB, NVIDIA 621.40, Windows 11 build 26300, i5-13600K, DXC 1.8.2502.11. All four arms use main
68a284a, with PR #2191 headfb84fdeand PR #1380 head7d43a46merged locally. The #1380 merge kept main’scoherent_memand the PR’s flat gate. One coldCreateComputePipelineStatemeasurement per record and arm, four windows, caches disabled. Runtime and workspace tests were outside this measurement.The two RaytracingResolve records improved by 3.37× and 4.44×. The largest record (
219287eb2f6021fe) went from 1,079.463 s to 505.207 s (2.14×), with peak private memory dropping from 9.37 to 4.53 GB. Across all eight records, DXIL fell from 14.95 to 14.69 MB (−1.7%) and DXC time fell from 676.5 to 556.4 s (−17.8%). All eight records took the flat path on this corpus.On the same base,
XCL_HEAP_WINDOWS=1took 510.8 s in aggregate and 347.0 s on the largest record. The flat path reads four windows per access, so its runtime cost remains open. Per-record results: #2191AI disclosure: OpenCode ran the benchmark and drafted the report. ChatGPT checked the figures against the saved matrix and posted at my request.
@DavidM1911 on GitHub · 2026-11-26 05:03 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.