Log the texture pool's blocks and free ranges on request #411
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
old-names
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!411
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-411"
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?
@safesearch77 on GitHub · 2026-11-28 13:25 UTC · original
safesearch77:feat/pool-stats-census→main· +60238 −5432 · 206 files · 661 commits · closed without mergingVICTORY_POOL_STATS=1(off by default) adds one log line every five seconds from the sweep. It describes the texture pool:<= 64 KiB,<= 256 KiB,<= 1 MiB,<= 4 MiB, larger)The last count is nonzero only under
VICTORY_POOL_SMALL=0or with the AMD default. On other cards Vice-Tay already places small textures at 4 KiB.The goal is to show pool fragmentation without a capture. Blocks only go back to the card when they are wholly empty, so the free space inside blocks still counts as card memory in use.
room()already subtractspool::texture_room()from use. This line shows how that free space is split up.Placement doesn't change. Each texture made or released costs two relaxed counter updates. With the switch on, it also costs one
GetResourceAllocationInfoper texture made. WithVICTORY_SWEEP=0the line doesn't appear.Ported from
trustno1-coder/VIctory-NVIDIA@ecfa1a6(1mosce). Changes from the original:VICTORY_POOL_SMALL=0, which is not Vice-Tay's default.docs/this-fork.mdentry under "Measuring".Verification (Linux,
GE-Proton11-14Wine runner,x86_64-pc-windows-msvc)crate::host::host()isNone(no D3D12 host in that harness). Both new census tests (pool::tests::the_census_counts_what_is_free_resting_and_how_full_blocks_areandpool::tests::textures_are_counted_by_their_piece) are pure CPU tests, so they do run and pass.cargo +1.98.1 test -p victory-gpu --lib(Wine):524 passed; 5 failed(default) and590 passed; 6 failed(--features diagnostics), matching untouchedmain(fe7c6e5); zero new failures.cargo +1.98.1 clippy -p victory-gpu --all-targets -- -D warnings: clean, both default and--features diagnostics.cargo +1.98.1 xtask policy:asset policy: 322 files ok.vkd3d-proton(RTX 4070 Laptop 8 GB, CachyOS,GE-Proton11-14-viewtree, Wayland, DLSS Quality,VICTORY_POOL_STATS=1,VICTORY_VRAM_HEADROOM_MB=1024), captured cleanly every 5s, e.g.:texture blocks (VICTORY_POOL_STATS=1): 26 of them (1664 MB), 688 MB held by 14740 textures, 972 MB free now in 4729 ranges (the largest 65536 KB; 683 MB of it in ranges of 1 MiB and more), 2 MB resting, 2 blocks empty; blocks by how full: 12 under a quarter, 4 under a half, 4 under three quarters, 6 above; textures by their piece: 13999 of 64 KiB (163 MB), 359 to 256 KiB (47 MB), 228 to 1 MiB (127 MB), 138 to 4 MiB (250 MB), 16 larger (99 MB); 0 of them could lie at multiples of 4 KiB and would hold 0 MB where they hold 0 MB@TaynanGT on GitHub · 2026-11-29 11:35 UTC · original
Thanks for the pool diagnostics. The distinction between total free bytes and the largest contiguous range is useful for fragmentation. Please keep logging and collection overhead negligible when the option is off.
@safesearch77 on GitHub · 2026-11-29 13:20 UTC · original
Gated
counted(...)in bothtexture()andrelease()behindif stats_on(), so whenVICTORY_POOL_STATSis off (the default) neitherLIVEnorSMALLERatomic counters are updated per texture allocation/release — only the cachedOnceLockcheck runs (verified by code inspection). Also switchedstats()to sumlivepiece bytes instead of readingHELD(removed in#439'sf581aea), and addedpool_stats_switch_is_off_unless_set_to_oneto test env-var parsing across unset, empty,0,true, and1. Once#439lands, I'm happy to rebase the remaining 3 mechanical hunks inpool.rs(census()besidereusable_bytes(),release(), andtexture()) ontomain.Verified with Wine
victory-gpu --lib -- pool::tests(13/13pass),clippy --all-targets -- -D warnings, andcargo xtask policy(322 files ok).@TaynanGT on GitHub · 2026-11-29 14:39 UTC · original
Thanks for gating the counters when pool statistics are disabled. Keeping the default allocation and release path free of atomic updates is important. I will retain the switch test and check the census against the current pool implementation before integrating the remaining hunks.
@TaynanGT on GitHub · 2026-11-30 17:08 UTC · original
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed