GPU: preserve full DYNAMIC descriptor range when host view heap is capped at PORTABLE_VIEWS #1548
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!1548
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1548"
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?
@n-romanovich on GitHub · 2026-11-24 19:02 UTC · original
n-romanovich:fix/nvidia-dynamic-descriptor-slots→main· +60 −13 · 1 files · 4 commits · openSummary
Fixes Issue #1496, #747.
Preserves the full
DYNAMIC(2^18= 262,144) descriptor range when a host view heap is capped atPORTABLE_VIEWS(1,000,000, e.g., on NVIDIA) instead of shrinking it toMIN_DYNAMIC(2^16= 65,536):crates/victory-gpu/src/descriptor/host.rs: whencount + DYNAMIC > PORTABLE_VIEWSandmake(count + DYNAMIC)fails, allocatePORTABLE_VIEWSwithcount = PORTABLE_VIEWS - DYNAMIC(737,856) anddynamic = DYNAMIC(262,144).draw.rs::tables()already remaps any table entry>= host.count()into dynamic slots, preventing thousands of world draws from being dropped for lack of dynamic slots.checked_add/saturating_addfor heap size calculations and update theMIN_DYNAMICdoc comment.capped_heap_keeps_full_dynamic_range.Testing
Tested on Windows 11, NVIDIA GeForce RTX 5060 Ti:
cargo clippy --workspace --all-targets --locked -- -D warnings(pass)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(pass)cargo test -p victory-gpu --locked(51 passed, 0 failed, 1 ignored)AI-assisted: implemented and reviewed with AI assistance.
@ThomasHFWright on GitHub · 2026-11-24 19:04 UTC · original
Related Linux/RTX5090 evidence for the 737856 mirrored / 262144 dynamic split: I just tested the one-line capped-tuple variant from #747 on our
proton-fixes+ #852/#454/#206 diagnostic stack. The observed title heap has1245184 slots, so that variant reaches the same split as this PR on this input.Allocation-warning counter reached32768 with65536 dynamic slots and was zero with262144. The latter still showed incomplete debug geometry and later hit the #774 title CPU lookup spin, without a kernel Xid or GPU-fence timeout. Full setup, checks and limits: #747
This is not an exact-head test of4002dd7: your revised decision order, overflow handling and new test were not in that build. It supports the capacity change on this capped Linux setup, not every new branch or a claim that it fixes the whole world render. No duplicate PR needed from our side.
AI-assisted testing with Codex; no game-derived attachments.
@n-romanovich on GitHub · 2026-11-24 19:13 UTC · original
Thanks for testing and sharing the Linux / RTX 5090 numbers!
Great to see the allocation-warning counter drop from 32,768 to 0 on the 1,245,184-slot heap — I also observed the exact same
count=1245184 capped=737856 dynamic=262144split on Windows 11 with an RTX 5060 Ti.I've also linked #747 in the PR description since this addresses the same underlying
MIN_DYNAMICexhaustion.@Ender1Dragon on GitHub · 2026-11-24 19:17 UTC · original
Verified on RTX 3080 Ti, driver 32.0.16.2101, Windows 11 build 26300,
main@ 2026-11-24, release+diagnostics. Applied this branch and rebuilt (10 s). Same dump, same launch arguments.Before (main):
My instrumented build reported the first failure as:
After (this branch):
Note
count=1,245,184here, which is 24% pastPORTABLE_VIEWSrather than just over it, so this exercises the capped branch from further out than the 5060 Ti run. Frames captured from the same window went from a 1.8 MB peak to 4.1 MB, and the world no longer drops binds.3D world content itself is still mostly black on this card, but that is the separate shader/refusal path (#71), not this fix. Slot exhaustion is gone.
@n-romanovich on GitHub · 2026-11-24 19:22 UTC · original
Awesome, thanks for testing and confirming the fix! Glad to see the slot exhaustion is completely resolved.
@YaBulochka on GitHub · 2026-11-24 19:26 UTC · original
Linux/RADV data point: the fix does what it says, but the warning it adds is loud.
ffe310e+ #994 + #491 + this PRThe title asks for 1,245,184 views against the 1,000,000 cap, exactly the shape in #1496. With this PR the log shows:
Before the PR it mirrored 934,464 with no dynamic range. In a 90-second run:
title slot past the host heap: 507,328 lines;for_draw=true: 0.So no draw loses its slot any more - that part is confirmed on RADV. The run still ends, but on an unrelated
vkCreate*Pipelinesshader (the pipeline journal catches it and refuses it on the next start), not on the heap.The one thing worth changing: 507k warnings for 90 seconds produce a 110 MB log, which makes the rest of the log hard to read and costs time. A single line per index range, or a counter printed once per frame or once at exit, would keep the diagnostic without the flood. The
for_draw=falsecase in particular seems to be "a title slot exists that no draw uses", which is not an error at all.I will keep this build as my baseline and report whether the world draws return once the journal ratchet gets past the remaining pipelines.
@Impre-visible on GitHub · 2026-11-24 19:35 UTC · original
Test result for the idea of this PR on Linux (Wine from GE-Proton11-6 + vkd3d-proton, GTX 1660, NVIDIA 620.73.04), where the view heap is capped (
count=1245184 host_limit=1000000).I could not merge the branch as is (it conflicts with #1523 in
descriptor/host.rs, which I already had), so I applied the same idea on top of #1523: the capped heap keepsDYNAMICslots instead ofMIN_DYNAMIC.a draw or dispatch dropped: no dynamic slots for its tableswarnings in one run to about frame 1950-2050MIN_DYNAMIC(main)MIN_DYNAMIC+ #1523DYNAMIC(this PR's idea)No device removal in any of the three. These drops only show once indirect execution actually runs (under Wine that needs the native
d3dcompiler_47, see my note on #523). The final image is still dark in all three, so I cannot say whether the 507,328 left-out title slots are ever read.@Bullet18x on GitHub · 2026-11-24 20:07 UTC · original
RTX 5090 (driver 621.40, Windows 11 10.0.28000), head
4002dd7onffe310e, diag build, in the world: log showshost view heap capped at 1000000 count=1245184 capped=737856 dynamic=262144, and nono dynamic slots for its tablesdrops at all (onmainthe same machine reachesdropped=8192, on #1520's branchdropped=262144). The run still ends inDXGI_ERROR_DEVICE_HUNG~37 s into the world (as onmain), so on this machine the dynamic-slot shortage is not what hangs. Trade-off to note: 507,328 of the title's 1,245,184 slots are now outside the heap (310,720 withMIN_DYNAMIC). Details of the other experiments: #1586.AI use: Claude Code (Claude Opus 5.5) built, ran and summarised; I checked it.
@Bladureau on GitHub · 2026-11-24 20:12 UTC · original
Tested
4002dd7in the title on an RTX 4060 Laptop (8 GB). No more dynamic-slot drops. The picture is still black, for another reason (below).Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB, title 1.0.2.1 (exe BLAKE3
b99f876b74d4a77f…). This PR is merged ontomainffe310ewith #578 (fb7facd, so the world does not hang on this card) and #334 (c99e429), all cleanly. Diag build,VICTORY_D3D12_DRED=1. I played into the first mission's intro by hand. The log shows the expected split:host view heap capped at 1000000 count=1245184, 737,856 mirrored + 262,144 dynamic.main+ #578 + #334 + this PRno dynamic slots for its tables/no free dynamic descriptor slotsdropped=reached 512 to 65,536From the frame report at the end of the run: 1.0 fps, 968 ms/frame. 636 ms of that is preparation, mostly about 2 GB of refreshes per frame, and 225 ms is on the GPU. 442 draws/frame run. Per frame, 3,777 draws and dispatches are dropped without a host pipeline, plus 5,012 indirect executions. In the per-pipeline list, about four fifths of those drops are pipelines #578 refuses (wave64 mesh and compute), and the rest are shaders that do not translate. So on this card, with #578, the wave64 refusals are now what keeps the picture empty, not the descriptor slots.
@Marvisak on GitHub · 2026-11-25 01:30 UTC · original · edited 2026-11-26 00:25 UTC
Automated triage for the maintainers.
Needs work. Thank you for working through the earlier points. In
HostHeap::new(crates/victory-gpu/src/descriptor/host.rs) the comment now says that slots past the cap are left out, which is accurate. The.max(views)problem is gone, andCAPPED_PAIRSleaves room for the copy pairs. Testers on several NVIDIA cards and RADV confirm that theno dynamic slotsdrops disappear, and one measured more draws per frame. What still stands:main. As you say in your reply, there is no count yet of draws reading the dropped slots (713,280..934,464) through the heap. That evidence is what would let this land.count + MIN_DYNAMIC <= PORTABLE_VIEWS - CAPPED_PAIRS. A title heap of about 909,900..934,464 slots, whichmainkeeps whole (make(count + MIN_DYNAMIC)fits under 1,000,000), now falls to the capped branch and keeps only 713,280. Please make the step continuous, for example by keepingmin(count, PORTABLE_VIEWS - MIN_DYNAMIC - CAPPED_PAIRS)withMIN_DYNAMICbefore dropping to theDYNAMICsplit. Please also say where 24,576 comes from: a tester needed 16,384, and #1777 reserves 3 slots for the null buffer views.capped_heap_keeps_full_dynamic_rangecreates two million-slot heaps. A tester reported that this made timing-sensitive tests running beside it intermittently fail. One heap would do.You also note that #2177 supersedes this PR, and #1777 conflicts with it in the same function. If you plan to rely on #2177, saying so here or closing this PR would help the maintainers.
CI: passing (
check).Generated by Claude Code
@n-romanovich on GitHub · 2026-11-25 01:44 UTC · original
@Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.
@astrosteveo on GitHub · 2026-11-25 02:43 UTC · original
On the triage point about heaps between 737,856 and 934,464 slots: I reproduced it on an RTX 5080 (Wine 11.22, vkd3d-proton 3.1, driver 620.73.04), and one word fixes it.
Adding this to
capped_heap_keeps_full_dynamic_rangefails at7866124(left: 737856, right: 934464):With the new branch taken only when the smaller range does not fit either, it passes:
The title's heap (1,245,184) still gets your split. Both changes are one commit on top of your head, to cherry-pick if you like:
github.com/astrosteveo/VIctory@6763ec7948cargo test -p victory-gpu --lib: 139 passed, 5 failed, 2 ignored; the 5 also fail onmain940d32fhere. Clippy forx86_64-pc-windows-msvc: clean. No title run yet, so this says nothing on the other point, whether the title reads the slots between 737,856 and 934,464 through the heap.AI-assisted (Claude).
@n-romanovich on GitHub · 2026-11-25 05:56 UTC · original
@Marvisak, updated
fix/nvidia-dynamic-descriptor-slots(75e202b) so thePORTABLE_VIEWScap fallback only runs on overflow:HostHeap::newnow triescount + DYNAMIC, thencount + MIN_DYNAMIC, and only falls back toPORTABLE_VIEWS(737,856title slots +DYNAMIC) whencount + MIN_DYNAMIC > PORTABLE_VIEWS.countbetween737,856and934,464now keep all of their title slots on 1M-capped hosts instead of being truncated.@n-romanovich on GitHub · 2026-11-25 07:11 UTC · original
@Marvisak, added the middle-range assertion (
count = PORTABLE_VIEWS - MIN_DYNAMIC) tocapped_heap_keeps_full_dynamic_rangeinbf0004cand verified on RTX 5060 Ti (1 passed; 0 failed):PORTABLE_VIEWS - MIN_DYNAMICkeeps all934,464title slots whilePORTABLE_VIEWSkeeps the fullDYNAMIC(2^18) range.On the open trade-off:
737,856..934,464still keeps all title slots as noted; we don't have a separatefor_draw=truehistogram for737,856..934,464specifically to settle whether directResourceHeapreads ever target that slice on 1,245,184-slot titles.@neonbyte1 on GitHub · 2026-11-25 08:15 UTC · original
Same change as the one I measured on #747 (RTX 5090, Wine + vkd3d-proton): with the capped heap keeping
DYNAMICslots, theno dynamic slotswarnings went from 20 to 0 per run, and the indirect calls dropped asprepare failedfor kinds 1 and 2 stopped. Without it,main940d32flogstitle slot past the host heapabout 84,000 times before world entry on that card.AI-assisted (Claude); measured on my machine.
@Machad3x on GitHub · 2026-11-25 11:35 UTC · original · edited 2026-11-25 11:37 UTC
RTX 3080 Ti (driver 621.24, Windows 11 26300): the dynamic-slot drops are gone; two tests need a small change on this card
Base:
main940d32fplus other open fixes, including #1751, with this PR (75e202b) on top. The title asks for 1,245,184 views.no dynamic slots for its tablesdropped=32768One run per build, so run-to-run variation is not measured.
With this PR as it is, on top of #1751, two tests failed here:
descriptor::host::tests::dynamic_slots_are_held_until_released(65,536 vs 262,144): the resolved fallback chain no longer had #1751's(count + DYNAMIC).max(PORTABLE_VIEWS)step for a small title heap.memory::tests::lists_share_a_table_and_copies_keep_their_views(past the dynamic slots):(PORTABLE_VIEWS - DYNAMIC) + DYNAMICfills the heap, leaving nothing for the copies' view pairs.Both pass locally after keeping #1751's step before the
MIN_DYNAMICone and capping title slots atPORTABLE_VIEWS - DYNAMIC - 2^14, so that 16,384 slots stay for pairs. The run in the table is with that change. The null buffer views still do not fit (no room for the null buffer views).AI-assisted (Claude Code).
@Spaghetih on GitHub · 2026-11-25 21:53 UTC · original
Measured on an RTX 4070 Ti (12 GB, driver 32.0.16.2124 / 621.24), i7-13700KF, Windows 11 26200, title 1.0.2.1, Series X, diag build, 9-minute runs into the intro cutscene in the world.
Tree:
main13f91ca+ #233, #454, #89, #1906, #2178, #2098, then #1777 and #2634, then this PR.Without this PR (the capped heap keeps
MIN_DYNAMIC), the world dropped draws for lack of dynamic slots every frame:With it:
host view heap capped at 1000000 count=1245184 kept=737853 dynamic=262144, and no "no dynamic slots" drop at all in 9 minutes, no device removal. Draws per world frame peaked at 10,452 (6,263 without it). Frame rate stayed about the same (0.7-2 fps with it, 0.2-1.9 without; the run without it also had a cold pipeline library), so the gain here is the draws, not speed.Combining it with #1777: they conflict in
HostHeap::new. #1777 removesPORTABLE_VIEWS(the cap isheap_views()) and keeps the heap's last three slots for the null buffer views and the clamped index; this PR's split (737,856 + 262,144 = 1,000,000) leaves no room for them. I kept both rules:With that,
cargo test -p victory-gpupasses on this card, including #1777's null-view tests. One caveat for the test here: making a second million-slot heap incapped_heap_keeps_full_dynamic_rangeslowed the timing-sensitive tests running beside it into intermittent failures (3 in 8 full runs; 8/8 green with the test skipped). A single capped heap in that test kept the suite stable.AI-assisted (Claude Code); the runs and the card are mine.
@n-romanovich on GitHub · 2026-11-25 22:57 UTC · original
@Marvisak Updated
fix/nvidia-dynamic-descriptor-slots(6b72ce9):HostHeap::mirrorreturnsNoneforindex >= self.count) rather than remapped.MIN_DYNAMICfallback branch to usePORTABLE_VIEWSwithout.max(views)(HEAP_VIEWS = 2^21), and reservedCAPPED_PAIRS(24_576) somemory::tests::lists_share_a_table_and_copies_keep_their_viewspasses on a 1M-capped NVIDIA card.capped_heap_keeps_full_dynamic_rangeandlists_share_a_table_and_copies_keep_their_viewslocally on a 1M-capped NVIDIA GPU; CIcheckpasses.Note: #2177 supersedes this with
host_heap_views()probing and shader clamping if you prefer to land #2177 instead.@postblink on GitHub · 2026-11-26 07:39 UTC · original
Linux / Proton, RTX 5080: the dynamic-slot drops are gone with this PR, and #2461 doesn't remove them
Setup: GE-Proton11-14's
wine, vkd3d-proton master71cae091, NVIDIA driver 620.73.04, title 1.0.2.1, diag build, 12-minute runs into the prologue (in the world, with player control). The heap is capped as on Windows:count=1245184, host cap 1,000,000.Base for all three runs:
main63bcca4+ #2723 + #2969 + #189. Each run adds one heap change. Numbers are per frame, medians over the in-world reports:6b72ce9)2b5f652)no dynamic slots for root views / its tablesThis PR logs
capped=713280 dynamic=262144 pairs=24576. fps doesn't go up because the draws that were dropped now run, and this scene is GPU-bound for other reasons. The other drops are unchanged with or without it: a dispatch whose root view's offset isn't in a title buffer, and pipelines whose shaders don't translate.AI-assisted (Claude), runs and numbers from my own hardware.
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.