GPU: retry CPU snapshot allocations after releasing idle buffers #360

Open
github-bot wants to merge 1 commit from github-bot/gh-360 into main AGit
Owner

@⁠avt0m4t48 on GitHub · 2026-11-24 23:53 UTC · original
avt0m4t48:fix/snapshot-pool-allocation-retry → main · +10 −1 · 1 files · 1 commits · open

Refs #321.

A CPU snapshot pool miss currently calls Vec::with_capacity even when the pool still holds idle buffers of other sizes. If that allocation fails, the process exits without releasing those buffers. Try the exact allocation first. When it fails, clear the idle pool and make one final attempt. Pool hits still reuse the same buffers, and an empty pool takes the direct path.

The idle pool owns buffers only after their snapshots have finished. This change is separate from #47's retention cap and #200's admission rules.

I exercised the exact pool code with a test allocator that rejected an 8,396,800-byte request while a reusable 1 MiB allocation was held. Main exited on the rejected request. This branch released the idle buffer and succeeded on its second attempt. The normal pool miss and exact-fit reuse controls passed on both revisions. Windows MSVC GPU test targets type-checked with diagnostics and warnings denied.

The size in #321 is also possible in texture scratch allocation. These checks establish recovery for the snapshot-pool path. The reported game crash and Windows commit-pressure behavior still need runtime confirmation.

AI-assisted using Codex.

**@⁠avt0m4t48** on GitHub · 2026-11-24 23:53 UTC · [original](https://github.com/fxceless/victory-fork/pull/360) `avt0m4t48:fix/snapshot-pool-allocation-retry` → `main` · +10 −1 · 1 files · 1 commits · open Refs #321. A CPU snapshot pool miss currently calls `Vec::with_capacity` even when the pool still holds idle buffers of other sizes. If that allocation fails, the process exits without releasing those buffers. Try the exact allocation first. When it fails, clear the idle pool and make one final attempt. Pool hits still reuse the same buffers, and an empty pool takes the direct path. The idle pool owns buffers only after their snapshots have finished. This change is separate from #47's retention cap and #200's admission rules. I exercised the exact pool code with a test allocator that rejected an 8,396,800-byte request while a reusable 1 MiB allocation was held. Main exited on the rejected request. This branch released the idle buffer and succeeded on its second attempt. The normal pool miss and exact-fit reuse controls passed on both revisions. Windows MSVC GPU test targets type-checked with diagnostics and warnings denied. The size in #321 is also possible in texture scratch allocation. These checks establish recovery for the snapshot-pool path. The reported game crash and Windows commit-pressure behavior still need runtime confirmation. AI-assisted using Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:41:38 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/360/head:github-bot/gh-360'
git switch 'github-bot/gh-360'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-360'
git switch 'github-bot/gh-360'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-360'
git switch 'github-bot/gh-360'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-360'
git switch 'main'
git merge --squash 'github-bot/gh-360'
git switch 'main'
git merge --ff-only 'github-bot/gh-360'
git switch 'main'
git merge 'github-bot/gh-360'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.