Repository navigation
Conversation
SetEventOnCompletion(value, NULL) must block until the fence reaches the value. It answered E_NOTIMPL at once (from when no GPU work ran), so a title that waits this way went on before the value was reached. A command list's bottom-of-pipe write at a fence's GPU address moved the value without setting the events waiting for it. Live fences are now registered by value address; Written::write wakes the fence it touched. Blocking waits re-check the value every 100 ms and warn every 5 s while stuck. New tests cover both paths; three of them fail on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ID3D12CommandQueue::Wait did nothing, so work submitted after a wait for a value another queue signals later ran too early. Each queue now has a timeline that Wait, Signal and ExecuteCommandLists go through in order. Not held back, work runs on the submitting thread as before; behind a wait not reached yet, the call returns and the work runs on the thread that moves the fence. A list reset or dropped while a submission of it is still to run keeps its host list and upload memory until that submission completes. One synthetic two-queue test.
A present on a queue held back by a wait ran immediately, before the work preceding it. present() now reads its plane parameters at call time, holds a reference to the presented resource via a shared object::Held wrapper (also reused by fence::Held), and submits the present through the queue's timeline. One synthetic two-queue test.
CopyPageMappingsBatchX previously ran immediately even on a queue held back behind a fence wait, updating page mappings ahead of earlier queued work. It now snapshots the caller's batch and range arrays at submission time (with checked address arithmetic) and runs through the queue's timeline. One synthetic two-queue test.
Previously, moving a fence's value via a direct write to its GPU address (outside Signal or Written::write) only woke blocking null-event waits; registered Win32 events stayed unset and held-back queues waited until their next submission. A lazy background watcher thread (victory-fence-watch) now polls live fences every 10 ms only while at least one event or queue wait is pending and parks on a condvar when idle. Also switches aligned Written::write stores to atomic Release stores. Two new synthetic tests.
Detached HostLists whose submissions finished on a held-back queue are now returned to a bounded pool on Host (up to 64) and reused on subsequent list creations or pending resets. Dropping or resetting a list while a submission of it is still queued now transfers both its allocate_upload blocks and dynamic descriptor slots to the pending HostList until execution completes, and reset failure no longer resets an in-flight HostList. One new synthetic test.
The merge of main (6e88bc0) kept only the last 126 lines of crates/victory-gpu/src/host.rs, so the crate did not build. This is the file as the merge should have left it: both sides' additions kept (the held lists' kept uploads and descriptor slots, Send and Sync, and main's diagnostics timestamps). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Host::execute did the lists' bottom-of-pipe writes holding its `submitted` lock and the lists' `deferred` guards. A write at a fence a held-back queue waits for ran that queue's work inline (fence::written -> Timeline::wake), and the work calls Host::execute again: a deadlock on `submitted` (std's Mutex is not re-entrant), in the case the queue timeline is for (a graphics queue waiting on a compute list's write). Written::write and fence::written now return the woken queues (Woken, must_use); execute collects them and runs them after dropping its locks. Without a host GPU, list writes still run them at once (no lock held). Reported in review by Sunkiller-qc. 1 new test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep memory waits in timeline order and retain closed native segments only where earlier commands need to run. Recycle idle segments and warn on long waits without advancing the queue. The masked Wait32 coverage builds on AlanQiang0418’s comparison in issue Marvisak#700. Implementation and synthetic validation assisted by Codex.
…plementation PR Marvisak#32 by AndyLatimer, head 9c5328d. Source tree verified against the public integration merge plus the latest main change. Reconstructed locally with Codex.
Keep possible waits alive and release impossible waits with the guest queue. Use checked Windows reads for guest operands, following AndyLatimer’s approach in a9a7985. Developed with Codex.
…ak#32 source tree Developed and tested locally using Codex.
|
We checked the shader UAV/copyback case on 836490b with an RTX 4090 under Wine/vkd3d-proton 3.2. A guest compute dispatch updated two UAV records, followed in the same guest command list by a masked 32-bit wait for the low byte of the first output to equal 20 (flags zero), then a copy. After submission the two shader output bytes were 20 and 44, and the copy after the wait returned Removing only the wait left the final shader outputs intact, but the subsequent copy captured the old CPU value |
|
In-title numbers for the waits this handles, from an RTX 2080 (measured on #700 with other branches, not with this one). They bear on one choice here: a wait never completes by timeout.
Your copy-back wakes waits, so some of those 234 may resolve here; @MichaelSmithAI's shader-written test passes. Only a title run can say. The line to look for is your 5-s For that run, two things would help:
The other failure I hit on I wouldn't expect a picture change from the waits alone. With AI-assisted (Claude Code): the probe, runs and log summary were automated. The hardware, title copy and runs are the user's. |
|
Tested in the title on a 6 GB / 16 GB laptop as KLeek5 asked; the full table is at #700 (comment).
AI use: Claude Code (Claude Opus 5.5) ran the title on my machine and drafted this. |
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
Summary
Addresses #700 by implementing ordered, non-blocking command-list memory waits.
Validation
Tested on NVIDIA RTX 3050 and WARP:
Dependencies and limitations
This branch incorporates the source changes from #32 at
9c5328d.Non-zero wait flags, transient external memory writes between polls, and end-to-end shader UAV/copy-back behavior remain unverified.
Full workspace validation and
cargo xtask policywere blocked by an unavailable dependency.No in-game validation has been performed. Independent testing is welcome.
Thanks to AndyLatimer and AlanQiang0418 for their alternative implementations and useful comparison points.
AI-assisted development (OpenAI Codex).