GPU: safely reset an open host command list #2979
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!2979
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2979"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:08 UTC · original
andrewpozdnakov7-jpg:codex2/command-list-recording→main· +60 −0 · 2 files · 2 commits · openAn open VIctory command list can reach the host allocator reset without being closed. On D3D12 this returns
E_FAILand VIctory terminates. A second guestClosecan also reach the same host list after it is closed.Keep the recording state on the host list. Close an open host recording before resetting its allocator and skip repeated native closes.
Close,ResetandResetXkeep VIctory's existing guest result codes. The existing guest restart still discards the old commands, deferred work and state.The same synthetic guest-vtable test aborts at the first host reset on
63bcca43. At4f97c15it passes for direct and copy lists on Windows app-local WARP. It covers resetting a recording, discarding deferred work throughResetandResetX, repeated closes, the null-allocator error, and submitting the reset list. The focused test also passes with GPU timing enabled. The full GPU suite passed 247 tests with one ignored. Strict GPU Clippy passed with default and all features, and asset policy passed.The host precondition comes from the Windows D3D12 API. Command allocator reset
Coordination claim
Please retain the Git author when reapplying this change. If you fold it into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.GPU: validate command list Close and Reset stateto GPU: safely reset an open host command list@andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:27 UTC · original
Thanks for the RTX 5090 and WARP checks. D3D12 requires the caller to serialize methods on the same command list. For a handoff between threads, the caller's synchronization covers the entire Close or Reset operation, including the guest recording bit. The atomic is a lifecycle flag.
Review note · Command list threading contract
@Marvisak on GitHub · 2026-11-26 05:40 UTC · original · edited 2026-11-26 07:19 UTC
Automated triage for the maintainers.
Merge candidate (recommending a look, not approving). Thanks for taking the narrower route. The guest
Close/Reset/ResetXinlist.rsreturn the same codes as onmain, so the title sees no change. The fix is now host-side only, inHostList(crates/victory-gpu/src/host.rs):recordingflag makesclosea no-op on an already closed list;resetcloses an open recording before it resets the allocator.This avoids the host
E_FAILonmainwhen the title resets an open list. I checked the other callers:waitcloses a segment and thenrestart/recyclereset it, which still works because a closed list skips the second close.command_list_can_discard_an_open_recordingchecks the HRESULTs and that discarded deferred work never runs, for direct and copy lists.CI: passing (
check).Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 06:11 UTC · original
I took the narrower option in the review. Commit
4f97c15restores the existing guestClose,ResetandResetXresult codes. The host closes an open recording before resetting its allocator and ignores a second native close.The same synthetic test on
63bcca43reaches hostE_FAILduring the first reset. On the updated head, direct and copy lists discard the queued work, preserve the null-allocator check and can submit after resetting. Windows app-local WARP passed the focused case with and without GPU timing and 247 GPU tests with one ignored. Both strict GPU Clippy configurations and asset policy passed.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.