gpu: coalesce concurrent failed low-memory window searches #3293

Merged
spk-c merged 1 commit from upstream-pr/3293 into main 2026-11-30 14:12:01 +00:00
spk-c commented 2026-11-29 21:22:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by spk-c on 2026-11-29T21:22:53Z.


What it changes

The one-second backoff in upload::reserve checks an atomic before VirtualAlloc2, so simultaneous requests can enter expensive searches of a full address window. The cooldown also starts before the potentially long failed search.

Serialize only the slow fallback search and start the cooldown when a failure completes. Early and pooled allocations remain outside the new mutex. Successful fallback searches may now queue behind one another; the trade-off needs measurement.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Not yet tested in-game; planned on RTX 4090, Series X, with matching settings and RT-heavy streaming.
  • Before: concurrent fallback searches can bypass the cooldown; time spent in a failed call consumes the cooldown (source inspection).
  • After: concurrent failures are coalesced and the cooldown begins at completion (source inspection). FPS and frametimes not measured.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A.
  • cargo test passed for the crates it touches: no, not yet run. Added tests for a slow failed search and concurrent callers.
  • Windows CI: run 46311135502 stopped at Clippy because victory-loader::unwind_copy is unused, outside the changed file. No successful test run is claimed.
  • Planned: cargo test -p victory-gpu upload --locked, then compare low-window warnings, successful allocation latency, p95/p99 and worst frame time on the same streaming route.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3271 addresses first-upload headroom; #3078 addresses oversized GPU uploads; #2723 and #2133 address XMem address-space placement. None of those changes upload.rs. No duplicate found in the searched results.

AI assistance

Prepared with AI assistance; gameplay validation and human review remain pending.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5555261284 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3293). Originally posted by [spk-c](https://github.com/spk-c) on 2026-11-29T21:22:53Z. --- ## What it changes The one-second backoff in `upload::reserve` checks an atomic before VirtualAlloc2, so simultaneous requests can enter expensive searches of a full address window. The cooldown also starts before the potentially long failed search. Serialize only the slow fallback search and start the cooldown when a failure completes. Early and pooled allocations remain outside the new mutex. Successful fallback searches may now queue behind one another; the trade-off needs measurement. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Not yet tested in-game; planned on RTX 4090, Series X, with matching settings and RT-heavy streaming. - Before: concurrent fallback searches can bypass the cooldown; time spent in a failed call consumes the cooldown (source inspection). - After: concurrent failures are coalesced and the cooldown begins at completion (source inspection). FPS and frametimes not measured. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A. - `cargo test` passed for the crates it touches: no, not yet run. Added tests for a slow failed search and concurrent callers. - Windows CI: [run 46311135502](https://github.com/spk-c/VIctory-NVIDIA/actions/runs/46311135502) stopped at Clippy because `victory-loader::unwind_copy` is unused, outside the changed file. No successful test run is claimed. - Planned: `cargo test -p victory-gpu upload --locked`, then compare low-window warnings, successful allocation latency, p95/p99 and worst frame time on the same streaming route. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3271 addresses first-upload headroom; #3078 addresses oversized GPU uploads; #2723 and #2133 address XMem address-space placement. None of those changes upload.rs. No duplicate found in the searched results. ## AI assistance Prepared with AI assistance; gameplay validation and human review remain pending.
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!3293
No description provided.