Repository navigation
Conversation
…n the compact form On NVIDIA, the driver's compile time of a compute pipeline explodes between 2 and 4 MB of DXIL. A retail CS of about 8 900 instructions (under compact::large's 20 000) gave 3.9 MB of plain direct DXIL: still in the driver after 5 minutes on an RTX 3060, and the title, which binds it during its world load, waited for it. Its compact form is 1.3 MB and compiles in 35 s. translate_entry now translates a compute or kernel program once as before; when its DXIL is over XCL_DIRECT_COMPACT_KB (1536 by default, 0: off) and the compact form was neither forced nor forbidden (XCL_DIRECT_COMPACT unset), it translates it again in the compact form and keeps that one when it is smaller. A size other than the default is part of the translated-cache identity, as XCL_DIRECT_COMPACT is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows verification of exact PR head Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver Unit/build: Exact shader record Paired owned-title smoke: Same title, Base: PR head: Limits: The smoke runs cover startup only and did not show this large record being compiled or bound; frame counts are not a performance comparison. I did not measure cold or warm AMD PSO compilation, compact-form GPU time, or a full workspace suite on this head. The offline translator test itself is hardware independent despite running on the RX 6800M host. AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows unit test and release build, monitored the offline shader checks and paired title runs, verified exact revisions and local output sizes, and drafted this report. No game data was uploaded. |
|
Cold PSO reproduction on RTX 5070 Ti under Proton for record
One PSO made with zero refusals in each compact run. The compact DXIL matched byte for byte across the two runs. The control entered vkd3d-proton with the same root signature and an empty pipeline cache. Zero OOM kills in all three runs. The interval from the no-blob message in vkd3d-proton to the Vulkan feedback was 27.264 s and 27.540 s in the compact runs. The 180 s value is the process timeout. cargo build --locked --release --target x86_64-pc-windows-gnullvm -p xcl --bin xcl -j5
XCL_DIRECT_DXIL=1 XCL_DXC_THREADS=2 XCL_PIPELINE_THREADS=1 \
wine xcl.exe shaders <one-record-directory> --precompile --only cs --pipelines --split 1 --windows 4Fresh Wine process, prefix and title-data paths per run. XCL translated and PSO disk caches, vkd3d-proton's shader cache and NVIDIA's shader disk cache were disabled. Each run used a 14 GiB Linux cgroup with swap disabled. This measures a retail compute PSO in the offline CLI. Runtime GPU cost and world-load behavior are outside this measurement. RTX 5070 Ti (16 GB, driver 620.73.04), Ryzen 7 9700X, 32 GB DDR5, CachyOS 7.3.5-2-cachyos, Proton Experimental AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report. |
|
Independent test and 60 s smoke report for head Tested
Regression run (
PR Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window. AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting. |
|
AMD Windows data for #2301: on the RX 9070 XT this change makes two programs that currently build fail instead. On AMD's driver the compact form runs out of memory faster than the plain one. I'd suggest keeping the retry off on AMD, or gating it on the adapter. Setup
Method
Census (all 2,689 retail compute programs, translation only): the retry fires on 4 programs on this adapter, and keeps the compact form for all 4.
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. |
|
AMD RX 9070 XT with 64 GB of RAM, exact head Setup
Method
Not tested
AI use: Claude Code (Claude Fable 5.2) made the builds and the runs and wrote this comment; the account owner asked for the report. Counts and timings only, no game data. |
|
Test report for c94ad8a on AMD (RX 6650 XT, Ryzen 7 5700X, 32 GB RAM + 64 GB pagefile, Windows). Summary: the retry works exactly as described. On this AMD card, though, the compact form never finishes compiling in the driver, so the world-load stall stays. Four 360 s world-load walks from the same save, alternating the merge base
The compact retry is still useful (2.4-3x smaller input), but on RDNA2 it does not bring this record under whatever makes the driver's compile not finish. AI use: the walks were run, and the table numbers collected, by an agent on Muse Spark (Meta). The builds were made by another Muse Spark agent, and a third Muse Spark agent reviewed the diff for which env vars reach the retry path. Claude Code (Claude Sonnet 5.5) ran the 600 s main-branch profile. Claude Code (Claude Opus 5.5) wrote this comment, checked the retry line, the 1 292 052 B starts and the missing finish lines in the two PR-arm logs (the base-arm numbers were not re-checked), and posted it. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Follow-up from the same machine (RTX 3060,
So I cannot tell yet whether the compact form of that program is wrong, or whether the program itself reads through a null buffer descriptor (base 0) that the console tolerates. In the direct path I found no bounds check on buffer loads ( |
|
Correction to the comment above. In a local build where |
|
Last follow-up. The device removal is not related to this PR, nor to the direct DXIL path. With |
Part of #1269. With
XCL_DIRECT_DXIL=1, a compute program belowcompact::large's 20 000 instructions can still produce plain DXIL that the NVIDIA driver never finishes compiling. On NVIDIA, the driver's compile time explodes somewhere between 2 and 4 MB of DXIL. On the retail title of #505, record95cc13288a27a96e(about 8 900 instructions, under the 20 000 cut, andcompact::wanted's duplication ratio refuses it) produces 3 916 120 B of plain direct DXIL. On an RTX 3060, the driver had not finished it after 447 s, and the title binds it during the world load. Its compact form is 1 292 052 B and compiled in 34.5 s.This PR retries such a program in the compact form and keeps whichever form is smaller. The trigger is the plain form's DXIL size, the quantity the driver's compile time actually depends on, rather than the instruction count.
What is in it
crates/xcl/src/gpu/dxil/kernel.rs:translate_entrytranslates a compute or kernel program as before (it is nowtranslate_entry_once). When the DXIL is overXCL_DIRECT_COMPACT_KB(1536 by default,0turns the retry off) andXCL_DIRECT_COMPACTis unset, it translates the program again with the compact form forced. It keeps the compact result if it is smaller, and logs[SHADER] direct DXIL: N B plain over XCL_DIRECT_COMPACT_KB, M B compact kept.XCL_DIRECT_COMPACT=0or1still forbids or forces the compact form as before. A unit test covers the default, an explicit value,0and an invalid value.crates/xcl/src/gpu/recomp/pso.rs: a non-defaultXCL_DIRECT_COMPACT_KBis part of the translated-cache identity, asXCL_DIRECT_COMPACTis.Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4atc94ad8a: 1155 passed, 0 failed, 46 ignored. SKIPPED on this adapter: the wave64 GPU comparisons (no wave64), the per-lane forms refused inlower_dxil::tests, andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_DIRECT_DXIL=1, 480 s per run, A pressed every 4 s from 12 to 120 s, caches carried over between runs (one run per row):95cc13288a27a96eDXILmain568e7db(run 1)mainwithcompact::largelowered to 5 000 (run 2)wantedrefuses it)The other giant of that title,
56c0cd3b82a00c6e(22 MB of DXIL through the HLSL path), is already compact onmain(484 508 B) and does not change.On this title, the world load still stops later (presents end after the
#101call, the #505 stall). This PR removes one pipeline the title waited on, not that stall.Regression run
main:This PR (
c94ad8a):Not tested
AI use
Claude (claude-opus-5-5, through Hermes) found the stalled pipeline in the logs and minidumps, wrote the change and its test, ran the builds, tests and title runs on the hardware above over SSH, and drafted this description. Maxime (Natakout) directed the work and asked for the retry to be a setting.