Pool: what the texture blocks hold, in the log every five seconds (VICTORY_POOL_STATS=1, off by default) #79

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

@⁠1mosce on GitHub · 2026-11-27 17:08 UTC · original
1mosce:pool-stats → main · +186 −3 · 1 files · 1 commits · open

What

VICTORY_POOL_STATS=1 (off by default) writes one line about the texture pool every five seconds: the blocks and how full they are (in quarters), the bytes free now and in how many ranges, the largest of those, the pieces that rest, the live textures by the size of their piece, and what the small ones would hold at multiples of 4 KiB (VICTORY_POOL_SMALL).

Nothing about how pieces are cut changes. Without the switch a texture costs two counters when it is made and when it goes; with it, one more GetResourceAllocationInfo for each texture made.

Why

the texture queue's room says how much of the blocks is free, not how it lies or why. On an 8 GiB card that was the difference between "the pool is fragmented" and "small textures take 64 KiB each", which need different fixes.

What it showed

RTX 4070 Laptop (8 GiB), Ryzen 9 8945HS, 32 GB, Series S profile, DLSS Balanced, no frame generation.

Five minutes into a run with VICTORY_POOL_SMALL=0 (the launcher's setting):

  • 57 blocks (3,648 MB) for 2,387 MB of textures; 1,260 MB of them free in 1,655 ranges; 25 blocks less than half full and none empty, so none goes back to the card;
  • 13,363 of 15,836 live textures in pieces of 64 KiB; 13,748 could lie at multiples of 4 KiB and would hold 222 MB where they held 907 MB.

With VICTORY_POOL_SMALL=1 the next run, six minutes: 20,000 to 38,000 live textures in 40 to 45 blocks (2,560 to 2,880 MB), 2,024 MB held on average, the card 560 to 780 MB under its budget, 2 % of the queue's slots held back for room where the run before had 9 %, and no device loss. That is one run on one NVIDIA card; I am not proposing to change the launcher's default on it.

Tests

the_census_counts_what_is_free_resting_and_how_full_blocks_are, textures_are_counted_by_their_piece. cargo test -p victory-gpu --lib pool:: passes (9 tests); clippy has no warning in pool.rs, plain and with diagnostics.

CI: on main (d12eb1b) cargo clippy --workspace --all-targets -- -D warnings stops at crates/victory-formats/src/texture.rs:1346 (clippy::precedence), and two tests fail on this machine with and without this change: indirect::tests::host_list_budget_starts_empty_at_each_submission and indirect::tests::warp_batch_charges_every_execution.

**@⁠1mosce** on GitHub · 2026-11-27 17:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/79) `1mosce:pool-stats` → `main` · +186 −3 · 1 files · 1 commits · open ## What `VICTORY_POOL_STATS=1` (off by default) writes one line about the texture pool every five seconds: the blocks and how full they are (in quarters), the bytes free now and in how many ranges, the largest of those, the pieces that rest, the live textures by the size of their piece, and what the small ones would hold at multiples of 4 KiB (`VICTORY_POOL_SMALL`). Nothing about how pieces are cut changes. Without the switch a texture costs two counters when it is made and when it goes; with it, one more `GetResourceAllocationInfo` for each texture made. ## Why `the texture queue's room` says how much of the blocks is free, not how it lies or why. On an 8 GiB card that was the difference between "the pool is fragmented" and "small textures take 64 KiB each", which need different fixes. ## What it showed RTX 4070 Laptop (8 GiB), Ryzen 9 8945HS, 32 GB, Series S profile, DLSS Balanced, no frame generation. Five minutes into a run with `VICTORY_POOL_SMALL=0` (the launcher's setting): - 57 blocks (3,648 MB) for 2,387 MB of textures; 1,260 MB of them free in 1,655 ranges; 25 blocks less than half full and none empty, so none goes back to the card; - 13,363 of 15,836 live textures in pieces of 64 KiB; 13,748 could lie at multiples of 4 KiB and would hold 222 MB where they held 907 MB. With `VICTORY_POOL_SMALL=1` the next run, six minutes: 20,000 to 38,000 live textures in 40 to 45 blocks (2,560 to 2,880 MB), 2,024 MB held on average, the card 560 to 780 MB under its budget, 2 % of the queue's slots held back for room where the run before had 9 %, and no device loss. That is one run on one NVIDIA card; I am not proposing to change the launcher's default on it. ## Tests `the_census_counts_what_is_free_resting_and_how_full_blocks_are`, `textures_are_counted_by_their_piece`. `cargo test -p victory-gpu --lib pool::` passes (9 tests); clippy has no warning in `pool.rs`, plain and with `diagnostics`. CI: on `main` (d12eb1b) `cargo clippy --workspace --all-targets -- -D warnings` stops at `crates/victory-formats/src/texture.rs:1346` (`clippy::precedence`), and two tests fail on this machine with and without this change: `indirect::tests::host_list_budget_starts_empty_at_each_submission` and `indirect::tests::warp_batch_charges_every_execution`.
One line of the texture pool's state: the blocks and how full they are (in quarters), the bytes free now and in how many ranges, the largest of those, the pieces that rest, the live textures by the size of their piece, and what the small ones would hold at multiples of 4 KiB (VICTORY_POOL_SMALL).

Nothing about how pieces are cut changes. Without the switch a texture costs two counters when it is made and when it goes; with it, one more GetResourceAllocationInfo for each texture made.

What it showed on an RTX 4070 Laptop (8 GiB), Series S profile, five minutes into a run with VICTORY_POOL_SMALL=0: 57 blocks (3,648 MB) for 2,387 MB of textures, 1,260 MB of them free in 1,655 ranges, 25 blocks less than half full and none empty; 13,363 of 15,836 textures in pieces of 64 KiB, and 13,748 that would hold 222 MB at multiples of 4 KiB where they held 907 MB. With VICTORY_POOL_SMALL=1 the next run of six minutes held 20,000 to 38,000 textures in 40 to 45 blocks, with no device loss.

Tests: the census over a pool (free, resting, how full), and the size classes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:15:18 +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/79/head:github-bot/gh-79'
git switch 'github-bot/gh-79'

Merge

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