GPU: a title heap a capped host heap does not hold whole keeps its lower 393,215 slots; the rest are dynamic #1258

Open
github-bot wants to merge 1 commit from github-bot/gh-1258 into main AGit
Owner

@⁠notquiteog on GitHub · 2026-11-26 03:50 UTC · original
notquiteog:pr-fx-capped-split → main · +68 −5 · 1 files · 1 commits · open

Problem

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 leaves DYNAMIC = 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 DYNAMIC dynamic 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):

  • 13,000 to 60,000 tables refused per 5 s, each a dropped draw

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:

  • 512, 22, 179, then 512 (every page) for every band from slot 393,216 up
  • all 507,205 views seen past slot 737,855 were in tables made afresh for a draw; none was a view that only a shader picking by index reads

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):

  • 0 tables refused
  • 350,000 dynamic slots free at the fewest
  • 0 index-picked views left without a host slot
  • about 40,000 more small tables per 5 s made afresh because they reach past the title's host slots (about 120,000 slots per 5 s, a few percent of what the pool hands out)

Change

  • A title heap that does not fit, with DYNAMIC more, in a host heap capped below PORTABLE_VIEWS keeps 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.
  • The dynamic slots' bookkeeping follows the heap's own number: the taken-slot list, the free count, the search bound and the cursor's wrap in HostHeap::dynamic used the constant DYNAMIC, which would have left the added slots unused.
  • Title slots past the ones kept have no host slot. A table reaching there is made afresh for its draw, which is the path tables past slot 737,855 already took (index >= host.count() in tables()); nothing new is needed for them.
  • Not changed: hosts that do not cap (AMD), and heaps that fit in a capped host heap with DYNAMIC more. draw.rs still refuses a fresh table of more than DYNAMIC slots; that is a limit on one table, not on the pool.
  • One unit test of the split.

One file, +68 −5.

Switch

VICTORY_DYNAMIC_SLOTS=262144 restores the split as it was (737,855 title slots, 262,144 dynamic).

Not tested

  • This tree was not run in game. The branch passes 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.
  • One NVIDIA card only (RTX 5060 Ti 16 GB). No other NVIDIA card or driver, and open-world free roam only; cutscenes and interiors were not measured separately.
  • Not tested on AMD. A host that takes more than 1,000,000 views does not reach the changed code.
  • 393,215 is where the ring began in that play. A build or scene of the title that keeps long-lived, index-picked views above it would lose them (they would read the null view); the measurement found none.

🤖 Generated with Claude Code

**@⁠notquiteog** on GitHub · 2026-11-26 03:50 UTC · [original](https://github.com/fxceless/victory-fork/pull/1258) `notquiteog:pr-fx-capped-split` → `main` · +68 −5 · 1 files · 1 commits · open ## Problem 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 leaves `DYNAMIC` = 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 `DYNAMIC` dynamic 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): - 13,000 to 60,000 tables refused per 5 s, each a dropped draw 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: - 512, 22, 179, then 512 (every page) for every band from slot 393,216 up - all 507,205 views seen past slot 737,855 were in tables made afresh for a draw; none was a view that only a shader picking by index reads 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): - 0 tables refused - 350,000 dynamic slots free at the fewest - 0 index-picked views left without a host slot - about 40,000 more small tables per 5 s made afresh because they reach past the title's host slots (about 120,000 slots per 5 s, a few percent of what the pool hands out) ## Change - A title heap that does not fit, with `DYNAMIC` more, in a host heap capped below `PORTABLE_VIEWS` keeps 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. - The dynamic slots' bookkeeping follows the heap's own number: the taken-slot list, the free count, the search bound and the cursor's wrap in `HostHeap::dynamic` used the constant `DYNAMIC`, which would have left the added slots unused. - Title slots past the ones kept have no host slot. A table reaching there is made afresh for its draw, which is the path tables past slot 737,855 already took (`index >= host.count()` in `tables()`); nothing new is needed for them. - Not changed: hosts that do not cap (AMD), and heaps that fit in a capped host heap with `DYNAMIC` more. `draw.rs` still refuses a fresh table of more than `DYNAMIC` slots; that is a limit on one table, not on the pool. - One unit test of the split. One file, +68 −5. ## Switch `VICTORY_DYNAMIC_SLOTS=262144` restores the split as it was (737,855 title slots, 262,144 dynamic). ## Not tested - This tree was not run in game. The branch passes `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. - One NVIDIA card only (RTX 5060 Ti 16 GB). No other NVIDIA card or driver, and open-world free roam only; cutscenes and interiors were not measured separately. - Not tested on AMD. A host that takes more than 1,000,000 views does not reach the changed code. - 393,215 is where the ring began in that play. A build or scene of the title that keeps long-lived, index-picked views above it would lose them (they would read the null view); the measurement found none. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a host that caps view heaps at 1,000,000 (NVIDIA) the title's heap
(1,245,184 slots) kept its first 737,855 and left 262,144 dynamic slots
for the tables made afresh per draw. A frame in the open world asks for
about 200,000 and holds them until the GPU has run it: 13,000 to 60,000
tables were refused per 5 s and their draws dropped.

From slot 393,216 on the title's heap is its own ring of per-draw
tables (every 256-slot page of it held views; all 507,205 views seen
past slot 737,855 were in tables made afresh for a draw). Those are made
in dynamic slots anyway, so the host slots kept for the ring stood
unused. Such a heap now keeps the title's lower 393,215 slots and has
606,784 dynamic ones; tables reaching past the title's host slots are
made afresh, as they already were past 737,855.

VICTORY_DYNAMIC_SLOTS=<n> sets the number (at least 2^18, leaving the
title at least 2^16 slots); 262144 is the split as it was. Hosts that do
not cap, and heaps that fit, are as before. The dynamic slots' search
and free count follow the heap's own number, not the constant.

Measured in a fork of avatarmanz/VIctory-7900XTX on an RTX 5060 Ti
(none refused, 350,000 free at the fewest); this tree was not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:07:02 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
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.
git fetch -u origin '+refs/pull/1258/head:github-bot/gh-1258'
git switch 'github-bot/gh-1258'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1258'
git switch 'github-bot/gh-1258'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1258'
git switch 'github-bot/gh-1258'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1258'
git switch 'main'
git merge --squash 'github-bot/gh-1258'
git switch 'main'
git merge --ff-only 'github-bot/gh-1258'
git switch 'main'
git merge 'github-bot/gh-1258'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.