GPU: a list used twice in one submission gets a prelude per use #3162

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

@⁠kotekompotek on GitHub · 2026-11-26 10:38 UTC · original
kotekompotek:gpu/prelude-per-submission-use → main · +116 −15 · 1 files · 1 commits · open

HostList::prelude keeps one (allocator, list) pair. When one submission names the same list twice, prelude() runs once per use — and the second use's allocator.Reset() + list.Reset() destroys the recording the first use just made. ExecuteCommandLists then runs the second use's transitions twice and the first use's never: textures the first use needs are left in the wrong state.

The pair is now a small pool. prelude() pops a free pair (or makes another for a second or later use), records on it, and moves it to a flight list; execute moves the flight pairs back to free once every group's submission is waited for — the same lifetime the single pair had, just per use.

host::tests::a_second_use_gets_its_own_prelude records two uses and checks each got its own command list and its own move, in order.

Found by the #1242 audit (VIC-BT-001). Touches prelude(), which #2908 rewrites for parallel recording — whichever lands second rebases; the pool here also gives that change its per-thread pair for free.

**@⁠kotekompotek** on GitHub · 2026-11-26 10:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/3162) `kotekompotek:gpu/prelude-per-submission-use` → `main` · +116 −15 · 1 files · 1 commits · open `HostList::prelude` keeps one `(allocator, list)` pair. When one submission names the same list twice, `prelude()` runs once per use — and the second use's `allocator.Reset()` + `list.Reset()` destroys the recording the first use just made. `ExecuteCommandLists` then runs the second use's transitions twice and the first use's never: textures the first use needs are left in the wrong state. The pair is now a small pool. `prelude()` pops a free pair (or makes another for a second or later use), records on it, and moves it to a `flight` list; `execute` moves the flight pairs back to `free` once every group's submission is waited for — the same lifetime the single pair had, just per use. `host::tests::a_second_use_gets_its_own_prelude` records two uses and checks each got its own command list and its own move, in order. Found by the #1242 audit (VIC-BT-001). Touches `prelude()`, which #2908 rewrites for parallel recording — whichever lands second rebases; the pool here also gives that change its per-thread pair for free.
HostList::prelude recorded its submission transitions on a single
(allocator, list) pair. A submission naming the same list twice called
prelude twice; the second call reset the pair the first had just
recorded, so the first use's barriers were destroyed before
ExecuteCommandLists ran them.

The pair is now a pool: prelude pops a free pair or makes one, records
it, and moves it to a flight list; execute moves flight pairs back to
free once every group is waited for. A regression test records two
uses' preludes and checks they are different command lists.

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:09:06 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-26 10:48 UTC · original · approved these changes

Verified on RTX 5090 & WARP against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released: passed.
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed on RTX 5090 and WARP.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly ensures a command list submitted twice in one submission receives a prelude per use.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-26 10:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/3162#pullrequestreview-6072763906) · **approved these changes** Verified on RTX 5090 & WARP against `origin/main` (`63bcca4`): - `cargo test -p victory-gpu --lib host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released`: passed. - `cargo test -p victory-gpu --lib draw:: -- --test-threads=1`: 20/20 passed on RTX 5090 and WARP. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Cleanly ensures a command list submitted twice in one submission receives a prelude per use. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This pull request can be merged automatically.
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/3162/head:github-bot/gh-3162'
git switch 'github-bot/gh-3162'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3162'
git switch 'github-bot/gh-3162'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3162'
git switch 'github-bot/gh-3162'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3162'
git switch 'main'
git merge --squash 'github-bot/gh-3162'
git switch 'main'
git merge --ff-only 'github-bot/gh-3162'
git switch 'main'
git merge 'github-bot/gh-3162'
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!3162
No description provided.