Repository navigation
Conversation
…by default A compute program whose direct DXIL container reaches 64 KiB takes the direct translator also without XCL_DIRECT_DXIL: the driver compiles its container 3-6x faster than DXC's for the same program (RTX 4090, cold). XCL_DIRECT_HUGE=0 keeps the HLSL path, XCL_DIRECT_HUGE=<KiB> moves the threshold. The translated disk cache gets its own identity for this routing. --measure-pso measures the direct container with XCL_DIRECT_DXIL=1 and dumps it with XCL_MEASURE_DUMP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested PR Setup
Observed results
Takeaway
Not tested
|
|
A heads-up before this merges: #1805. With AI use
|
|
Read the diff at 1. The translated cache's identity now follows the direct translator's version for every entry
2. The default also covers native wave64 The new branch looks at the stage and the container's size, not at 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
An earlier measurement of 83 programs on another build ( 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 4. Smaller points
Not tested
AI use
|
|
Tested On
Windows 11 build 26300, NVIDIA driver 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11. 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 For 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 On the same RTX 3080 Ti setup, the stock The tests ran using 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
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
AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the check and drafted this update. |
|
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, The head log confirms that the new route ran for one compute program: Base ( PR ( 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 |
|
Cost of the 64 KiB gate for compute records that still use HLSL I built clean head On the remaining 233 records I compared
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. |
Flyander
left a comment
There was a problem hiding this comment.
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.
| // the driver compiles its container 3 - 6x faster than DXC's (`huge_direct_min`) | ||
| if stage == Stage::Compute && !crate::gpu::dxil::kernel::enabled() { | ||
| if let Some(min) = huge_direct_min() { | ||
| match direct_compute(blob, sampler_base, windows, split_wave64) { |
There was a problem hiding this comment.
[P1] This path bypasses the cached-only/defer contract. real::attempt() wraps console_to_dxil_in in dxc::cached_only; when this direct translation returns a container at or above the threshold, the probe sees a successful compile without ever calling dxc::defer(). It therefore performs cold direct translation synchronously instead of returning the stand-in, defeating the async probe fix in #1788 (the guard there covers XCL_DIRECT_DXIL=1, while this branch runs with that flag off). Please check dxc::defer() before direct_compute and return the same DXIL not compiled yet miss; extend direct_compute_pso_cached_only to cover the default XCL_DIRECT_HUGE path.
There was a problem hiding this comment.
Thanks, good catch. Fixed in 4bc5e40: both direct compute routes (the default huge-program route and XCL_DIRECT_DXIL=1) now call defer_direct_compute() before direct_compute. Inside dxc::cached_only that marks the miss via dxc::defer() and returns DXIL 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_only isn't on main yet, I added a focused unit test here: pso::direct_probe_tests::direct_compute_routes_defer_inside_cached_only_probes. It calls compile_console_shader for a compute stage inside cached_only and 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, with XCL_DIRECT_DXIL=1, and skips with XCL_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.
The default huge-program route (and XCL_DIRECT_DXIL=1) translated a cold program synchronously inside dxc::cached_only, so the non-blocking probe never saw a miss and the title's thread waited. Both routes now report "DXIL not compiled yet" there (dxc::defer), so the probe returns the stand-in and builds in the background. Review by Flyander. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@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. |
|
Thanks all for the testing and the careful reads. Status per point: @Flyander (P1, cached-only probe): fixed in @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
@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. @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. |
With the default huge-program route, Backend::current() is HlslHugeDirect and the translated cache's one identity carried TRANSLATOR_VERSION for every stage, so a direct translator bump re-keyed VS / PS entries the route never changes (review by imnicho). Vertex / pixel entries now keep the plain HLSL identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Two updates relevant to the open risks in your status comment:
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. |
|
Tested commit Tested
Regression run ( Base ( PR ( Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Offline driver timing of #1809 (and #1809 + #1834) on AMD RDNA4. Compared with The earlier RX 9070 XT report here was a title run. This one measures Setup
Method
Totals (mean of 2 rounds; 0 refused in all 6 runs)
Per program, rerouted programs only
Read / inference
Not tested
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. |
|
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 Setup:
Read: @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 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. |
|
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 Census
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
AI use: Claude Code (Claude Opus 5.5) ran the census and measurements and drafted this. Counts and timings only, no game data. |
|
Test report: RDNA2 driver times for the direct route, on This covers the AMD path listed under Not tested, on a wave64 RDNA2 card. The measurements use a clean release build of Tested
Not tested
AI use
|
A 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
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/main 689f2db merged in). Each block comes from its own checkout'sscripts/smoke.ps1.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code