Diagnostics for finding what paces a frame: causal profiling switches, a capture trigger, a multi-lane stress harness #3508

Closed
github-bot wants to merge 3 commits from github-bot/gh-3508 into main AGit
Owner

@⁠Aseoriy on GitHub · 2026-11-30 00:12 UTC · original
Aseoriy:pr/gta6-watchdog-and-diagnostics → main · +201 −1 · 5 files · 3 commits · closed without merging

Three independent commits on top of main 41adb551. Each builds alone (normal and diagnostics), and the tests they add pass.

1. Causal profiling switches (diagnostics builds only)

VICTORY_SLOW_SUBMIT (the submitting thread busy-waits 120 µs per submission) and VICTORY_SLOW_LISTS (each translating thread 80 µs per recording); VICTORY_SLOW_US overrides the amount. Used with VICTORY_AB, they tell whether a stage sets the frame's pace: if frames get slower by about as much as was added, it does.

What it showed while driving (RTX 5070, i7-14700F, Series X profile, 4-way in-run A/B): neither stage slowed frames by the ~2 ms added (−0.3 ms and −0.7 ms over 12 and 11 matched pairs). The card was 76–90 % busy by the card clock, with the title waiting ~11 ms a frame at present. So on this machine, driving frames are paced by the card, and cutting CPU work on either stage alone is neutral; that matched several CPU reductions measured neutral the same day.

2. Capture: a file named shot in the capture folder captures the next frame, as F9 does

For tools outside the process (unattended test runs with the display off). Checked every 15 frames; diagnostics builds only.

3. Stress harness for preparing on more than one thread (shadow::lane_tests)

No game needed, about 4 s. Rounds race two writer threads against two lanes' refreshes of random pieces of five nested and overlapping copies of write-watched memory, then stop the writers, refresh every copy whole and check every dword against title memory. A planted lost write (a thread clearing the kernel's write bits behind the journal) is caught, so the harness is known to see what it is for. VICTORY_LANE_ROUNDS=<n> for longer runs (2,000 rounds clean). Meant as a safety net for work that splits submission preparing across threads.

Tested

  • cargo check -p victory-gpu -p victory-hle, with and without diagnostics; cargo check -p victory --features diagnostics.
  • VICTORY_LANE_ROUNDS=40 cargo test -p victory-gpu --lib lane_tests: 3 passed (including the planted-lost-write check).
**@⁠Aseoriy** on GitHub · 2026-11-30 00:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3508) `Aseoriy:pr/gta6-watchdog-and-diagnostics` → `main` · +201 −1 · 5 files · 3 commits · closed without merging Three independent commits on top of main 41adb551. Each builds alone (normal and `diagnostics`), and the tests they add pass. ## 1. Causal profiling switches (diagnostics builds only) `VICTORY_SLOW_SUBMIT` (the submitting thread busy-waits 120 µs per submission) and `VICTORY_SLOW_LISTS` (each translating thread 80 µs per recording); `VICTORY_SLOW_US` overrides the amount. Used with `VICTORY_AB`, they tell whether a stage sets the frame's pace: if frames get slower by about as much as was added, it does. What it showed while driving (RTX 5070, i7-14700F, Series X profile, 4-way in-run A/B): neither stage slowed frames by the ~2 ms added (−0.3 ms and −0.7 ms over 12 and 11 matched pairs). The card was 76–90 % busy by the card clock, with the title waiting ~11 ms a frame at present. So on this machine, driving frames are paced by the card, and cutting CPU work on either stage alone is neutral; that matched several CPU reductions measured neutral the same day. ## 2. Capture: a file named `shot` in the capture folder captures the next frame, as F9 does For tools outside the process (unattended test runs with the display off). Checked every 15 frames; diagnostics builds only. ## 3. Stress harness for preparing on more than one thread (`shadow::lane_tests`) No game needed, about 4 s. Rounds race two writer threads against two lanes' refreshes of random pieces of five nested and overlapping copies of write-watched memory, then stop the writers, refresh every copy whole and check every dword against title memory. A planted lost write (a thread clearing the kernel's write bits behind the journal) is caught, so the harness is known to see what it is for. `VICTORY_LANE_ROUNDS=<n>` for longer runs (2,000 rounds clean). Meant as a safety net for work that splits submission preparing across threads. ## Tested - `cargo check -p victory-gpu -p victory-hle`, with and without `diagnostics`; `cargo check -p victory --features diagnostics`. - `VICTORY_LANE_ROUNDS=40 cargo test -p victory-gpu --lib lane_tests`: 3 passed (including the planted-lost-write check).
For drivers outside the process whose screen cannot be read (an
unattended test with the display off): checked every 15 frames,
diagnostics builds only.
A stage made slower on purpose (the submitting thread by 120 us a
submission, each translating thread by 80 us a recording; VICTORY_SLOW_US
overrides): if frames get slower by about as much, that stage sets the pace.
shadow::lane_tests (no game needed, ~4 s): rounds race two writers against
two lanes' refreshes of random pieces of five nested and overlapping
copies of write-watched memory, then stop the writers, refresh every copy
whole and check every dword against title memory. A planted lost write
(a thread clearing the kernel's write bits behind the journal) is caught.
VICTORY_LANE_ROUNDS=<n> for longer runs; 2,000 rounds clean on next.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 00:17:12 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:51 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3508#issuecomment-7321686090) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
github-bot closed this pull request 2026-12-01 18:58:26 +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!3508
No description provided.