Streamline: NVIDIA Reflex low latency without frame generation (VICTORY_REFLEX=on|boost) #3072

Closed
github-bot wants to merge 3 commits from github-bot/gh-3072 into main AGit
Owner

@⁠Adriwin06 on GitHub · 2026-11-29 19:52 UTC · original
Adriwin06:reflex → main · +2175 −45 · 7 files · 3 commits · closed without merging

What it changes

Reflex low latency was set only while frame generation is on (#250).
VICTORY_REFLEX=on (or boost, low latency with boost) turns it on with
or without frame generation and paces the title's frames with Reflex's
markers:

  • streamline/reflex.rs: the per-frame state (frame tokens matched
    across the input reading, the origin wait, the submissions and the
    present), Reflex's sleep with a watchdog, and 10 s telemetry lines;
    streamline/abi.rs: the Streamline 2.14 ReflexReport, ReflexReport2
    and ReflexState layouts.
  • frame.rs, queue.rs and GameInput: frame_begins, title_submits (the
    first direct-queue submission of a frame, tagged by ExecuteCommandListsX's
    token), title_presents, and input_sampling (GetCurrentReading), where
    the sleep and SimulationStart happen when the title reads input
    every frame.
  • F1: NVIDIA REFLEX (LOW LATENCY): OFF / ON / ON + BOOST.

Unset, nothing changes: no marker is sent and frame generation sets
Reflex as before.

Ported from Kemerd/VIctory-NVIDIA-RT@6463141 and
Kemerd/VIctory-NVIDIA-RT@14f973b (Kemerd),
GPL-3.0-or-later. Upstream asked for Reflex as a pull request of its
own in #18.

How it was tested

  • GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch.
  • Before: n/a (no in-title measurement on this branch)
  • After: n/a
  • cargo test passed for the crates it touches:
    • this change: no: 112 passed, 1 failed: host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started (cargo test -p victory-gpu --lib -- streamline:: queue:: frame:: host::menu::); the one failure is the menu tests' race on VICTORY_MENU_FILE, which fails on main too (fixed in #3061)
  • cargo clippy --workspace --all-targets --locked: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself).
  • cargo xtask policy: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs).
  • With all eleven of my pull requests merged together: cargo clippy also with --all-features adds no finding, and cargo test --workspace --locked fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related:
    #250 (merged) turns Reflex on only with frame generation; #1938 (open) keeps the card awake less while Reflex paces. Neither adds Reflex without frame generation. #18 (closed) asked for Reflex as a pull request of its own.

🤖 Generated with Claude Code

**@⁠Adriwin06** on GitHub · 2026-11-29 19:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072) `Adriwin06:reflex` → `main` · +2175 −45 · 7 files · 3 commits · closed without merging ## What it changes Reflex low latency was set only while frame generation is on (#250). VICTORY_REFLEX=on (or boost, low latency with boost) turns it on with or without frame generation and paces the title's frames with Reflex's markers: - streamline/reflex.rs: the per-frame state (frame tokens matched across the input reading, the origin wait, the submissions and the present), Reflex's sleep with a watchdog, and 10 s telemetry lines; streamline/abi.rs: the Streamline 2.14 ReflexReport, ReflexReport2 and ReflexState layouts. - frame.rs, queue.rs and GameInput: frame_begins, title_submits (the first direct-queue submission of a frame, tagged by ExecuteCommandListsX's token), title_presents, and input_sampling (GetCurrentReading), where the sleep and SimulationStart happen when the title reads input every frame. - F1: NVIDIA REFLEX (LOW LATENCY): OFF / ON / ON + BOOST. Unset, nothing changes: no marker is sent and frame generation sets Reflex as before. Ported from Kemerd/VIctory-NVIDIA-RT@6463141 and Kemerd/VIctory-NVIDIA-RT@14f973b (Kemerd), GPL-3.0-or-later. Upstream asked for Reflex as a pull request of its own in #18. ## How it was tested - GPU and profile: RTX 4070 SUPER, Ryzen 7 5800X. Not measured in the title on these commits by themselves: they come from a fork of mine that carries them with the rest of this set, and the title ran there. What is below is the unit tests on this branch. - Before: n/a (no in-title measurement on this branch) - After: n/a - `cargo test` passed for the crates it touches: - this change: no: 112 passed, 1 failed: host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started (`cargo test -p victory-gpu --lib -- streamline:: queue:: frame:: host::menu::`); the one failure is the menu tests' race on VICTORY_MENU_FILE, which fails on main too (fixed in #3061) - `cargo clippy --workspace --all-targets --locked`: no finding that main does not already have (main has 34 of its own, which is why the Clippy step of CI is red on main itself). - `cargo xtask policy`: no new finding (main fails it on crates/victory-loader/src/heap_sites/frame_users.rs). - With all eleven of my pull requests merged together: `cargo clippy` also with `--all-features` adds no finding, and `cargo test --workspace --locked` fails only tests main also fails on this machine: the five shader tests that fail on main here too (WARP's SM 6.2 and the validator) (barycentric_tests::first_half_values_render_on_hardware_and_warp, hw_tests::split_lds_wave32_read_after_read_barrier_coalescing_and_parity, intersect_tests::flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves, rect::tests::rectangles_are_drawn_whole, rect::tests::the_rectangle_stage_is_a_geometry_shader) and xtask's repository_passes_policy (frame_users.rs). 2208 passed, including five that fail on main (three BCPack oracle tests, the menu save race, the shader key test). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #250 (merged) turns Reflex on only with frame generation; #1938 (open) keeps the card awake less while Reflex paces. Neither adds Reflex without frame generation. #18 (closed) asked for Reflex as a pull request of its own. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reflex low latency was set only while frame generation is on (#250).
VICTORY_REFLEX=on (or boost, low latency with boost) turns it on with
or without frame generation and paces the title's frames with Reflex's
markers:

- streamline/reflex.rs: the per-frame state (frame tokens matched
  across the input reading, the origin wait, the submissions and the
  present), Reflex's sleep with a watchdog, and 10 s telemetry lines;
  streamline/abi.rs: the Streamline 2.14 ReflexReport, ReflexReport2
  and ReflexState layouts.
- frame.rs, queue.rs and GameInput: frame_begins, title_submits (the
  first direct-queue submission of a frame, tagged by ExecuteCommandListsX's
  token), title_presents, and input_sampling (GetCurrentReading), where
  the sleep and SimulationStart happen when the title reads input
  every frame.
- F1: NVIDIA REFLEX (LOW LATENCY): OFF / ON / ON + BOOST.

Unset, nothing changes: no marker is sent and frame generation sets
Reflex as before.

Ported from Kemerd/VIctory-NVIDIA-RT@6463141 and
Kemerd/VIctory-NVIDIA-RT@14f973b (Kemerd),
GPL-3.0-or-later. Upstream asked for Reflex as a pull request of its
own in #18.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 19:59:47 +00:00
@ -0,0 +626,4 @@
// again, and the host's present of it names that frame's index
// ([`Frames::presenting`]).
Some(at) => {
self.repeat = Some((present, self.live[at].index));
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:58 UTC · original

This single slot overwrites an unconsumed repeat: with simulation 2 open, three queued presents of the same origin produce host indexes [1, 2, 1] instead of [1, 1, 1]. The middle present consumes the next simulation, and the last moves frame-generation constants and markers backwards. Keep a pending present-to-index mapping for every repeat, consume only the matching entry in presenting, and test multiple queued repeats.

**@⁠Copilot** on GitHub · 2026-11-29 19:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4732931845) This single slot overwrites an unconsumed repeat: with simulation 2 open, three queued presents of the same origin produce host indexes [1, 2, 1] instead of [1, 1, 1]. The middle present consumes the next simulation, and the last moves frame-generation constants and markers backwards. Keep a pending present-to-index mapping for every repeat, consume only the matching entry in `presenting`, and test multiple queued repeats.
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 19:58 UTC · original · reviewed

Repeated presents can consume the wrong simulation and move frame indexes backwards because pending and completed token mappings are lost, while failed Reflex configuration can still enable sleeps and markers.

3 open issues
What changed in this PR

Adds opt-in NVIDIA Reflex low latency with or without frame generation, extending the existing Streamline integration while preserving unset behavior.

Changes:

  • Adds VICTORY_REFLEX=on|boost and an F1 menu setting.
  • Connects input sampling, frame starts, submissions and presents through shared Reflex frame tracking.
  • Adds latency-report layouts, telemetry, sleep-duration safeguards and unit tests.
File Description
crates/​victory-hle/​src/​modules/​gameinput.rs Hooks input reads into Reflex pacing and markers.
crates/​victory-gpu/​src/​streamline/​reflex.rs Adds frame tracking, marker sequencing, latency calculations and tests.
crates/​victory-gpu/​src/​streamline/​abi.rs Defines Reflex report layouts and function signatures.
crates/​victory-gpu/​src/​streamline.rs Integrates Reflex initialization, tokens, sleeps, markers and telemetry.
crates/​victory-gpu/​src/​queue.rs Associates submissions and presents with title frame tokens.
crates/​victory-gpu/​src/​host/​menu.rs Adds Reflex OFF, ON and ON + BOOST settings.
crates/​victory-gpu/​src/​frame.rs Connects frame-origin waits to Reflex tracking and pacing.

Review effort: Balanced

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-29 19:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#pullrequestreview-6104542247) · **reviewed** <!-- ccr-overview-v2 --> ### 🟡 Changes recommended Repeated presents can consume the wrong simulation and move frame indexes backwards because pending and completed token mappings are lost, while failed Reflex configuration can still enable sleeps and markers. <details open> <summary><strong>3 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [Track every queued repeat present-to-index mapping](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3072) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [Retain completed origin-token mappings for repeats](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3072) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [Enable Reflex only after options are accepted](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3072) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Adds opt-in NVIDIA Reflex low latency with or without frame generation, extending the existing Streamline integration while preserving unset behavior. **Changes:** - Adds `VICTORY_REFLEX=on|boost` and an F1 menu setting. - Connects input sampling, frame starts, submissions and presents through shared Reflex frame tracking. - Adds latency-report layouts, telemetry, sleep-duration safeguards and unit tests. | File | Description | | ---- | ----------- | | `crates/​victory-hle/​src/​modules/​gameinput.rs` | Hooks input reads into Reflex pacing and markers. | | `crates/​victory-gpu/​src/​streamline/​reflex.rs` | Adds frame tracking, marker sequencing, latency calculations and tests. | | `crates/​victory-gpu/​src/​streamline/​abi.rs` | Defines Reflex report layouts and function signatures. | | `crates/​victory-gpu/​src/​streamline.rs` | Integrates Reflex initialization, tokens, sleeps, markers and telemetry. | | `crates/​victory-gpu/​src/​queue.rs` | Associates submissions and presents with title frame tokens. | | `crates/​victory-gpu/​src/​host/​menu.rs` | Adds Reflex OFF, ON and ON + BOOST settings. | | `crates/​victory-gpu/​src/​frame.rs` | Connects frame-origin waits to Reflex tracking and pacing. | </details> <sub>Review effort: Balanced</sub>
@ -0,0 +695,4 @@
pub fn presented(&mut self, index: u32) -> Markers {
let Some(at) = self.live.iter().position(|f| f.index == index) else { return Markers(0) };
let owed = self.live[at].reach(Stage::PresentEnd);
self.live.remove(at);
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:58 UTC · original

Removing the frame also loses its origin-token-to-index mapping, so a repeated title present after the first host present completes is no longer recognised. It then consumes the next open simulation or creates a new frame instead of reusing the completed frame's index without markers. Retain bounded completed-token history separately from live marker state, and test a repeat arriving after host completion.

**@⁠Copilot** on GitHub · 2026-11-29 19:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4732931855) Removing the frame also loses its origin-token-to-index mapping, so a repeated title present after the first host present completes is no longer recognised. It then consumes the next open simulation or creates a new frame instead of reusing the completed frame's index without markers. Retain bounded completed-token history separately from live marker state, and test a repeat arriving after host completion.
@ -1283,0 +1385,4 @@
let code = unsafe { set_options(&options) };
tracing::info!(code, result = abi::result_name(code), mode = mode.name(), "Streamline: Reflex options set (VICTORY_REFLEX)");
}
reflex_ready = true;
Author
Owner

@⁠Copilot on GitHub · 2026-11-29 19:58 UTC · original

reflex_ready becomes true even when slReflexSetOptions fails, enabling title-thread sleeps and markers and logging Reflex as on despite the rejected mode. The earlier frame-generation setup also sets reflex_set after a failed call, causing this path to skip configuration. Carry the options call's success through both initialization paths and publish readiness only after success; otherwise warn and leave standalone Reflex disabled.

**@⁠Copilot** on GitHub · 2026-11-29 19:58 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4732931869) `reflex_ready` becomes true even when `slReflexSetOptions` fails, enabling title-thread sleeps and markers and logging Reflex as on despite the rejected mode. The earlier frame-generation setup also sets `reflex_set` after a failed call, causing this path to skip configuration. Carry the options call's success through both initialization paths and publish readiness only after success; otherwise warn and leave standalone Reflex disabled.
Author
Owner

@⁠Aniseto on GitHub · 2026-11-29 20:23 UTC · original

Ran the Reflex and related groups at 3e5f6c72 on an NVIDIA Blackwell desktop part.

System

  • GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40)
  • CPU: Intel Core i5-12400F, 64 GB RAM
  • OS: Windows 11 Pro build 26200 x64
  • Toolchain: Rust 1.98.1 (48a229cea 2026-09-01, pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5
  • Build: debug

Results

  • VICTORY_D3D12_ADAPTER=NVIDIA cargo test -p victory-gpu --lib --locked streamline:: -- --test-threads=1: 73 passed, 0 failed, 0 ignored.
  • ... queue::: 24 passed, 0 failed, 0 ignored.
  • ... frame::: 2 passed, 0 failed, 0 ignored.
  • ... host::menu::: 14 passed, 0 failed, 0 ignored. The menu save race the author reports on an RTX 4070 SUPER did not reproduce here.

What this adds
All four groups pass on an RTX 5070 Ti. This is the first datapoint from this card in the thread and adds driver 32.0.16.2140. These are CPU-side tests; no title latency was measured with VICTORY_REFLEX=on|boost, so no latency claim is made.

Not tested
A retail title, input-to-photon latency, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - ran the commands above on this machine and wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-29 20:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#issuecomment-7262046222) Ran the Reflex and related groups at `3e5f6c72` on an NVIDIA Blackwell desktop part. **System** - GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders), driver 32.0.16.2140 (621.40) - CPU: Intel Core i5-12400F, 64 GB RAM - OS: Windows 11 Pro build 26200 x64 - Toolchain: Rust 1.98.1 (48a229cea 2026-09-01, pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 - Build: debug **Results** - `VICTORY_D3D12_ADAPTER=NVIDIA cargo test -p victory-gpu --lib --locked streamline:: -- --test-threads=1`: 73 passed, 0 failed, 0 ignored. - `... queue::`: 24 passed, 0 failed, 0 ignored. - `... frame::`: 2 passed, 0 failed, 0 ignored. - `... host::menu::`: 14 passed, 0 failed, 0 ignored. The menu save race the author reports on an RTX 4070 SUPER did not reproduce here. **What this adds** All four groups pass on an RTX 5070 Ti. This is the first datapoint from this card in the thread and adds driver 32.0.16.2140. These are CPU-side tests; no title latency was measured with `VICTORY_REFLEX=on|boost`, so no latency claim is made. **Not tested** A retail title, input-to-photon latency, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - ran the commands above on this machine and wrote this report; no game data was used.
One slot held a further present of a frame's token, so a second one
overwrote the first: with simulation 2 open, three queued presents of
frame 1 got the host indexes [1, 2, 1], the middle one taking the next
simulation and the last moving frame generation's constants and markers
backwards. And once frame 1's host present returned, its token was
gone with it, so a present of that token the title called later was
taken for a newer frame's or a frame of its own. Further presents now
wait in KEPT places, each consumed by its own host present, and the
last KEPT presented frames' tokens are remembered apart from the live
frames. Tests: queued_further_presents_of_one_frame_each_show_that_frame,
a_further_present_after_the_hosts_present_shows_that_frame_again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Readiness was published whatever slReflexSetOptions returned, so a
refused mode still put the title threads to sleep in slReflexSleep and
sent markers, with Reflex logged as on; and when frame generation's
setup had made the call (and failed), the VICTORY_REFLEX path took it as
done and skipped its own. The setup's result is now carried to the
VICTORY_REFLEX path, which calls again only if nothing was asked, and
publishes readiness only on success; a refusal is warned about and
Reflex by itself stays off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 00:54 UTC · original

Fixed in c5cd5410: further presents now wait in KEPT places (one per repeat), each consumed only by its own host present. Regression test: queued_further_presents_of_one_frame_each_show_that_frame (three queued repeats with simulation 2 open give [1, 1, 1] and leave simulation 2 for the next frame).

**@⁠Adriwin06** on GitHub · 2026-11-30 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4734026858) Fixed in c5cd5410: further presents now wait in `KEPT` places (one per repeat), each consumed only by its own host present. Regression test: `queued_further_presents_of_one_frame_each_show_that_frame` (three queued repeats with simulation 2 open give [1, 1, 1] and leave simulation 2 for the next frame).
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 00:54 UTC · original

Fixed in c5cd5410 as well: the last KEPT presented frames' origin tokens and indexes are kept apart from the live marker state, so a repeat arriving after the host present still reuses that index with no markers. Regression test: a_further_present_after_the_hosts_present_shows_that_frame_again (it also checks the history is bounded).

**@⁠Adriwin06** on GitHub · 2026-11-30 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4734027006) Fixed in c5cd5410 as well: the last `KEPT` presented frames' origin tokens and indexes are kept apart from the live marker state, so a repeat arriving after the host present still reuses that index with no markers. Regression test: `a_further_present_after_the_hosts_present_shows_that_frame_again` (it also checks the history is bounded).
Author
Owner

@⁠Adriwin06 on GitHub · 2026-11-30 00:54 UTC · original

Fixed in e2561b1e: the frame-generation setup now carries the slReflexSetOptions result code, and the VICTORY_REFLEX path calls the function only if nothing was asked yet. It publishes REFLEX_READY only when the code is OK; otherwise it warns and standalone Reflex stays off.

**@⁠Adriwin06** on GitHub · 2026-11-30 00:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3072#discussion_r4734027143) Fixed in e2561b1e: the frame-generation setup now carries the `slReflexSetOptions` result code, and the `VICTORY_REFLEX` path calls the function only if nothing was asked yet. It publishes `REFLEX_READY` only when the code is OK; otherwise it warns and standalone Reflex stays off.
github-bot closed this pull request 2026-12-01 18:59:14 +00:00

Pull request closed

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!3072
No description provided.