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

Closed
github-bot wants to merge 1 commit from github-bot/gh-1767 into main AGit
Owner

@⁠nick0451 on GitHub · 2026-11-29 00:00 UTC · original
nick0451:fix/compute-wait-bounded → main · +54 −20 · 1 files · 1 commits · closed without merging

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

**@⁠nick0451** on GitHub · 2026-11-29 00:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767) `nick0451:fix/compute-wait-bounded` → `main` · +54 −20 · 1 files · 1 commits · closed without merging 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)
#243 made a dispatch make its compute pipeline on the asking thread, one
after another and with no limit. A fresh build's first start, with most
compute pipelines new, then held a frame past the title's 30 s watchdog
while it loaded and stopped with a null write at +0x23cf683: every first
start on 923e38c, bisected to the merge of #243 (#628).

A dispatch now waits as a draw does, in `wait`, with a budget of its own:
VICTORY_COMPUTE_WAIT_MS, 10 s a frame (the screen passes' 10 s beside it,
below the watchdog), while the workers make the pipelines side by side.
#243's case, a compute program first met at a scene change taking a few
seconds, is still waited for, not dropped. VICTORY_PIPELINE_COMPUTE_WAIT=0
still means the draws' half second. A dispatch waited for more than half a
second is logged.

RTX 3090, i9-14900K, Series S, frozen save, fresh build each time:
- main d4b5d51: first start crashed at +0x23cf683 (7 of 7 on 923e38c-based builds)
- this: 3 of 3 first starts reached the world, 9-12 dispatches waited
  (the longest 10 s each); one more start sat at the menu (no input)
- victory-gpu tests: 550 passed (the test that expected #243's inline make
  now expects the budgeted wait)

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

@⁠nick0451 on GitHub · 2026-11-29 00:10 UTC · original

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

**@⁠nick0451** on GitHub · 2026-11-29 00:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767#issuecomment-7247925253) 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)
github-bot closed this pull request 2026-11-29 00:34:01 +00:00
Author
Owner

@⁠nick0451 on GitHub · 2026-11-29 00:29 UTC · original

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

**@⁠nick0451** on GitHub · 2026-11-29 00:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1767#issuecomment-7248143734) 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

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