GPU: a dispatch waits for its compute pipeline within a budget of its own, not without limit (fixes #628) #1767

Closed
nick0451 wants to merge 1 commit from upstream-pr/1767 into main
nick0451 commented 2026-11-29 00:00:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T00:00:19Z.


Fixes #628 (the first-start crash at +0x23cf683), which comes with #243.

What was wrong

#243 made a dispatch build its compute pipeline on the asking thread (p.make() in pipeline::make::ready), one pipeline after another and with no limit. On a fresh build's first start most compute pipelines are new. The title then waits in one frame for many of them in turn, past its 30 s watchdog (screen_budget's comment names it), while it loads. It stops with a null write at victory-image+0x23cf683.

Bisected in #628 (git bisect --first-parent 32ecacf..923e38c): the first bad commit is the merge of #243 (17612c3). Confirmed with #243's own switch on current main: of two fresh first starts of the same code, the one with VICTORY_PIPELINE_COMPUTE_WAIT=0 reached the world, and the default one crashed.

The change (crates/victory-gpu/src/pipeline/make.rs)

A dispatch now waits the way a draw does, in wait, with a budget of its own: VICTORY_COMPUTE_WAIT_MS, 10 s a frame. That is the same as the screen passes' budget, and below the watchdog. The pipeline is queued with start(p, REQUESTED) as before, so the workers make the new pipelines side by side while the dispatch waits.

  • #243's case still holds: a compute program first met at a scene change and taking a few seconds (4.4 s in the prison corridor) is waited for, not dropped. Only a frame that would wait more than 10 s for dispatches in total drops one, as before #243.
  • VICTORY_PIPELINE_COMPUTE_WAIT=0 still means the draws' half-second budget.
  • A dispatch waited for longer than half a second is logged (a dispatch was waited for), like the screen passes.
  • The test that expected #243's inline make (pending_pipeline_is_recorded_for_the_next_launch) now expects the budgeted wait. A pipeline still being made past the budget is recorded for the next launch, as a draw's is. Under cfg(test) the compute budget is 50 ms, so the test doesn't wait 10 s.

Tested

RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11, release builds, Series S, frame generation off. The same frozen save for every start. Each first start was a fresh copy of the executable with its own file hash.

first starts result
main (923e38c / d4b5d51) 7 7 crashed at +0x23cf683 while loading
this PR 4 4 reached the world; 9-12 dispatches waited each (the longest at the 10 s budget)

Normal play, after the warm-up starts:

  • Balcony save: no crash, the same picture and the same refused shaders as main.
  • A city save (open world, about 8,500 draws): no crash or ERROR line. 19 dispatches were waited for within the budget as new pipelines streamed in. fps 18.4 / 20.0 against main's 20.9, inside that scene's run-to-run variation (traffic: one main run was 16.9).
  • cargo test -p victory-gpu --lib: 550 passed. cargo clippy --workspace --all-targets -- -D warnings: only the two existing findings in victory-shader/src/emit/lower.rs that main has too.

Not tested: the prison corridor itself (#243's original scene), as I have no save there.

Found, bisected and tested with an AI assistant (Claude Code); every number above is from this PC's runs.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5545840902 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T00:00:19Z. --- Fixes #628 (the first-start crash at `+0x23cf683`), which comes with #243. ## What was wrong #243 made a dispatch build its compute pipeline on the asking thread (`p.make()` in `pipeline::make::ready`), one pipeline after another and with no limit. On a fresh build's first start most compute pipelines are new. The title then waits in one frame for many of them in turn, past its 30 s watchdog (`screen_budget`'s comment names it), while it loads. It stops with a null write at `victory-image+0x23cf683`. Bisected in #628 (`git bisect --first-parent 32ecacf..923e38c`): the first bad commit is the merge of #243 (`17612c3`). Confirmed with #243's own switch on current main: of two fresh first starts of the same code, the one with `VICTORY_PIPELINE_COMPUTE_WAIT=0` reached the world, and the default one crashed. ## The change (`crates/victory-gpu/src/pipeline/make.rs`) A dispatch now waits the way a draw does, in `wait`, with a budget of its own: `VICTORY_COMPUTE_WAIT_MS`, 10 s a frame. That is the same as the screen passes' budget, and below the watchdog. The pipeline is queued with `start(p, REQUESTED)` as before, so the workers make the new pipelines side by side while the dispatch waits. - #243's case still holds: a compute program first met at a scene change and taking a few seconds (4.4 s in the prison corridor) is waited for, not dropped. Only a frame that would wait more than 10 s for dispatches in total drops one, as before #243. - `VICTORY_PIPELINE_COMPUTE_WAIT=0` still means the draws' half-second budget. - A dispatch waited for longer than half a second is logged (`a dispatch was waited for`), like the screen passes. - The test that expected #243's inline make (`pending_pipeline_is_recorded_for_the_next_launch`) now expects the budgeted wait. A pipeline still being made past the budget is recorded for the next launch, as a draw's is. Under `cfg(test)` the compute budget is 50 ms, so the test doesn't wait 10 s. ## Tested RTX 3090 24 GB (driver 610.88), i9-14900K, 32 GB, Windows 11, release builds, Series S, frame generation off. The same frozen save for every start. Each first start was a fresh copy of the executable with its own file hash. | | first starts | result | |---|---|---| | main (`923e38c` / `d4b5d51`) | 7 | **7 crashed** at `+0x23cf683` while loading | | this PR | 4 | **4 reached the world**; 9-12 dispatches waited each (the longest at the 10 s budget) | Normal play, after the warm-up starts: - **Balcony save:** no crash, the same picture and the same refused shaders as main. - **A city save (open world, about 8,500 draws):** no crash or `ERROR` line. 19 dispatches were waited for within the budget as new pipelines streamed in. fps 18.4 / 20.0 against main's 20.9, inside that scene's run-to-run variation (traffic: one main run was 16.9). - `cargo test -p victory-gpu --lib`: 550 passed. `cargo clippy --workspace --all-targets -- -D warnings`: only the two existing findings in `victory-shader/src/emit/lower.rs` that main has too. Not tested: the prison corridor itself (#243's original scene), as I have no save there. Found, bisected and tested with an AI assistant (Claude Code); every number above is from this PC's runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nick0451 commented 2026-11-29 00:10:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T00:10:19Z.


A note for review: #315 (Lyrnc, opened before #243 was merged) fixes the same crash the same way, with armin's cap from fxceless/victory-fork#1450. I missed it when I looked for competing fixes before opening this. Tested it the same way as this PR, so the two can be weighed:

fresh first starts result
main (923e38c / d4b5d51) 7 7 crashed at +0x23cf683
this PR 4 4 reached the world
#315 head (74113b0) 3 3 reached the world

(RTX 3090, the same frozen save and settings, a new executable name and file hash for every start.)

How the two differ:

  • #315: 8 s a frame for dispatch waits, summed over threads. Past that, the frame's draw budget applies. The first 600 frames wait without a limit. Here the crash came at frame 9383, so that 600-frame window doesn't reach it. It conflicts with main now, since #243 has been merged.
  • This PR: 10 s a frame through the same wait path and accounting as the screen passes, and no early-frame exception. It merges cleanly on main. One frame's worst case is 10 s for screen passes, 10 s for dispatches and 0.5 s for draws, which is still below the 30 s watchdog.

Either one fixes #628 here. I'm happy for whichever fits better to land and the other to close. If #315 is preferred, its 600-frame exception is the one part I couldn't test, as it never came into play on this save.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247925253 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767#issuecomment-7247925253). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T00:10:19Z. --- A note for review: #315 (Lyrnc, opened before #243 was merged) fixes the same crash the same way, with armin's cap from fxceless/victory-fork#1450. I missed it when I looked for competing fixes before opening this. Tested it the same way as this PR, so the two can be weighed: | | fresh first starts | result | |---|---|---| | main (`923e38c` / `d4b5d51`) | 7 | 7 crashed at `+0x23cf683` | | this PR | 4 | 4 reached the world | | #315 head (`74113b0`) | 3 | **3 reached the world** | (RTX 3090, the same frozen save and settings, a new executable name and file hash for every start.) How the two differ: - **#315:** 8 s a frame for dispatch waits, summed over threads. Past that, the frame's draw budget applies. The first 600 frames wait without a limit. Here the crash came at frame 9383, so that 600-frame window doesn't reach it. It conflicts with main now, since #243 has been merged. - **This PR:** 10 s a frame through the same `wait` path and accounting as the screen passes, and no early-frame exception. It merges cleanly on main. One frame's worst case is 10 s for screen passes, 10 s for dispatches and 0.5 s for draws, which is still below the 30 s watchdog. Either one fixes #628 here. I'm happy for whichever fits better to land and the other to close. If #315 is preferred, its 600-frame exception is the one part I couldn't test, as it never came into play on this save. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nick0451 commented 2026-11-29 00:29:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T00:29:04Z.


Closing: 88244e8 on main ("a frame waits at most 3 s in all for its compute pipelines") fixes #628 the same way, so this one isn't needed. Thanks!

One more data point for #628 from tonight's runs on the pre-fix base (d4b5d51): the +0x23cf683 crash also hit a second start of an already-warmed build in 4 of 8 starts of one benchmark, 3 of them after the build's first start (the very first start crashed too). So it is not only a first-start crash: it can come on any start while pipelines are still being made. I'll post first-start results for the new main on #628 once I've run them.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7248143734 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767#issuecomment-7248143734). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T00:29:04Z. --- Closing: `88244e8` on main ("a frame waits at most 3 s in all for its compute pipelines") fixes #628 the same way, so this one isn't needed. Thanks! One more data point for #628 from tonight's runs on the pre-fix base (`d4b5d51`): the `+0x23cf683` crash also hit a **second** start of an already-warmed build in **4 of 8** starts of one benchmark, 3 of them after the build's first start (the very first start crashed too). So it is not only a first-start crash: it can come on any start while pipelines are still being made. I'll post first-start results for the new main on #628 once I've run them. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!1767
No description provided.