D3D12.X: XCL_DUMP_WAIT_MS sets how long a dumped frame's present waits for the dump's copies #3571
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3571"
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?
Imported from ivall/xcl. Originally posted by imnicho on 2026-12-01T13:35:44Z.
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 isdump_wait_ms(): 2000 unlessXCL_DUMP_WAIT_MSis 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 withXCL_DUMP_TARGETSandXCL_DUMP_AFTER_Samong the settings that are not part of a launch preparation's key.README.md: two lines afterXCL_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, noSKIPPEDline.the_dump_wait_is_two_seconds_unless_a_positive_number_of_msis new.XCL_FRAME_DUMP=10and 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 andXCL_DUMP_WAIT_MS=90000wrote the dump's 54 pictures and their texel counts. That build was the draft #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):This PR (
b26c76e02), its second run (the first run of a new binary fills its caches and is not kept, as formain):Not tested
cargo test -p xcl --libas a whole: on this PC plainmainends the test process partway (reported on #3089); CI has the whole suite.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
Imported from ivall/xcl. Originally posted by Aniseto on 2026-12-01T13:39:43Z.
Ran the three named selections (
the_dump_wait,parse_frame_dump_every,warm_settings) atb26c76e0on 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.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_DUMPorXCL_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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T20:24:15Z.
Review (head
b26c76e0, 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), howfence::waittakes the timeout, that the resize wait at ~1362 still uses 2000 ms, that the default stays 2000 ms whenXCL_DUMP_WAIT_MSis unset, and that the variable is left out of the warm-settings key inshaders.rslikeXCL_DUMP_TARGETS.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:53:02Z.
Review: COMMENTED
Review of
b26c76e0: 1 finding(s) (1 medium), most severe first.crates/xcl/src/hle/d3d12x/present.rs:1727:parse_dump_wait_msaccepts any u32 with no upper bound, so XCL_DUMP_WAIT_MS=4294967295 reaches WaitForSingleObject as INFINITE (0xFFFFFFFF) and the present can wait forever. (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:53:03Z.
Code review location:
crates/xcl/src/hle/d3d12x/present.rs; line 1727Medium:
parse_dump_wait_msaccepts any u32 with no upper bound, so XCL_DUMP_WAIT_MS=4294967295 reaches WaitForSingleObject as INFINITE (0xFFFFFFFF) and the present can wait forever. A user who sets a huge value to mean "wait as long as it takes" gets a wait that never times out if the dump copy never finishes and the device isn't reported removed (e.g. the frame's GPU work waits on a fence the title signals only after PresentX returns). The title's PresentX thread then hangs for good while holding PRESENTX_LOCK and the PRESENTER mutex. Any value above the 2 s / 5 s watchdogs (XCL_WAIT_TIMEOUT_MS, XCL_GPU_WAIT_TIMEOUT_MS) can also trip them and stop the title mid-diagnosis. Capping the value below INFINITE and logging the effective wait would avoid both.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:53:04Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T12:32:39Z.
merge-check
base:
0c725d5da2head:
b26c76e027merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3017 passed, 0 failed, 56 ignored; SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. The new
the_dump_wait_is_two_seconds_unless_a_positive_number_of_msand the extendedwarm_settings_ignore_waits_watchdogs_and_traces_but_keep_pipeline_switchesare among the passed.review: read the whole diff (3 files, +33 -2),
fence::waitand the present code around the call. No blocking finding.fence::waitthen returnsRemovedwithout waiting for the timeout.performance: none by default (reasoned): the variable is read once, and only when a frame is dumped.
verdict: safe to merge
hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.