Recompiler: route huge compute programs through the direct DXIL translator #1809
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!1809
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1809"
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?
@bmjask on GitHub · 2026-11-24 21:00 UTC · original
bmjask:perf/huge-shader-compile→main· +150 −11 · 2 files · 4 commits · openA compute program whose direct DXIL container is at least 64 KiB now goes through the direct translator (
gpu::dxil) by default, withoutXCL_DIRECT_DXIL. The driver compiles the direct container 1.4 to 6.5 times faster than DXC's container for the same program. Smaller programs stay on the HLSL path.XCL_DIRECT_HUGE=0turns this off, andXCL_DIRECT_HUGE=<KiB>changes the threshold.What is in it
pso::compile_console_shader: triesdirect_computefirst for compute programs. It keeps the result when the container is at leasthuge_direct_min()(default 64 KiB) and otherwise falls back to HLSL. It logs[SHADER] huge compute program <hash>: direct DXIL (<n> B).Backend::HlslHugeDirect(min)identity, tagged with the direct translator version and the threshold, so entries are never mixed with plain HLSL ones.XCL_DIRECT_HUGE=0keeps the old identity and the old entries.xcl shaders --measure-pso: measures the direct container whenXCL_DIRECT_DXIL=1is set (with no HLSL fallback), labels the line[hlsl]or[direct], and writes the container to<dir>withXCL_MEASURE_DUMP=<dir>.Measurements (RTX 4090, release,
--measure-pso: driver cache off, cold, 4 windows, split wave64)The HLSL path also spends 6.5 to 36 s in DXC for these programs; the direct path takes 20 to 174 ms. All four direct containers are validator-clean (
--direct --hash … --compare).Structural cause of the remaining cost: the per-access
switchover the 4 root-UAV memory windows. In the direct container of b3618a…, 1,214 switches and 5,837rawBufferLoads (every access duplicated 4 times) produce about 5,800 branches. The same program measured:XCL_HEAP_WINDOWS=1: 714,556 B, 15.3 sFor 1404420b…: heap windows 2.2 s, 1 window 1.5 s. The switch operands are 941 distinct values out of 1,214, so merging adjacent switches would save at most about 22%. Heap windows remain the real fix, but they stay opt-in because of the NVIDIA failures noted at
heap_windows().Review fix
huge_route_tags_compute_entries_only).Tested
f090104(review fix + origin/main merged):cargo test -p xcl --lib gpu::recomp265 passed, 0 failed, 18 ignored;cargo build --workspaceandcargo test --workspace -- --test-threads=40 failed (xcl lib 930 passed, 25 ignored)cargo test -p xcl --lib(4bc5e40): 843 passed, 0 failed, 22 ignoredcargo test -p xcl --lib gpu::dxil: 82 passed.gpu::recompwith default,XCL_DIRECT_DXIL=1andXCL_DIRECT_DXIL=all: 198 passed each.Regression run
scripts/smoke.ps1, 60 s,XCL_PRESS_AT=2:B,4:B,6:B,8:B XCL_PRESS_A_AT=10,15,20,25,30,40(B presses at 2/4/6/8 s, A presses at 10/15/20/25/30/40 s), run back to back. main is a release build of origin/main (689f2db); PR is a release build of the head (f090104, origin/main689f2dbmerged in). Each block comes from its own checkout'sscripts/smoke.ps1.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
@raylitebull on GitHub · 2026-11-24 21:09 UTC · original
Tested PR
#1809(0516042) merged ontomain(e9e94ce) on Windows 11 with an AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64, 32 GB system RAM) — covering the untested AMD path on the newer retail title.Setup
0516042ontoe9e94ce(release build).XCL_NETWORK=0, defaultXCL_DIRECT_HUGE=64,XCL_DIRECT_DXILunset, 120 s run cap.Observed results
66–737 KB) worked very well:39huge compute programs routed through direct DXIL,172compute PSOs compiled,1,951presents,45,613DirectStorage requests (2,783 MB,0failed),0crashes,0device removals, clean 4K loading frames (frame_1520,frame_1940). All 7 pre-outlier gated huge PSOs (270–737 KB) compiled cold in3.2–20.0 s(75.0 stotal) at a steady~20.2 GBcommit.56c0cd3b82a00c6e,3,939,588 Bdirect DXIL) hit an AMD OOM past 60 s: because the earlier gated shaders finish much faster,#803(56c0cd3b82a00c6e) enteredamdxc64.dllatt = 77.93 sand spiked process commit from20,248 MBto44,113 MB(+23.9 GBin22.2 s, leaving13 MBavailable system RAM) before an external RAM safety monitor terminated the process att = 98 s.smoke.ps1run misses this spike because56c0cd3b82a00c6edoes not start until~78 s.Takeaway
66–737 KBrouting is a major speedup on RX 9070 XT, but enabling unbounded direct-DXIL routing on AMD (32 GBRAM) likely needs either an upper DXIL byte cap (e.g.,XCL_DIRECT_HUGE_MAX) or further basic-block collapse on56c0cd3b82a00c6e(3.94 MB) soamdxc64.dlldoes not OOM.Not tested
cargo test --workspaceon this merged commit,XCL_DIRECT_HUGE=0paired baseline one9e94ce, NVIDIA/Intel GPUs, and Linux/Wine.@itsd-effex on GitHub · 2026-11-24 21:09 UTC · original
A heads-up before this merges: #1805. With
XCL_DIRECT_DXIL=1, 12 of this title's big compute programs overflow the whole 512 MBxcl-warm-*stack inxcl pipelinesunder Wine within about 5 s, and the worker dies without a message. The same 12 build in 23 s through HLSL + DXC. If this PR routes huge compute programs through the direct translator by default, those programs would take that path without the opt-in. It may be worth checking against the hashes in #1805, or keeping a fallback for the biggest ones.AI use
@Flyander on GitHub · 2026-11-24 21:30 UTC · original
Independent native Windows smoke on the RTX 5070 Ti (driver 621.40), release build, Rust 1.100.0. Both runs used the same retail-folder alias, 210 seconds,
XCL_PRESS_AT=2:B,4:B,6:B,8:B,XCL_PRESS_A_AT=10,15,20,25,30,40, separateXCL_DXIL_CACHEdirectories, andXCL_PSO_DISK_CACHE=0.The head log confirms that the new route ran for one compute program:
1e32f25121c1552f, direct DXIL 80,520 B. The four programs in the PSO table were not seen in this scene, so this checks integration but does not independently measure their long compile-time savings.Base (
4178e888c0b5be50a2887eda45cdb832763b68a4, the PR merge base and an ancestor of main):PR (
0516042348091fb99069130994d7dc410bd01dc8):This scene was essentially even: +28 frames (0.47%) and +16 MB peak commit on the PR, with no device removals or crashes. The latest PR-description check also reports that the current baseline block uses the PR head instead of a commit on main, and that the PR smoke block lacks
title:. These paired blocks use the merge base and the same title/duration.@t4l03 on GitHub · 2026-11-24 21:31 UTC · original
Cost of the 64 KiB gate for compute records that still use HLSL
I built clean head
0516042in release on Windows 11 build 26300 (Ryzen 7 7800X3D, RTX 4070 Ti, DXC 1.9.2609.5). I selected 240 records evenly by unpacked size from the 959CS_records at or below 4 KiB in a retail pack. AtXCL_DIRECT_HUGE=64, seven went direct. Their input containers were 948–3,500 B and their direct DXIL was 65,660–115,376 B. A 4 KiB input-size cutoff would miss all seven.On the remaining 233 records I compared
XCL_DIRECT_HUGE=0and=64with the same executable, four switch windows,--split 1,XCL_DXC_THREADS=1, andXCL_TRANSLATED_CACHE=0. I warmed the shared DXC cache with the gate off, then ran 20 alternating-order pairs ofxcl shaders <sample> --precompile --only cs --windows 4 --split 1. Every run completed all 233 with zero errors and zero direct routes. The DXC cache stayed at 240 files.This isolates the gate on translated-cache misses with a warm DXC cache. It excludes driver pipeline creation and does not measure title startup or the net effect across the whole pack.
AI use
Codex (gpt-6.2-sol) built the PR, ran the measurements, and drafted this report.
@imnicho on GitHub · 2026-11-24 21:13 UTC · original · edited 2026-11-24 21:53 UTC
Read the diff at
0516042, and measured this head on a 32-lane card in both window forms (section 3; edited 21:55 UTC with those numbers - the first version had only a measurement of another build).1. The translated cache's identity now follows the direct translator's version for every entry
Backend::current()returnsHlslHugeDirect(min)on the default path, andidentity()is one value for all stages, so vertex, pixel and small compute entries are tagged withTRANSLATOR_VERSIONtoo. Until now the default identity was the plainidentity_for(..), andshader_cache_testssays why: "the direct version does not touch HLSL entries". With this change each bump of the direct translator's version (4 → 7 today) re-keys the whole default cache, and every program is translated again at the next start (the DXC cache still hits, the HLSL text being the same) - the per-start cost that cache was added to remove.cached_inknows the stage, so the tag could apply to compute entries only.2. The default also covers native wave64
The new branch looks at the stage and the container's size, not at
split_wave64. raylitebull's run above shows the rerouted programs build and run without a crash on an RX 9070 XT (one driver out-of-memory aside). What it cannot show is whether their output is right there: on #1679 the AMD testers report driver miscompiles of direct-translator output in the fuzz tests (seeds 722 and 1599 on RX 9070 XT / RX 7800 XT, seed 540 on RX 6600), and the description lists a comparison of the rerouted programs as not done. The numbers the default rests on are from the split form on a 32-lane card; limiting the default to the split form until that comparison exists on AMD would keep the gain where it was measured.3. This head on an RTX 5080: a driver gain in the switch form, none with heap windows
RTX 5080 (32-lane waves, driver 32.0.16.1047), i7-7700K, Windows 10, release build of
0516042. Six big compute programs of a retail title's shader pack (direct containers of 91 KB to 993 KB; all six take the new route),xcl shaders <dir> --precompile --only csand then the same with--pipelines. Every run on an empty XCL cache and under an executable name the driver had not seen, so DXC and the driver were cold; two rounds. "off" isXCL_DIRECT_HUGE=0, "default" is this PR's routing; the heap form isXCL_HEAP_WINDOWS=1.An earlier measurement of 83 programs on another build (
main4178e88plus local patches, heap windows on both sides,XCL_DIRECT_DXIL=1against the HLSL path) agrees with the heap rows: driver 55.5 s / 55.0 s for the HLSL path, 52.8 s / 53.2 s direct; translation 45.0 s / 42.5 s against 6.2 s / 6.2 s.So the 3 - 6x in the doc comment is the switch form's; with heap windows the route no longer saves driver time here. If heap windows become the default, the threshold's reason would be the DXC time alone, and the comment on
HUGE_DIRECT_MIN_DEFAULTcould say which form its numbers are from.4. Smaller points
--measure-psowithoutXCL_DIRECT_DXILstill measures and labels the HLSL container for a program the title now builds from the direct one.coverage::record_translated, soXCL_DIRECT_DXIL_STATS=1shows none of them.Not tested
AI use
@cansolele on GitHub · 2026-11-24 22:04 UTC · original
@bmjask, thanks for addressing the cached-only probe contract in
4bc5e40.I independently tested your updated head on an RTX 5060 Ti. The end-to-end GPU checks passed for both direct compute routes, including the default 64 KiB threshold.
Since #1788 now overlaps with part of #1809, would you prefer to land #1788 first and extend its regression coverage in #1809, or land #1809 first and retain the end-to-end GPU coverage as a test-only follow-up?
I'm happy to coordinate either approach to avoid duplicated changes.
AI use: ChatGPT assisted with drafting this comment.
@bmjask on GitHub · 2026-11-24 22:05 UTC · original
Thanks all for the testing and the careful reads. Status per point:
@Flyander (P1, cached-only probe): fixed in
4bc5e40(reply inline). Thanks also for the paired smoke on the 5070 Ti. You're right that it only exercises one rerouted program (1e32f25121c1552f), so it's an integration check, not a measurement of the compile-time gain. I'll fix the description's baseline/title:blocks along with the next smoke pair.@thehollowedone: thanks for the threshold boundary check (3,112 B direct between the 3 and 4 KiB gates, all 768 threads checked) and for the retest on
4bc5e40showing the cached-only probe now reports the miss.@imnicho
ee2c98b, on top of4bc5e40, being handed to the branch): with the huge route on, only compute entries carry the direct translator's version; vertex/pixel entries keep the plain HLSL identity. New testhuge_route_tags_compute_entries_only.!heap_windows()is one option. Same as point 2, I'm leaving that decision open and not claiming a gain with heap windows on.--measure-psolabelling,coverage::record_translatedand the info-level "unavailable" line are not changed yet.@t4l03: thanks, this is the measurement the gate needed. A median of +172.7 ms over 233 records that stay on HLSL (about 0.74 ms per record, translated-cache miss with a warm DXC cache) is the cost of translating directly first and then dropping the result. It is paid only on translated-cache misses, but it is paid. Your seven 948–3,500 B inputs that produce 65–115 KB of direct DXIL also show that a cheap input-size pre-filter can't replace the attempt.
@raylitebull: thanks for the RX 9070 XT run. 38/39 rerouted programs built in 3.2–20.0 s.
56c0cd3b82a00c6e(3.94 MB direct) drivingamdxc64.dllto +23.9 GB commit is a real problem with an unbounded default on AMD. An upper cap (yourXCL_DIRECT_HUGE_MAXidea) or keeping the biggest programs on HLSL is on the table. I haven't picked a cap value yet because there's no data for one. Also noted: 60 s smoke runs miss this because it starts at about 78 s.@itsd-effex: thanks for the pointer to #1805. I haven't checked those 12 hashes against this route yet, so I can't say whether the default would hit the 512 MB warm-stack overflow under Wine. It needs checking before this can be the default. A fallback for the biggest programs would cover it together with raylitebull's OOM.
AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@WebIdentity1 on GitHub · 2026-11-24 23:36 UTC · original
Two updates relevant to the open risks in your status comment:
56c0cd3b82a00c6ememory spike: #1834 targets this exact program, with reported reductions in CFG size and driver memory. Independent NVIDIA measurements also report lower driver time and memory. We previously checked the synthetic compute path on the 3090. The current head is not a settled dependency: an extended geometry test found loss of the GS entry boundary, and the author has claimed that repair.These address specific failure causes; they do not establish that every large direct container is safe, or resolve native-wave64 output correctness. The useful next check appears to be the affected programs with those fixes, after the #1834 geometry repair, before enabling the broad default.
This is a dependency update from the linked reports, not a new retail or combined-tree test. We have not run either title data or the combined #1809/#1834/#1860 tree.
AI use: Codex with GPT-6 Astra inspected the current PR/issue reports and drafted this note.
@thehollowedone on GitHub · 2026-11-24 21:13 UTC · original · edited 2026-11-24 23:42 UTC
Tested
On
0516042, I ran the stock wave64 compute fixture through the D3D12.X pipeline hook and checked the GPU readback on an RTX 3080 Ti. The shader's direct DXIL was 3,112 B, which falls between the 3 and 4 KiB thresholds.XCL_DIRECT_HUGE=2and=3took the direct route (3,112 B).XCL_DIRECT_HUGE=4, the unset 64 KiB default, and=0used the HLSL route (6,124 B).XCL_DIRECT_DXILunset.Windows 11 build 26300, NVIDIA driver 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11.
cargo test --offline --locked -p xcl --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --nocapture --test-threads=1passed 1/1 in each setting. The stockshader_cache_testsfilter passed 14/14 with zero skips across these runs.Not tested
This checks routing and output using a small synthetic shader with an adjustable threshold. It does not measure large-shader compile times or retail behavior.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the stock tests and drafted this report.
Retest on
4bc5e401For a valid synthetic compute shader, the previous revision compiled inside a cache-only probe and reported no miss. The new revision reported a miss and returned no compiled shader with both explicit direct DXIL and the automatic route enabled. Outside the probe, both settings compiled the same input successfully. The local
scratch_valid_shader_defers_in_cached_only_probetest failed on the previous routing code and passed on the new revision.On the same RTX 3080 Ti setup, the stock
async_compute_pso_registers_real_pso_and_not_standintest also passed with the automatic gate enabled, explicit direct DXIL, and the gate disabled. Using the larger 3,112-byte synthetic shader with a 3 KiB gate, the test returned a stand-in, logged the direct route, and resolved the real PSO. The older revision also passed that outer hook test, so the inner cache-only probe is the regression check that distinguishes the two. No skips.The tests ran using
cargo test --offline --locked -p xcl --lib <probe>andcargo test --offline --locked -p xcl --test gpu_compute_e2e <hook-test>, both with-- --nocapture --test-threads=1. Synthetic inputs only.AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the probe and drafted this update.
Graphics cache retest on 3236dc3
On the same RTX 3080 Ti, I seeded an isolated translated cache with a synthetic VS, PS and CS using
XCL_DIRECT_HUGE=0. In fresh processes with the default threshold and then withXCL_DIRECT_HUGE=32, the production translated-cache lookup hit for both graphics stages. Their two cache files stayed byte-for-byte identical. Each threshold added a separate compute entry, and all 64 D3D12 readback pixels matched the original draw. With only the previous 4bc5e40 cache code restored, switching from off to default missed and wrote new files for both graphics stages.cargo test --offline --locked -p xcl --lib scratch_huge_route_keeps_graphics_translation_cache -- --nocapture --test-threads=1passed 1/1 in each of the five processes with zero skips. The stockhuge_route_tags_compute_entries_onlyalso passed 1/1. The separate cache-off PSO timing test reported a skip becauseShaderCacheControlreturned0x887A002D.AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the synthetic check and drafted this update.
Per-lane cache retest on f090104
I ran the same VS/PS/CS cache check in fresh processes with
XCL_PER_LANE=1throughout andXCL_DIRECT_DXILunset. On the rebased head, changing onlyXCL_DIRECT_HUGEfrom 0 to the default still caused both graphics translations to miss. The cache grew from three to six entries. A local variant that applied the per-lane cache tag only to compute preserved both graphics files byte-for-byte and added only the second compute entry. All 64 D3D12 readback pixels matched in every run.cargo test --offline --locked -p xcl --lib scratch_per_lane_compute_keeps_the_graphics_cache_namespace -- --nocapture --test-threads=1passed 1/1 in each of four processes, zero skips. Same RTX 3080 Ti and toolchain as above. Synthetic inputs only.AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the check and drafted this update.
@thiagocalile on GitHub · 2026-11-25 00:12 UTC · original
Tested commit
f090104a9c16dd957c36dafe5d861508251264dcon an AMD Radeon RX 6600 (RDNA2, native 64-lane waves) with unit/workspace tests and a 60 sscripts/smoke.ps1regression run (comparing againstmain62265d3).Tested
32.0.21045.29003;XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::recomp::pso -- --test-threads=4: 17 passed, 0 failed, 1 ignored (33.31s).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 975 passed, 4 failed, 45 ignored (94.18s).mainfailures (placed_title_textures_share_vram_and_preserve_pixels+ 2 mutex-poison cascades; #1028), plusgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(known AMD Windows driver32.0.21045.29003miscompile ofsext i1 -> i64/ashr i64).SKIPPED(not counted as coverage):gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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));gpu::recomp::lower_dxil::tests::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;shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): O aplicativo solicitou uma operação que depende de um componente SDK que está ausente ou é incompatível. (0x887A002D)(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Regression run (
scripts/smoke.ps1, 60 s, release build,XCL_ADAPTER=radeon)Base (
main62265d3):PR (
f090104):Not tested
AI use
scripts/smoke.ps1runs on my RX 6600 and drafted this report; I checked the output before posting.@DavidM1911 on GitHub · 2026-11-25 00:28 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@bielfreedom on GitHub · 2026-11-25 00:41 UTC · original
Offline driver timing of #1809 (and #1809 + #1834) on AMD RDNA4. Compared with
main, the driver builds 0.6–1 MB programs about 2× slower. Programs of 135–632 KB build 2–70 % faster. DXC time goes away.The earlier RX 9070 XT report here was a title run. This one measures
CreateComputePipelineStateper program, cold, againstmain.Setup
main80f4819, so all three use #1834's base):main8e87fc7;8e87fc7+ #1809f090104;8e87fc7+ #1809 + #1834d899eb5.Both PRs merge cleanly there.
console_to_dxil_inand aroundCreateComputePipelineState.Method
xcl shaders <pack> --precompile --only cs [--pipelines], default settings:XCL_DIRECT_HUGEunset (64 KiB),XCL_HEAP_WINDOWS=0, 4 windows.XCL_DXC_THREADS=1andXCL_PIPELINE_THREADS=1, so the driver builds one pipeline at a time.XCL_PSO_DISK_CACHE=0, and a fresh exe name for each run. The AMD driver's own shader cache is keyed on the exe's file name, as shown in A26, so every run starts cold.[SHADER] huge compute program … direct DXILline appeared for 15 of the 24 programs; the other 9 stayed on HLSL, and their times matchmainwithin ±5 %.Totals (mean of 2 rounds; 0 refused in all 6 runs)
Per program, rerouted programs only
Read / inference
main, against 197 s with #1809 and 192 s with #1809 + #1834.56c0cd3b82a00c6ecase that #1834 targets.Not tested
XCL_HEAP_WINDOWS=1.AI use: Claude Code (Claude Opus 5.5) built the branches, ran the measurements and drafted this report. Counts and timings only, no game data.
@Royalflamejlh on GitHub · 2026-11-25 00:42 UTC · original
Test report at the retail title's world-load stop (#505) on an RTX 5070 Ti: with this pull request merged the title stops where
maindoes, in 2 of 2 runs. The record whose build stays open through the stop onmain,56c0cd3b82a00c6e, takes the direct route as 4,321,608 B of DXIL instead of 29,215,776 B, and the driver did not finish it in the 295 s it had in run 2 (139 s in run 1). In run 2 its thread was inside the driver's compiler (nvgpucomp64.dll) in 3 of 3 dumps, at a different address each time. #1834's thread has this record's direct container built alone on an RTX 4090 with heap windows in 117 s (3,978,772 B); these runs are the switch form, inside the title, beside its other builds.Setup:
f090104merged ontomain20cf130(clean merge, local commit128444b), release. RTX 5070 Ti 16 GB (driver 621.24), Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, DXC 1.8.2502.11. Retail title, the first-run screens completed once, no story progress. Each run: 300 s,XCL_NETWORK=0 XCL_ACTIVITY=1, A at 32, 35, 38 and 41 s, thread dumps at 90, 150 and 240 s, preload at its default. XCL's line at the start of each run:13203 MB of commit free, under 17408 MB(13,203 to 13,545 MB over the runs); in run 2 the process's commit was 31 to 32 GB from 90 s on. The last column is #1316's head964f5ed(with #1315) merged onto the samemain(local commitf77c937), for the same record in the compact form.mainhas since moved to6567c5f; since #1836 (80f4819)f090104no longer merges into it (conflict ingpu/recomp/pso.rs), so these runs are on20cf130.main20cf130, 1 run#101call56c0cd3b82a00c6e: DXILmain, and in run 2 with this pull request, one thread of the title is inside XCL undergame+0x248c341in 3 of 3 dumps. That it waits for this record's pipeline is my reading: it is the only build open over that whole time.big_compile_turn's wait for 3 GB of free commit (XCL logged 13,203 MB of commit free at the start of that run; the process's commit was 16.8 GB at 50 s and 29.4 GB from 90 s on), ended when a bind wanted the pipeline; the wait is only logged when a build finishes, and this one did not. In that run a thread of the title was still building programs of 0.3 to 0.4 MB, 4 to 7 s each, when the 300 s ended, and a thread of the title was undergame+0x248c341only in the 240 s dump.mainwithXCL_DIRECT_DXIL=1made between the two (debug build, 300 s: the same 4,321,608 B container went to the driver at 176.0 s and had no finish line by 300 s). In run 2 a second thread of the title built four programs of about 0.9 MB in 34 to 42 s each after the stop.main8e87fc7with #889 and #1798 merged as well andXCL_SKIP_BINK=1(and a local switch, off in this run): the same container went to the driver at 7.5 s and was not finished at 300 s; the last interval with a present ended at 70.0 s.Read:
compile_console_shader(gpu/recomp/pso.rs:383-397) triesdirect_computefirst for every compute program and keeps the result when the container is 64 KiB or more, so by default this record no longer reaches the HLSL path. #1316 routes to its compact form on that path and puts it ahead ofXCL_DIRECT_DXIL(goes_direct); this branch has no such check, so which form the record gets in a tree with both depends on how the conflict is resolved. The two conflict ingpu/recomp/pso.rsandshaders.rswhen merged together ontomain8e87fc7, the lastmaineach merged into cleanly, so I have not run them together.@bmjask, on the upper cap you said has no data yet: this is the NVIDIA side of @raylitebull's run above. The same record (3,939,588 B there, 4,321,608 B here in the split form) was still in the driver's compiler after 295 s, and the largest direct container that finished in these two runs was 1,205,544 B, in 59.2 s. There was no commit spike like the AMD one: in run 1 the process went from 29.5 to 30.9 GB in the 139 s the build ran. I have not run #1834, which targets its container, nor the compact form for the direct translator I claimed on #1269 (691,764 B for this record in a prototype, not yet built on a card).
Not tested: how long the driver needs for the 4.3 MB container (no run was longer than 300 s); the same with
XCL_HEAP_WINDOWS=1; this pull request together with #1316 or with #1834; the driver compile of95cc13288a27a96ein its direct form (3,914,652 B in the third run, against 13,823,000 B on the HLSL path; its driver compile did not start in any run); the output of the direct pipelines; AMD, Intel, Linux. The suite was not run on the merge.AI use: Claude Code (Claude Fable 5.2) made the merges, ran the title, read the logs and dumps and wrote this report; a second Claude agent checked its numbers against the logs.
Posted without review by a person: the account owner was away and reads replies later.
@bielfreedom on GitHub · 2026-11-25 01:42 UTC · original
Follow-up to my RDNA4 timing above: I tested whether the 2× slower driver builds come from program size or from static samplers. Neither predicts it. The effect is per program, and so is the gain. Over this set, #1809 is a clear net win for cold compile on AMD, because it removes 311 s of DXC.
In my first set, the four programs that got slower were both the largest and the only ones with 4–6 static samplers. So I took a census of all 2,689 retail compute programs with this build: direct DXIL size, plus the static-sampler count from
Compiled::samplers.Census
8e87fc7vs8e87fc7+ #1809f090104, one pipeline at a time, cold driver cache, fresh exe names, 2 rounds each. Round-to-round spread was under ±7 % on every program, and 0 pipelines were refused.Per program (mean of 2 rounds)
Totals
By group, #1809 against main: large few ×1.07, large many ×1.20, medium few ×0.67, medium many ×1.08.
Read / inference
Not tested
XCL_HEAP_WINDOWS=1.AI use: Claude Code (Claude Opus 5.5) ran the census and measurements and drafted this. Counts and timings only, no game data.
@madaraXor on GitHub · 2026-11-25 03:10 UTC · original
Test report: RDNA2 driver times for the direct route, on
f090104This covers the AMD path listed under Not tested, on a wave64 RDNA2 card. The measurements use a clean release build of
f090104and the retail title of #505 (1.0.2.1) with its shader pack. Each one isxcl shaders <pack> --measure-pso <record>, with the driver cache off and one cold run. The direct form setsXCL_DIRECT_DXIL=1(through this PR's--measure-psochange), and the heap-window form addsXCL_HEAP_WINDOWS=1.Tested
84eee477…never finished on the HLSL path in this run, or in an earlier one on another build. The direct route builds it in 49.8 s.main62265d3plus other open PRs it needs to reach its world load. 302 compute programs took the huge route, with direct DXIL from 66,408 to 1,481,420 B. The 104 cold driver builds of 800 KB or more took 23.9–80.1 s each, 47.2 s on average. There was no device removal and no crash. 20 records loggedhuge-program direct DXIL unavailable: not a console shader containerand stayed on HLSL.95cc13288a27a96e(CS_ScreenProbes_ActivateRays, about 3.9 MB of direct DXIL). Its driver compile grew past 84 GB of commit in 16 minutes before a watchdog stopped it. The HLSL form did not build either (more than 50 minutes and about 100 GB on an earlier build), so this is not a regression. With this PR, though, that compile starts withoutXCL_DIRECT_DXIL.Not tested
f090104itself.AI use
@bobosneefdev on GitHub · 2026-11-25 07:09 UTC · original
Test report on
f090104(this PR's head), RX 6800: a mixed result. One compute program of the retail title never finishes in the driver on the HLSL path, and the direct container from this PR finishes in 146 s. On two other huge programs the direct container is not faster here.The program is
84eee477d68b6fdf,prop_2lyr_procedural_batch:CS_RaytracingResolve. In two runs of the title onmain80f4819, the driver compile of this program started (driver compile start #1402and#1853, 1,265,608 B DXIL, no driver blob) and never finished. The title's two dispatching threads sat inresolve_waitfrom then on. Run 1 waited about 40 minutes with 0 presents and run 2 about 15, before I ended them. Thread dumps show the compiling thread inamdxc64.dllthe whole time, using CPU (24 min of CPU time in run 2).Tested
xcl shaders <title>\shaders.rpf --measure-pso 84eee477d68b6fdf --repeat 1(driver cache off, cold):main6987e49f090104XCL_DIRECT_DXIL=1)The same measurement on two other huge programs of the title, cold, one compile at a time:
mainHLSLf090104direct620491641aa9bad6(scattering_transmittance_system)95cc13288a27a96eCreateComputePipelineState: 0x8007000E (out of memory) after ~7 minSo on this RDNA2 card the direct container is not faster across the board: it unblocks
84eee477…, and is 1.6x slower on620491….A run of the title on
f090104: the world load did not hang on84eee477…. It still sat on a run of huge compute compiles (~45–83 s each in the title, next to other compiles) with 0 presents, and on95cc13288a27a96efor over 11 minutes, when I ended it.cargo test --workspace --no-fail-fast -- --test-threads=4onf090104: 975 passed, 4 failed, 45 ignored.fuzz_validate_and_gpu_1also fails onmain.placed_title_textures_share_vram_and_preserve_pixels("3D 64x64x64 4 mips: subresource 2 mismatch") is the RDNA2 failure #1990 fixed onmain; this branch's base predates it.transitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memoryfail on the poisoned lock it leaves.lower_dxil::tests::f16_programs_on_the_gpu,f32_programs_on_the_gpu,heap_window_out_of_memory_falls_back_to_the_switch_form.Not tested
AI use
@bielfreedom on GitHub · 2026-11-25 07:42 UTC · original
@bobosneefdev RDNA4 numbers for the same programs.
84eee477d68b6fdfdoesn't finish on the HLSL path here either (over 20 min), and the direct route builds it in 53 s. With #2107's split (on #2080) it builds in 7.8 s.Setup
maincbc296afor the HLSL path and the whole direct container;d4b8717for the split.CreateComputePipelineStatetime.fnv64of the container, the same hash--measure-psouses.Method
--measure-psocan't turn the cache off here. So I usedxcl shaders --precompile --only cs [--pipelines]for the single record, withXCL_PSO_DISK_CACHE=0and a fresh exe name per run, because the AMD driver cache is keyed on the exe file name.84eee477d68b6fdf(CS_RaytracingResolve)main)84eee477d68b6fdfXCL_DIRECT_DXIL=1,main)84eee477d68b6fdf620491641aa9bad6main)620491641aa9bad6main)620491641aa9bad6is not split by #2080 or #2107 on this adapter. On RDNA4 its direct container is 14 % slower than HLSL, against 1.6× slower on your RX 6800.Read / inference
84eee477…is not specific to RDNA2: the same AMD Windows compiler never finishes it on RDNA4 either.95cc13288a27a96eis the other blocker in your list. On this card neither the plain nor the compact direct form builds within 24 GB (#2076), and #2080, #2107 and #2097 don't split it here.Not tested
AI use: Claude Code (Claude Opus 5.5) ran this and drafted the reply. The account owner is away; counts and timings only, no game data.
@ -362,0 +385,4 @@if stage == Stage::Compute && !crate::gpu::dxil::kernel::enabled() {if let Some(min) = huge_direct_min() {defer_direct_compute()?;match direct_compute(blob, sampler_base, windows, split_wave64) {@Flyander on GitHub · 2026-11-24 21:34 UTC · original
[P1] This path bypasses the cached-only/defer contract.
real::attempt()wrapsconsole_to_dxil_inindxc::cached_only; when this direct translation returns a container at or above the threshold, the probe sees a successful compile without ever callingdxc::defer(). It therefore performs cold direct translation synchronously instead of returning the stand-in, defeating the async probe fix in #1788 (the guard there coversXCL_DIRECT_DXIL=1, while this branch runs with that flag off). Please checkdxc::defer()beforedirect_computeand return the sameDXIL not compiled yetmiss; extenddirect_compute_pso_cached_onlyto cover the defaultXCL_DIRECT_HUGEpath.@ -362,0 +385,4 @@if stage == Stage::Compute && !crate::gpu::dxil::kernel::enabled() {if let Some(min) = huge_direct_min() {defer_direct_compute()?;match direct_compute(blob, sampler_base, windows, split_wave64) {@bmjask on GitHub · 2026-11-24 21:55 UTC · original
Thanks, good catch. Fixed in
4bc5e40: both direct compute routes (the default huge-program route andXCL_DIRECT_DXIL=1) now calldefer_direct_compute()beforedirect_compute. Insidedxc::cached_onlythat marks the miss viadxc::defer()and returnsDXIL not compiled yet, so the probe hands out the stand-in and the build happens in the background instead of translating on the title's thread.Since #1788's
direct_compute_pso_cached_onlyisn't on main yet, I added a focused unit test here:pso::direct_probe_tests::direct_compute_routes_defer_inside_cached_only_probes. It callscompile_console_shaderfor a compute stage insidecached_onlyand asserts the miss is recorded and nothing is translated (the input isn't a console container, so any translation attempt would fail with a different error). It also checks that the same call outside a probe does reach the translator. It passes with the default route, withXCL_DIRECT_DXIL=1, and skips withXCL_DIRECT_HUGE=0.gpu::recomp: 200 passed, 0 failed. Once #1788 lands, its test can take a default-route case too.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@DavidM1911 on GitHub · 2026-11-26 06:19 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.@Flyander on GitHub · 2026-11-24 21:34 UTC · original · requested changes
The new default huge-compute route bypasses the asynchronous cache-only probe contract. The inline P1 comment describes the blocking path and the focused regression test needed.
@bmjask on GitHub · 2026-11-25 20:16 UTC · original · reviewed
High impact, but not merge-ready from this review. The new default at pso.rs:385-391 routes every >=64 KiB direct-DXIL compute output, including multi-megabyte shaders. The PR discussion reports a 3.9-4.3 MiB output causing an AMD OOM (+23.9 GB commit) and an NVIDIA compile still running after 295 seconds; please bound or gate this default. Also, pso.rs:264-266 tests Backend::current() rather than the stage-filtered backend_for(..., stage), so XCL_PER_LANE=1 rekeys VS/PS cache entries despite the direct-compute-only intent. Please fix that and rebase/refresh the required evidence.
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.