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

Closed
Machad3x wants to merge 2 commits from upstream-pr/901 into main
Machad3x commented 2026-11-28 08:48:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T08:48:27Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538447931 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T08:48:27Z. --- 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)
Machad3x commented 2026-11-28 08:59:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T08:59:35Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7236941684 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7236941684). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T08:59:35Z. --- 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.
Dukestar69 commented 2026-11-28 09:34:32 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T09:34:32Z.

Review: APPROVED


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6096998839 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#pullrequestreview-6096998839). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T09:34:32Z. **Review:** APPROVED --- 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).
Exopus-0x65f7ad0 commented 2026-11-28 14:51:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T14:51:42Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240993467 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7240993467). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-28T14:51:42Z. --- 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 commented 2026-11-28 16:02:59 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T16:02:59Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7241934685 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7241934685). Originally posted by [Exopus-0x65f7ad0](https://github.com/Exopus-0x65f7ad0) on 2026-11-28T16:02:59Z. --- **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.
Razen114514 commented 2026-11-28 19:46:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Razen114514 on 2026-11-28T19:46:46Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7244798578 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/901#issuecomment-7244798578). Originally posted by [Razen114514](https://github.com/Razen114514) on 2026-11-28T19:46:46Z. --- ## 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.

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