FG snapshots: a host list gives its kept input snapshots back on reset (#1978 follow-up) #4297

Closed
CubeB wants to merge 1 commit from upstream-pr/4297 into main
CubeB commented 2026-11-30 18:20:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by CubeB on 2026-11-30T18:20:35Z.


Follow-up to #1978, merged today (2026-11-30 14:12Z).

What is wrong

Deferred::clear() (crates/victory-gpu/src/host.rs) resets every per-list record except fg_snapshots. HostList::keep_fg_snapshot pushes an Arc<FgSnapshot> for each frame-generation input snapshot a list writes, and pooled host lists are reset and reused, not dropped, so each list keeps every snapshot it was ever given.

With VICTORY_FRAMEGEN_SNAPSHOT=1 the snapshot pool then runs dry about 30 s into a run: the log shows all input snapshots are in flight and the fallback to unsnapshotted inputs on nearly every frame (so_far=32768 in a 30-minute run), so the setting stops doing anything after start-up. I reported this on #1978 earlier and opened the same fix against its branch (SkivHisink/VIctory-NVIDIA#1); #1978 has been merged since, so this is the fix against main.

Fix

One line in Deferred::clear(): self.fg_snapshots.clear(); beside self.kept.clear().

HostList::reset runs only after the list's last submission has finished, and the present path holds its own clone, so the GPU is done with the snapshot when the list lets go of it.

Testing

  • The same change has been in my fork since 2026-11-29 (on top of #1978): cargo build --release --locked -p victory and cargo test -p victory-gpu --lib -- --test-threads=1 pass there, and a 70-minute play session on an RTX 5070 Ti ran without a crash with it in the build; frame generation was loaded but stayed off in that session, so the fix itself has not been exercised in play yet.
  • On this branch (upstream main + this commit) I have not built it; the change is the four lines shown.
  • The expected sign in a frame-generation run is that the no input snapshot free / all input snapshots are in flight lines stop after start-up.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5571160883 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297). Originally posted by [CubeB](https://github.com/CubeB) on 2026-11-30T18:20:35Z. --- Follow-up to #1978, merged today (2026-11-30 14:12Z). ## What is wrong `Deferred::clear()` (`crates/victory-gpu/src/host.rs`) resets every per-list record except `fg_snapshots`. `HostList::keep_fg_snapshot` pushes an `Arc<FgSnapshot>` for each frame-generation input snapshot a list writes, and pooled host lists are reset and reused, not dropped, so each list keeps every snapshot it was ever given. With `VICTORY_FRAMEGEN_SNAPSHOT=1` the snapshot pool then runs dry about 30 s into a run: the log shows `all input snapshots are in flight` and the fallback to unsnapshotted inputs on nearly every frame (`so_far=32768` in a 30-minute run), so the setting stops doing anything after start-up. I reported this on #1978 earlier and opened the same fix against its branch (SkivHisink/VIctory-NVIDIA#1); #1978 has been merged since, so this is the fix against `main`. ## Fix One line in `Deferred::clear()`: `self.fg_snapshots.clear();` beside `self.kept.clear()`. `HostList::reset` runs only after the list's last submission has finished, and the present path holds its own clone, so the GPU is done with the snapshot when the list lets go of it. ## Testing - The same change has been in my fork since 2026-11-29 (on top of #1978): `cargo build --release --locked -p victory` and `cargo test -p victory-gpu --lib -- --test-threads=1` pass there, and a 70-minute play session on an RTX 5070 Ti ran without a crash with it in the build; frame generation was loaded but stayed off in that session, so the fix itself has not been exercised in play yet. - On this branch (upstream `main` + this commit) I have not built it; the change is the four lines shown. - The expected sign in a frame-generation run is that the `no input snapshot free` / `all input snapshots are in flight` lines stop after start-up. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tyr0nsur commented 2026-11-30 18:41:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T18:41:50Z.


I checked the reset path with a synthetic D3D12 snapshot on Windows 11 / RTX 4060. After a closed recording is reset, main (e1251c31) still has two strong references (the test and the list). With fe9cc1cf, it has one. The ten Streamline unit tests passed with the regression added. The test is available as a cherry-pick. Test commit

For the same-description reuse path, proxied_queue returns the native queue behind the same Streamline proxy used to create the swap chain. The D3D12 Streamline contract documents that its default mode blocks the presenting queue until the DLSS-G work completes. The test covers release of the list's reference after reset. An in-game run with snapshotting enabled would still be needed to measure pool recovery under frame generation. Queue setup · NVIDIA guide

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288232128 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7288232128). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-11-30T18:41:50Z. --- I checked the reset path with a synthetic D3D12 snapshot on Windows 11 / RTX 4060. After a closed recording is reset, main (`e1251c31`) still has two strong references (the test and the list). With `fe9cc1cf`, it has one. The ten Streamline unit tests passed with the regression added. The test is available as a cherry-pick. [Test commit](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/05b5a2b468c110938348adf2de6332c00d66ce2d) For the same-description reuse path, `proxied_queue` returns the native queue behind the same Streamline proxy used to create the swap chain. The D3D12 Streamline contract documents that its default mode blocks the presenting queue until the DLSS-G work completes. The test covers release of the list's reference after reset. An in-game run with snapshotting enabled would still be needed to measure pool recovery under frame generation. [Queue setup](https://github.com/trustno1-coder/VIctory-NVIDIA/blob/e1251c3199465565147711887351d80359162bb0/crates/victory-gpu/src/streamline.rs#L1315-L1350) · [NVIDIA guide](https://github.com/NVIDIA-RTX/Streamline/blob/main/docs/ProgrammingGuideDLSS_G.md)
andrewpozdnakov7-jpg commented 2026-12-01 17:35:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T17:35:03Z.


There are now two field reports with a consistent cutoff this change can be tested against. In #5007 on an RTX 3070 Ti, FG at 2× switches off eight frame indices after it switches on with DLSS Quality, with the snapshot exhaustion warning in between. Both #5016 logs show the same eight-frame cutoff with Performance at 6× and Quality at 5×. Log comparison

Changing #5007 only to DLAA removed the warning and produced extra frames. That provides a workaround and a control. The open verification for this patch is whether the original Quality case releases and reuses snapshots and produces extra frames with #4297 applied. The existing reset test verifies the reference drop, which is one part of that check.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7319528999 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7319528999). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T17:35:03Z. --- There are now two field reports with a consistent cutoff this change can be tested against. In #5007 on an RTX 3070 Ti, FG at 2× switches off eight frame indices after it switches on with DLSS Quality, with the snapshot exhaustion warning in between. Both #5016 logs show the same eight-frame cutoff with Performance at 6× and Quality at 5×. [Log comparison](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/5007#issuecomment-7319518996) Changing #5007 only to DLAA removed the warning and produced extra frames. That provides a workaround and a control. The open verification for this patch is whether the original Quality case releases and reuses snapshots and produces extra frames with #4297 applied. The existing reset test verifies the reference drop, which is one part of that check.
andrewpozdnakov7-jpg commented 2026-12-01 18:24:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T18:24:47Z.


The maintainer added the same fg_snapshots.clear() reset to main in a82703f0. The commit also explains the test-build regression. Alias mode 2 started using snapshots for aliased depth or motion vectors, which made the eight-entry pool exhaustion show up with default play settings. Commit on main

The v2026.12.01.01-test download still predates that commit. The remaining field check is the original DLSS Quality route on a build that contains it. The two checks are sustained extra frames and no recurrence of the snapshot exhaustion warning.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7320901205 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7320901205). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T18:24:47Z. --- The maintainer added the same `fg_snapshots.clear()` reset to `main` in `a82703f0`. The commit also explains the test-build regression. Alias mode 2 started using snapshots for aliased depth or motion vectors, which made the eight-entry pool exhaustion show up with default play settings. [Commit on main](https://github.com/trustno1-coder/VIctory-NVIDIA/commit/a82703f0655480c3ba212e7af4df1db6d4d0727d) The v2026.12.01.01-test download still predates that commit. The remaining field check is the original DLSS Quality route on a build that contains it. The two checks are sustained extra frames and no recurrence of the snapshot exhaustion warning.
trustno1-coder commented 2026-12-01 18:44:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:44:26Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321450830 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7321450830). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:44:26Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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