Skip to content

D3D12.X: XCL_DUMP_WAIT_MS sets how long a dumped frame's present waits for the dump's copies - #3571

Open
imnicho wants to merge 1 commit into
xcl-dev:mainfrom
imnicho:dump-wait
Open

imnicho wants to merge 1 commit into
xcl-dev:mainfrom
imnicho:dump-wait

Conversation

@imnicho

@imnicho imnicho commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

With XCL_DUMP_WAIT_MS=<ms>, the present of a frame that is dumped waits that long for the dump's copies instead of 2 s. Where a frame takes the GPU longer than 2 s, every frame dump and every target dump was skipped. The default is unchanged.

What is in it

The present of a dumped frame (XCL_FRAME_DUMP, XCL_DUMP_TARGETS) waits for the copies it queued behind the title's work of that frame, 2000 ms, and gives the dump up after that (present: frame dump copy: not finished after 2000 ms – this dump is skipped). A target dump is the tool for a title that draws something wrong, and such a title is often slow.

  • present.rs: that wait is dump_wait_ms(): 2000 unless XCL_DUMP_WAIT_MS is a positive number of milliseconds (parse_dump_wait_ms). The 2 s wait before a resize is not touched.
  • shaders.rs: the switch is listed with XCL_DUMP_TARGETS and XCL_DUMP_AFTER_S among the settings that are not part of a launch preparation's key.
  • README.md: two lines after XCL_DUMP_AFTER_S.

Size: 3 files, 9 lines of code, 12 of tests and 2 of the README.

Tested

  • cargo test -p xcl --lib -- --test-threads=1 the_dump_wait parse_frame_dump_every warm_settings: 5 passed, 0 failed, no SKIPPED line. the_dump_wait_is_two_seconds_unless_a_positive_number_of_ms is new.
  • Where it came from, on another tree: a retail title on this PC (RTX 5080, i7-7700K) whose world frames took the GPU about 6 s each. In a 600 s run with XCL_FRAME_DUMP=10 and one target dump asked for at 360 s, the log has the skip line three times and no target picture was written. The same run on a local build with this change and XCL_DUMP_WAIT_MS=90000 wrote the dump's 54 pictures and their texel counts. That build was the draft Merge amd-dev into main #3547's branch (afeb3e551) with this change, not this head.

Regression run

scripts/smoke.ps1, 60 s, XCL_PREPARE=0, each built in release from a clean worktree, the crate's outputs cleaned first. The switch is not set in these runs.

main (b2b1f109d):

xcl-smoke v1
commit: b2b1f109d27e746a62ec95b04dd1f9924452e682
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1479 (PresentX 1479)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 12698 MB

This PR (b26c76e02), its second run (the first run of a new binary fills its caches and is not kept, as for main):

xcl-smoke v1
commit: b26c76e0275257cbd55018428ab142d9c3c78b41
gpu: NVIDIA GeForce RTX 5080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1519 (PresentX 1519)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 12603 MB

Not tested

AI use

Claude Code with Claude Fable 5.2 wrote the code and the test, ran the tests and the regression runs, and wrote this description.

🤖 Generated with Claude Code

…s for its copies

The present of a frame that is dumped (XCL_FRAME_DUMP, XCL_DUMP_TARGETS) waits
2000 ms for the GPU to finish the dump's copies and skips the dump after that.
The copies are queued behind the title's own work of the frame, so where a
frame takes the GPU longer than two seconds every dump was skipped, a target
dump's pictures and texel counts with it. The wait stays 2000 ms unless
XCL_DUMP_WAIT_MS names another.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Dec 1, 2026
@Aniseto

Aniseto commented Dec 1, 2026

Copy link
Copy Markdown

Ran the three named selections (the_dump_wait, parse_frame_dump_every, warm_settings) at b26c76e0 on an NVIDIA Blackwell desktop part with 16 GB of VRAM.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build, XCL_ADAPTER=NVIDIA, detached worktree at the exact PR head, no local patches.

XCL_ADAPTER=NVIDIA cargo test -q -p xcl --lib -- --test-threads=1 the_dump_wait parse_frame_dump_every warm_settings
5 passed; 0 failed; 0 ignored; 2781 filtered out      (exit 0)

All five tests pass here, including the new the_dump_wait_is_two_seconds_unless_a_positive_number_of_ms. The default path still uses 2000 ms; no frame dump was performed.

Not tested: the full workspace suite, a retail title with XCL_FRAME_DUMP or XCL_DUMP_TARGETS, a frame that takes over 2 s, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Review (head b26c76e, diff read, not a merge-check):

No problems found in the diff. Checked the parser and its test, the one call site in present_now (present.rs ~1673), how fence::wait takes the timeout, that the resize wait at ~1362 still uses 2000 ms, that the default stays 2000 ms when XCL_DUMP_WAIT_MS is unset, and that the variable is left out of the warm-settings key in shaders.rs like XCL_DUMP_TARGETS.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants