gpu: implement ordered 32-bit and 64-bit command-list memory waits #1023
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1023
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1023"
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?
@KLeek5 on GitHub · 2026-11-24 15:09 UTC · original
KLeek5:fix/gpu-wait64-v3→main· +2627 −153 · 10 files · 17 commits · openSummary
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).
@MichaelSmithAI on GitHub · 2026-11-24 15:18 UTC · original
We checked the shader UAV/copyback case on
836490bwith 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 returned0x01010114_01010101.Removing only the wait left the final shader outputs intact, but the subsequent copy captured the old CPU value
0x01010101_01010101. This distinguishes visibility at the point of the copy from eventual copyback at the end of submission. Both existing wait64 GPU tests also passed. The shader-produced predicate test covers this one same-list path; nonzero flags, external transient writes and title behavior remain open.@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
836490b:cargo test -p victory-gpupasses, 70 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@NuraadGit on GitHub · 2026-11-24 16:23 UTC · original
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.
reference = now + 1(rarely + 2).8dc74b6plus my reset fix (8168962) gives up after 2 s. That fired 234 times in ~5.5 minutes in the world. So with that implementation many of these counters weren't satisfied by any write it modelled. Without a timeout, the same case would hold a queue for good.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
GPU queue still waiting for memorywarning in the world.For that run, two things would help:
waitit prints, so it can be matched to the 16 counters.The other failure I hit on
8dc74b6was held lists that the title resets and records again:DXGI_ERROR_INVALID_CALLat world entry, 2 of 2 runs. You handle that case. My test for it,a_held_list_the_title_resets_runs_first(https://github.com/NuraadGit/VIctory/tree/gpu/held-list-reset), may be useful as an extra one.I wouldn't expect a picture change from the waits alone. With
8dc74b6+8168962the presented world frame stayed near black, max 2 of 255, as without.AI-assisted (Claude Code): the probe, runs and log summary were automated. The hardware, title copy and runs are the user's.
@AgneyaK on GitHub · 2026-11-24 20:55 UTC · original
Tested in the title on a 6 GB / 16 GB laptop as KLeek5 asked; the full table is at #700.
mainffe310e+ #208 + the wave64 stack + #452 + #579 + #431.GPU queue still waiting for memorywarning, so every wait resolved within 5 s. No stalled queue. Frame time about 13% above the same tree without this PR.host GPU failure: wait segment: Not enough memory resources (0x8007000E)fromacquire_listinwait_value. The machine was at its commit limit. A fallback there instead ofhost::failwould keep low-memory machines running.AI use: Claude Code (Claude Opus 5.5) ran the title on my machine and drafted this.
@Marvisak on GitHub · 2026-11-25 00:33 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/list.rs,crates/victory-gpu/src/shadow.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.