GPU: aliasing and UAV barriers keep the host resources they name until the list is reset #2298
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!2298
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2298"
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/list-001→main· +43 −1 · 2 files · 1 commits · openSummary
Aliasing and UAV barriers did not keep the host resources they name; only transition barriers did (through the list's states). A title that released a resource after recording such a barrier left the command list naming a freed resource. They now keep their resources until the list is reset.
Testing
Test
uav_and_aliasing_barriers_keep_their_resourcesfails onmainand passes with this change.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 real release after recording, in the game.
AI-assisted.
@Marvisak on GitHub · 2026-11-25 15:25 UTC · original · edited 2026-11-26 03:21 UTC
Automated triage for the maintainers.
Re-reviewed after the rebase. The branch now merges cleanly.
On
main,host_barrier(crates/victory-gpu/src/list.rs) turns UAV and aliasing barriers into raw host-resource pointers. It takes them from a temporaryhost_resourceclone that is dropped right away. Only transitions keep their texture, throughHostList::transition. If the title releases the resource before the list runs, the recorded barrier then names a freed resource. The PR callsHostList::keepon every resource that thehostclosure resolves, which is the same mechanism the list already uses for replaced argument buffers. The test checks that both barrier kinds add one kept reference. The only change inhost.rsis a test-onlykept_count.Verdict: merge candidate (a recommendation to look, not an approval). CI: passing.
Generated by Claude Code
@catminou4 on GitHub · 2026-11-25 10:19 UTC · original · reviewed
Aliasing and UAV barriers keep the host resources they name (host_barrier keeps resource alive until list reset). 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.
@fuzeofficlal on GitHub · 2026-11-26 15:13 UTC · original · approved these changes
Reviewed
crates/victory-gpu/src/host.rsandcrates/victory-gpu/src/list.rsat2d83bf2cmerged ontoorigin/main(63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.Null safety & retention audit
host_barrier(crates/victory-gpu/src/list.rs:499-544) retains every resolved hostID3D12Resourcevialist.keep(&h)(list.rs:505) inside thehostclosure while preserving the explicit null checks for bothb.first(aliasingkind == 1and UAVkind == 2) andb.second(aliasingkind == 1). Null/null aliasing and global null UAV barriers remain untouched (0 kept refs), and non-null before/after resources stay alive untilHostList::reset().git merge-treeconfirms clean merges with both#2293and#2329(the latter adds the identical#[cfg(test)] kept_count()helper athost.rs:2262).Verification
cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.list:: host::withVICTORY_D3D12_DEBUG=1: 39/39 passed on RTX 5090 (skippingdynamic_slots_are_held_until_released) and 40/40 passed on WARP (--features diagnostics, skipping the pre-existingmaincompositor_failure_presents_primary_in_the_same_frameDebug Layer mismatch), includinguav_and_aliasing_barriers_keep_their_resources(list.rs:1912).NULL/NULL(+0 kept),NULL/t2(+1),t1/t2(+2), UAVNULL(+0), UAVt1(+1), plus recording a real D3D12 UAV barrier ont1and releasing both title COM textures (Release() -> 0) beforelist.close()/host.execute()/list.reset()passed cleanly withkept_count() == 0afterward andGetDeviceRemovedReason().is_ok().#2293 + #2298merge verified cleanly on RTX 5090 + Debug Layer (2/2targeted tests 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.