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

Open
github-bot wants to merge 1 commit from github-bot/gh-5011 into main AGit
Owner

@⁠xteral67 on GitHub · 2026-12-01 17:17 UTC · original
xteral67:stall-watch → main · +266 −1 · 8 files · 1 commits · draft

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

**@⁠xteral67** on GitHub · 2026-12-01 17:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/5011) `xteral67:stall-watch` → `main` · +266 −1 · 8 files · 1 commits · draft ## 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)
When a frame takes longer than the threshold, log process memory counters
and the stack of every thread, to see what the emulator waits on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013wogQQ6zZK1Wujq7MJhtAS
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 17:19:16 +00:00
This pull request has changes conflicting with the target branch.
  • apps/victory/src/run.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/5012/head:github-bot/gh-5011'
git switch 'github-bot/gh-5011'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-5011'
git switch 'github-bot/gh-5011'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-5011'
git switch 'github-bot/gh-5011'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-5011'
git switch 'main'
git merge --squash 'github-bot/gh-5011'
git switch 'main'
git merge --ff-only 'github-bot/gh-5011'
git switch 'main'
git merge 'github-bot/gh-5011'
git push origin 'main'
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!5012
No description provided.