GPU: reserve 2^18 dynamic slots on capped view heaps and trim fresh tables (#747) #1349
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!1349
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1349"
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?
@wbkepler on GitHub · 2026-11-24 17:34 UTC · original
wbkepler:gpu/nvidia-dynamic-view-heap→main· +145 −32 · 2 files · 1 commits · openSummary
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@shortselow-byte on GitHub · 2026-11-24 19:32 UTC · original
For triage: this conflicts with #955 (
git merge-treeagainst the current heads, indescriptor/host.rs), and the two make incompatible choices about the same slots.capped_split(PORTABLE_VIEWS)gives(1_000_000 - 262_144, 262_144)=(737_856, 262_144), the whole 1M heap, and the uncapped path keepscount + DYNAMICwith allDYNAMICslots dynamic.dynamic = DYNAMIC - 1(orMIN_DYNAMIC - 1when capped) andguard = total - 1.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.
DYNAMIC - 1dynamic slots) so the guard stays outside both.This PR on its own, at
eb5fea7onmainffe310e, isolated target directory, Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT: workspace 345 passed, 0 failed, including its three new tests; both clippy runs clean.@devgosling on GitHub · 2026-11-24 20:48 UTC · original
Tested on an RTX 5080: the PR fixes the dynamic-slot starvation, but the world still hangs (0x887A0006) about as soon as before.
Setup
nvlddmkmlogs the errors), Windows 11 Pro 262007952987Adiagprofile with--features diagnostics,VICTORY_D3D12_DRED=1, default loop limit, no TDR registry changes. The D3D12 debug layer isn't installed, so this is DRED-only.mainatffe310e. PR:eb5fea7, which sits directly onffe310e. One run each, same settings.cargo test -p victory-gpupasses on this GPU with the PR: 53 passed, including the three new tests.Results
ffe310eeb5fea7(this PR)capped at 1000000 count=1245184capped at 1000000 count=1245184 mirrored=737856 dynamic=262144no free dynamic descriptor slots/no dynamic slots for its tablesdropped=1024before the hang)title slot past the host heapms=5648 lists=27ms=4730 lists=31mesh 159 [mesh 4adfa13bea1c556a]mesh 50 [mesh 29f7805ffefc2e63, pixel 19acd330dacc8f32]A third baseline run with
VICTORY_SHADER_LOOP_LIMIT=4096(ffe310e) also starved the dynamic slots (dropped=16384) and then hung on a single list (ms=4683 lists=1).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
DispatchMeshhang with no page fault, and the mesh shader changes from run to run. That looks like the same thing as #1216 and #1670. These are single runs, so the timing difference between them doesn't mean much.@upipibi on GitHub · 2026-11-24 21:00 UTC · original
In-world evidence for keeping 2^18 on capped heaps, from a fork that runs
maininto the world on NVIDIA (RTX 4070, capped at 1,000,000 views): fxceless/victory-gta6, the comment onDYNAMICindescriptor/host.rs.main's capped fallback, 2^16 (MIN_DYNAMIC, from #336), ran out in the world: "no free dynamic descriptor slots".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).
@adnanoos on GitHub · 2026-11-24 22:08 UTC · original
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
--features diagnostics. The base is #1520 (2190efe) + theresync_title_writesbound from #994's thread + #452 + #1010. Computeeeed82b877b44b5fis skipped (VICTORY_SKIP_PIPELINES) in both runs, because it hangs the GPU here otherwise. Targets were dumped withVICTORY_DUMP_TARGETSat world frames. 8-minute runs, one each.eb5fea7)mirrored=672320 dynamic=262144(see the merge note)a draw or dispatch dropped: no dynamic slots for its tablesRender 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,
HostHeap::newalso reservesaliasesslots. To merge this PR there, I usedcount + DYNAMIC + aliasesfor the wanted size andcapped_split(PORTABLE_VIEWS - aliases)for the capped case. Themirrored=672320above comes from that.Frame rate in the world drops (1.19 → 0.37 fps) because far more is drawn. No device removal in either run.
@wbkepler on GitHub · 2026-11-24 22:25 UTC · original
Superseded by #1779, which redoes this on current
main(70564ae).mainchanged around this since the branch was cut: heaps are now at leastHEAP_VIEWS(2^21) slots and translated shaders clamp to that and read the null buffer views at2^21 - 2, neither of which exists in a capped 1,000,000-slot heap. #1779 keeps what this PR did (the full 2^18 dynamic range on a capped heap, tables made afresh trimmed to their first used entry) and adds the part this one could not cover: the clamp bound and the null buffer views fitted to the heap the host actually makes.Leaving this open for the maintainers to close; it conflicts with
mainand will not be rebased.AI-assisted (Claude Code); checked on Windows 11 / RTX 5090.
@Marvisak on GitHub · 2026-11-25 01:23 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@kais7654 on GitHub · 2026-11-25 14:20 UTC · original
Rebased and opened for review at the linked PR (author preserved on the
commit, @wbkepler / @wrothgaril credited). Main moved since
ffe310e(the marks upload, the tests module in draw.rs), so the conflicts are
resolved keeping main's flow — the 2M mirrored floor, the
MIN_DYNAMICmiddle branch — and only the deeply capped path changesto
capped_split(PORTABLE_VIEWS). Verified on an RTX 5070 Laptop GPU(driver 616.87) whose host refuses the 2M heap right now: the capped
path runs live with the full 2^18 reserve, and the whole victory-gpu
suite passes.
AI-assisted (Mistral Vibe).
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.