GPU: aliasing and UAV barriers keep the host resources they name until the list is reset #2298

Open
github-bot wants to merge 1 commit from github-bot/gh-2298 into main AGit
Owner

@⁠denkencar-sketch on GitHub · 2026-11-25 10:05 UTC · original
denkencar-sketch:fix/list-001 → main · +43 −1 · 2 files · 1 commits · open

Summary

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_resources fails on main and passes with this change. cargo test --workspace --locked passes apart from known flakes: modules::dstorage::tests::a_page_list_filled_after_its_request_starts fails now and then on main too, and so does a parallel-run flake in victory-gpu's lib tests (watch:: and descriptor::host:: tests, 2 of 40 runs on pristine main).

Not tried: a real release after recording, in the game.

AI-assisted.

**@⁠denkencar-sketch** on GitHub · 2026-11-25 10:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2298) `denkencar-sketch:fix/list-001` → `main` · +43 −1 · 2 files · 1 commits · open ## Summary 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_resources` fails on `main` and passes with this change. `cargo test --workspace --locked` passes apart from known flakes: `modules::dstorage::tests::a_page_list_filled_after_its_request_starts` fails now and then on `main` too, and so does a parallel-run flake in `victory-gpu`'s lib tests (`watch::` and `descriptor::host::` tests, 2 of 40 runs on pristine `main`). Not tried: a real release after recording, in the game. AI-assisted.
Only transition barriers held theirs (through the list's states); a title
that released a resource after recording a barrier on it left the command
list naming a freed resource.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:01:25 +00:00
Author
Owner

@⁠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 temporary host_resource clone that is dropped right away. Only transitions keep their texture, through HostList::transition. If the title releases the resource before the list runs, the recorded barrier then names a freed resource. The PR calls HostList::keep on every resource that the host closure 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 in host.rs is a test-only kept_count.

Verdict: merge candidate (a recommendation to look, not an approval). CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2298#issuecomment-7166827502) · edited 2026-11-26 03:21 UTC <!-- victory-triage v1 head=2d83bf2c990076517c342c24a7c09c1306220b40 verdict=merge-candidate at=2026-11-26T03:21:15Z --> 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 temporary `host_resource` clone that is dropped right away. Only transitions keep their texture, through `HostList::transition`. If the title releases the resource before the list runs, the recorded barrier then names a freed resource. The PR calls `HostList::keep` on every resource that the `host` closure 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 in `host.rs` is a test-only `kept_count`. **Verdict: merge candidate** (a recommendation to look, not an approval). CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠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.

**@⁠catminou4** on GitHub · 2026-11-25 10:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2298#pullrequestreview-6055713019) · **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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 15:13 UTC · original · approved these changes

Reviewed crates/victory-gpu/src/host.rs and crates/victory-gpu/src/list.rs at 2d83bf2c merged onto origin/main (63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) with VICTORY_D3D12_DEBUG=1.

Null safety & retention audit

  • host_barrier (crates/victory-gpu/src/list.rs:499-544) retains every resolved host ID3D12Resource via list.keep(&h) (list.rs:505) inside the host closure while preserving the explicit null checks for both b.first (aliasing kind == 1 and UAV kind == 2) and b.second (aliasing kind == 1). Null/null aliasing and global null UAV barriers remain untouched (0 kept refs), and non-null before/after resources stay alive until HostList::reset().
  • git merge-tree confirms clean merges with both #2293 and #2329 (the latter adds the identical #[cfg(test)] kept_count() helper at host.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:: with VICTORY_D3D12_DEBUG=1: 39/39 passed on RTX 5090 (skipping dynamic_slots_are_held_until_released) and 40/40 passed on WARP (--features diagnostics, skipping the pre-existing main compositor_failure_presents_primary_in_the_same_frame Debug Layer mismatch), including uav_and_aliasing_barriers_keep_their_resources (list.rs:1912).
  • Additional RTX 5090 + Debug Layer probe covering aliasing NULL/NULL (+0 kept), NULL/t2 (+1), t1/t2 (+2), UAV NULL (+0), UAV t1 (+1), plus recording a real D3D12 UAV barrier on t1 and releasing both title COM textures (Release() -> 0) before list.close() / host.execute() / list.reset() passed cleanly with kept_count() == 0 afterward and GetDeviceRemovedReason().is_ok().
  • Combined #2293 + #2298 merge verified cleanly on RTX 5090 + Debug Layer (2/2 targeted tests passed).
**@⁠fuzeofficlal** on GitHub · 2026-11-26 15:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2298#pullrequestreview-6076555455) · **approved these changes** Reviewed `crates/victory-gpu/src/host.rs` and `crates/victory-gpu/src/list.rs` at `2d83bf2c` merged onto `origin/main` (`63bcca43`) and verified on RTX 5090 and WARP (`VICTORY_D3D12_WARP=1`) with `VICTORY_D3D12_DEBUG=1`. ### Null safety & retention audit - `host_barrier` (`crates/victory-gpu/src/list.rs:499-544`) retains every resolved host `ID3D12Resource` via `list.keep(&h)` (`list.rs:505`) inside the `host` closure while preserving the explicit null checks for both `b.first` (aliasing `kind == 1` and UAV `kind == 2`) and `b.second` (aliasing `kind == 1`). Null/null aliasing and global null UAV barriers remain untouched (0 kept refs), and non-null before/after resources stay alive until `HostList::reset()`. - `git merge-tree` confirms clean merges with both `#2293` and `#2329` (the latter adds the identical `#[cfg(test)] kept_count()` helper at `host.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::` with `VICTORY_D3D12_DEBUG=1`: **39/39 passed** on RTX 5090 (skipping `dynamic_slots_are_held_until_released`) and **40/40 passed** on WARP (`--features diagnostics`, skipping the pre-existing `main` `compositor_failure_presents_primary_in_the_same_frame` Debug Layer mismatch), including `uav_and_aliasing_barriers_keep_their_resources` (`list.rs:1912`). - Additional RTX 5090 + Debug Layer probe covering aliasing `NULL/NULL` (+0 kept), `NULL/t2` (+1), `t1/t2` (+2), UAV `NULL` (+0), UAV `t1` (+1), plus recording a real D3D12 UAV barrier on `t1` and releasing both title COM textures (`Release() -> 0`) **before** `list.close()` / `host.execute()` / `list.reset()` passed cleanly with `kept_count() == 0` afterward and `GetDeviceRemovedReason().is_ok()`. - Combined `#2293 + #2298` merge verified cleanly on RTX 5090 + Debug Layer (`2/2` targeted tests passed).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2298/head:github-bot/gh-2298'
git switch 'github-bot/gh-2298'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2298'
git switch 'github-bot/gh-2298'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2298'
git switch 'github-bot/gh-2298'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2298'
git switch 'main'
git merge --squash 'github-bot/gh-2298'
git switch 'main'
git merge --ff-only 'github-bot/gh-2298'
git switch 'main'
git merge 'github-bot/gh-2298'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2298
No description provided.