GPU: throttle failed swap-chain creation and resize #1626

Manually merged
github merged 1 commit from gh-pr/1626/head into gh-pr/1626/base 2026-11-26 04:38:48 +00:00
Owner

@⁠AwsAli05 on GitHub · 2026-11-24 19:56 UTC · original
AwsAli05:gpu/throttle-swap-chain-retries → main · +79 −18 · 1 files · 1 commits · merged 2026-11-25 00:23 UTC

Fixes #1591. Thanks to @⁠fiestorra for identifying the per-frame DXGI calls and documenting the failure.

When DXGI refuses swap-chain creation or resize, wait one second before repeating the operation. The retry state lives beside the presenter under the existing lock. Frames that match an already working swap chain can still present during a failed resize's cooldown. Creation failures identify the failing step and log the requested dimensions and format.

The regression test simulates two seconds of frames at 60 Hz during a desktop outage. Only two calls reach the failing operation. It also verifies that a successful attempt immediately clears the cooldown.

On Windows, the GPU diagnostics suite passed 54 tests with one ignored benchmark. Clippy passed for the GPU crate with all targets and features. The regression used synthetic inputs.

**@⁠AwsAli05** on GitHub · 2026-11-24 19:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1626) `AwsAli05:gpu/throttle-swap-chain-retries` → `main` · +79 −18 · 1 files · 1 commits · merged 2026-11-25 00:23 UTC Fixes #1591. Thanks to @⁠fiestorra for identifying the per-frame DXGI calls and documenting the failure. When DXGI refuses swap-chain creation or resize, wait one second before repeating the operation. The retry state lives beside the presenter under the existing lock. Frames that match an already working swap chain can still present during a failed resize's cooldown. Creation failures identify the failing step and log the requested dimensions and format. The regression test simulates two seconds of frames at 60 Hz during a desktop outage. Only two calls reach the failing operation. It also verifies that a successful attempt immediately clears the cooldown. On Windows, the GPU diagnostics suite passed 54 tests with one ignored benchmark. Clippy passed for the GPU crate with all targets and features. The regression used synthetic inputs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:44 +00:00
github manually merged commit f0967745ef into gh-pr/1626/base 2026-11-26 04:38:48 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 22:14 UTC · original

Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current main (70564ae):

cargo test -p victory-gpu passed failed ignored
main 76 2 1
main + this PR 77 2 1
main, --all-features 79 2 -
main + this PR, --all-features 80 2 -
  • The new test passes.
  • No GPU test skipped for lack of a device.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.
  • Two victory-gpu tests fail on current main on this NVIDIA card: dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 22:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/1626#issuecomment-7145988415) Tested on Windows 11, RTX 4070 SUPER (driver 621.14), with the repo toolchain, merged into current `main` (70564ae): | `cargo test -p victory-gpu` | passed | failed | ignored | |---|---|---|---| | `main` | 76 | 2 | 1 | | `main` + this PR | 77 | 2 | 1 | | `main`, `--all-features` | 79 | 2 | - | | `main` + this PR, `--all-features` | 80 | 2 | - | - The new test passes. - No GPU test skipped for lack of a device. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. - Two `victory-gpu` tests fail on current `main` on this NVIDIA card: `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`. That's the 1,000,000-view heap cap, see #1744. They fail the same way with this PR, and no other test does. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>
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/Marvisak--VIctory!1626
No description provided.