GPU: release CPU reservations when by-address setup fails #1525
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1525"
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?
Imported from fxceless/victory-fork. Originally posted by Swagi-REDACTED on 2026-11-29T06:24:28Z.
A failed GPU backing allocation or copy registration in
Memory::anotherabandoned a 64 MiB CPU allocation made withMEM_RESERVE | MEM_COMMIT. Retrying could leak another 64 MiB each time. Directory setup had the same ownership gap if its backing copy or faults buffer failed.What changed
The CPU reservation now owns its Windows allocation until setup succeeds. An early return releases it with
VirtualFree(..., MEM_RELEASE). Successfully published areas retain their existing lifetime.Evidence
A local integration run of A newer retail game logged 224 failed 64 MiB shared-buffer requests in 3.4 seconds. Between adjacent five-second samples, process private commit rose from 23,722 to 38,349 MiB. Multiple paths call the shared-buffer allocator, so the log alone cannot attribute every failure or the entire increase to this leak.
The regression uses a small Windows allocation and checks its state with
VirtualQueryafter abandoning it. Before adding cleanup it remainedMEM_COMMIT. With cleanup it isMEM_FREE.Tested
Windows 11, Ryzen 7 9800X3D, 16 GiB RAM, GeForce RTX 3060 12 GiB, Rust 1.98.1.
cargo +1.98.1 test --release --locked --offline -j 2 -p victory-gpu --lib -- --test-threads=1 --nocapture(local target directory omitted).368967ff7d3d0fBoth failed
indirect::tests::host_list_budget_starts_empty_at_each_submissionandindirect::tests::warp_batch_charges_every_execution.Not tested
Full workspace, end-to-end memory savings, and frame-rate impact.
AI use
Codex, GPT-6 (exact serving variant unavailable), traced the failure path, wrote the fix and regression, and ran the comparisons.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.