Release swept pool blocks outside allocator locks #4394

Closed
github-bot wants to merge 1 commit from github-bot/gh-4393 into main AGit
Owner

@⁠sklzygit on GitHub · 2026-11-30 19:44 UTC · original
sklzygit:contrib/pool-release-outside-lock → main · +47 −12 · 1 files · 1 commits · closed without merging

What it changes

The periodic pool sweep destroys retired D3D12 heaps/upload buffers while holding their allocator mutex. If a driver release stalls, other threads cannot allocate or return pieces to that pool. Collect the retired block handles under the lock, then release them after unlocking.

Pool selection, block sizes, budgets, quarantine, counters and busy-pool try-lock behavior stay unchanged. The allocation-path rested call retains its existing synchronous release behavior. No background worker, new switch, or deferred resource queue is added.

How it was tested

  • Windows, Ryzen 7 9800X3D; no game assets or gameplay test required for the lock regression.
  • cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1: 31 passed, 3 ignored on upstream e1251c31 plus this patch.
  • The new regression fixture blocks a synthetic destructor and verifies that the allocator mutex remains available and the retired block/accounting have already left the pool.
  • Before: the destructor executes while the pool guard is held. After: the same sweep returns handles and drops them after the guard is released.
  • Changed-file asset policy: 1 file OK. git diff --check passes.
  • Shader wave sizes: not applicable. Focused GPU-crate tests passed; the entire crate suite was not rerun for this isolated branch.

No in-game FPS, RAM/VRAM reduction, or total hitch reduction is claimed.

Checked for overlap

  • Searched open PRs and current main. #4138 handles release/reaping in other subsystems and does not change pool.rs; #3858 bounds texture-table sweeps. This isolates the allocator-lock lifetime in pool.rs. It is independent of the block-selection index in #4220.

Current-main revalidation (2026-12-01)

Rebased as one focused commit 3395ad5f directly on upstream 5fabb46e, removing the obsolete upstream-history divergence from the PR comparison. No unrelated launcher, shader or dependency changes.

Hardware for the local checks: Windows 11, Ryzen 7 9800X3D, GeForce RTX 5080 16 GB, 32 GB system RAM, NVIDIA driver 621.40 (32.0.16.2140). These PRs are generic allocator/host changes; the tests below are not gameplay measurements. The local game profile is Series X, output 2560×1440, DLSS Quality, 30 FPS base cap, frame generation off in the latest recorded playtest, ray tracing off. The focused regression tests do not launch the game or depend on this profile.

  • cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1: 31 passed, 0 failed, 3 ignored.
  • Changed-file asset policy and git diff --check origin/main...HEAD: passed.
  • Full workspace tests and GitHub CI were not claimed passed; no new in-game performance result.
**@⁠sklzygit** on GitHub · 2026-11-30 19:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4393) `sklzygit:contrib/pool-release-outside-lock` → `main` · +47 −12 · 1 files · 1 commits · closed without merging ## What it changes The periodic pool sweep destroys retired D3D12 heaps/upload buffers while holding their allocator mutex. If a driver release stalls, other threads cannot allocate or return pieces to that pool. Collect the retired block handles under the lock, then release them after unlocking. Pool selection, block sizes, budgets, quarantine, counters and busy-pool try-lock behavior stay unchanged. The allocation-path `rested` call retains its existing synchronous release behavior. No background worker, new switch, or deferred resource queue is added. ## How it was tested - Windows, Ryzen 7 9800X3D; no game assets or gameplay test required for the lock regression. - `cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1`: **31 passed, 3 ignored** on upstream `e1251c31` plus this patch. - The new regression fixture blocks a synthetic destructor and verifies that the allocator mutex remains available and the retired block/accounting have already left the pool. - Before: the destructor executes while the pool guard is held. After: the same sweep returns handles and drops them after the guard is released. - Changed-file asset policy: **1 file OK**. `git diff --check` passes. - Shader wave sizes: not applicable. Focused GPU-crate tests passed; the entire crate suite was not rerun for this isolated branch. No in-game FPS, RAM/VRAM reduction, or total hitch reduction is claimed. ## Checked for overlap - [x] Searched open PRs and current main. #4138 handles release/reaping in other subsystems and does not change `pool.rs`; #3858 bounds texture-table sweeps. This isolates the allocator-lock lifetime in `pool.rs`. It is independent of the block-selection index in #4220. ## Current-main revalidation (2026-12-01) Rebased as one focused commit `3395ad5f` directly on upstream `5fabb46e`, removing the obsolete upstream-history divergence from the PR comparison. No unrelated launcher, shader or dependency changes. Hardware for the local checks: Windows 11, Ryzen 7 9800X3D, GeForce RTX 5080 16 GB, 32 GB system RAM, NVIDIA driver 621.40 (32.0.16.2140). These PRs are generic allocator/host changes; the tests below are not gameplay measurements. The local game profile is Series X, output 2560×1440, DLSS Quality, 30 FPS base cap, frame generation off in the latest recorded playtest, ray tracing off. The focused regression tests do not launch the game or depend on this profile. - `cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1`: **31 passed, 0 failed, 3 ignored**. - Changed-file asset policy and `git diff --check origin/main...HEAD`: passed. - Full workspace tests and GitHub CI were not claimed passed; no new in-game performance result.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 19:46:01 +00:00
github-bot force-pushed github-bot/gh-4393 from f0b829340b to 3395ad5fb1 2026-12-01 04:14:08 +00:00 Compare
Author
Owner

@⁠albertik322-sudo on GitHub · 2026-12-01 17:00 UTC · original

Tested as part of a batch cherry-picked onto main @ 5fabb46e (with #3943, #4394, #4395 together). PC: RTX 3070 Laptop 8 GB, i7-11800H, 32 GB RAM, Windows 11. Series S, DLSS Performance, FG x4.

No isolated measurement — but the batch showed no regressions over multiple 20+ minute sessions: fps medians stable or slightly up (17.4 to 17.8 in light scenes), no crashes, no visual corruption. Posting mostly to confirm it runs fine on a memory-tight 8 GB laptop, which is probably the harshest environment for anything touching allocator locking.

**@⁠albertik322-sudo** on GitHub · 2026-12-01 17:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4393#issuecomment-7318604365) Tested as part of a batch cherry-picked onto main @ 5fabb46e (with #3943, #4394, #4395 together). PC: RTX 3070 Laptop 8 GB, i7-11800H, 32 GB RAM, Windows 11. Series S, DLSS Performance, FG x4. No isolated measurement — but the batch showed no regressions over multiple 20+ minute sessions: fps medians stable or slightly up (17.4 to 17.8 in light scenes), no crashes, no visual corruption. Posting mostly to confirm it runs fine on a memory-tight 8 GB laptop, which is probably the harshest environment for anything touching allocator locking.
github-bot closed this pull request 2026-12-01 18:43:45 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:42 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4393#issuecomment-7321372185) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4394
No description provided.