GPU: a list that binds a heap's view-address table keeps it until reset #2327
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2329"
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 denkencar-sketch on 2026-11-25T10:42:39Z.
Summary
The view-address table a list binds lived and died with its heap, which the title may release while the GPU still reads the table as a root view. A list that binds it now keeps it until reset. It is also made under the made-slots lock now, so a view noted meanwhile is not lost.
Testing
Test
a_list_keeps_the_view_address_table_it_bindsfails without the keep and passes with this change. The second part, holding the lock across the publish, is not covered by a test (it is right by reading).cargo test --workspace --lockedpasses apart from known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).This changes the same function as open PR #1906, so a small textual conflict is expected. Not tried: a run in the game.
AI-assisted.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:54:11Z.
Review: COMMENTED
A list binding a heap's view-address table keeps it until published — lock ordering documented. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:42:30Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:cargo test -p victory-gpu draw::tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (includinga_list_keeps_the_view_address_table_it_binds).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
upstream-sync referenced this pull request2026-11-25 16:09:09 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:22:58Z.
Automated triage for the maintainers.
Verdict: merge candidate (as before the conflict). Thanks for rebasing; it merges cleanly into current
main.crates/victory-gpu/src/draw.rs: the root SRV bound for view addresses now goes throughkept_view_addresses, whichlist.keeps the table'sID3D12Resource. Onmaina list keeps the descriptor heaps it binds (draw.rsaround line 1027) but not this upload buffer, whichHostHeapowns. So a heap the title releases before the list runs could free a buffer the GPU still reads.descriptor/host.rsview_addressesnow takes themadelock beforeget_or_initand holds it until the table is published.mirrornotes addresses while holding that lock, so an address noted between the snapshot and the publish is no longer lost.Outside this PR: dynamic slots (
make_at,make_raw) callnote_addresswithout themadelock, and their entries aren't in the snapshot. That is the same as onmain.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:04:44Z.
Review: APPROVED
Reviewed
descriptor/host.rs,draw.rs, andhost.rsat0c80172bmerged ontoorigin/main(63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.Code & concurrency audit
State::cut:draw.rs:856routes root-SRV binding ofstage.view_addressesthroughkept_view_addresses(draw.rs:2014), which callslist.keep(table)onheap.view_addresses_buffer()(descriptor/host.rs:607) so the upload buffer remains alive untilHostList::reset()even if the title releases the descriptor heap before submission. BecauseState::cutresets cached host state andState::bindre-runs the binding loop on the new segment, every segment that binds the table retains it.HostHeap::view_addresses()(descriptor/host.rs:567-598) fast-pathsself.addresses.get()and holdsself.made(descriptor/host.rs:573) acrossself.addresses.get_or_init(...), closing the race where a concurrentmirror()could write a slot between the initial snapshot andOnceLockpublication. Lock ordering (self.made->view_at/VIEWS) matchesmirror().#2293(and#1906), so a minor conflict resolution may be needed depending on merge order.Verification
cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.descriptor:: draw:: host::withVICTORY_D3D12_DEBUG=1: 62/62 passed on RTX 5090 (skippingdynamic_slots_are_held_until_released) and 63/63 passed on WARP (--features diagnostics, skipping the pre-existingmaincompositor_failure_presents_primary_in_the_same_frameDebug Layer mismatch), includinga_list_keeps_the_view_address_table_it_binds(draw.rs:2065).HostHeapafterkept_view_addressesand beforelist.close()/host.execute()/list.reset()passed cleanly, confirming the buffer stays live until reset (kept_count == 0afterward) withGetDeviceRemovedReason().is_ok().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.