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

Merged
Exopus-0x65f7ad0 merged 1 commit from upstream-pr/1312 into main 2026-11-26 23:06:47 +00:00
Exopus-0x65f7ad0 commented 2026-11-26 13:49:35 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Exopus-0x65f7ad0 on 2026-11-26T13:49:35Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:5511225772 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1312). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-26T13:49:35Z. --- ## 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)
grosterr commented 2026-11-26 17:06:34 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by grosterr on 2026-11-26T17:06:34Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7198512792 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7198512792). Originally posted by [grosterr](https://github.com/grosterr) on 2026-11-26T17:06:34Z. --- 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.
Filip722 commented 2026-11-26 18:31:02 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-26T18:31:02Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7200551841 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7200551841). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-26T18:31:02Z. --- 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://github.com/fxceless/victory-fork/pull/1234#issuecomment-7199416985). 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).
grosterr commented 2026-11-26 21:45:11 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by grosterr on 2026-11-26T21:45:11Z.


Follow-up to my earlier comment, now with this PR merged: RTX 3060 12 GB, Windows 11, Series X profile, the same prison save. Tree: fork main e4245f3 plus #1312, #1336 and a few others. The pipeline library was cold after a translator change, except for what a 3-minute run cut short by a power cut had already built.

  • The cell came up with its lamps lit and normal skin from the first world frames. Before this PR, both runs after a translator change had dark lamps and grey skin for the whole session. The cutscene and the office scene after it looked right too.
  • The wait did not hang here. World frames began 2 minutes after launch. For the next 5 minutes, while textures and pipelines arrived, the interval lines were 0.6-1.3 s a frame; then the frame settled to 160-230 ms. No interval line said pipelines were still being built.
  • No device removal; the run was ended from the window after 22 minutes.

So on Windows/NVIDIA the unconditional compute wait cost nothing visible and fixed what we reported. Filip722's 97 s driver stall under Proton is the case it still needs to guard against (VICTORY_PIPELINE_COMPUTE_WAIT=0).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7204025687 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7204025687). Originally posted by [grosterr](https://github.com/grosterr) on 2026-11-26T21:45:11Z. --- Follow-up to my earlier comment, now with this PR merged: RTX 3060 12 GB, Windows 11, Series X profile, the same prison save. Tree: fork main `e4245f3` plus #1312, #1336 and a few others. The pipeline library was cold after a translator change, except for what a 3-minute run cut short by a power cut had already built. - The cell came up with its lamps lit and normal skin from the first world frames. Before this PR, both runs after a translator change had dark lamps and grey skin for the whole session. The cutscene and the office scene after it looked right too. - The wait did not hang here. World frames began 2 minutes after launch. For the next 5 minutes, while textures and pipelines arrived, the interval lines were 0.6-1.3 s a frame; then the frame settled to 160-230 ms. No interval line said pipelines were still being built. - No device removal; the run was ended from the window after 22 minutes. So on Windows/NVIDIA the unconditional compute wait cost nothing visible and fixed what we reported. Filip722's 97 s driver stall under Proton is the case it still needs to guard against (`VICTORY_PIPELINE_COMPUTE_WAIT=0`).
Exopus-0x65f7ad0 commented 2026-11-28 16:05:23 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T16:05:23Z.


A warning about this change, for anyone who ports it again. It's no longer in main since the rebase onto VIctory-NVIDIA (5dbf5ce), so only builds from between that merge and the rebase have it.

The unbounded wait can deadlock world loads. ready() calls p.make() on the submitting thread, which blocks on the pipeline's OnceLock while a worker is building it. If that worker is itself held up behind the submitting thread, neither moves again: all host threads idle, no frame lines, and the title's watchdog fires on an upstream build.

Measured today on an RTX 5060 Ti 8 GB / 16 GB RAM with VIctory-NVIDIA 63b902f plus this commit: 6 stalls in ~20 starts with it on, 0 in 5 with VICTORY_PIPELINE_COMPUTE_WAIT=0. Details on trustno1-coder/VIctory-NVIDIA#846. My mistake. If the dropped-dispatch problem from run 195 needs solving, a bounded wait (a few seconds, then drop as before) would be the safe form.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7241965488 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1312#issuecomment-7241965488). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-28T16:05:23Z. --- A warning about this change, for anyone who ports it again. It's no longer in `main` since the rebase onto VIctory-NVIDIA (`5dbf5ce`), so only builds from between that merge and the rebase have it. The unbounded wait can **deadlock world loads**. `ready()` calls `p.make()` on the submitting thread, which blocks on the pipeline's `OnceLock` while a worker is building it. If that worker is itself held up behind the submitting thread, neither moves again: all host threads idle, no frame lines, and the title's watchdog fires on an upstream build. Measured today on an RTX 5060 Ti 8 GB / 16 GB RAM with VIctory-NVIDIA `63b902f` plus this commit: **6 stalls in ~20 starts** with it on, **0 in 5** with `VICTORY_PIPELINE_COMPUTE_WAIT=0`. Details on trustno1-coder/VIctory-NVIDIA#846. My mistake. If the dropped-dispatch problem from run 195 needs solving, a bounded wait (a few seconds, then drop as before) would be the safe form.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!1309
No description provided.