GPU: a slot rewritten during a run keeps its view's copy of title memory until the run is over #2293
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!2293
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/dhost-001→main· +34 −5 · 3 files · 2 commits · openSummary
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.
@welisonzika14-jpg on GitHub · 2026-11-25 12:00 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 14:51 UTC · original · edited 2026-11-26 03:22 UTC
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
@catminou4 on GitHub · 2026-11-25 10:19 UTC · original · reviewed
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.
@fuzeofficlal on GitHub · 2026-11-26 15:13 UTC · original · approved these changes
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.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.