fix: avoid unnecessary VIctory tile heap allocations #316
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!316
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-316"
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?
@mauroalvare on GitHub · 2026-11-26 02:32 UTC · original
mauroalvare:codex/victory-tile-pool-fit→main· +282 −13 · 2 files · 3 commits · openChange
Neptune's levels-on-demand texture path maps mips into a pool of 64 MiB D3D12 heaps. The first heap with enough total free tiles can have the only space available for a large mip. If a smaller mip takes that space, the large one needs a new heap even when the smaller mip could have used a tighter fit.
Pick the existing heap with the fewest free tiles that can satisfy the request. Stop looking at an exact fit and maintain the free count under the pool lock so selection does not have to sum each heap's free ranges. Texture levels still map using the tile ranges selected by the allocator. D3D12 tile mappings
Verification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880. The same test was built on the base and on the fix in the release profile with diagnostics for adapter selection.Two heaps start with 768 and 256 tiles free. The larger free space spans two separate ranges. Each of eight rounds maps a 256-tile mip followed by a 768-tile mip and releases both. The test writes both textures before reading three RGBA markers from each, including the far corner of the large mip in the second range. The base passes marker readback and fails the two-heap bound. The fix passes both checks on the RTX 5070 Ti and on WARP.
RTX 5070 Ti, driver 621.40. Five alternating pairs after one warm-up pair, with a fresh process and tile pool for each run. Heap bytes are the pool's D3D12 heap sizes. CPU time is the median for reservation and mapping across all eight rounds.
tiles::tests::levels_on_demand_on_the_cardfixture also passed on WARP when run by name with--ignored --nocapture --test-threads=1.victory-gpurelease test binaries with--test-threads=1both reported 196 passed, 3 failed and 4 ignored. The same three failures reproduce on the base:spans_say_the_next_start_and_the_lowest_level_viewed,warp_card_fetch_copies_flagged_pieces_to_their_slots, andwarp_card_patch_writes_the_masked_bytes_and_no_others.cargo xtask policy— 200 files OK.python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools— All checks passed.python -m pytest -rawithANYXBOXX_REQUIRE_RUNTIME=1— 1665 passed in 89.83 s, zero skipped. Reused the C++, Rust and TomBox binaries built from the same source inputs.Oracle and test data
The fixture generates the RGBA markers from the round and sample indices and reads them back byte for byte through D3D12. The reservations and textures are synthetic. AI-assisted with OpenAI Codex.
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.