GPU: a title heap a capped host heap does not hold whole keeps its lower 393,215 slots; the rest are dynamic #68
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/DexNom--VIctory!68
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-68"
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?
@notquiteog on GitHub · 2026-11-26 03:50 UTC · original
notquiteog:pr-dx-capped-split→main· +61 −0 · 1 files · 1 commits · openProblem
On a host that caps the shader-visible CBV/SRV/UAV heap at exactly 1,000,000 views (NVIDIA), the host heap cannot hold the title's heap (1,245,184 slots) plus the dynamic slots.
HostHeap::new(crates/victory-gpu/src/descriptor/host.rs) then gives the title's first 737,855 slots a host slot and leavesDYNAMIC= 262,144 dynamic slots for the tables made afresh per draw (draw.rs,tables(): every table that holds a constant buffer, and every table reaching past the host heap's title slots).In the open world a frame asks for about 200,000 dynamic slots and holds them until the GPU has run it. 262,144 ran dry: tables were refused (
no free dynamic descriptor slots: a table is not made) and their draws dropped, seen as flicker and vegetation popping in and out.Measurement
Not measured on this tree. Measured on notquiteog/victory-nvidia, a tree based on avatarmanz/VIctory-7900XTX, where the capped heap is laid out the same way (title slots, then
DYNAMICdynamic slots, then the null slot at 999,999). RTX 5060 Ti 16 GB, i5-13600K, 32 GB RAM, Windows 11, open-world free roam.Before (737,855 title slots, 262,144 dynamic):
Which title slots ever hold a view, counted by 256-slot page and by band of 131,072 slots (512 pages a band). Pages used per band, from slot 0:
So from slot 393,216 on the title's heap is its own ring of per-draw tables. Those tables are copied into dynamic slots anyway, so the host slots reserved for the ring were not used.
After (393,215 title slots, 606,784 dynamic):
Change
DYNAMICmore, in a host heap capped belowPORTABLE_VIEWSkeeps its lower 393,215 slots; the rest up to the null slot (606,784) are dynamic (capped_dynamic_slots).VICTORY_DYNAMIC_SLOTS=<n>sets the number of dynamic slots for such a heap: at least 262,144, and leaving the title at least 65,536 slots. This tree had no such variable; it is read only for such a heap.HostHeap::dynamicto grow into later (dynamic = null - countequals the split).index >= host.count()intables()); nothing new is needed for them.DYNAMICmore.draw.rsstill refuses a fresh table of more thanDYNAMICslots; that is a limit on one table, not on the pool.One file, +61 −0.
Switch
VICTORY_DYNAMIC_SLOTS=262144restores the split as it was (737,855 title slots, 262,144 dynamic).Not tested
cargo check --locked -p victory-gpu, with and without--features diagnostics, and with--tests; the unit test itself was not run. The numbers above are from the fork named under Measurement.material_demand.rstakeshost.count()as the bound of the slots it looks at. With the split that bound is 393,215 instead of 737,855 on a capped host; whether material demand in this tree reads slots between the two was not checked in a run.🤖 Generated with Claude Code
@Artking175 on GitHub · 2026-11-26 05:19 UTC · original · edited 2026-11-26 05:33 UTC
I ran the split unit test and a local hardware fixture against
a031353on RTX 2060, Windows 10, driver 531.41, and Agility 1.614.1. The fixture actually created the 1,000,000-descriptor D3D12 heap for a 1,245,184-slot title heap. The default retained 393,215 title slots and allocated all 606,784 dynamic slots in contiguous requests. WithVICTORY_DYNAMIC_SLOTS=262144, it retained 737,855 title slots and exhausted the dynamic pool at 262,144 as expected. The null slot was 999,999 in both runs.One distinction matters before making this the default on capped cards. A direct heap index in 393,215–737,854 now names the dynamic region.
Shader::heap_handleclamps at 999,999, so an index in that interval can read a descriptor belonging to a live table, even though the original title view was omitted. The remapping path for table-relative bindings is separate. I would keep the larger split opt-in until an index-picked material capture covers that interval, or add a bound specifically for title-indexed accesses. This was an allocator test and source review.I tested an opt-in version on the same RTX 2060. With no override it kept 737,855 title slots and 262,144 dynamic slots. Setting
VICTORY_DYNAMIC_SLOTS=606784kept 393,215 title slots and exercised the full expanded pool. The unit test and both native heap cases passed.@Artking175 on GitHub · 2026-11-26 06:28 UTC · original
I followed up on the displaced-range question in the RTX 2060 prologue. A RayTime release binary with the #49 probe and the opt-in split above ran at 262,144 and 606,784 dynamic slots, with material demand off in both. Both saw the one-million-descriptor host limit and reached the scene near the window with very dark clothing. Across those captures and a material-demand variant on the smaller split, the probe returned 26 GPU material records from
a402e650d0acbc92. The 40 distinct title indices were in 1–104,981. This sample did not exercise the displaced 393,215–737,854 interval.I'd keep the larger split opt-in and add an actual shader-read fixture for the boundary before changing the default. In a capped heap, place a known SRV in the first dynamic slot. Verify that a title-originated direct index of 393,214 still reads its title SRV and that 393,215 resolves to the null SRV, while an internal dynamic reference to the physical slot still reads the known value. Check the same title index against the old split as a control. That exercises the difference between a retained title range and a physical host heap limit without changing table-relative remapping.
@Artking175 on GitHub · 2026-11-26 07:15 UTC · original
I opened a follow-up against the branch used here: https://github.com/notquiteog/victory-nvidia/pull/1
The wide split remains opt-in. A one-million-slot D3D12 fixture on RTX 2060 verified reads at 393214 and 393215 for both retained counts, including the separate internal read of the live dynamic descriptor. The bound covers direct float-readable Texture2D SRVs, matching the permanent null descriptor. Both deferred material shaders still validated and created PSOs with the cap enabled.
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.