Frame-times line: frames over 16.7, 20 and 25 ms, and pairs of frames in a row over 33.4 ms #3999

Open
kMagic142 wants to merge 1 commit from upstream-pr/3999 into main
kMagic142 commented 2026-11-30 14:07:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kMagic142 on 2026-11-30T14:07:24Z.


What it changes

frame_times_line (target victory_gpu::frame_times, once a second) logs the median, p95, p99 and longest time between presents, and how many frames took over 50 ms and over 100 ms. Near 60 fps those last two counts stay at 0, and the percentiles cover only one second's ~60 frames. So the line does not say how often a 60-a-second pace was missed.

It now also counts the following, from the same intervals and before they are sorted (dips):

  • the frames over 16.7, 20 and 25 ms;
  • the pairs of frames in a row that together took over 33.4 ms, two refreshes at 60 Hz. A short frame next to a long one cannot make up for such a pair. A pace that swings between short and long frames misses in every pair: 12 and 24 ms in turn averages 18, and 15 and 19 ms in turn misses even though no frame passes 20 ms. Each frame is in a pair with the one before it and with the one after it. A pair that crosses from one line to the next is not counted.

The new counts go at the end of the line. Here is one second of a run near 60 fps, in this PR's wording:

frame times: 64 frames, median 15.4 ms, p95 19.8, p99 20.8, longest 21.7; 0 over 50 ms, 0 over 100 ms; 21 over 16.7 ms, 3 over 20 ms, 0 over 25 ms, 16 pairs in a row over 33.4 ms

scripts/play-rig.ps1 and scripts/watch-rig.ps1 read only the start of this line (frame times: N frames, median X ms). scripts/bench.ps1 reads the diagnostics framelog line, not this one. None of them change. Only the log line changes; nothing on screen does.

How it was tested

  • GPU and profile: RTX 5090, Core Ultra 9 285K; Series X, 1440p, DLSS Quality, no frame generation.
  • Before: the line ends at N over 100 ms. In the steady cutscene near 60 fps, both the over-50 and the over-100 counts are 0 in most seconds.
  • After: we have had the same four counts on our own builds' line for a day of runs. Those builds are v2026.11.28.03 with other changes of ours, and the wording differs slightly from this PR's. The example above is one second of the opening's cutscenes there.
  • Not run on main: this branch itself was not run in the game. The unit test dips_tests covers an even pace, two swinging paces, a long frame between short ones, a lone frame and an empty second.
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: Yes. cargo xwin check -p victory --target x86_64-pc-windows-msvc passes on main (41adb551) with this branch applied, and dips_tests::the_misses_of_a_60_a_second_pace_are_counted passes (1 passed, 0 failed).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches (frame times, percentiles, 1% low, pacing). Related:
    • #3920 adds a rolling 1% low (the p99 of the last 100 presents) to the F3 panel and the FPS line, and leaves frame_times_line as it is. This PR only adds counts to the end of the log line. The two change nearby lines of host.rs but each applies to main on top of the other without conflict (checked with git apply).
    • #3851 (VICTORY_FRAME_PACE, which evens out long/short frame pairs) and #2201 (VICTORY_PACE) change the pace itself. #3851 moves the call to frame_times_line to another thread, with the same signature. Both apply on top of this branch. The pair count is one way to see what they do near 60 fps.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5566873978 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3999). Originally posted by [kMagic142](https://github.com/kMagic142) on 2026-11-30T14:07:24Z. --- ## What it changes `frame_times_line` (target `victory_gpu::frame_times`, once a second) logs the median, p95, p99 and longest time between presents, and how many frames took over 50 ms and over 100 ms. Near 60 fps those last two counts stay at 0, and the percentiles cover only one second's ~60 frames. So the line does not say how often a 60-a-second pace was missed. It now also counts the following, from the same intervals and before they are sorted (`dips`): - the frames over 16.7, 20 and 25 ms; - the pairs of frames in a row that together took over 33.4 ms, two refreshes at 60 Hz. A short frame next to a long one cannot make up for such a pair. A pace that swings between short and long frames misses in every pair: 12 and 24 ms in turn averages 18, and 15 and 19 ms in turn misses even though no frame passes 20 ms. Each frame is in a pair with the one before it and with the one after it. A pair that crosses from one line to the next is not counted. The new counts go at the end of the line. Here is one second of a run near 60 fps, in this PR's wording: ``` frame times: 64 frames, median 15.4 ms, p95 19.8, p99 20.8, longest 21.7; 0 over 50 ms, 0 over 100 ms; 21 over 16.7 ms, 3 over 20 ms, 0 over 25 ms, 16 pairs in a row over 33.4 ms ``` `scripts/play-rig.ps1` and `scripts/watch-rig.ps1` read only the start of this line (`frame times: N frames, median X ms`). `scripts/bench.ps1` reads the diagnostics `framelog` line, not this one. None of them change. Only the log line changes; nothing on screen does. ## How it was tested - GPU and profile: RTX 5090, Core Ultra 9 285K; Series X, 1440p, DLSS Quality, no frame generation. - Before: the line ends at `N over 100 ms`. In the steady cutscene near 60 fps, both the over-50 and the over-100 counts are 0 in most seconds. - After: we have had the same four counts on our own builds' line for a day of runs. Those builds are `v2026.11.28.03` with other changes of ours, and the wording differs slightly from this PR's. The example above is one second of the opening's cutscenes there. - Not run on main: this branch itself was not run in the game. The unit test `dips_tests` covers an even pace, two swinging paces, a long frame between short ones, a lone frame and an empty second. - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: Yes. `cargo xwin check -p victory --target x86_64-pc-windows-msvc` passes on main (41adb551) with this branch applied, and `dips_tests::the_misses_of_a_60_a_second_pace_are_counted` passes (1 passed, 0 failed). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches (frame times, percentiles, 1% low, pacing). Related: - #3920 adds a rolling 1% low (the p99 of the last 100 presents) to the F3 panel and the FPS line, and leaves `frame_times_line` as it is. This PR only adds counts to the end of the log line. The two change nearby lines of `host.rs` but each applies to main on top of the other without conflict (checked with `git apply`). - #3851 (`VICTORY_FRAME_PACE`, which evens out long/short frame pairs) and #2201 (`VICTORY_PACE`) change the pace itself. #3851 moves the call to `frame_times_line` to another thread, with the same signature. Both apply on top of this branch. The pair count is one way to see what they do near 60 fps.
dyshay commented 2026-11-30 14:53:43 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T14:53:43Z.


Merged for testing into our integration branch dyshay/VIctory-NVIDIA janus-prs. Builds and the targeted CPU tests pass; a run on an RTX 4090 (Series S, hardware RT) is queued and I'll post the result here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7282098769 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3999#issuecomment-7282098769). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T14:53:43Z. --- Merged for testing into our integration branch [dyshay/VIctory-NVIDIA `janus-prs`](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs). Builds and the targeted CPU tests pass; a run on an RTX 4090 (Series S, hardware RT) is queued and I'll post the result here.
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/3999:upstream-pr/3999'
git switch 'upstream-pr/3999'

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