Descriptors: a view heap with room past the title's slots makes them all dynamic, up to 2^20 #1010

Closed
github-bot wants to merge 1 commit from gh-pr/1010/head into gh-pr/1010/base
Owner

@⁠cmt8 on GitHub · 2026-11-25 15:57 UTC · original
up/dynamic-slots → main · +39 −8 · 1 files · 1 commits · closed without merging

What breaks today

Tables made afresh come from the view heap's 2^18 dynamic slots. A list holds its slots until it has run. With submissions sent ahead for longer between settles, more lists hold tables at once and the 2^18 run out. Their draws are then dropped ("a descriptor table found no free slots"). In one run under Proton on an RX 7900 XTX, 600 to 1,500 draws were dropped in frames of about 10,000, showing up as missing geometry and smearing in full-screen passes.

On a host whose view heaps take UNCAPPED_VIEWS (2^21: vkd3d-proton on RADV, and AMD on Windows), the title uses about 1,000,000 slots. That leaves about 800,000 slots between the dynamic ones and the null slot that nothing uses.

The change

Where the heap has that room, every slot between the title's and the null slot is dynamic, up to DYNAMIC_MOST (2^20). A capped host (NVIDIA, 1,000,000 views) keeps 2^18 as before. The search and the cursor now wrap at the heap's own count instead of DYNAMIC. The heap's debug line names the count. One test covers it: on a host with room, the slots up to the null slot are dynamic and can all be taken at once.

Evidence

  • One user's runs on one machine (cmt8: RX 7900 XTX, RADV Mesa 26.3, Proton Experimental). Before, 2,745 drop lines for no free slots in one run, with the missing geometry and smearing above. After, in two runs with the larger pool, at most 399,750 dynamic slots were in use at once (well over 2^18) and no table was refused. Those runs were of our Linux branch, where the change came with a wait for slots given back (below). Its counter shows the wait never fired, so the pool size is what made the difference.
  • Windows test binaries under Wine 11.22 with Proton Experimental's vkd3d-proton, using the wine-test xtask from Marvisak/VIctory #1218 (not part of this PR): victory-gpu 163 passed, 8 failed. The same 8 fail on 0b0074e0. The new test and dynamic_slots_are_held_until_released pass with 2^20 dynamic slots.

Not verified

  • Not run on Windows (we have none). This change is not Wine-only: on Windows, a host that takes 2^21 views (AMD) also gets the larger pool. That costs about 6 MB more for the heap's bookkeeping, and the slot search can scan a longer ring when it fails. Capped hosts (NVIDIA) are unchanged. We have not measured whether 2^18 runs out on Windows AMD.
  • Our original commit (381e9d97) also made a table with no free slots wait up to 250 ms for slots given back (VICTORY_DYNAMIC_WAIT_MS). That wait is left out here: it never fired in our runs, and on a host that truly runs out it could stall each table.

These save slots rather than add them, and would combine with this change:

  • Marvisak/VIctory #2475 (kais7654, taking over #1349 by wrothgaril) keeps 2^18 on capped heaps and trims fresh tables to their used range.
  • RecompLive's fork, 6b44e423, adapts #2475's trim.
  • Marvisak/VIctory #688 (iurysf) takes back the slots of lists that already ran when a heap runs short.
  • uiliannn's fork, 009856f0, fixes the wraparound scan in HostHeap::dynamic. The take bound this PR changes is the one that commit adjusts. The two touch the same line.

AI-assisted (Claude Code); no game data.

**@⁠cmt8** on GitHub · 2026-11-25 15:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/1010) `up/dynamic-slots` → `main` · +39 −8 · 1 files · 1 commits · closed without merging ## What breaks today Tables made afresh come from the view heap's 2^18 dynamic slots. A list holds its slots until it has run. With submissions sent ahead for longer between settles, more lists hold tables at once and the 2^18 run out. Their draws are then dropped ("a descriptor table found no free slots"). In one run under Proton on an RX 7900 XTX, 600 to 1,500 draws were dropped in frames of about 10,000, showing up as missing geometry and smearing in full-screen passes. On a host whose view heaps take `UNCAPPED_VIEWS` (2^21: vkd3d-proton on RADV, and AMD on Windows), the title uses about 1,000,000 slots. That leaves about 800,000 slots between the dynamic ones and the null slot that nothing uses. ## The change Where the heap has that room, every slot between the title's and the null slot is dynamic, up to `DYNAMIC_MOST` (2^20). A capped host (NVIDIA, 1,000,000 views) keeps 2^18 as before. The search and the cursor now wrap at the heap's own count instead of `DYNAMIC`. The heap's debug line names the count. One test covers it: on a host with room, the slots up to the null slot are dynamic and can all be taken at once. ## Evidence - One user's runs on one machine (cmt8: RX 7900 XTX, RADV Mesa 26.3, Proton Experimental). Before, 2,745 drop lines for no free slots in one run, with the missing geometry and smearing above. After, in two runs with the larger pool, at most 399,750 dynamic slots were in use at once (well over 2^18) and no table was refused. Those runs were of our Linux branch, where the change came with a wait for slots given back (below). Its counter shows the wait never fired, so the pool size is what made the difference. - Windows test binaries under Wine 11.22 with Proton Experimental's vkd3d-proton, using the `wine-test` xtask from Marvisak/VIctory #1218 (not part of this PR): victory-gpu 163 passed, 8 failed. The same 8 fail on `0b0074e0`. The new test and `dynamic_slots_are_held_until_released` pass with 2^20 dynamic slots. ## Not verified - Not run on Windows (we have none). This change is **not** Wine-only: on Windows, a host that takes 2^21 views (AMD) also gets the larger pool. That costs about 6 MB more for the heap's bookkeeping, and the slot search can scan a longer ring when it fails. Capped hosts (NVIDIA) are unchanged. We have not measured whether 2^18 runs out on Windows AMD. - Our original commit (381e9d97) also made a table with no free slots wait up to 250 ms for slots given back (`VICTORY_DYNAMIC_WAIT_MS`). That wait is left out here: it never fired in our runs, and on a host that truly runs out it could stall each table. ## Related These save slots rather than add them, and would combine with this change: - Marvisak/VIctory #2475 (kais7654, taking over #1349 by wrothgaril) keeps 2^18 on capped heaps and trims fresh tables to their used range. - RecompLive's fork, 6b44e423, adapts #2475's trim. - Marvisak/VIctory #688 (iurysf) takes back the slots of lists that already ran when a heap runs short. - uiliannn's fork, 009856f0, fixes the wraparound scan in `HostHeap::dynamic`. The `take` bound this PR changes is the one that commit adjusts. The two touch the same line. AI-assisted (Claude Code); no game data.
Ported by hand from 381e9d97 of cmt8/VIctory linux/fx-next6, its larger
pool only.

A view heap has 2^18 dynamic slots for tables made afresh, and a list
holds the ones its draws took until it has run. In a run under Proton on
an RX 7900 XTX (RADV) with submissions sent ahead for longer between
settles, 2^18 ran out: 600 to 1,500 draws of frames of about 10,000 were
dropped for "a descriptor table found no free slots" (missing geometry,
smearing). Where the host's view heap is larger than the title's slots
plus 2^18 (UNCAPPED_VIEWS, 2^21 views: vkd3d-proton on RADV, AMD on
Windows) the slots between the title's and the null slot went unused; now
they are all dynamic, up to DYNAMIC_MOST (2^20). A capped host (NVIDIA,
1,000,000 views) keeps 2^18 as before. The search and the cursor wrap at
the heap's own count instead of DYNAMIC.

In two runs with the larger pool, the most dynamic slots in use at once
was 399,750 and no table was refused. 381e9d97 also had a table that
finds none free wait up to 250 ms for slots given back
(VICTORY_DYNAMIC_WAIT_MS) and a status line; the wait never fired in those
runs and is left out here, as is the status line.

Test: on a host with room, the slots up to the null slot are dynamic (up
to DYNAMIC_MOST) and can all be taken at once.

Tested: cargo xwin build --release -p victory; cargo xtask policy (179
files ok); Windows tests under Wine 11.22 with Proton Experimental's
vkd3d-proton on an RX 7900 XTX: victory-gpu 163 passed, 8 failed, the
same 8 as on this commit's parent; the new test and
dynamic_slots_are_held_until_released pass with 2^20 dynamic slots. Not
run on Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:50 +00:00
github-bot closed this pull request 2026-11-26 03:55:50 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-25 16:59 UTC · original

Tested on RX 7900 XT (CachyOS Linux, Wine 11.22 + vkd3d-proton VKD3D_CONFIG=descriptor_heap + RADV). spare_view_heap_slots_are_dynamic passes under Wine and gameplay runs cleanly with ~10.7k tables/frame and 0 refused dynamic slot allocations.

**@⁠UwUCammie** on GitHub · 2026-11-25 16:59 UTC · [original](https://github.com/fxceless/victory-fork/pull/1010#issuecomment-7168839375) Tested on RX 7900 XT (CachyOS Linux, Wine 11.22 + vkd3d-proton `VKD3D_CONFIG=descriptor_heap` + RADV). `spare_view_heap_slots_are_dynamic` passes under Wine and gameplay runs cleanly with ~10.7k tables/frame and 0 refused dynamic slot allocations.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.