Pipelines: a dispatch waits for its compute pipeline until it is made (VICTORY_PIPELINE_COMPUTE_WAIT=0: as before) #1312

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

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-26 13:49 UTC · original
Exopus-0x65f7ad0:pr/compute-wait → main · +26 −1 · 1 files · 1 commits · open

What

In make::ready, a pipeline without a graphics state (a compute pipeline) that is not made yet is now made on the calling thread, or waited for while a worker makes it (Pending::make, OnceLock::get_or_init). This happens whatever the frame's wait budget. Draws keep the budget (wait) and are still dropped while their pipeline is missing.

VICTORY_PIPELINE_COMPUTE_WAIT=0 restores the old behaviour, where dispatches also wait only within the budget.

Why

A dropped draw is drawn again in the next frame. A dropped dispatch may not be: the title runs some compute passes once, when the scene changes, and the rest of the scene reads what they leave.

Seen in the prison corridor (RTX 5060 Ti 8 GB, 16 GB RAM, Series S):

  • A compute program met for the first time took 4.4 s to make, because memory was saturated. The log has its first bind, then translation 0.3 s later, then "a dispatch without a host pipeline dropped" after the 500 ms budget, then the host pipeline 4 s after that.
  • From that frame on, the windows of the dormitory Lucia had just looked through stayed blended over the whole picture. The guard looked transparent with a fence pattern on him. It lasted for more than 80 s while the camera moved, so it was not temporal AA.
  • That was the only dropped dispatch in about 15 runs that day.

The same route with this change: no dropped dispatch, and the corridor and the scene after it rendered clean. The program was in the pipeline library by then, so this run does not reproduce the 4 s wait itself. The stall can only happen the first time a program is met, since the library has it for later runs.

Cost

At most one wait of a few seconds, the first time a compute program is met on a slow machine. On a fast machine pipelines are made within the budget anyway, so nothing changes.

Tests

  • cargo check -p victory-gpu on this base.
  • In game on our tree (fork main plus PRs), release build, two 13-minute runs.

🤖 Generated with Claude Code

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-26 13:49 UTC · [original](https://github.com/fxceless/victory-fork/pull/1312) `Exopus-0x65f7ad0:pr/compute-wait` → `main` · +26 −1 · 1 files · 1 commits · open ## What In `make::ready`, a pipeline without a graphics state (a compute pipeline) that is not made yet is now made on the calling thread, or waited for while a worker makes it (`Pending::make`, `OnceLock::get_or_init`). This happens whatever the frame's wait budget. Draws keep the budget (`wait`) and are still dropped while their pipeline is missing. `VICTORY_PIPELINE_COMPUTE_WAIT=0` restores the old behaviour, where dispatches also wait only within the budget. ## Why A dropped draw is drawn again in the next frame. A dropped dispatch may not be: the title runs some compute passes once, when the scene changes, and the rest of the scene reads what they leave. Seen in the prison corridor (RTX 5060 Ti 8 GB, 16 GB RAM, Series S): - A compute program met for the first time took 4.4 s to make, because memory was saturated. The log has its first bind, then translation 0.3 s later, then "a dispatch without a host pipeline dropped" after the 500 ms budget, then the host pipeline 4 s after that. - From that frame on, the windows of the dormitory Lucia had just looked through stayed blended over the whole picture. The guard looked transparent with a fence pattern on him. It lasted for more than 80 s while the camera moved, so it was not temporal AA. - That was the only dropped dispatch in about 15 runs that day. The same route with this change: no dropped dispatch, and the corridor and the scene after it rendered clean. The program was in the pipeline library by then, so this run does not reproduce the 4 s wait itself. The stall can only happen the first time a program is met, since the library has it for later runs. ## Cost At most one wait of a few seconds, the first time a compute program is met on a slow machine. On a fast machine pipelines are made within the budget anyway, so nothing changes. ## Tests - `cargo check -p victory-gpu` on this base. - In game on our tree (fork main plus PRs), release build, two 13-minute runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A dropped draw is drawn again in the next frame; a dropped dispatch may
not be. In the prison corridor a compute program met for the first time
took 4.4 s to make on a 16 GB machine; its one dispatch was dropped after
the half second of budget, and the room's windows from before stayed
blended over the whole picture for minutes (run 195).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:54:13 +00:00
Author
Owner

@⁠grosterr on GitHub · 2026-11-26 17:06 UTC · original

A data point that looks like the same thing, from an RTX 3060 12 GB (32 GB RAM, Series X profile, prison prologue, same save). We have not run this PR yet.

After a merge that changed the translator, the first run with a warm shader cache rebuilds ~1,800 pipelines in its first minutes. In both such runs we made today (two different builds), the cell came up without its lamps' light, and skin stayed dark grey for the whole session: 12-14 minutes, long after the log said 0 being made. The next run of the same binary, with the pipeline library full, had the lamps and normal skin from the first frame. Four warm runs since then have looked the same way, all of them right.

So it does not heal when the pipelines are made later. That fits a compute pass the title runs once at the scene's start, dropped because its pipeline was not ready, which is what this PR waits for. We will try VICTORY_PIPELINE_COMPUTE_WAIT unset against =0 on the next cold start and report back.

**@⁠grosterr** on GitHub · 2026-11-26 17:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7198512792) A data point that looks like the same thing, from an RTX 3060 12 GB (32 GB RAM, Series X profile, prison prologue, same save). We have not run this PR yet. After a merge that changed the translator, the first run with a warm shader cache rebuilds ~1,800 pipelines in its first minutes. In both such runs we made today (two different builds), the cell came up **without its lamps' light, and skin stayed dark grey for the whole session**: 12-14 minutes, long after the log said `0 being made`. The next run of the same binary, with the pipeline library full, had the lamps and normal skin from the first frame. Four warm runs since then have looked the same way, all of them right. So it does not heal when the pipelines are made later. That fits a compute pass the title runs once at the scene's start, dropped because its pipeline was not ready, which is what this PR waits for. We will try `VICTORY_PIPELINE_COMPUTE_WAIT` unset against `=0` on the next cold start and report back.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-26 18:31 UTC · original

A driver-side timing result that may matter for the unconditional compute wait. On Bazzite 44, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-proton 3.2.0, a local trace on main 52ac4ec plus the one-frame wait policy from #1234 recorded 2,211 pipeline build starts and 2,207 completions.

All four remaining jobs were compute pipelines. Shader translation and root-signature creation completed for each. The library lookup returned and each then entered the native CreateComputePipelineState call. They were still there 97–98 seconds later when I ended the startup test. The bounded-wait version rendered the opening scene and accepted camera input in a separate replay. Matched replay results.

A synchronous wait on one of these jobs could hold the recording thread for the same duration. This is a trace of the existing bounded-wait build.

Assisted by Codex (GPT-6.2-Sol High).

**@⁠Filip722** on GitHub · 2026-11-26 18:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7200551841) A driver-side timing result that may matter for the unconditional compute wait. On Bazzite 44, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-proton 3.2.0, a local trace on main 52ac4ec plus the one-frame wait policy from #1234 recorded 2,211 pipeline build starts and 2,207 completions. All four remaining jobs were compute pipelines. Shader translation and root-signature creation completed for each. The library lookup returned and each then entered the native CreateComputePipelineState call. They were still there 97–98 seconds later when I ended the startup test. The bounded-wait version rendered the opening scene and accepted camera input in a separate replay. [Matched replay results](https://git.gtahub.st/github/fxceless--victory-fork/pulls/1234). A synchronous wait on one of these jobs could hold the recording thread for the same duration. This is a trace of the existing bounded-wait build. Assisted by Codex (GPT-6.2-Sol High).
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/1312/head:github-bot/gh-1312'
git switch 'github-bot/gh-1312'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1312'
git switch 'github-bot/gh-1312'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1312'
git switch 'github-bot/gh-1312'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1312'
git switch 'main'
git merge --squash 'github-bot/gh-1312'
git switch 'main'
git merge --ff-only 'github-bot/gh-1312'
git switch 'main'
git merge 'github-bot/gh-1312'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.