Skip resize preparation during swap-chain backoff #4924

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

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 14:09 UTC · original
andrewpozdnakov7-jpg:codex2/fix/resize-preparation-backoff → main · +8 −1 · 1 files · 1 commits · closed without merging

What it changes

When DXGI refuses a resize, the swap-chain retry gate waits a second before calling ResizeBuffers again. Frames in that interval still wait for submitted GPU work and call the DLSS and FSR resize hooks before the gate drops them.

Check the cooldown before those preparations. On an eligible attempt, the presenter still settles GPU work and runs both resize hooks before calling DXGI.

How it was tested

  • A focused Windows Rust fixture used the exact resize gate and preparation block from main 5fabb46e and f017360cc5e73c67517f99beb00859a6154d607b, a simulated clock, and stubbed DXGI and frame-generation calls. Release e1251c31 has the same baseline preparation block.
  • With resize refused for 120 frames at 60 Hz, both builds made two DXGI attempts. GPU settle and each resize hook ran 120 times on main and twice with the patch. On recovery, the first eligible retry succeeded and the cooldown cleared.
  • cargo xtask policy --staged accepted the changed file. Main's CI check has five existing Clippy errors tracked in #4708.

Checked for overlap

  • Searched open and closed PRs and issues for swap-chain resize retries and checked PRs touching host.rs. The existing DXGI backoff came from #257. The patch combines cleanly with #4900 and #4919 in git merge-tree.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change into another commit.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 14:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4923) `andrewpozdnakov7-jpg:codex2/fix/resize-preparation-backoff` → `main` · +8 −1 · 1 files · 1 commits · closed without merging ## What it changes When DXGI refuses a resize, the swap-chain retry gate waits a second before calling `ResizeBuffers` again. Frames in that interval still wait for submitted GPU work and call the DLSS and FSR resize hooks before the gate drops them. Check the cooldown before those preparations. On an eligible attempt, the presenter still settles GPU work and runs both resize hooks before calling DXGI. ## How it was tested - A focused Windows Rust fixture used the exact resize gate and preparation block from main `5fabb46e` and `f017360cc5e73c67517f99beb00859a6154d607b`, a simulated clock, and stubbed DXGI and frame-generation calls. Release `e1251c31` has the same baseline preparation block. - With resize refused for 120 frames at 60 Hz, both builds made two DXGI attempts. GPU settle and each resize hook ran 120 times on main and twice with the patch. On recovery, the first eligible retry succeeded and the cooldown cleared. - `cargo xtask policy --staged` accepted the changed file. Main's [CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) has five existing Clippy errors tracked in #4708. ## Checked for overlap - [x] Searched open and closed PRs and issues for swap-chain resize retries and checked PRs touching `host.rs`. The existing DXGI backoff came from #257. The patch combines cleanly with #4900 and #4919 in `git merge-tree`. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change into another commit. AI-assisted with OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 14:11:48 +00:00
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 14:29 UTC · original · reviewed

AI-assisted review; I used an AI assistant to inspect this diff.

**@⁠gut0to** on GitHub · 2026-12-01 14:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4923#pullrequestreview-6133325055) · **reviewed** AI-assisted review; I used an AI assistant to inspect this diff.
@ -16833,6 +16837,9 @@ impl Host {
}
}
if (p.width, p.height, p.format) != (width, height, format) {
if retry.waiting(Instant::now()) {
Author
Owner

@⁠gut0to on GitHub · 2026-12-01 14:29 UTC · original

Could you add a small unit test for the backoff boundary here? now < next_attempt should skip resize preparation, while now == next_attempt should allow it. That would pin the new early return before settle_now and streamline::resizing without requiring a swap chain. AI-assisted review; I traced the retry helper's boundary condition through the resize path.

**@⁠gut0to** on GitHub · 2026-12-01 14:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4923#discussion_r4755663199) Could you add a small unit test for the backoff boundary here? `now < next_attempt` should skip resize preparation, while `now == next_attempt` should allow it. That would pin the new early return before `settle_now` and `streamline::resizing` without requiring a swap chain. AI-assisted review; I traced the retry helper's boundary condition through the resize path.
Author
Owner

@⁠Dukestar69 on GitHub · 2026-12-01 16:23 UTC · original · approved these changes

Reviewed crates/victory-gpu/src/host.rs: factoring SwapChainRetry::waiting(now) and short-circuiting resize preparation (avoiding settle_now(WHY_SYNC) and streamline::resizing()) while in retry backoff is clean and avoids redundant stalls on failing swap-chain resizes. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib swap_chain -- --test-threads=1 (1 passed, 0 failed).

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-12-01 16:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4923#pullrequestreview-6135368926) · **approved these changes** Reviewed crates/victory-gpu/src/host.rs: factoring SwapChainRetry::waiting(now) and short-circuiting resize preparation (avoiding settle_now(WHY_SYNC) and streamline::resizing()) while in retry backoff is clean and avoids redundant stalls on failing swap-chain resizes. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib swap_chain -- --test-threads=1 (1 passed, 0 failed). Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github-bot closed this pull request 2026-12-01 18:30:29 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:28 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:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4923#issuecomment-7320996104) 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!4924
No description provided.