gpu: implement ordered 32-bit and 64-bit command-list memory waits #1023
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by KLeek5 on 2026-11-24T15:09:26Z.
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).
Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T15:18:35Z.
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.Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:40:14Z.
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).
Imported from Marvisak/VIctory. Originally posted by NuraadGit on 2026-11-24T16:23:58Z.
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.
Imported from Marvisak/VIctory. Originally posted by AgneyaK on 2026-11-24T20:55:34Z.
Tested in the title on a 6 GB / 16 GB laptop as KLeek5 asked; the full table is at https://github.com/Marvisak/VIctory/issues/700#issuecomment-7144235622.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:33:32Z.
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
upstream-sync referenced this pull request2026-11-25 11:05:13 +00:00
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.