Skip to content

fix(gpu): cap how long a frame waits for compute pipelines (hang watchdog at 30 s) - #315

Open
Lyrnc wants to merge 2 commits into
trustno1-coder:mainfrom
Lyrnc:fix/compute-wait-cap
Open

Lyrnc wants to merge 2 commits into
trustno1-coder:mainfrom
Lyrnc:fix/compute-wait-cap

Conversation

@Lyrnc

@Lyrnc Lyrnc commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Builds on #243. This branch is #243's commit plus one more, so merging this lands both. If #243 lands first, this one is only the second commit.

Problem

With #243, a compute dispatch waits for its pipeline however long that takes. With an empty cache, the first cutscene met 457 compute programs in one frame, at about a second each. That frame then ran for more than 30 s. The title's own hang watchdog fires after 30 s and stores to address 0 (+0x23cf683), which crashes the title. This was reported on fxceless/victory-fork as #1420.

Fix

The fix is armin's commit from fxceless/victory-fork#1450 (still open there). The author is kept.

Conflict resolution here: #243 has no 600-frame rule, so the condition is now compute_waits() && (early || compute_room(frame)). With VICTORY_PIPELINE_COMPUTE_WAIT=0, a dispatch waits within the budget exactly as before. Only pipeline/make.rs changes.

Verification

On Windows 11, RTX 5080:

Not run in game on this branch.

AI use: Claude Code (Claude Opus 5.5) ported the commit, resolved the conflict with #243, ran the checks above and drafted this description.

🤖 Generated with Claude Code

fxceless and others added 2 commits November 27, 2026 23:04
A draw whose pipeline is not ready within the frame's budget is dropped
and drawn again next frame. A dispatch may not be drawn again: the title
runs some compute passes once, when a scene changes, and what they leave
is read for as long as the scene lasts. 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 windows of the room
before stayed blended over the picture for minutes (run 195).

A compute pipeline now waits for its own making, whatever the budget; a
draw still waits within the budget. The pipeline library has it on the
next run. `VICTORY_PIPELINE_COMPUTE_WAIT=0` restores the old behaviour.

Ported from fxceless/victory-fork a42b627 (pull request #1312), GPL-3.0-or-later.
…ispatch

With VICTORY_PIPELINE_COMPUTE_WAIT on (the default) a compute dispatch
makes its pipeline on the spot, however long that takes. With an empty
cache the first cutscene met 457 compute programs in one frame at about a
second each: the frame did not end for over 30 s and the title's own
hang watchdog stored to address 0 (+0x23cf683, #1420).

A frame now waits for such pipelines up to VICTORY_PIPELINE_COMPUTE_WAIT_MS
(8,000 by default, summed over threads); after that its dispatches wait
within the frame's budget as with VICTORY_PIPELINE_COMPUTE_WAIT=0. The
first 600 frames (loading) still make theirs whatever it costs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants