perf(gpu): opt-in best-fit texture pool placement to reduce fragmentation #543
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!543
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-543"
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?
@fladit123 on GitHub · 2026-11-28 00:36 UTC · original
fladit123:perf/texture-pool-best-fit→main· +168 −30 · 1 files · 1 commits · openSummary
Adds an experimental, opt-in best-fit placement policy for the texture pool, intended to preserve larger contiguous free ranges and reduce heap growth under fragmentation.
First-fit remains the default.
Enable the experimental policy with:
Implementation
Experimental results
The comparative campaign covered 70 deterministic CPU workload scenarios and physical D3D12 validation on NVIDIA RTX 4060 (8 GiB) and Microsoft WARP.
Compared with the same candidate with best-fit disabled:
Best-fit increased full-trace heap capacity in 44 of 70 scenarios. This is an important trade-off: preserving contiguous ranges does not necessarily make entire heaps easier to reclaim.
Synthetic mutex contention benchmarks also showed higher allocation costs than first-fit. The pruning optimization reduced execution time by approximately 10–14% relative to the earlier unpruned best-fit implementation, without changing placement decisions in 10,000 deterministic equivalence cases.
The comparative campaign also measured a median paired throughput reduction of approximately 5% with eight threads when the feature was disabled, relative to clean upstream. This result warrants further investigation.
Relationship to #399
This proposal is distinct from the fullest-block-first policy and VRAM growth gate introduced in #399.
Two controlled physical scenarios demonstrated complementary strengths on both RTX 4060 and WARP:
Best-fit can preserve larger contiguous ranges, while fullest-block-first can concentrate allocations and facilitate whole-heap reclamation.
The policies should not be considered universally superior to one another. Coordination with #399's VRAM gate may be useful.
Validation
64d4931: 11 passed with best-fit disabled and 11 passed with best-fit enabled.The comparative full-library suites reproduced the same three failures on clean upstream and both candidate settings. No additional test failures were observed in the candidate.
The comparative performance measurements remain tied to their pinned test base. Initial fixture failures and corrected reruns were retained in the experimental evidence.
Limitations
Disclosure
AI-assisted implementation, benchmarking and analysis. Tests were executed on local hardware. No proprietary game data or assets were used in this investigation.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.