Record present intervals so hitching can be measured #1085

Open
superboynick wants to merge 5 commits from upstream-pr/1087 into main
superboynick commented 2026-11-25 18:58:16 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by superboynick on 2026-11-25T18:58:16Z.


Frame rate hides hitching, and an interval alone does not say why. This change does both halves.

Interval recording. VICTORY_PRESENT_TIMES=<path> writes one row per present with the interval, running p50/p95/p99 and the worst interval so far, plus a total row on exit. On the prologue of the retail title, 1500 presents over 72.8 s:

p50 33.4 ms p95 105.4 ms p99 370.8 ms worst 3527 ms stalls over 100 ms: 77

Sitting in the menus the same build gives p99 34.2 ms, so the long stalls belong to content streaming, not to the steady state.

Attribution. VICTORY_STALL_LOG=<ms> prints, for any present slower than the threshold, the counters accumulated during that frame: pipelines created, shaders translated, texture uploads. Real output:

Present stall interval_ms=1471.9 pipelines_created=0 shaders_translated=0 texture_uploads=1159 Present stall interval_ms=399.2 pipelines_created=0 shaders_translated=34 texture_uploads=19

Across a 120 s run, texture uploads appear in 81 of 91 stalls; shader translation in a handful. That is a correlation and I am not claiming a cause - but it points at the upload path rather than at compilation, which is where I would look next.

Counters that cannot be read cheaply are reported as na instead of guessed. Neither variable is read unless set, and with neither set the present path is unchanged.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6611554975 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1087). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-25T18:58:16Z. --- Frame rate hides hitching, and an interval alone does not say why. This change does both halves. **Interval recording.** `VICTORY_PRESENT_TIMES=<path>` writes one row per present with the interval, running p50/p95/p99 and the worst interval so far, plus a total row on exit. On the prologue of the retail title, 1500 presents over 72.8 s: ` p50 33.4 ms p95 105.4 ms p99 370.8 ms worst 3527 ms stalls over 100 ms: 77 ` Sitting in the menus the same build gives p99 34.2 ms, so the long stalls belong to content streaming, not to the steady state. **Attribution.** `VICTORY_STALL_LOG=<ms>` prints, for any present slower than the threshold, the counters accumulated during that frame: pipelines created, shaders translated, texture uploads. Real output: ` Present stall interval_ms=1471.9 pipelines_created=0 shaders_translated=0 texture_uploads=1159 Present stall interval_ms=399.2 pipelines_created=0 shaders_translated=34 texture_uploads=19 ` Across a 120 s run, texture uploads appear in 81 of 91 stalls; shader translation in a handful. That is a correlation and I am not claiming a cause - but it points at the upload path rather than at compilation, which is where I would look next. Counters that cannot be read cheaply are reported as `na` instead of guessed. Neither variable is read unless set, and with neither set the present path is unchanged.
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/1087:upstream-pr/1087'
git switch 'upstream-pr/1087'

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