GPU: a slot rewritten during a run keeps its view's copy of title memory until the run is over #2291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2293"
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:05:18Z.
Summary
A descriptor slot rewritten during a run retired only its host buffer; the view's copy of title memory went at once, together with the marks the submission's copy-back still had to read. The copy is now kept until the run is over.
Testing
Test
a_rewritten_slot_retires_its_copy_of_title_memoryfails onmainand passes with this change. The branch has a second, comment-only commit that moves two doc comments back to their items.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).Not tried: a run in the game. The test depends on the global
release_retired.AI-assisted.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T10:19:11Z.
Review: COMMENTED
A slot rewritten during a run keeps its view's copy of title memory until the work ran (retire(old, copy)). 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. Lifetime fix with regression test.
Imported from Marvisak/VIctory. Originally posted by welisonzika14-jpg on 2026-11-25T12:00:02Z.
First run on NVIDIA hardware here, as far as I can see (the reviews above are static or WARP). RTX 5070 (Blackwell, driver 621.24), Ryzen 7 5700X, Windows 11, Rust 1.98.1 MSVC, no game files. Head
0318c56merged ontomain940d32f,cargo test -p victory-gpu -p victory-shader --lib --no-fail-fast.The PR's test
descriptor::host::tests::a_rewritten_slot_retires_its_copy_of_title_memorypasses on this card. The rest is the same asmainon this card: the 5 known NVIDIA failures from #1744 (2 view heap cap tests invictory-gpu, 3 invictory-shader), nothing new.One run, unit tests only, title not run.
Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T14:51:06Z.
Automated triage for the maintainers.
Verdict: merge candidate. I reviewed the rebased head
ad5440a.HostHeap::keep(crates/victory-gpu/src/descriptor/host.rs) now passes the old slot'sArc<Shadow>tohost::retiretogether with its resource, so the copy outlives the run. This matters because the copy owners inshadow::MarksareWeak, andcopy_back_marks(host.rs ~1396) runs beforerelease_retired(~1428). Without the change, a slot rewritten mid-run dropped its copy, and its marked writes were lost.retirehas no other callers. Thedraw.rstest now waits for the release thread, which matchesrelease_later.Minor:
a_rewritten_slot_retires_its_copy_of_title_memoryasserts an exactstrong_countwhile other tests may call the globalrelease_retiredin parallel. It could flake under the default thread count.CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T15:13:26Z.
Review: APPROVED
Reviewed
descriptor/host.rs,draw.rs, andhost.rsatad5440a9merged ontoorigin/main(63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.Lifetime & locking audit
HostHeap::keep(crates/victory-gpu/src/descriptor/host.rs:561) passes both the displacedID3D12ResourceandOption<Arc<Shadow>>tohost::retire(crates/victory-gpu/src/host.rs:3677,3683), keeping the shadow copy (and itsWeak-referencedMarksentry) alive untilHost::submitfinishescopy_back_marksand callsrelease_retired()(host.rs:3688).release_retired()swapsRETIREDout withstd::mem::takeand sends theVecto the backgroundvictory-releasethread (release_later), soArc<Shadow>drops (which lockARENA/MARKS) happen completely outside bothHostHeap::keptandRETIRED, andRETIREDis drained on every submission.draw.rs:3634-3637cleanly updatesstructured_views_off_their_buffers_elements_get_their_own_copyto drainrelease_retired()and wait for the background release thread. (Minor non-blocking note:a_rewritten_slot_retires_its_copy_of_title_memoryatdescriptor/host.rs:2095asserts an exactArc::strong_countagainst the process-globalRETIREDlist, which can contend if another test callsrelease_retired()concurrently.)git merge-treeconfirms clean merges with both#2329and#2298.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_rewritten_slot_retires_its_copy_of_title_memory(descriptor/host.rs:2095) andstructured_views_off_their_buffers_elements_get_their_own_copy.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T22:11:08Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib descriptor::host::tests:: -- --skip dynamic_slots_are_held_until_released --test-threads=1: 15 passed, 0 failed (includinga_rewritten_slot_retires_its_copy_of_title_memory).cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.