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

Open
github-bot wants to merge 3 commits from github-bot/gh-4700 into main AGit
Owner

@⁠mstrmoos on GitHub · 2026-12-01 02:23 UTC · original
mstrmoos:pr/pace-brings-aside → main · +18 −2 · 1 files · 3 commits · open

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 #4333, #4207 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 #4636 (other ways of evening out frame delivery). Neither touches present_aside::on().
**@⁠mstrmoos** on GitHub · 2026-12-01 02:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700) `mstrmoos:pr/pace-brings-aside` → `main` · +18 −2 · 1 files · 3 commits · open ## 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 #4333, #4207 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 #4636 (other ways of evening out frame delivery). Neither touches `present_aside::on()`.
The pace is kept by present_aside's thread, which ran only with
VICTORY_PRESENT_ASIDE=1 or VICTORY_PRESENT_QUEUE=1: asked for alone,
VICTORY_PACE did nothing and said nothing. Asking for a pace now puts the
present aside too, and the log says so once.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 02:25:27 +00:00
Author
Owner

@⁠IRennie74 on GitHub · 2026-12-01 06:28 UTC · original

This collides with #4636 if both land. #4636 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 #4636's pace as well. The new log line names the aside thread but not that. One more line there, or in #4636'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.

**@⁠IRennie74** on GitHub · 2026-12-01 06:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700#issuecomment-7302915282) This collides with #4636 if both land. #4636 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 #4636's pace as well. The new log line names the aside thread but not that. One more line there, or in #4636'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.
Author
Owner

@⁠mstrmoos on GitHub · 2026-12-01 15:46 UTC · original

Good catch, thanks. You're right: with this change any VICTORY_PACE turns the present aside on, and #4636 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.

**@⁠mstrmoos** on GitHub · 2026-12-01 15:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4700#issuecomment-7316483336) Good catch, thanks. You're right: with this change any `VICTORY_PACE` turns the present aside on, and #4636 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 can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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