[pr-fix][rendering] Skip resize preparation while retry is cooling down #244

Open
andrewpozdnakov7-jpg wants to merge 1 commit from andrewpozdnakov7-jpg/Darner:port/4923-skip-resize-preparation-during-backoff into main
First-time contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

After a failed swap-chain resize, the existing retry guard blocks further ResizeBuffers calls for a second. The presentation path currently waits on the GPU and notifies DLSS and FSR before it reaches that guard. Check the same deadline before preparation. Eligible attempts follow the original path.

Restores locally saved VIctory-NVIDIA work from December 1, 2026. Recovered revision: f017360. Adapted by andrewpozdnakov7-jpg (GitHub profile).

How it was tested

  • Tested revision: a14e39d on f3840d7.
  • Commands and results: A standalone Rust fixture compiled the retry gates from both revisions. Across 120 synthetic frames with failing resize calls, preparations fell from 120 to 2 and both revisions made two actual attempts. Successful recovery cleared the pause. cargo check --locked -p darner-gpu --lib --tests, xtask policy, and git diff --check passed.
  • Changes a default: no.
  • Gates run on that revision: none of the three workspace-wide gates.
  • Coverage gaps: Injected resize outcomes. No real swap-chain failure or gameplay.

Checklist

  • I ran this change in the game.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #222 changes VSync behavior but not the resize retry deadline.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: <!-- optional --> ## What it changes After a failed swap-chain resize, the existing retry guard blocks further ResizeBuffers calls for a second. The presentation path currently waits on the GPU and notifies DLSS and FSR before it reaches that guard. Check the same deadline before preparation. Eligible attempts follow the original path. Restores locally saved VIctory-NVIDIA work from December 1, 2026. Recovered revision: f017360. Adapted by [andrewpozdnakov7-jpg](https://git.gtahub.st/andrewpozdnakov7-jpg) ([GitHub profile](https://github.com/andrewpozdnakov7-jpg)). ## How it was tested - Tested revision: a14e39d on f3840d7. - Commands and results: A standalone Rust fixture compiled the retry gates from both revisions. Across 120 synthetic frames with failing resize calls, preparations fell from 120 to 2 and both revisions made two actual attempts. Successful recovery cleared the pause. cargo check --locked -p darner-gpu --lib --tests, xtask policy, and git diff --check passed. - Changes a default: no. - Gates run on that revision: none of the three workspace-wide gates. - Coverage gaps: Injected resize outcomes. No real swap-chain failure or gameplay. ## Checklist - [ ] I ran this change in the game. - [x] This PR contains one change based on main. - [x] The diff follows docs/asset-policy.md. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #222 changes VSync behavior but not the resize retry deadline. - Replaces or overlaps: none found
Adapt locally saved VIctory-NVIDIA work from December 1, 2026 (f017360). Skip waiting on the GPU and notifying DLSS and FSR while the existing resize retry gate is closed.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
First-time contributor

Independent Windows build, gate, and code-read review of a14e39d4e (based on main f3840d73d). Not run in-game.

Environment

  • Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (x86_64-pc-windows-msvc), MSVC 19.44.35230.

Measured results

  • Gate 1 (cargo clippy --workspace --all-targets --locked -- -D warnings): PASS
  • Gate 2 (cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASS
  • cargo xtask policy: PASS (asset policy: 555 files ok)
  • cargo test --locked -p darner-gpu --lib host::tests: PASS (123 passed; 0 failed; 3 ignored in 1.47 s).

Code-read audit

  • Confirmed the bug on main (crates/darner-gpu/src/host.rs:20185-20196): during resize retry cooldown, every mismatched frame ran settle_now(WHY_SYNC), streamline::resizing(), and streamline::fsr::resizing() before retry.attempt(...) returned None.
  • Sharing Presentation::retry between presenter() (:20139) and ResizeBuffers (:20190) is consistent, and the two Instant::now() calls (waiting then attempt) are monotonic-safe.
  • Minor non-blocking note: lines 20157-20183 (p.pace.take(true) -> p.show(...), present_aside::wait(), and Composer::new / composer_aside) still execute before the cooldown check at :20190. In particular, if planes.is_some() and Composer::new fails during a resize cooldown, each frame still retries composer creation and falls back to show_base_only() before reaching retry.waiting. Since buffers (:20184) only reads pure switch/state flags, moving the (width, height, format, buffers) + retry.waiting early return above :20157 would skip that work too. Adding a direct retry.waiting(...) assertion in host.rs:2762 would also keep the new helper covered in-tree.

Verdict: PASS (with minor optional polish note).

AI-assisted: yes (Gemini 4 Neon).

Independent Windows build, gate, and code-read review of `a14e39d4e` (based on `main` `f3840d73d`). Not run in-game. ### Environment - Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (`x86_64-pc-windows-msvc`), MSVC 19.44.35230. ### Measured results - Gate 1 (`cargo clippy --workspace --all-targets --locked -- -D warnings`): **PASS** - Gate 2 (`cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`): **PASS** - `cargo xtask policy`: **PASS** (`asset policy: 555 files ok`) - `cargo test --locked -p darner-gpu --lib host::tests`: **PASS** (`123 passed; 0 failed; 3 ignored` in 1.47 s). ### Code-read audit - Confirmed the bug on `main` (`crates/darner-gpu/src/host.rs:20185-20196`): during resize retry cooldown, every mismatched frame ran `settle_now(WHY_SYNC)`, `streamline::resizing()`, and `streamline::fsr::resizing()` before `retry.attempt(...)` returned `None`. - Sharing `Presentation::retry` between `presenter()` (`:20139`) and `ResizeBuffers` (`:20190`) is consistent, and the two `Instant::now()` calls (`waiting` then `attempt`) are monotonic-safe. - Minor non-blocking note: lines `20157-20183` (`p.pace.take(true)` -> `p.show(...)`, `present_aside::wait()`, and `Composer::new` / `composer_aside`) still execute before the cooldown check at `:20190`. In particular, if `planes.is_some()` and `Composer::new` fails during a resize cooldown, each frame still retries composer creation and falls back to `show_base_only()` before reaching `retry.waiting`. Since `buffers` (`:20184`) only reads pure switch/state flags, moving the `(width, height, format, buffers)` + `retry.waiting` early return above `:20157` would skip that work too. Adding a direct `retry.waiting(...)` assertion in `host.rs:2762` would also keep the new helper covered in-tree. **Verdict:** PASS (with minor optional polish note). AI-assisted: yes (Gemini 4 Neon).
Author
First-time contributor

Thanks for the independent Windows check. The 123 passing host tests and the code-read confirm the cooldown now skips the GPU settle and frame generation resize notifications. The composer can still do its existing preparation before that check. I am keeping that separate because this PR changes the retry path after a resize failure.

Thanks for the independent Windows check. The 123 passing host tests and the code-read confirm the cooldown now skips the GPU settle and frame generation resize notifications. The composer can still do its existing preparation before that check. I am keeping that separate because this PR changes the retry path after a resize failure.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'port/4923-skip-resize-preparation-during-backoff:andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git rebase 'main'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git rebase 'main'
git switch 'main'
git merge --no-ff 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'main'
git merge --squash 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'main'
git merge --ff-only 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git switch 'main'
git merge 'andrewpozdnakov7-jpg-port/4923-skip-resize-preparation-during-backoff'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
TrustNo1/Darner!244
No description provided.