Repository navigation
Conversation
fladit123
marked this pull request as ready for review
November 28, 2026 00:37
Owner
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.