Credit the texture budget only for reusable pool ranges #1214

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

@⁠ghptc on GitHub · 2026-11-28 15:43 UTC · original
ghptc:fix/texture-pool-budget-room → main · +35 −4 · 1 files · 1 commits · closed without merging

The texture admission and idle-eviction paths subtract free texture-pool space from reported video-memory usage. The old calculation credited a piece at final COM release, even though the allocator keeps it resting for 2,500 ms before admitting another placement there.

In an isolated synthetic run, a 64 MiB block held one 16 MiB piece. Releasing the last reference to its reclamation token left 48 MiB in free ranges and 16 MiB resting. The budget reported 64 MiB. With this change the same probe reported 48 MiB, then 64 MiB after reclaim, and zero after trimming the block.

Track free bytes under the same lock as the ranges. Growth, reservation, reclaim and trimming update the counter. The budget lookup now reads that counter directly. The accompanying regression fills a block, releases a piece, attempts an allocation before it matures, reuses the piece, and trims the empty block.

cargo test --locked -p victory-gpu --lib pool::tests::budget_room_tracks_free_ranges_through_release_reuse_and_trim -- --exact

The regression passed in a Windows-target release build under Wine. The measurement concerns reusable capacity in the allocator. Changes in driver residency and physical VRAM remain unmeasured.

Windows CI stopped before the test stage on the same two Clippy diagnostics as the base commit, in victory-shader/src/emit/mod.rs:2768 and victory-gpu/src/shadow.rs:1708. PR run · Base run

**@⁠ghptc** on GitHub · 2026-11-28 15:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1214) `ghptc:fix/texture-pool-budget-room` → `main` · +35 −4 · 1 files · 1 commits · closed without merging The texture admission and idle-eviction paths subtract free texture-pool space from reported video-memory usage. The old calculation credited a piece at final COM release, even though the allocator keeps it resting for 2,500 ms before admitting another placement there. In an isolated synthetic run, a 64 MiB block held one 16 MiB piece. Releasing the last reference to its reclamation token left 48 MiB in free ranges and 16 MiB resting. The budget reported 64 MiB. With this change the same probe reported 48 MiB, then 64 MiB after reclaim, and zero after trimming the block. Track free bytes under the same lock as the ranges. Growth, reservation, reclaim and trimming update the counter. The budget lookup now reads that counter directly. The accompanying regression fills a block, releases a piece, attempts an allocation before it matures, reuses the piece, and trims the empty block. ```sh cargo test --locked -p victory-gpu --lib pool::tests::budget_room_tracks_free_ranges_through_release_reuse_and_trim -- --exact ``` The regression passed in a Windows-target release build under Wine. The measurement concerns reusable capacity in the allocator. Changes in driver residency and physical VRAM remain unmeasured. Windows CI stopped before the test stage on the same two Clippy diagnostics as the base commit, in `victory-shader/src/emit/mod.rs:2768` and `victory-gpu/src/shadow.rs:1708`. [PR run](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46161327858) · [Base run](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46157117122)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:43:37 +00:00
Author
Owner

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-28 16:52 UTC · original

Since Windows CI stopped before the tests (and this ran under Wine): native Windows 11 26300 (MSVC, Rust 1.98.1), RTX 5060 Ti; current main + this PR (merged together with #1213/#1214, which touch different files).

cargo test --release --locked -p victory-gpu --lib -- --exact pool::tests::budget_room_tracks_free_ranges_through_release_reuse_and_trim → passed.

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-28 16:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1214#issuecomment-7242578183) Since Windows CI stopped before the tests (and this ran under Wine): native Windows 11 26300 (MSVC, Rust 1.98.1), RTX 5060 Ti; current `main` + this PR (merged together with #1213/#1214, which touch different files). `cargo test --release --locked -p victory-gpu --lib -- --exact pool::tests::budget_room_tracks_free_ranges_through_release_reuse_and_trim` → **passed**.
github-bot closed this pull request 2026-11-28 19:24:55 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-28 19:22 UTC · original

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

**@⁠trustno1-coder** on GitHub · 2026-11-28 19:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1214#issuecomment-7244498111) Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

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!1214
No description provided.