gpu: scale dynamic descriptor pool on capped heaps (NVIDIA) #3300
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!3300
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3300"
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?
@AdvaitPalve11 on GitHub · 2026-11-26 16:24 UTC · original
AdvaitPalve11:feat/gpu-capped-heap-dynamic-pool→main· +109 −21 · 1 files · 1 commits · openOn NVIDIA hardware, shader-visible CBV/SRV/UAV heaps fail creation past PORTABLE_VIEWS (1,000,000). Previously, HostHeap::new skipped count + DYNAMIC whenever (count + DYNAMIC).max(HEAP_VIEWS) failed, and capped large heaps down to MIN_DYNAMIC (65,536) dynamic slots.
Because 2^16 dynamic slots can exhaust in seconds in the world (#59) and high-index tables also spill into dynamic slots on capped heaps, draws can be dropped or trigger device removal.
Extract allocate_view_heap() to try count + DYNAMIC before capping.
Reserve CAPPED_DYNAMIC (2^17 = 131,072) dynamic slots when capping huge heaps at PORTABLE_VIEWS, preserving all title slots up to PORTABLE_VIEWS - CAPPED_DYNAMIC.
Probe HEAP_VIEWS support in dynamic_slots_are_held_until_released so capped NVIDIA GPUs assert >= 4 + DYNAMIC instead of panicking on the 2M Tier-3 check.
Add unit test view_heap_allocation_scales_on_capped_hosts covering Tier 3, NVIDIA capped layouts, and fallback behavior.
@HLVM04 on GitHub · 2026-11-26 16:26 UTC · original
A hardware data point for the capped-heap sizes here, from the fork (fxceless/victory-fork), not
mainor this PR:PORTABLE_VIEWS.Limits: one early scene, a different tree, and we have not run this PR. Demand varies by scene: #747 has a 600 s scripted cell-block walk on another fork that still refused 944 tables a frame at 2^18. So 2^17 may be tight in places our runs don't reach.
aeeb3cb251to01f91fea96@Dukestar69 on GitHub · 2026-11-26 16:49 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):
allocate_view_heapcleanly scales the(kept, dynamic)split on 1M-capped NVIDIA heaps (reserving the fullDYNAMICpool on capped heaps while falling back toMIN_DYNAMICon smaller caps) and fixesdynamic_slots_are_held_until_releasedon RTX 5090.cargo test -p victory-gpu --lib descriptor::host::tests:: -- --test-threads=1(RTX 5090): 16 passed, 0 failed (includingdynamic_slots_are_held_until_releasedandview_heap_allocation_scales_on_capped_hosts).VICTORY_FORCE_WARP=1 cargo test -p victory-gpu --lib descriptor::host::tests:: -- --test-threads=1(WARP): 16 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@upipibi on GitHub · 2026-11-26 17:52 UTC · original · edited 2026-11-26 20:13 UTC
Verified #3300 at
01f91fea96on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, rustc 1.98.1. main63bcca43as control for the shared tests (view_heap_allocation_scales_on_capped_hostsis added by this PR, so it ran on the PR head only), each tree in its own target dir,--locked,--test-threads=1. Synthetic tests only.memory::x3view_heap_allocation_scales_on_capped_hostsx5dynamic_slots_are_held_until_releasedx5cargo test -p victory-gpu --libSo the PR fixes
dynamic_slots_are_held_until_releasedon this card. The remaining failure ismemory::tests::lists_share_a_table_and_copies_keep_their_views("past the dynamic slots", memory.rs:1030), identical on main (#3178, #1744). No nvlddmkm resets.AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
@borosf on GitHub · 2026-11-26 19:03 UTC · original
Independent local verification on Windows 11 x64, Intel Arc B580 12 GB (12 cores), at this PR's head
01f91fe:Result: victory-gpu lib: 231 passed / 1 failed (memory::tests::lists_share_a_table_and_copies_keep_their_views, known baseline). Notably descriptor::host::tests::dynamic_slots_are_held_until_released now PASSES on this B580 with the PR in, and the new view_heap_allocation_scales_on_capped_hosts test passes too.
Both clippy runs exit 0 (-D warnings, both feature sets). The B580 baseline failures pristine main also hits are: victory-gpu descriptor::host::tests::dynamic_slots_are_held_until_released + memory::tests::lists_share_a_table_and_copies_keep_their_views (#1744/#1829); victory-shader emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros + emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products. This PR appears to fix one of the two #1744/#1829 heap-cap failures on capped (1,000,000-view) Intel heaps.
Synthetic tests only; no game data used. Full log kept locally. — borosf
@fuzeofficlal on GitHub · 2026-11-26 20:24 UTC · original · approved these changes
Verified locally merged onto
origin/main(63bcca43) at PR head01f91feaacross three real adapters on Windows 11 x64 (VICTORY_D3D12_DEBUG=1,--features diagnostics):crates/victory-gpu/src/descriptor/host.rs(allocate_view_heapL109-L140,HostHeap::newL184-L206,dynamic_slots_are_held_until_releasedL2264-L2285):checked_add/saturating_add) tryingmax(count + DYNAMIC, HEAP_VIEWS)->count + DYNAMIC->PORTABLE_VIEWS(preserving the fullDYNAMIC= 262,144 pool and keeping up to 737,856 title slots) ->count + MIN_DYNAMIC.descriptor::host::tests::dynamic_slots_are_held_until_releasedon 1M-capped NVIDIA hardware while keeping fullHEAP_VIEWSchecks on uncapped adapters.cargo xtask policy: 191 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features): 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib -- descriptor::host::tests:: --test-threads=1:VICTORY_D3D12_DEBUG=1): 16/16 passed (1.92s, includingdynamic_slots_are_held_until_releasedandview_heap_allocation_scales_on_capped_hosts).VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1): 16/16 passed (3.87s).allocate_view_heapdirectly against realCreateDescriptorHeapcalls on every adapter:0x10de, Tier 3, 1M cap):count=4->(262148, 4, 262144),500k->(762144, 500000, 262144),800k->(1000000, 737856, 262144),1M->(1000000, 737856, 262144).0x1002, Tier 3): all four sizes stay uncapped at(2097152, count, 262144).0x1414, Tier 3): all four sizes stay uncapped at(2097152, count, 262144).count = 0, exact737_856/737_857boundary,u32::MAX,100_000tiny-cap fallback, and full 262,144-slot exhaustion/release/reuse on a live RTX 5090HostHeap::new(false, 4).memory::tests::lists_share_a_table_and_copies_keep_their_viewsstill passes on WARP and fails atmemory.rs:1030on RTX 5090 identically tomain(separate baseline issue).CAPPED_DYNAMIC (2^17 = 131,072), while the code at01f91feareserves the fullDYNAMIC(2^18 = 262,144, leaving737,856title slots) — worth syncing the PR description text.Synthetic tests only; looks ready to merge.
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.