Retry temporary stand-in texture allocation failures #4863

Closed
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/4863 into main
andrewpozdnakov7-jpg commented 2026-12-01 12:00:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T12:00:17Z.


What it changes

The gray stand-in textures are created lazily. If the first creation returns None, the current OnceLock<Option<_>> caches that failure until the program exits. All later requests for that texture kind fall back to a null view even after memory is available again.

Cache only successful creations. When an attempt fails, wait one second before trying that kind again. A successful cached lookup still uses one OnceLock::get.

How it was tested

  • Ran the exact initializer on Windows with Rust 1.98.1 and a synthetic allocator that fails the first flat-texture request. Main 5fabb46e and release v2026.11.30.03 stayed empty after the allocator could succeed. c9e0b97a1ff739fe5287a2544edb175350618337 skipped the attempt at 999 ms, recovered at 1,000 ms, and reused the new texture.
  • A separate texture kind still initialized during the flat kind's cooldown, and four concurrent calls initialized one cube texture.
  • cargo xtask policy --staged passed for the one changed file. This fixture covers initialization and retry.
  • Main's CI check has five existing Clippy errors tracked in #4707.

Checked for overlap

  • Searched for stand-in allocation failures and retry logic. #3241 concerns ordinary cached views and their eviction, #4806 concerns two fallback descriptor heaps, and #4859 reports slot rewrites. The slot counts in #4859 do not identify a stand-in allocation failure.

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5585245724 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4863). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T12:00:17Z. --- ## What it changes The gray stand-in textures are created lazily. If the first creation returns `None`, the current `OnceLock<Option<_>>` caches that failure until the program exits. All later requests for that texture kind fall back to a null view even after memory is available again. Cache only successful creations. When an attempt fails, wait one second before trying that kind again. A successful cached lookup still uses one `OnceLock::get`. ## How it was tested - Ran the exact initializer on Windows with Rust 1.98.1 and a synthetic allocator that fails the first flat-texture request. Main `5fabb46e` and release `v2026.11.30.03` stayed empty after the allocator could succeed. `c9e0b97a1ff739fe5287a2544edb175350618337` skipped the attempt at 999 ms, recovered at 1,000 ms, and reused the new texture. - A separate texture kind still initialized during the flat kind's cooldown, and four concurrent calls initialized one cube texture. - `cargo xtask policy --staged` passed for the one changed file. This fixture covers initialization and retry. - Main's [CI check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) has five existing Clippy errors tracked in #4707. ## Checked for overlap - [x] Searched for stand-in allocation failures and retry logic. #3241 concerns ordinary cached views and their eviction, #4806 concerns two fallback descriptor heaps, and #4859 reports slot rewrites. The slot counts in #4859 do not identify a stand-in allocation failure. 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.
trustno1-coder commented 2026-12-01 18:30:17 +00:00 (Migrated from github.com)

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


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:7321051049 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4863#issuecomment-7321051049). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:30:17Z. --- 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!4863
No description provided.