perf(gpu): opt-in best-fit texture pool placement to reduce fragmentation #543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by fladit123 on 2026-11-28T00:36:41Z.
Summary
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:34Z.
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.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by fladit123 on 2026-11-30T04:30:42Z.
Thanks for the guidance!
I've updated the implementation for the current main and opened a replacement PR: #3711.
The updated patch preserves the fullest-block-first default, the new pool accounting, and unlocked heap creation. I've also repeated the comparative benchmarks and D3D12 validation on my RTX 4060 and WARP, documenting both the benefits and the trade-offs.
The feature remains experimental and opt-in.
Thanks again for your time!
Pull request closed