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

Merged
MrSquirrel489 merged 1 commit from upstream-pr/250 into main 2026-11-29 08:16:59 +00:00
MrSquirrel489 commented 2026-11-27 20:08:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MrSquirrel489 on 2026-11-27T20:08:55Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532494738 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250). Originally posted by [MrSquirrel489](https://github.com/MrSquirrel489) on 2026-11-27T20:08:55Z. --- ## 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)
hussainmussa commented 2026-11-28 01:06:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by hussainmussa on 2026-11-28T01:06:56Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231431316 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250#issuecomment-7231431316). Originally posted by [hussainmussa](https://github.com/hussainmussa) on 2026-11-28T01:06:56Z. --- 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 commented 2026-11-28 01:16:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by hussainmussa on 2026-11-28T01:16:39Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231550384 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/250#issuecomment-7231550384). Originally posted by [hussainmussa](https://github.com/hussainmussa) on 2026-11-28T01:16:39Z. --- 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.
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!250
No description provided.