GPU: reserve 2^18 dynamic slots on capped view heaps and trim fresh tables #2475
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!2475
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2475"
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?
@kais7654 on GitHub · 2026-11-25 14:19 UTC · original
kais7654:gpu/capped-dynamic-reserve→main· +180 −29 · 3 files · 2 commits · openImplements #747, taking over #1349 (@wbkepler, author @wrothgaril kept on
the commit) rebased onto main 940d32f's layout.
The heap-sizing change keeps main's flow (the 2M mirrored floor, the
MIN_DYNAMIC middle branch) and changes only the deeply capped path: when
the host refuses both, the capped heap takes
capped_split(PORTABLE_VIEWS)— 737,856 mirrored title slots + the full2^18 = 262,144 dynamic reserve — so the world's fresh tables stop
dropping every indirect draw and mesh dispatch for missing slots.
Fresh dynamic descriptor tables in draw.rs are trimmed to
[first_used, last_used] (clamped to the mirrored count so
base = first - startnever underflows) and the per-list cache keyincludes the
[start, end)range.Commits:
dynamic_slots_are_held_until_released and
lists_share_a_table_and_copies_keep_their_views fail on a capped host
otherwise).
Verified on an RTX 5070 Laptop GPU (driver 616.87, Windows 11) where the
host caps its heaps right now:
large_view_heap_keeps_full_dynamic_budgetruns the capped path live — a real 1,000,000-slot heap at 737,856
mirrored + 262,144 dynamic — and the full victory-gpu suite passes (146
tests; on a capped host the two adapted tests report the cap and skip
their size and pair-range assertions). WARP and uncapped hosts keep
main's assertions and behaviour unchanged.
The world-measurement numbers stay the ones the #747 thread collected.
AI-assisted (Mistral Vibe).
@kotekompotek on GitHub · 2026-11-25 14:29 UTC · original
Two separable changes, both in the right direction:
capped_splitkeeping the fullDYNAMICinside the cap matches the #747 report —MIN_DYNAMIC's 2^16 starving the fresh tables on capped heaps is a real failure mode. Trimming title slots instead is defensible (highest title index seen ~720K < 737,856 kept here).The fresh-table trim is a good idea — copying only
[start, end)instead of the whole prefix — with one edge to confirm: a table index belowstartnow lands atbase + k < first, i.e. inside unrelated heap slots (a mirrored slot of a different title slot, or another dynamic allocation), where the old whole-prefix copy put a real view or a null there. If a shader can index a descriptor array below its first used entry, it reads a foreign descriptor instead of a null — not a fault, but a wrong view. Worth astart = 0clamp, or a comment on why indices belowstartare unreachable.Overlap for triage: the heap-size test relaxation duplicates part of #2251 (merge-candidate), and the capped layout overlaps #2461's — worth merging one story for the NVIDIA cap.
@Marvisak on GitHub · 2026-11-25 16:39 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(67e8ae14). Conflicting files:crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
@xyzMikah on GitHub · 2026-11-25 17:04 UTC · original
@kais7654 RTX 5060 Ti 16 GB, Windows 11. Both tests fail on main for me. Can test your branch once it's rebased. Want me to take the host.rs or draw.rs conflicts?
@xyzMikah on GitHub · 2026-11-25 17:06 UTC · original
RTX 5060 Ti 16 GB, Windows 11. Ran cargo test -p victory-gpu --lib on this branch: 146 passed, 0 failed, 2 ignored. Both tests that fail on main pass here.
@DenRakEiw on GitHub · 2026-11-25 14:34 UTC · original · approved these changes
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 (Blackwell) and WARP:2^18dynamic slots on capped view heaps and trimming fresh tables fixes both pre-existing NVIDIA#1744baseline failures on RTX 5090!cargo test -p victory-gpu descriptor::host::tests: 7/7 passed on RTX 5090, 7/7 passed on WARP (includingcapped_view_heap_reserves_dynamic_slots,large_view_heap_keeps_full_dynamic_budget, anddynamic_slots_are_held_until_released).cargo test -p victory-gpu memory::tests: 3/3 passed on RTX 5090 (includinglists_share_a_table_and_copies_keep_their_views).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 14:57 UTC · original · reviewed
Reserve 2^18 dynamic slots on capped view heaps, trim (+180). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Third PR in the heap-capping cluster after #2451/#2461 — all three touch descriptor/host.rs caps; they will conflict with each other.
@assttro on GitHub · 2026-11-26 13:03 UTC · original
Tested on an RTX 3070 8 GB (driver 610.88; this host caps shader-visible view heaps). I applied only the
descriptor/host.rsandmemory.rsparts onto940d32f+ #230.capped_view_heap_reserves_dynamic_slots,large_view_heap_keeps_full_dynamic_budget(gets the full 2^18 on the capped host) and the adapted descriptor-heap and memory tests: pass.descriptor::host::+memory::: 10 of 10.I left out the
draw.rsfresh-table trim, because of kotekompotek's point: an index belowstartwould read another table's slot instead of a null. If the 2^18 split alone is enough in game, the trim could follow separately withstart = 0or a proof that lower indices are unreachable.AI-assisted (Claude); results above are from my own runs.
@HLVM04 on GitHub · 2026-11-26 13:26 UTC · original
An in-game data point for "if the 2^18 split alone is enough", though from the fork (fxceless/victory-fork), not this branch: RTX 5070 Ti 16 GB, Windows, Series S profile, a fork tree (
0b0074eplus several open PRs and local changes).0b0074ecopies the whole prefix0..nof a table, i.e. no[first_used, last_used]trim.So on this card and title the 2^18 reserve alone kept up, without the trim. Three runs, one scene region, and a different tree, so it says nothing about the trim's own cost or about the below-
startedge.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.