VICTORY_PACE brings the presenting thread that keeps it (did nothing without VICTORY_PRESENT_ASIDE) #4700

Open
mstrmoos wants to merge 3 commits from upstream-pr/4700 into main
mstrmoos commented 2026-12-01 02:23:32 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-12-01T02:23:32Z.


What it changes

VICTORY_PACE (from #2201) is kept by the presenting thread of present_aside. That thread runs only with VICTORY_PRESENT_ASIDE=1 or VICTORY_PRESENT_QUEUE=1. Asked for alone, the pace did nothing and said nothing: no line of the pace in the log, and frame times the same as without it. I hit this myself: a pass at VICTORY_PACE=auto and =16 that I first took to show "the pace doesn't help here" had never paced a frame.

With this change, asking for a pace brings the presenting thread with it, and the log says so once: the present is put aside to its own thread, which keeps the pace (VICTORY_PACE). Nothing changes when VICTORY_PACE is unset or 0, or when VICTORY_PRESENT_ASIDE/VICTORY_PRESENT_QUEUE are already given. The change is in one place, present_aside::on() (crates/victory-gpu/src/host.rs), which sends a frame's present to that thread.

How it was tested

  • GPU and profile: RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, 540 Hz 2560x1440 display. Series X, DLSS Balanced (1484x835 inside), frame generation off, ray tracing off.
  • Bench scene: standing still on a pier for 90 s after a warm-up. Water fills the left of the frame, people sit at a terrace behind, foliage and a far shore are in the distance. About 6,000-7,500 draws a frame with the title's LOD scale and population held at 0.5 (VICTORY_IMAGE_HOLD, the same in every run below).
  • Before, main f5c3d243: VICTORY_PACE=auto alone gives no pace line, and the frame times are those of an unpaced run.
  • After, main f5c3d243 + this: VICTORY_PACE=auto alone gives the hand-off line, then frames are paced ... refreshes=18 refresh_us=1838 auto=true, then the late-frame lines (refreshes=20 late=14 frames=192).

What the pace then does depends on headroom, and that's worth saying plainly. On plain main this scene is held by the submitting thread (it worked 33-35 ms a frame), so auto climbs to 20 refreshes (36.8 ms) and the spread gets worse:

main f5c3d243 + this, 90 s each median p95 p99 over 50 ms
no pace 34.5 ms 42.6 45.1 25 (1.0 %)
VICTORY_PACE=auto 37.3 ms 52.2 57.3 170 (6.9 %)

On a build with more headroom (main e1251c31 plus #4332, #4206 and #3809's switches; the card is the limit there, and the submitting thread works 21-22 ms), the pace does what #2201 describes. Both runs below had VICTORY_PRESENT_ASIDE=1 set by hand:

e1251c31 + picks, VICTORY_PRESENT_ASIDE=1, 90 s each median p95 p99 seconds with p95 over 33 ms over 50 ms
no pace 30.3 ms 40.9 45.7 89 of 89 21
VICTORY_PACE=auto (held at 17 refreshes, 31.3 ms) 31.5 ms 31.7 32.0 14 of 91 5
VICTORY_PACE=16 (29.4 ms, 37 of 192 frames late) 30.8 ms 43.9 48.1 91 of 91 32

So auto is the setting to suggest: a fixed count the card can't keep is worse than none. A note in the docs could say that the pace pays only where the frame has slack.

  • cargo test -p victory-gpu --lib passed: yes

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2201 (the pace itself), #3851 and #4635 (other ways of evening out frame delivery). Neither touches present_aside::on().
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5577670399 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-12-01T02:23:32Z. --- ## What it changes `VICTORY_PACE` (from #2201) is kept by the presenting thread of `present_aside`. That thread runs only with `VICTORY_PRESENT_ASIDE=1` or `VICTORY_PRESENT_QUEUE=1`. Asked for alone, the pace did nothing and said nothing: no line of the pace in the log, and frame times the same as without it. I hit this myself: a pass at `VICTORY_PACE=auto` and `=16` that I first took to show "the pace doesn't help here" had never paced a frame. With this change, asking for a pace brings the presenting thread with it, and the log says so once: `the present is put aside to its own thread, which keeps the pace (VICTORY_PACE)`. Nothing changes when `VICTORY_PACE` is unset or `0`, or when `VICTORY_PRESENT_ASIDE`/`VICTORY_PRESENT_QUEUE` are already given. The change is in one place, `present_aside::on()` (`crates/victory-gpu/src/host.rs`), which sends a frame's present to that thread. ## How it was tested - **GPU and profile:** RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, 540 Hz 2560x1440 display. Series X, DLSS Balanced (1484x835 inside), frame generation off, ray tracing off. - **Bench scene:** standing still on a pier for 90 s after a warm-up. Water fills the left of the frame, people sit at a terrace behind, foliage and a far shore are in the distance. About 6,000-7,500 draws a frame with the title's LOD scale and population held at 0.5 (`VICTORY_IMAGE_HOLD`, the same in every run below). - **Before, main f5c3d243:** `VICTORY_PACE=auto` alone gives no pace line, and the frame times are those of an unpaced run. - **After, main f5c3d243 + this:** `VICTORY_PACE=auto` alone gives the hand-off line, then `frames are paced ... refreshes=18 refresh_us=1838 auto=true`, then the late-frame lines (`refreshes=20 late=14 frames=192`). What the pace then does depends on headroom, and that's worth saying plainly. On plain main this scene is held by the submitting thread (it worked 33-35 ms a frame), so `auto` climbs to 20 refreshes (36.8 ms) and the spread gets worse: | main f5c3d243 + this, 90 s each | median | p95 | p99 | over 50 ms | | --- | --- | --- | --- | --- | | no pace | 34.5 ms | 42.6 | 45.1 | 25 (1.0 %) | | `VICTORY_PACE=auto` | 37.3 ms | 52.2 | 57.3 | 170 (6.9 %) | On a build with more headroom (main e1251c31 plus #4332, #4206 and #3809's switches; the card is the limit there, and the submitting thread works 21-22 ms), the pace does what #2201 describes. Both runs below had `VICTORY_PRESENT_ASIDE=1` set by hand: | e1251c31 + picks, `VICTORY_PRESENT_ASIDE=1`, 90 s each | median | p95 | p99 | seconds with p95 over 33 ms | over 50 ms | | --- | --- | --- | --- | --- | --- | | no pace | 30.3 ms | 40.9 | 45.7 | 89 of 89 | 21 | | `VICTORY_PACE=auto` (held at 17 refreshes, 31.3 ms) | 31.5 ms | 31.7 | 32.0 | 14 of 91 | 5 | | `VICTORY_PACE=16` (29.4 ms, 37 of 192 frames late) | 30.8 ms | 43.9 | 48.1 | 91 of 91 | 32 | So `auto` is the setting to suggest: a fixed count the card can't keep is worse than none. A note in the docs could say that the pace pays only where the frame has slack. - `cargo test -p victory-gpu --lib` passed: yes ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2201 (the pace itself), #3851 and #4635 (other ways of evening out frame delivery). Neither touches `present_aside::on()`.
IRennie74 commented 2026-12-01 06:28:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by IRennie74 on 2026-12-01T06:28:31Z.


This collides with #4635 if both land. #4635 holds a present only when !present_aside::on(); presents handed to the aside thread are shown as they come. With this change any VICTORY_PACE value turns present_aside::on() true, so setting VICTORY_PACE quietly turns off #4635's pace as well. The new log line names the aside thread but not that. One more line there, or in #4635's doc, would make that clear to anyone comparing the two.

A data point that fits the bug you found. On a Ryzen 5 5600X with an RTX 3060 (Series S, DLSS Performance, the same scripted walk, two runs per arm), VICTORY_PACE=auto without VICTORY_PRESENT_ASIDE gave 18.4 and 81.8 hitches a minute and 43.2 and 71.0 ms frame-to-frame variability. That is about what we see with no pacing. VICTORY_PACE=7 with VICTORY_PRESENT_ASIDE=1 gave 5.8 and 7.7 hitches a minute (16.0 and 17.1 fps). We didn't check the auto arm's log for a pace line, so this doesn't prove it never paced, but the spread matches a pace that never ran.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7302915282 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700#issuecomment-7302915282). Originally posted by [IRennie74](https://github.com/IRennie74) on 2026-12-01T06:28:31Z. --- This collides with #4635 if both land. #4635 holds a present only when `!present_aside::on()`; presents handed to the aside thread are shown as they come. With this change any `VICTORY_PACE` value turns `present_aside::on()` true, so setting `VICTORY_PACE` quietly turns off #4635's pace as well. The new log line names the aside thread but not that. One more line there, or in #4635's doc, would make that clear to anyone comparing the two. A data point that fits the bug you found. On a Ryzen 5 5600X with an RTX 3060 (Series S, DLSS Performance, the same scripted walk, two runs per arm), `VICTORY_PACE=auto` without `VICTORY_PRESENT_ASIDE` gave 18.4 and 81.8 hitches a minute and 43.2 and 71.0 ms frame-to-frame variability. That is about what we see with no pacing. `VICTORY_PACE=7` with `VICTORY_PRESENT_ASIDE=1` gave 5.8 and 7.7 hitches a minute (16.0 and 17.1 fps). We didn't check the `auto` arm's log for a pace line, so this doesn't prove it never paced, but the spread matches a pace that never ran.
mstrmoos commented 2026-12-01 15:46:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-12-01T15:46:29Z.


Good catch, thanks. You're right: with this change any VICTORY_PACE turns the present aside on, and #4635 holds only presents that aren't put aside, so its pace stops acting. It's one or the other, not both. c350f748 says so in the line that's logged when the pace brings the thread ("a pace of presents not put aside does not act"), and in present_aside::on's doc.

Your 3060 numbers fit the bug as well: auto without the aside thread at about the level of no pacing, and 5.8 and 7.7 hitches a minute once the thread was there.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7316483336 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700#issuecomment-7316483336). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-12-01T15:46:29Z. --- Good catch, thanks. You're right: with this change any `VICTORY_PACE` turns the present aside on, and #4635 holds only presents that aren't put aside, so its pace stops acting. It's one or the other, not both. c350f748 says so in the line that's logged when the pace brings the thread ("a pace of presents not put aside does not act"), and in `present_aside::on`'s doc. Your 3060 numbers fit the bug as well: `auto` without the aside thread at about the level of no pacing, and 5.8 and 7.7 hitches a minute once the thread was there.
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/4700:upstream-pr/4700'
git switch 'upstream-pr/4700'

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