GPU: honor command-list 64-bit memory waits without blocking submissions (#700) #1388
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!1388
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1388"
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?
@wbkepler on GitHub · 2026-11-24 17:41 UTC · original
wbkepler:gpu/cmdlist-memory-wait→main· +1118 −105 · 5 files · 1 commits · openSummary
Rebased cleanly onto
upstream/main(ffe310e):wait_value64, slot 72) with full 64-bitD3D12_COMPARISON_FUNCevaluation,Acquire/Releasememory ordering, and segmentedHostList/CpuOpexecution.victory-gpu-waitscheduler so submitting CPU threads never deadlock on consumer-first submission orders.draw::State::rebind_segment, clearsfresh_tablesper segment, and ties upload/HostList/dynamic-slot lifetimes toArc-retained segments.queue::testscovering full 64-bit comparison ops, both producer-first and consumer-first 2-queue ordering (#700), and mid-list pre-wait work preservation.Verification
cargo clippy -p victory-gpu --all-targets&-p victory --features diagnostics --all-targets— passedcargo test -p victory-gpu— passedVICTORY_D3D12_DEBUG=1 VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --lib queue— passedcargo xtask policy— passed@HenriqueSBueno on GitHub · 2026-11-24 19:22 UTC · original
Field data for this PR from a retail run (RTX 3080, Series S profile,
main@ffe310e+ #189 + #89 + this PR, diag build).I added a counter at the point where this PR defers a list tail behind an unsatisfied 64-bit memory wait, and a queue-level
ID3D12CommandQueue::Waitimplemented as the same kind of wait on the fence's value (GREATER_EQUAL) through this PR's pending stream:held=32)Queue::Wait)So on this title the producer/consumer ordering goes through command-list memory waits, not queue fence waits. Without this PR those consumers ran before their producers. That matches #700 and the "GPU waits on itself in the wrong order" explanation for the black world.
This run did not light the world by itself: the stack is plain
mainwithout translator changes (603 shaders refused, so the lighting compute passes are still dropped), and the GPU was removed at ~300 s after reaching the world. The next step on our side is to combine this PR with our translator changes. Background and the related hypotheses are in #1317 (H-6.14, H-6.7).AI-assisted (Claude Code)
@AgneyaK on GitHub · 2026-11-24 20:55 UTC · original
Tested in the title on a 6 GB / 16 GB laptop (RTX 3050, diag build, title 1.0.2.1, story load). Full table: #700.
mainffe310e+ #208 + the wave64 stack + #452 + #579 + #431, this PR (9d84135, clean merge) lost the device in 2 of 2 runs without DRED: at 2:46 and 3:29,0x887A0007, after submissions of 29 and 3 lists. The same tree without it ran 7:26 and 8:21 (2 runs) to a title stop, with no removal.VICTORY_D3D12_DRED=1did not reproduce it (9:29, no removal), so it looks timing-dependent, and I have no DRED breadcrumbs for it.HostListthroughhost.new_list()(two allocators, two lists). This title records thousands of waits per load, so reusing segment lists might be where the time goes. Not measured separately.AI use: Claude Code (Claude Opus 5.5) ran the title on my machine and drafted this; results are from the runs described.
@wwwwwwww3333333 on GitHub · 2026-11-25 01:14 UTC · original
Rebased onto main
42363ab6and ran it on AMD. It conflicted in 9 places; four of them needed more than picking a side. #700 is still open on main (wait_valueis still the empty stub), so this seemed worth carrying forward.What the rebase had to change
list.rsuploads. Main replaced theVec<u8>upload blocks withUpload(VirtualAlloc'd, notClone), soArc<Vec<Vec<u8>>>plusArc::make_mutno longer works. Uploads are nowVec<Arc<Upload>>(pub(crate) type Uploads).Arcs, and reset just clears the list's ownVec.draw.rsdynamic slots. This PR moves them fromStateto the host list segment (keep_dynamic). Main has since added two more users ofState::dynamic: root views (root_view,ROOT_VIEW_RUN) andclear_unordered. Both now calllist.keep_dynamic(..).rebind_segmentnow also resetsroot_runandroot_slots. Otherwise a new segment keeps handing out slots from a run the sealed segment owns, and those slots are freed when that segment retires.Deferred::dropgives slots of our own view heap (memory::OURS) back tomemory::heap(), as main's oldState::dropdid.descriptor::release_dynamicdoesn't know that heap.list.rscreate_listkeeps main's initialset_pipeline.resetkeepspipeline::bound.external.rsuses the nowArc-returninghost_list(madepub(crate)).host.rskeeps main's frame dump and then callsnotify_memory_waiters, after thesubmittedlock is dropped.draw.rskeeps main's diagnostics lines.Results on
42363ab6+ this, RX 6750 XT (RDNA2), Windows 11, Rust 1.98.1 MSVC:command_list_memory_wait_orders_producer_and_consumer_both_waysandmid_list_memory_wait_preserves_pre_wait_work_and_releases_post_wait_tail(the producer-first and consumer-first cases from #700): 8 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.Not covered: how this interacts with #1828 (asynchronous submissions). Both rework
host.rssubmission, so whichever lands second will need a rebase. Not tested with the title.The rebase on top of a plain
git merge -X theirsof this PR into42363ab6(what differs from taking this PR's side of every conflict)Unit tests only, no game files. AI-assisted (Claude rebased it; I ran it on my machine).
@Marvisak on GitHub · 2026-11-25 01:25 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs,crates/victory-gpu/src/list.rs). It will be reviewed once it is rebased onto the currentmain.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.