Reflex low latency only while frame generation is on (+7% with it ready but off) #250

Open
github-bot wants to merge 1 commit from github-bot/gh-250 into main AGit
Owner

@⁠MrSquirrel489 on GitHub · 2026-11-27 20:08 UTC · original
MrSquirrel489:perf/reflex-only-with-framegen → main · +40 −18 · 2 files · 1 commits · open

What

Reflex low latency was switched on at start whenever DLSS Frame Generation was planned, also when the launcher only makes it ready, but off for the F1 menu (the default since the menu switches it live). Now it is on only while frame generation is asked for:

  • at start: on only if frame generation is on from the start (VICTORY_FRAMEGEN_X ≠ 0);
  • in the present: switched on/off when the asked amount goes from off to on or back (the F1 menu, VICTORY_FRAMEGEN_CYCLE). No call when only the amount changes (2x → 4x).

One file of code (streamline.rs, +29/−12), the Reflex passage of docs/dlss.md updated.

Why

A stack sampler on the submitting thread (victory-submit, release build, 60 s in the first boat mission) showed ~16% of its time asleep in the present:
present_planes → DXGI Present → sl.interposer → NVAPI → driver Sleep.
That is Reflex's pacing. Here it holds back the thread that feeds the card, so the card waits too (the frame line's "the card idle behind us" halves without it).

Measured

RTX 4080, i7-13700K, 4K output with DLSS Performance, Series X profile, launcher defaults (frame generation ready, off). Same scripted run each time (start screen, cutscene skipped, first boat mission), frame lines averaged over 165–245 s after the window appears, the two builds alternated, each run's build checked by its log line. On 0cef07e:

run 1 run 2 run 3 mean card idle behind the submitting thread
main 25.3 25.4 24.3 25.0 fps 6.4 ms/frame
this PR 27.0 26.5 27.1 26.8 fps 3.0 ms/frame

(Four runs each on the tree before the last upstream commits: 24.7 → 27.2 fps.)

With frame generation on from the start nothing changes: Reflex is on from the start, as before.

Frame generation still works

VICTORY_FRAMEGEN_CYCLE=300 (2x, 4x, off, 6x in turn) in the same run: Reflex switches on and off with it (Streamline: Reflex low latency … on=true/false code=0), and in the world every 5-second line shows frames shown = 2 × presents with it on (2x is this card's most), status 0x0 throughout, no "Reflex not seen", no failed present.

Not measured

  • Input latency with frame generation ready but off: Reflex no longer paces that case. Here the submitting thread is the bottleneck, so few frames should queue up, but I have no latency measurement.
  • Other settings: only 4K with DLSS Performance in one scene on one card. Where the card is the bottleneck (DLSS Quality, DLAA) the gain may be smaller.
  • Without frame generation planned (no HAGS, older cards, -NoFrameGenReady) the changed code does not run: Reflex was never set there, before or now.

Checks

  • cargo test --workspace: all pass except the two indirect budget tests, which fail the same way on main (#67 fixes them).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 39 findings on main, the same 39 with this PR; none in the changed lines.

🤖 Generated with Claude Code

**@⁠MrSquirrel489** on GitHub · 2026-11-27 20:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250) `MrSquirrel489:perf/reflex-only-with-framegen` → `main` · +40 −18 · 2 files · 1 commits · open ## What Reflex low latency was switched on at start whenever DLSS Frame Generation was planned, also when the launcher only makes it *ready, but off* for the F1 menu (the default since the menu switches it live). Now it is on only while frame generation is asked for: - at start: on only if frame generation is on from the start (`VICTORY_FRAMEGEN_X` ≠ 0); - in the present: switched on/off when the asked amount goes from off to on or back (the F1 menu, `VICTORY_FRAMEGEN_CYCLE`). No call when only the amount changes (2x → 4x). One file of code (`streamline.rs`, +29/−12), the Reflex passage of `docs/dlss.md` updated. ## Why A stack sampler on the submitting thread (`victory-submit`, release build, 60 s in the first boat mission) showed **~16% of its time asleep in the present**: `present_planes → DXGI Present → sl.interposer → NVAPI → driver Sleep`. That is Reflex's pacing. Here it holds back the thread that feeds the card, so the card waits too (the frame line's "the card idle behind us" halves without it). ## Measured RTX 4080, i7-13700K, 4K output with DLSS Performance, Series X profile, launcher defaults (frame generation ready, off). Same scripted run each time (start screen, cutscene skipped, first boat mission), frame lines averaged over 165–245 s after the window appears, the two builds alternated, each run's build checked by its log line. On `0cef07e`: | | run 1 | run 2 | run 3 | mean | card idle behind the submitting thread | |---|---|---|---|---|---| | `main` | 25.3 | 25.4 | 24.3 | **25.0 fps** | 6.4 ms/frame | | this PR | 27.0 | 26.5 | 27.1 | **26.8 fps** | 3.0 ms/frame | (Four runs each on the tree before the last upstream commits: 24.7 → 27.2 fps.) With frame generation on from the start nothing changes: Reflex is on from the start, as before. ## Frame generation still works `VICTORY_FRAMEGEN_CYCLE=300` (2x, 4x, off, 6x in turn) in the same run: Reflex switches on and off with it (`Streamline: Reflex low latency … on=true/false code=0`), and in the world every 5-second line shows frames shown = 2 × presents with it on (2x is this card's most), status `0x0` throughout, no "Reflex not seen", no failed present. ## Not measured - **Input latency** with frame generation ready but off: Reflex no longer paces that case. Here the submitting thread is the bottleneck, so few frames should queue up, but I have no latency measurement. - **Other settings:** only 4K with DLSS Performance in one scene on one card. Where the card is the bottleneck (DLSS Quality, DLAA) the gain may be smaller. - Without frame generation planned (no HAGS, older cards, `-NoFrameGenReady`) the changed code does not run: Reflex was never set there, before or now. ## Checks - `cargo test --workspace`: all pass except the two indirect budget tests, which fail the same way on `main` (#67 fixes them). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 39 findings on `main`, the same 39 with this PR; none in the changed lines. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With frame generation ready but off (the launcher's default, so that the
F1 menu can switch it), Reflex low latency was on all the same. Its pacing
put the submitting thread to sleep in the present, about a sixth of its
time, with the card idle behind it. Now it is on only while frame
generation is asked for: from the start when it is on from the start, and
switched with it in the present otherwise.

First boat mission, RTX 4080, 4K with DLSS Performance, frame generation
ready but off: 25.0 -> 26.8 frames a second (three runs each, alternated).
Frame generation switched live (VICTORY_FRAMEGEN_CYCLE) still shows two
frames for each one rendered, status 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 20:10:04 +00:00
Author
Owner

@⁠hussainmussa on GitHub · 2026-11-28 01:06 UTC · original

I built this branch and its base on a smaller card, where this matters much more.

Setup: RTX 4070 12 GB (driver 621.24), Core Ultra 7 265KF, 64 GB RAM, Windows 11. Release builds. Series X profile, 1440p, DLSS Quality, launcher defaults (frame generation ready, off). Opening area. Numbers are the 5-second frame lines after loading.

Median fps Lowest 1 in 10 Time in the present call (median)
base 0cef07e 14.0 14.0 42.6 ms
this PR a920cbf 25.1 22.1 0.46 ms

On the base, 16 of 17 samples sat at 71.4 ms per frame, with "0 presents with it on". With this PR none do, and the longest present call was 1.6 ms.

Limits: one run each (17 and 31 samples), played by hand, so the routes were not identical. I did not test frame generation switched on, or input latency.

Written with help from Claude; everything above was built and run on my machine.

**@⁠hussainmussa** on GitHub · 2026-11-28 01:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250#issuecomment-7231431316) I built this branch and its base on a smaller card, where this matters much more. **Setup:** RTX 4070 12 GB (driver 621.24), Core Ultra 7 265KF, 64 GB RAM, Windows 11. Release builds. Series X profile, 1440p, DLSS Quality, launcher defaults (frame generation ready, off). Opening area. Numbers are the 5-second frame lines after loading. | | Median fps | Lowest 1 in 10 | Time in the present call (median) | |---|---|---|---| | base `0cef07e` | 14.0 | 14.0 | 42.6 ms | | this PR `a920cbf` | 25.1 | 22.1 | 0.46 ms | On the base, 16 of 17 samples sat at 71.4 ms per frame, with "0 presents with it on". With this PR none do, and the longest present call was 1.6 ms. **Limits:** one run each (17 and 31 samples), played by hand, so the routes were not identical. I did not test frame generation switched on, or input latency. Written with help from Claude; everything above was built and run on my machine.
Author
Owner

@⁠hussainmussa on GitHub · 2026-11-28 01:16 UTC · original

Follow-up: the same build (a920cbf) with frame generation on from the start (-FrameGen, DLSS 2x), same card and settings as above.

  • Start log: Reflex low latency (needed by frame generation, only while it is on) on=true code=0 result="ok".
  • 201 of 201 one-second status lines in the world show status 0x0, and frames shown = 2 × presents once it settled (for example "19 presents with it on, 0 off, 38 frames shown by it").
  • Median 19.9 rendered fps (about 40 shown), lowest 1 in 10 at 18.6, over 40 samples. The present call took 15.8 ms (median).
  • For scale: with frame generation ready but off, this build rendered 25.1 fps.

Limits: one run, played by hand. I did not switch frame generation off and on in the F1 menu during the run, so the live switching is not covered. I have no run of the base with frame generation on to compare against.

Written with help from Claude; everything above was built and run on my machine.

**@⁠hussainmussa** on GitHub · 2026-11-28 01:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250#issuecomment-7231550384) Follow-up: the same build (`a920cbf`) with frame generation on from the start (`-FrameGen`, DLSS 2x), same card and settings as above. - Start log: `Reflex low latency (needed by frame generation, only while it is on) on=true code=0 result="ok"`. - 201 of 201 one-second status lines in the world show status `0x0`, and frames shown = 2 × presents once it settled (for example "19 presents with it on, 0 off, 38 frames shown by it"). - Median 19.9 rendered fps (about 40 shown), lowest 1 in 10 at 18.6, over 40 samples. The present call took 15.8 ms (median). - For scale: with frame generation ready but off, this build rendered 25.1 fps. **Limits:** one run, played by hand. I did not switch frame generation off and on in the F1 menu during the run, so the live switching is not covered. I have no run of the base with frame generation on to compare against. Written with help from Claude; everything above was built and run on my machine.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/250/head:github-bot/gh-250'
git switch 'github-bot/gh-250'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-250'
git switch 'github-bot/gh-250'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-250'
git switch 'github-bot/gh-250'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-250'
git switch 'main'
git merge --squash 'github-bot/gh-250'
git switch 'main'
git merge --ff-only 'github-bot/gh-250'
git switch 'main'
git merge 'github-bot/gh-250'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.