GPU: honor the staging spare limit when returned ranges become reusable #1343
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1343
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1343"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ghptc on GitHub · 2026-11-28 17:42 UTC · original
ghptc:fix/staging-allocation-spare-limit→main· +91 −29 · 1 files · 1 commits · openThe budget sweep allows one idle staging block under host pressure and zero under critical commit pressure. When returned ranges finish resting between sweeps, the next allocation reloads the texture spare limit. It can keep empty 64 MiB upload buffers beyond the staging budget until a later sweep gets the mutex.
Publish the staging limit before trying the pool lock. Each pool reads its own limit when allocating. With a zero limit, reserve a reusable range for the current request before dropping the other empty blocks. Texture allocations retain their existing trim order and ripe-block selection.
Measured on an RTX 5070
A synthetic fixture on Proton Experimental and NVIDIA 620.73.04 filled four 64 MiB D3D12 upload buffers through the production pool. It returned seven of the eight half-blocks, supplied the critical spare limit while they were resting, then advanced the allocator clock to the existing rest deadline and requested the other half of the still-live block. The growth callback refused new allocations.
These bytes count D3D12 resources still owned by the pool. The fixture supplies the pressure state directly. Physical runs used a 1 GiB high watermark, 2 GiB hard cap and zero swap. The allocator regression failed on the base with two unexpected idle blocks. All 11 pool tests passed on the proposed source, including whole-block reuse at zero budget, recovery, delayed return and ripe texture selection. Reproduce the submitted regressions with
cargo test --locked -p victory-gpu --lib pool::tests:: -- --test-threads=1on Windows.The duplicate check included the host texture sweep, the optional texture spare scaling, driver calls outside the pool lock, and reusable texture-budget accounting. Those changes address different paths. #394 · #784 · #816 · #1214
The diagnostic-feature cross-check and staged asset policy passed locally. Upstream Windows CI stopped at the same Clippy findings on the PR and its base, in
victory-shader/src/emit/mod.rs:2768andvictory-gpu/src/shadow.rs:1708. PR check · Base checkView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.