NVIDIA: dynamic descriptor slots (word search, early release), a pool barrier fix, a diagnostics counter #237
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!237
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-237"
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?
@HenriqueSBueno on GitHub · 2026-11-26 12:16 UTC · original
HenriqueSBueno:contrib/nvidia-descriptor-slots→main· +216 −29 · 5 files · 5 commits · openFour small changes found while running this fork on NVIDIA (RTX 3080 10 GB, i5-10400F, 32 GB, Windows 11). All numbers: same save, 9-minute runs, median of the last 30 frame-rate lines.
1. Dynamic descriptor slots searched a word at a time
NVIDIA caps shader-visible view heaps at 1,000,000 views, so only 2^18 dynamic slots fit (a quarter of what an uncapped AMD heap gets). The ring was a
Vec<bool>walked one slot at a time under the lock every recording thread takes; when it fragments, every refused table walks the whole ring.Takenkeeps one bit per slot and skips whole free or taken words. A failed search now logs (at powers of two) the free slots, the longest free run and slots given out / back.A unit test checks it against the slot-at-a-time search on random patterns across word ends.
2. A landed flight's table slots go back before the bury lag (
VICTORY_EARLY_TABLES=1, off by default)The counters above showed ~239,000 of 262,144 slots held while a frame takes ~38,000: landed flights keep their lists, and with them their table slots, for
VICTORY_BURY_LAG(64 submissions, about four frames). 2,200–2,400 tables a frame were refused (each drops its draw) with 45,000–69,000 slots free, longest run 100–163. Fewer lists in flight (VICTORY_LATE_WAIT_LISTS=128) and per-list chunks of 256 did not change the refusals. A landed flight's fence is done, so its table slots are not read again; the lag still applies to the lists and memory.(The frame time goes up at first because the dropped draws are drawn again.)
3. Diagnostics: differing pieces counted on the relay and wide copy-back paths
BackDifferwas counted only on the shadow path, so the frame account said "0 pieces that differ" while the relay scans find 600–970 a frame.4. The first upload's aliasing barrier only for textures made in a pool block
With the pool on, the first upload into any title-filled texture records an aliasing barrier. A committed texture (one the block refused, or a stand-in made elsewhere) cannot take one: the host refuses to close the list (
E_INVALIDARG; debug layer id 528, "cannot use aliasing barrier since committed resource memory cannot be aliased"). Seen as a stop about three minutes into a run together with the PC FidelityFX upscaler port.pool::pooledtells a block's texture by the private data it already carries.Built with
--profile diag --features diagnostics; the gpu crate's slot tests pass and clippy is clean for the touched files. Related measurement for small cards (no code here): on a ≤12 GiB budget,VICTORY_CARD_BUFFERS_MIN_MB=1took the median frame from 191 to ~85 ms; 64 KB left the world undrawn.AI-assisted (Claude Code)
@Jesper-Andersson on GitHub · 2026-11-26 18:28 UTC · original
A test of this PR on another NVIDIA card: RTX 2070 SUPER 8 GB (Turing, driver 621.14, 32-lane waves, host view heaps capped at 1,000,000), 32 GB RAM, Windows 11. Tested as part of a local merge of this PR and about 30 other open PRs onto main
c9c932c, diagnostics build, defaultplay.ps1settings.The slots still run out under load. About 3 minutes into the prologue, one window of frames hits
no free dynamic descriptor slots: a table is not made n=27, and this PR's counter reads:That's over 8 frames with 45,057 list calls (0.6 fps there). Earlier, quieter windows had 0 refused, with searching at or below 1 ms.
Those refusals are what #70 sees as
indirect kind 0/1/2/10: prepare failed. With a diagnostics change that names the failing exit, every indirect drop in this run wasdescriptor table: no free slots(354 dispatches, 55 mesh dispatches and 4 draws in that frame). Details are in #70.Compared with main without this PR (a 4.5-minute run on the same card), slot shortages came up in more and bigger windows: up to 2,504 dropped mesh dispatches in one frame. The runs differ in length, place in the game and frame rate, so I can't put a number on the improvement. It looks like this PR helps, but the pool can still run out on an 8 GB card.
This comment was written with AI assistance (Claude Code).
@Jesper-Andersson on GitHub · 2026-11-26 23:10 UTC · original
A follow-up to my comment above, this time with this PR alone on main: with
VICTORY_EARLY_TABLES=1the slots no longer run out on an 8 GB card. With the default (off), they still do.Setup: RTX 2070 SUPER 8 GB (driver 621.14, host view heap capped at 1,000,000), Ryzen 7 5800X, 32 GB, Windows 11. Builds:
126acb3+ #360 (names the failing exit ofprepare failed) + #203 (DLSS).77e4543). The two differ only in this PR's files.Diagnostics build,
play.ps1settings of126acb3, Series S profile with DLSS (quality 2). Each run is the same stretch of the open world, about 1 to 1.5 minutes after loading. The numbers are the range over the 5 s lines in the world.VICTORY_EARLY_TABLES=1prepare failed (descriptor table: no free slots))VICTORY_EARLY_TABLES=1is what removes the refusals here, as in your RTX 3080 numbers.d4b8094a, after DexNom/VIctory#68, the same idea as #96's heap sizing) on top of this PR withVICTORY_EARLY_TABLES=1, also had 0 refused and 0 indirect dropped. On this card the early release alone is enough with 2^18 slots.So on capped (NVIDIA) heaps,
VICTORY_EARLY_TABLES=1looks worth having on by default.Separate from this PR but in the same code: #392, a list gives its dynamic slots back to whatever heap now has the old heap's address.
Not checked: AMD (no card here), runs longer than 1.5 minutes in the world, and Series X.
This comment was written with AI assistance (Claude Code).
@akimfomin on GitHub · 2026-11-26 23:30 UTC · original
The current rebase of #237 onto
014d52dedf837d1ac660a0bd256c4704be9eeb40conflicts inhost.rsandtexture.rs. PortBridge checked77e4543against that exact Git tree. Jesper's isolated RTX 2070 SUPER run establishes the slot-exhaustion benefit of early release. I also verified that the #237 head still releases ranges by heap address alone, the separate lifetime case in #392.After resolving the two files, carry the fxceless #1324 two-heaps regression to verify early release does not free another heap's live range. The source check establishes the missing identity guard. It does not attribute a 2070 artifact to it. PortBridge · AI-assisted comparison.
@Jesper-Andersson on GitHub · 2026-11-26 23:49 UTC · original
A correction to my last comment: main already does part 2. Since
1e72861(now in main014d52d), a landed flight's lists give their tables' slots back throughHostList::release_tables()in both settle paths (host.rs:5165and:5635), always, with no switch. That's whatVICTORY_EARLY_TABLES=1does here, so the "on by default" I suggested is already main's behaviour. It's also probably why this PR now conflicts inhost.rsandlist.rs.From reading main at
014d52d, the other three parts still apply:Vec<bool>searched one slot at a time (descriptor/host.rs:180). In my runs above the word search alone took the search from 29–61 ms to 2.3–4.8 ms a frame.BackDifferis still counted only on the shadow path (shadow.rs:3410).host.rs:6971), committed ones included.So a rebase onto main could drop part 2 and keep 1, 3 and 4. I haven't run main
014d52ditself in game. This is from the code only.This comment was written with AI assistance (Claude Code).
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.