Repository navigation
Conversation
…ables Implements Marvisak#747: - Reserve the full DYNAMIC (2^18 = 262,144) dynamic view slots on capped 1M heaps via capped_split() (737,856 mirrored + 262,144 dynamic, safe for small limits) so NVIDIA world indirect/mesh tables do not starve. - Trim fresh dynamic descriptor tables in draw.rs to [first_used, last_used] (clamped to mirrored count so base = first - start never underflows) and include (start, end) in the per-list cache key. - Add unit and live-device tests covering capped dynamic reservation and first-used-entry fresh-table indexing.
BTP 6's view heap has 1,245,184 slots; hosts that cap shader-visible view
heaps at 1,000,000 (the RTX 4080 SUPER, resource binding tier 3, takes
exactly that many, measured) got 65,536 dynamic slots, and the Series S
world ran short of them: session 20261124-181140 dropped draws for "no
dynamic slots" from 18:13:07 (256 by 18:13:31) and the device hung at
18:13:51 (watch item 109); session 5 of the series-s task dropped draws
the same way. Upstream, 2^18 took an RTX 5090's slot drops from 20 to 0
(VIctory #747, #1440).
A capped heap now keeps DYNAMIC (2^18) slots dynamic and mirrors 737,856
title slots (capped_split). Title tables reaching past the mirrored slots
are made afresh in dynamic slots (draw.rs, as before), not read past the
heap. In a Series S session with this change (20261124-182836, 30 s in
the world) the title wrote no slot past 737,856 ("title slot past the
host heap" never came) and the dynamic peak was 32,774 of 262,144.
Not taken from #1349: dropping the middle step (a heap the host takes
with 2^16 dynamic slots on top of every title slot keeps them all; #1349
cut title slots there, which #747 does not ask), and its draw.rs half
(fresh tables trimmed to the entries used), the drops task's file.
VIctory #1444 (heap ABA) is in draw.rs only: not in this change.
Tests: the split (and small limits), and a heap of the title's size.
Ported from Marvisak/VIctory#1349 (head eb5fea7) by wbkepler
Co-authored-by: wrothgaril <211408787+wrothgaril@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
For triage: this conflicts with #955 (
Merged as they are, there is no slot left for #955's guard on a capped heap. Whichever lands second needs one slot less in one of the two ranges (e.g. This PR on its own, at |
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; this is source review plus the PR's own Windows tests.
Capped view heaps (NVIDIA 1M descriptor limit) now reserve the full DYNAMIC=2^18 dynamic budget out of the cap instead of shrinking to MIN_DYNAMIC=2^16: capped_split(limit) gives (limit - min(DYNAMIC, limit-1), ...) so mirrored title slots keep at least one slot and small limits never underflow (0→(0,0), 1→(1,0), 1024→(1,1023)). Uncapped heaps still try count+DYNAMIC first. Rationale documented (#59, #747: world tables starving on capped heaps). Trade-off: mirrored prefix shrinks from ~960K to ~768K on a 1M cap — worth a sentence in the PR description, but the direction is right. Unit tests cover the split boundaries; the GPU test skips cleanly without a host.
|
Tested on an RTX 5080: the PR fixes the dynamic-slot starvation, but the world still hangs (0x887A0006) about as soon as before. Setup
Results
A third baseline run with So on this GPU the dynamic-slot exhaustion comes with the hang, but it isn't what causes it. With the starvation gone, the hang is still a |
|
In-world evidence for keeping 2^18 on capped heaps, from a fork that runs
The fork also found a second cost, which may matter for @devgosling's hang above. With slots free but in pieces, each refused table searched the whole ring before giving up: 0.33 ms each with 131,072 slots, and 1.0 s of the recording threads in a frame that refused 3,143 tables, all under the lock every table takes. It keeps a free-slot count, plus the shortest table length that last found no run, and refuses longer tables without searching until slots are given back. Reading only, nothing run. AI-assisted (Claude Code). |
|
RTX 5060 Laptop GPU: this PR stops every "no dynamic slots" drop and the world reaches the G-buffer Setup. NVIDIA GeForce RTX 5060 Laptop GPU (heap capped at 1,000,000; the title asks 1,245,184), driver 32.0.16.2124, Windows 11 Pro 26200, title 1.0.2.1, Series X mode. Release build with
Render targets.
So on this GPU the PR takes the world from "not drawn" to "drawn but not lit". The remaining black is the lighting stage, as in #1317 and #638. Merge note. On #1520, Frame rate in the world drops (1.19 → 0.37 fps) because far more is drawn. No device removal in either run. |
|
Superseded by #1779, which redoes this on current
Leaving this open for the maintainers to close; it conflicts with AI-assisted (Claude Code); checked on Windows 11 / RTX 5090. |
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
Summary
Implements #747:
DYNAMIC(2^18= 262,144) dynamic view slots on capped 1M heaps viacapped_split()(737,856mirrored +262,144dynamic, safe for small limits) so NVIDIA world indirect/mesh tables do not starve.draw.rsto[first_used, last_used](clamped to mirrored count sobase = first - startnever underflows) and includes(start, end)in the per-list cache key.Verification
cargo clippy -p victory-gpu --all-targets -- -D warnings— passedcargo clippy -p victory --features diagnostics --all-targets— passedcargo test -p victory-gpu— passedcargo xtask policy— passed