Queue: held waits nothing meets go unmet after 1.5 s without a present #901

Closed
github-bot wants to merge 2 commits from github-bot/gh-901 into main AGit
Owner

@⁠Machad3x on GitHub · 2026-11-28 08:48 UTC · original
pr/held-wait → main · +306 −5 · 4 files · 2 commits · closed without merging

Fixes #846.

Sometimes the title stops presenting while a value wait is held, and nothing ever meets that wait. The title's watchdog then writes to 0 at +0x23cf683 (the "GPU Loc Sig" fatal from #628). The held wait passes only once a present is queued, the fence signal sits behind it, and the title thread never wakes.

  • 194fb78b: a held value wait that nothing meets is passed after VICTORY_HELD_WAIT_MS (default 1500) when no present is queued. It is passed at once when the title waits on a fence whose signal is held behind that wait.
  • 3a62c3f2: review fixes.
    • An urge now passes only the wait in front of its own signal, not any held wait.
    • The urged set no longer leaks.
    • The stall timer is no longer keyed on the submission number.

Testing:

  • cargo test -p victory-gpu: 458 passed, 0 failed (36 ignored), on top of 63b902fe.
  • In game: RTX 3080 Ti, Ryzen 7 5700X, 240 s runs.
    • Before: the crash hit 6 of 13 recent runs.
    • With this change: 2 runs, no crash. The release fired once in one run (a single transient drop) and never in the other.
    • Two runs do not prove the rate is lower. More runs are coming and I will post them here.

First landed in our fork: github.com/Machad3x/VIctory-nvidia-RTX@10fcc252 and github.com/Machad3x/VIctory-nvidia-RTX@d4c31913 (fork main 0fa96c91). Cherry-picked onto current main here.

🤖 Generated with Claude Code

**@⁠Machad3x** on GitHub · 2026-11-28 08:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901) `pr/held-wait` → `main` · +306 −5 · 4 files · 2 commits · closed without merging Fixes #846. Sometimes the title stops presenting while a value wait is held, and nothing ever meets that wait. The title's watchdog then writes to 0 at `+0x23cf683` (the "GPU Loc Sig" fatal from #628). The held wait passes only once a present is queued, the fence signal sits behind it, and the title thread never wakes. - `194fb78b`: a held value wait that nothing meets is passed after `VICTORY_HELD_WAIT_MS` (default 1500) when no present is queued. It is passed at once when the title waits on a fence whose signal is held behind that wait. - `3a62c3f2`: review fixes. - An urge now passes only the wait in front of its own signal, not any held wait. - The urged set no longer leaks. - The stall timer is no longer keyed on the submission number. Testing: - `cargo test -p victory-gpu`: 458 passed, 0 failed (36 ignored), on top of `63b902fe`. - In game: RTX 3080 Ti, Ryzen 7 5700X, 240 s runs. - Before: the crash hit 6 of 13 recent runs. - With this change: 2 runs, no crash. The release fired once in one run (a single transient drop) and never in the other. - Two runs do not prove the rate is lower. More runs are coming and I will post them here. First landed in our fork: https://github.com/Machad3x/VIctory-nvidia-RTX/commit/10fcc252 and https://github.com/Machad3x/VIctory-nvidia-RTX/commit/d4c31913 (fork main 0fa96c91). Cherry-picked onto current main here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The line held an unmet memory-value wait until a present came, and the
fence signals behind it with it. A title thread that waits for such a
fence never presents, so nothing moved until the title's watchdog ended
the run (30-66 s into a stall during loading).

With nothing else free to run and no present in the line, the oldest
value wait now goes unmet after VICTORY_HELD_WAIT_MS (1500 by default;
0: until a present, as before), and at once when the title asks for an
event (or blocks) on a fence whose signal is in the line behind it. What
the wait held still runs, in order; a rate-limited WARN names the
address, reference, current value and how long it was held.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 10fcc252248d8446a4a64228e8f0c962fa8bd6ff)
Review fixes for the held-wait valve:
- An urge (the title waits on a fence whose signal is in the line) now
  passes only a head whose own queue holds that signal; other queues'
  waits keep the timed valve. Before, a briefly unmet wait on another
  queue went at once, ahead of its data.
- Urges are not kept without a valve, are kept once, and are trimmed in
  `urge` itself when their fence was reached or their signal left.
- The stuck timer is keyed on queue and number and cleared when an entry
  of that queue is taken out, so a second wait of one submission (whose
  parts share a number) gets its own time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit d4c31913c3cf90e31ce5d74c9bc867e9e82617f1)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:29:50 +00:00
Author
Owner

@⁠Machad3x on GitHub · 2026-11-28 08:59 UTC · original

Update: the crash happened again on a build with this change (our fork main 0fa96c91, which has these two commits), in a run with VICTORY_PLACED_READS=1 VICTORY_PLACED_ORDER=1 also set. Same write to 0 at +0x23cf683, with +0x2215c35 as the caller.

What the log shows:

  • the last frame line is 32 s before the crash;
  • for those 32 s there are no frame or submission lines at all, only the 10 s memory book lines;
  • the held-wait release never fired.

So this stall is not a held value wait. Something else stops the frames, possibly on our side. I'm looking into it and will post what I find. This PR still fixes the held-wait case, but on its own it does not close #846.

**@⁠Machad3x** on GitHub · 2026-11-28 08:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7236941684) Update: the crash happened again on a build with this change (our fork main `0fa96c91`, which has these two commits), in a run with `VICTORY_PLACED_READS=1 VICTORY_PLACED_ORDER=1` also set. Same write to 0 at `+0x23cf683`, with `+0x2215c35` as the caller. What the log shows: - the last frame line is 32 s before the crash; - for those 32 s there are no frame or submission lines at all, only the 10 s memory book lines; - the held-wait release never fired. So this stall is not a held value wait. Something else stops the frames, possibly on our side. I'm looking into it and will post what I find. This PR still fixes the held-wait case, but on its own it does not close #846.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 09:34 UTC · original · approved these changes

Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (294 files ok).
  • Tests (RTX 5090): cargo test -p victory-gpu --lib queue:: passed (15 passed; 0 failed, including a_wait_nothing_meets_goes_unmet_after_a_while, each_wait_gets_its_own_time, a_title_waiting_for_a_held_signal_lets_the_wait_go, a_present_goes_behind_everything_before_it_met_or_not, and an_urge_passes_only_the_wait_in_front_of_its_signal) with 0 compiler warnings.

Great deadlock-recovery guard for unmet held queue waits with thorough unit coverage. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 09:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#pullrequestreview-6096998839) · **approved these changes** Tested locally merged onto `main` (`63b902f`). - **Merge & Policy**: Clean merge; `cargo xtask policy` passed (`294 files ok`). - **Tests (RTX 5090)**: `cargo test -p victory-gpu --lib queue::` passed (`15 passed; 0 failed`, including `a_wait_nothing_meets_goes_unmet_after_a_while`, `each_wait_gets_its_own_time`, `a_title_waiting_for_a_held_signal_lets_the_wait_go`, `a_present_goes_behind_everything_before_it_met_or_not`, and `an_urge_passes_only_the_wait_in_front_of_its_signal`) with 0 compiler warnings. Great deadlock-recovery guard for unmet held queue waits with thorough unit coverage. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-28 14:51 UTC · original

Tested on a machine that reproduces the #846 stall often: RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11 26300. 63b902f + this PR, release, with README launcher defaults (VICTORY_RELAY=2, THIN=1, so behind::on() is true and the valve is live), Series X, native 1440p, DLSS Quality. My local build also has the title's watchdog fault patched out, so a stall stays a stall instead of becoming the +0x23cf683 crash, which makes it easy to see whether anything ever unsticks it.

4 starts in a row, 120 s in the world each:

start stalled? time from the last frame line to the end of the run held work runs without its unmet wait a queue still stood at a wait at a present
1 no (19 fps at the end) 0 s 0 0
2 yes, during world load 193 s 0 0
3 no (16 fps) 2 s 0 0
4 yes, during world load 220 s 0 0

So on this machine the valve never fired, not even in the two runs that stalled for over 3 minutes, and the stall didn't clear. Without the PR I had 4 such stalls in ~14 starts today, so the rate looks unchanged (small numbers, though). It matches #990's "the fix never fires here".

What these stalls look like (details in #846): all 78 host threads are idle at 0 CPU and the driver threads are idle. One title thread keeps looping (~24 % of a core, half the samples in an ntdll wait), and no host log lines appear except the xmem timer. Since the valve never sees a held wait, I think this kind of stall isn't a value wait parked in queue/behind.rs. The title is waiting on something the host never completes, but not through a queue wait the valve can pass.

The change itself looks harmless: no new warnings, and the two good runs played normally. Happy to run a build with extra logging around title fence waits (title_waits / current() values) if you want to see what the title is spinning on.

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-28 14:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7240993467) Tested on a machine that reproduces the #846 stall often: **RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11 26300**. `63b902f` + this PR, release, with README launcher defaults (`VICTORY_RELAY=2`, `THIN=1`, so `behind::on()` is true and the valve is live), Series X, native 1440p, DLSS Quality. My local build also has the title's watchdog fault patched out, so a stall stays a stall instead of becoming the `+0x23cf683` crash, which makes it easy to see whether anything ever unsticks it. **4 starts in a row, 120 s in the world each:** | start | stalled? | time from the last frame line to the end of the run | `held work runs without its unmet wait` | `a queue still stood at a wait at a present` | |---|---|---|---|---| | 1 | no (19 fps at the end) | 0 s | 0 | 0 | | 2 | **yes**, during world load | **193 s** | **0** | 0 | | 3 | no (16 fps) | 2 s | 0 | 0 | | 4 | **yes**, during world load | **220 s** | **0** | 0 | So on this machine the valve **never fired**, not even in the two runs that stalled for over 3 minutes, and the stall didn't clear. Without the PR I had 4 such stalls in ~14 starts today, so the rate looks unchanged (small numbers, though). It matches #990's "the fix never fires here". What these stalls look like (details in #846): all 78 host threads are idle at 0 CPU and the driver threads are idle. One title thread keeps looping (~24 % of a core, half the samples in an `ntdll` wait), and no host log lines appear except the xmem timer. Since the valve never sees a held wait, I think this kind of stall isn't a value wait parked in `queue/behind.rs`. The title is waiting on something the host never completes, but not through a queue wait the valve can pass. The change itself looks harmless: no new warnings, and the two good runs played normally. Happy to run a build with extra logging around title fence waits (`title_waits` / `current()` values) if you want to see what the title is spinning on.
Author
Owner

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-28 16:02 UTC · original

Correction, please discount my test above. The stalls in my four runs were very likely caused by a local, unpublished commit in my build: a dispatch that waits for its compute pipeline with no time limit. With that turned off (VICTORY_PIPELINE_COMPUTE_WAIT=0), the same build stalled 0 times in 5 starts, against ~6 in 20 with it on (details on #846). So "the valve never fired" was simply because those stalls weren't held queue waits at all. That says nothing against this PR for the real +0x23cf683 case on upstream builds. Sorry for the false lead.

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-28 16:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7241934685) **Correction, please discount my test above.** The stalls in my four runs were very likely caused by a local, unpublished commit in my build: a dispatch that waits for its compute pipeline with no time limit. With that turned off (`VICTORY_PIPELINE_COMPUTE_WAIT=0`), the same build stalled 0 times in 5 starts, against ~6 in 20 with it on (details on #846). So "the valve never fired" was simply because those stalls weren't held queue waits at all. That says nothing against this PR for the real `+0x23cf683` case on upstream builds. Sorry for the false lead.
Author
Owner

@⁠Razen114514 on GitHub · 2026-11-28 19:46 UTC · original

A longer run on an 8 GB card: 3 h 9 m with no fault, against every previous run stopping at 56 min

Not a new diagnosis — just a longer soak than the two 240 s runs in the PR, on a card and profile that this thread has less of.

Setup. RTX 5060 8 GB, driver 32.0.16.2124, Windows 11 26300, 32 GB RAM, title 1.0.2.1, image b99f876b74d4a77f. Built from 63b902f with #850, #857, #851 and #901 merged. Series S, DLSS performance, frame generation 2x, VICTORY_INPLACE=2, VICTORY_AMBIENT_SHADE=0,0.6, VICTORY_AMBIENT_ONCE=1.

without #901 with #901
session 55 min 46 s 3 h 9 min 12 s
fault at +0x23cf683 4 times 0
unhandled exception 4 0
peak draws/frame — 13,556

The failing run was the same build minus #901, same machine, same profile; it reached the city at about 10,000 draws and stopped 55 minutes in, at the watchdog.

The world played normally throughout at 5–14 fps depending on draw count, including the dense-crowd and dense-foliage scenes that used to kill it.

Two caveats, because they matter.

  • One session is one session. I am reporting that the fault did not reproduce in 3 h 9 m, not that it is eliminated. The PR's own note ("Two runs do not p[rove]") applies to mine as well — mine is only longer. If I hit it later I will say so here.
  • held wait never logged anything, and reading the patch it may not log at all. So I cannot show the new path executed; only that the fault which used to end these runs did not happen. If there is a switch or a counter that shows the held wait being passed, I will run again with it and report what it says.

For anyone else on a small card: the same watchdog stop is documented at +0x2215c35 / +0x23cf683 in docs/crash-addresses.md, and on this hardware it is what a 55-minute session used to end with.

**@⁠Razen114514** on GitHub · 2026-11-28 19:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7244798578) ## A longer run on an 8 GB card: 3 h 9 m with no fault, against every previous run stopping at 56 min Not a new diagnosis — just a longer soak than the two 240 s runs in the PR, on a card and profile that this thread has less of. **Setup.** RTX 5060 8 GB, driver 32.0.16.2124, Windows 11 26300, 32 GB RAM, title `1.0.2.1`, image `b99f876b74d4a77f`. Built from `63b902f` with #850, #857, #851 and **#901** merged. Series S, DLSS performance, frame generation 2x, `VICTORY_INPLACE=2`, `VICTORY_AMBIENT_SHADE=0,0.6`, `VICTORY_AMBIENT_ONCE=1`. | | without #901 | with #901 | | --- | --- | --- | | session | 55 min 46 s | **3 h 9 min 12 s** | | fault at `+0x23cf683` | 4 times | **0** | | `unhandled exception` | 4 | **0** | | peak draws/frame | — | **13,556** | The failing run was the same build minus #901, same machine, same profile; it reached the city at about 10,000 draws and stopped 55 minutes in, at the watchdog. The world played normally throughout at 5–14 fps depending on draw count, including the dense-crowd and dense-foliage scenes that used to kill it. **Two caveats, because they matter.** - **One session is one session.** I am reporting that the fault did not reproduce in 3 h 9 m, not that it is eliminated. The PR's own note ("Two runs do not p[rove]") applies to mine as well — mine is only longer. If I hit it later I will say so here. - **`held wait` never logged anything**, and reading the patch it may not log at all. So I cannot show the new path executed; only that the fault which used to end these runs did not happen. If there is a switch or a counter that shows the held wait being passed, I will run again with it and report what it says. For anyone else on a small card: the same watchdog stop is documented at `+0x2215c35` / `+0x23cf683` in `docs/crash-addresses.md`, and on this hardware it is what a 55-minute session used to end with.
github-bot closed this pull request 2026-11-29 02:06:42 +00:00

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!901
No description provided.