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

Closed
github-bot wants to merge 1 commit from github-bot/gh-4297 into main AGit
Owner

@⁠CubeB on GitHub · 2026-11-30 18:20 UTC · original
CubeB:pr/fg-snapshot-release-main → main · +4 −0 · 1 files · 1 commits · closed without merging

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

**@⁠CubeB** on GitHub · 2026-11-30 18:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297) `CubeB:pr/fg-snapshot-release-main` → `main` · +4 −0 · 1 files · 1 commits · closed without merging 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)
Deferred::clear() reset every per-list record except fg_snapshots, so a pooled host list held each Arc<FgSnapshot> pushed by keep_fg_snapshot for as long as the list lived. The pool ran dry about 30 s into a run ("all input snapshots are in flight"), and VICTORY_FRAMEGEN_SNAPSHOT=1 stopped doing anything after start-up. HostList::reset runs only after the list's last submission finished, and the present path holds its own clone, so the release is safe there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JzsiBtxAuHxjYfCpTzVV3h
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:23:01 +00:00
Author
Owner

@⁠tyr0nsur on GitHub · 2026-11-30 18:41 UTC · original

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

**@⁠tyr0nsur** on GitHub · 2026-11-30 18:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7288232128) 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)
github-bot force-pushed github-bot/gh-4297 from fe9cc1cfdd to 8bad0a6ae3 2026-12-01 02:41:47 +00:00 Compare
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 17:35 UTC · original

There are now two field reports with a consistent cutoff this change can be tested against. In #5008 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 #5017 logs show the same eight-frame cutoff with Performance at 6× and Quality at 5×. Log comparison

Changing #5008 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 #4298 applied. The existing reset test verifies the reference drop, which is one part of that check.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 17:35 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7319528999) There are now two field reports with a consistent cutoff this change can be tested against. In #5008 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 #5017 logs show the same eight-frame cutoff with Performance at 6× and Quality at 5×. [Log comparison](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/issues/5008) Changing #5008 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 #4298 applied. The existing reset test verifies the reference drop, which is one part of that check.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 18:24 UTC · original

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.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 18:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7320901205) 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.
github-bot closed this pull request 2026-12-01 18:50:12 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:44 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4297#issuecomment-7321450830) 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

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