victory-gpu: segregate single-slot and table dynamic descriptors (#747) #949
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!949
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/949/head"
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?
@Sakura-Byte on GitHub · 2026-11-24 14:25 UTC · original
Sakura-Byte:pr/dynamic-slots-segregated→main· +286 −34 · 1 files · 1 commits · closed without mergingSummary
n == 1) and bottom-up multi-slot table (n > 1) cursors insideDynamicPoolso single-slot churn does not fragment multi-slot table space while preserving release reuse.MIN_DYNAMICfrom1 << 16(65,536) to1 << 17(131,072) for capped heaps while preservingPORTABLE_VIEWSclamping.HostHeaptests coveringfree_space/free_table, non-fragmentation betweenn == 1andn > 1, exhaustion without overlap, release reuse, and 128KMIN_DYNAMIC.Verification
cargo xtask policyandcargo clippy --locked -- -D warnings: cleanAI-assisted; synthetic tests only, zero game assets.
@MichaelSmithAI on GitHub · 2026-11-24 14:46 UTC · original
With capacity held at eight slots, the same allocation sequence and three table releases left six free slots in both allocators. The baseline’s longest contiguous run was two slots. With the two search directions, all six free slots were contiguous. This isolates a placement effect from the separate increase in the capped heap reserve.
All nine descriptor tests on the author revision passed on RTX 4090 under Wine/vkd3d-proton 3.2. An allocator-only port that retained our comparison build’s existing capacity and guard passed twelve tests, including a free range straddling the search cursor. The eight-slot trace is synthetic. To attribute a title allocation failure to fragmentation, the useful measurements at that failure are the request width, total free slots, and largest contiguous run in the same heap.
@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
db91a48:cargo test -p victory-gpupasses, 56 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@R0D4X on GitHub · 2026-11-24 15:45 UTC · original
RTX 5080 (Blackwell, Wave32) A/B Test of #949 and #1024
Environment:
min=32, max=32, 1M capped shader-visible view heap), Windows 11mainffe310e+#439,#578,#334,#492,#646,#635,#987,#669,#984,#986,#452,#946,#948,#688#949(minor test-only merge conflict incrates/victory-gpu/src/descriptor/host.rs) +#1024(clean merge)1.0.2.1, scripted menu entry (VICTORY_KEYS), noVICTORY_SKIP_WAVE64, noVICTORY_SHADER_LOOP_LIMIToverride (no game assets attached)0 being made, ~440–480 draws/frame)diag+ DRED + Debug Layer)#949+#1024,diag+ DRED + Debug Layer)#949+#1024, no DRED / no Debug Layer, release codegen)dropped=512(n=254, even with#688)00slow host submission(>250 ms)000001.5(peak1.6)1.4–1.6(peak1.6)1.3–1.6(peak1.6)preparing(copies)251 ms(115 ms)241 ms(104 ms)184–229 ms(68–90 ms)on the GPU122 ms131 ms106–134 mscopying back301 ms(35.1 MB/frame)322 ms(14.1 MB/frame, tail264–285 ms)315–385 ms(13.1–14.9 MB/frame)Findings:
#949completely eliminates dynamic descriptor exhaustion on NVIDIA's 1M view heap — drops fell from512+(n=254, triggered by#986's fresh tables even with#688) down to0across both the 210 s debug-layer run and the 150 s no-debug run.#1024cuts copied-back volume by ~60% (35.1 MB/frame→14.1 MB/frame) with zero hangs or debug-layer errors. However,copying backwall time remained ~264–322 ms(with Debug Layer) and ~315–385 ms(without DRED/Debug Layer), indicating that copy-back latency at ~28 submissions/frame is dominated by per-submission readback sync / write-watch overhead rather than memcpy bandwidth.@hamdog0203 on GitHub · 2026-11-24 16:26 UTC · original
Tested unmodified
db91a48independently on Windows 11 (Build 26200), NVIDIA GeForce RTX 4060 (driver621.35, 32-lane waves), and Rust1.98.1:Verification results
cargo clippy --workspace --all-targets --locked -- -D warnings: passcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passcargo test -p victory-gpu --locked -- --nocapture descriptor::host::tests: 9/9 passed on RTX 4060 (free_table_chooses_the_first_contiguous_fit_in_cursor_order,dynamic_pool_segregates_singles_and_tables_to_exhaustion_without_overlap,a_free_table_can_straddle_the_search_cursor,single_slot_allocations_do_not_fragment_multi_slot_tables,capped_view_heap_uses_128k_min_dynamic, and all existing tests)cargo test --workspace --locked(RTX 4060): all workspace tests pass (victory-gpu: 56 passed, 0 failed, 1 benchmark ignored;victory-shader: 89 passed, 1 ignored;xtaskpolicy: 4 passed)HostHeap::new(false, PORTABLE_VIEWS + 1)):main(ffe310e): capped at1,000,000withcount = 934,464,dynamic = 65,536#949(db91a48): capped at1,000,000withcount = 868,928,dynamic = 131,072main(ffe310e): botha_free_table_can_straddle_the_search_cursor(returnedNoneinstead ofSome(4)) andsingle_slot_allocations_do_not_fragment_multi_slot_tablesfail againstmain.Non-blocking review notes
MIN_DYNAMICfrom1 << 16(65,536) to1 << 17(131,072) reduces staticcounton a1,000,000-capped NVIDIA heap from934,464to868,928; worth noting if any title accesses heap slots in868,928..934,464before full view remapping lands.rustfmt --checkformatting diffs exist incrates/victory-gpu/src/descriptor/host.rs(not gated by CI).Synthetic tests and RTX 4060 hardware only; no game data. AI-assisted.
@NuraadGit on GitHub · 2026-11-24 16:26 UTC · original
On the size: 2^17 may be too small for the full world on a capped heap. @R0D4X's zero drops were at ~440–480 draws per frame, and the world runs several times that once more programs translate.
no dynamic slots for its tablescounter reached 524,288 while 422–440 draws ran per frame. With 2^18, no such drop in any world run since, up to ~2,830 draws per frame and 12 minutes (heap line:capped at 1000000,count=1245184).Less fragmentation may lower the need, so I'd judge the two parts apart: this allocator at 2^18, logging peak occupied slots in the world, would show whether 2^17 is enough. If it isn't, AimLogin's layout (#747) gives the 1M heap 262,144 dynamic slots without cutting uncapped hosts. #902 also uses 2^17, so the same question applies there.
AI-assisted (Claude Code): the runs and log analysis were automated. The hardware, title copy and runs are the user's.
@MartinIndra02 on GitHub · 2026-11-24 17:25 UTC · original
Independent verification at
db91a48on Windows 11, NVIDIA GeForce RTX 3080 (driver621.24, 1M-capped view heap) + WARP, Rust1.98.1:cargo test -p victory-gpu --lib -- --test-threads=1(RTX 3080): 56 passed, 0 failed, 1 ignored (including all new dynamic-pool segregation and 128KMIN_DYNAMICtests).VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --lib -- --test-threads=1(WARP): 56 passed, 0 failed, 1 ignored.VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1(D3D12 Debug Layer): 59 passed, 0 failed, 1 ignored (0 debug-layer errors).cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): 0 warnings.cargo xtask policy: 153 files ok.No game data used. AI-assisted; all builds and GPU tests executed on my machine.
@Marvisak on GitHub · 2026-11-25 00:28 UTC · original
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #1548. Main avoids single-slot fragmentation of the dynamic range another way (root views take runs of 256, memory pairs sit past the dynamic slots); the larger dynamic range on capped heaps is #1548's.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed