Stall watch: when a frame takes longer than VICTORY_STALL_MS, log memory counters and every thread's stack #5011

Open
xteral67 wants to merge 1 commit from upstream-pr/5011 into main
xteral67 commented 2026-12-01 17:17:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by xteral67 on 2026-12-01T17:17:19Z.


What it changes

Long freezes (seconds) are hard to explain from the frame log alone. With VICTORY_STALL_MS=<ms> in a diagnostics build, a watcher thread notices when a frame takes longer than the threshold and writes:

  • process counters: working set, private bytes, page faults, free physical memory;
  • the stack of every thread of the process (victory-loader/src/stacks.rs).

All new code is behind #[cfg(feature = "diagnostics")]; release builds do not change. Off unless the variable is set.

How it was tested

  • RTX 3080 Ti 12 GB, 32 GB RAM, Series X profile, 1440p output, DLSS quality, FSR 3 frame generation 2x, diagnostics build.
  • Two play sessions with it on. It caught a 5.1 s freeze: every game thread waited on a pipeline compile inside the driver while free RAM was 557 MB. Without the stacks this looked like a submit-thread stall.
  • The cost while frames stay under the threshold was not measured separately.
  • Not run: cargo test, other cards, Series S profile, a release build with clippy.
  • Draft until CI has built this branch; the same change was built and played in a local tree.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2334, #1557

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5590744262 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/5011). Originally posted by [xteral67](https://github.com/xteral67) on 2026-12-01T17:17:19Z. --- ## What it changes Long freezes (seconds) are hard to explain from the frame log alone. With `VICTORY_STALL_MS=<ms>` in a diagnostics build, a watcher thread notices when a frame takes longer than the threshold and writes: - process counters: working set, private bytes, page faults, free physical memory; - the stack of every thread of the process (`victory-loader/src/stacks.rs`). All new code is behind `#[cfg(feature = "diagnostics")]`; release builds do not change. Off unless the variable is set. ## How it was tested - RTX 3080 Ti 12 GB, 32 GB RAM, Series X profile, 1440p output, DLSS quality, FSR 3 frame generation 2x, diagnostics build. - Two play sessions with it on. It caught a 5.1 s freeze: every game thread waited on a pipeline compile inside the driver while free RAM was 557 MB. Without the stacks this looked like a submit-thread stall. - The cost while frames stay under the threshold was not measured separately. - Not run: `cargo test`, other cards, Series S profile, a release build with clippy. - Draft until CI has built this branch; the same change was built and played in a local tree. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2334, #1557 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/5011:upstream-pr/5011'
git switch 'upstream-pr/5011'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/5011'
git switch 'upstream-pr/5011'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/5011'
git switch 'upstream-pr/5011'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/5011'
git switch 'main'
git merge --squash 'upstream-pr/5011'
git switch 'main'
git merge --ff-only 'upstream-pr/5011'
git switch 'main'
git merge 'upstream-pr/5011'
git push origin 'main'
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!5011
No description provided.