Skip to content

xcl run: warn when a drive a run writes to is nearly full - #3058

Closed
imnicho wants to merge 1 commit into
xcl-dev:mainfrom
imnicho:drive-space-warning
Closed

imnicho wants to merge 1 commit into
xcl-dev:mainfrom
imnicho:drive-space-warning

Conversation

@imnicho

@imnicho imnicho commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

A run writes to three places: XCL's data folder (XCL_DATA_ROOT), XCL's shader cache (XCL_DXIL_CACHE) and, through the GPU driver, the driver's own shader cache, which stays on the drive of the user's profile wherever the other two are. On my machine that third one filled the system drive in the middle of a run series, with XCL's own folders on another drive, and nothing a run printed said so. This adds those drives to what xcl run checks before the game starts, and says in the README where the driver's cache is and what caps it.

What was measured (RTX 5080, driver 610.47, Windows 10 22H2, 16 GB RAM):

  • %LOCALAPPDATA%\NVIDIA\DXCache held 45.4 GB in 276 files. 34.6 GB of it was the 10 files of xcl.exe, all written within two days of runs of a retail title on nvidia-dev: two sets of growing files (0.25, 1, 2 and 8 GB in one; 0.25, 0.25, 2, 4 and 16 GB in the other).
  • The 16 GB file was written while a run series was going, and the drive went to 0 MB free. Tools that write to %TEMP% then failed; the title's runs were stopped by hand.

#3048 (open, nvidia-dev) comes at the same file from the memory side: the driver maps it into the process, and XCL_DRIVER_SHADER_CACHE=0 there refuses it the file. This PR does not touch that; it only makes the disk side visible, on every vendor's driver (their caches are under the profile too).

What is in it

  • preflight.rs: Drive (root, free bytes, what a run writes there), drives (the folders a run writes, grouped by drive), free_bytes (GetDiskFreeSpaceExW), DRIVE_FREE_LEAST (4 GiB). checks adds a WARNING for each drive under it, with what the run writes there and what to do: drive C:\ has 4095 MB free, and a run writes there: XCL's data and logs, the GPU driver's own shader cache. It is printed before the game starts and again in the summary at the end, and is in report.json's environment, like the other checks. A PC with room prints nothing new.
  • README.md: a "Drive space" entry under "Building and usage" with the folder, the growth measured above and the driver's own setting that caps it.
  • Tests (3 new in preflight::tests): a_nearly_full_drive_a_run_writes_to_is_reported, the_folders_a_run_writes_are_grouped_by_drive (one drive whatever the letter's case, a UNC share, a relative folder and a drive that does not answer left out), the_temp_folders_drive_has_a_free_space (the real call).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Intel Core i7-7700K, 16 GB RAM, Windows 10 22H2 (19045), Rust 1.100.0 (MSVC); debug for the suite, release for the title.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1,468 passed, 0 failed, 47 ignored. That was bc3fb395, this head before one doc comment was reworded (no code changed); the 9 preflight tests were run again on the head. A run before it without --no-fail-fast stopped at one failure, hle::d3d12x::list_x::tests::cross_queue_wait64_before_signal_does_not_deadlock_submit_thread with 0x8007000E (out of memory, on this 16 GB machine with four test threads); that test passed alone and in the full run above. It does not touch the changed file.
  • 29 SKIPPED lines: 21 wave64 forms (no wave64 on this adapter), 3 per-lane f16 / f32 forms refused, 2 of the title under the debug layer and 1 upload test (no D3D12 debug layer here), 1 no heap windows, 1 that cannot turn the driver cache off (no Developer Mode).
  • Of the 9 preflight tests 6 are old and 3 new.

Regression run

Both with XCL_PREPARE=0 (the preparation of every record does not fit a 60 s run on a cold cache) and the shader cache on another drive than the system's.

main:

xcl-smoke v1
commit: 6089122a1c96dff16e93b6fdf04c8ed20cfb6102
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 822 (PresentX 822)
presents per 2 s (last 3): 44 44 44
device removals: 0
crashes: 0
peak commit: 17989 MB

this PR:

xcl-smoke v1
commit: 12199fe588f62cc2de785e31f2556babd137b222
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 840 (PresentX 841)
presents per 2 s (last 3): 43 45 44
device removals: 0
crashes: 0
peak commit: 17988 MB

More runs of the same 60 s: one of main (852 frames, peak commit 17,995 MB) and two of this PR at bc3fb395 (833 and 850 frames; 17,994 and 17,998 MB).

Not tested

  • The warning on a drive that really is nearly full: the checks are fed by the tests, and on this machine every drive has room again, so xcl run prints nothing new (as in the two runs above).
  • A drive that fills during a run: the check is made once, before the game starts.
  • AMD and Intel drivers (where their caches are and how they grow), Wine, a profile on a network share.

AI use

Claude Code with Claude Fable 5.2 wrote the change, the tests and this text, and ran the suite and the runs.

🤖 Generated with Claude Code

A run writes to XCL's data folder, to XCL's shader cache and, through the GPU
driver, to the driver's own shader cache, which is on the drive of the user's
profile whatever XCL_DATA_ROOT and XCL_DXIL_CACHE say. On an RTX 5080 (driver
610.47) the files of xcl.exe in %LOCALAPPDATA%\NVIDIA\DXCache reached 34.6 GB
in two days of runs of a retail title, in ten files of growing size, and the
drive was full in the middle of a run. Nothing a run did said so.

The checks xcl run makes before the game starts now look at the free space of
those drives and name each one with under 4 GiB, with what the run writes
there and what caps the driver's cache. The README says where it is.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant