GPU: Rejected draw/dispatch bindings may retain dynamic descriptor slots and amplify heap exhaustion #911
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#911
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@FunWithFlagsDev on GitHub · 2026-11-24 13:59 UTC · original
<html>Problem
On upstream
ffe310e, a draw or dispatch requiring multiple fresh descriptor tables can successfully allocate some tables before another allocation fails.Although
State::bind()subsequently rejects the operation, the successful allocations remain infresh_tablesanddynamicuntil the command list is reset or released.These reservations are not necessarily permanent waste because subsequent operations may reuse them. However, under descriptor pressure, unrecovered reservations may contribute to further allocation failures and amplify heap exhaustion.
Technical analysis
Affected file:
crates/victory-gpu/src/draw.rs.State::bind — operation rejection
State::tables — descriptor reservation and retention
The current allocation path allows partial reservations to survive an unsuccessful bind.
Synthetic example
Consider an eight-slot dynamic heap with two occupied slots:
A draw requests two fresh tables requiring four and three slots.
The first allocation succeeds.
The second allocation fails.
The draw is rejected, but four newly reserved slots remain occupied.
A subsequent operation requiring six contiguous slots cannot allocate them.
With transactional reservation, the unsuccessful operation would leave the original six free slots available.
This is a synthetic allocator-level example, not a measured in-game workload.
Proposed investigation
Before changing allocator behavior, I developed an opt-in diagnostic patch to quantify:
New descriptor reservations.
Reservations originating in rejected binds.
Reservations subsequently recovered through accepted cache hits.
Outstanding unrecovered reservations.
Peak unrecovered reservations within a command list recording.
Allocation failures occurring while earlier unrecovered reservations exist.
Failed allocation size distributions.
The diagnostic patch preserves existing allocation behavior, cache semantics, descriptor lifetimes and bind return values.
Enable it using:
VICTORY_DESCRIPTOR_ADMISSION=1If unrecovered reservations represent a significant fraction of descriptor demand, transactional reservation could complement existing allocator and reclamation improvements.
CPU-side validation
The reservation-policy model was evaluated across 194,074 exhaustive small-heap scenarios.
Metric | Current model | Transactional model -- | -- | -- Rejected operations retaining new reservations | 86,354 | 0The diagnostic accounting model was independently validated across:
40,000 completed bind snapshots.
180,093 allocation and cache events.
Zero discrepancies against a history-recomputing reference model.
All 12 Python tests across both models passed.
These results establish the modeled behavior and accounting invariants. They do not establish the frequency or performance impact of this mechanism in the title.
Relationship to existing work
This investigation complements:
#251 — descriptor allocation across the search cursor.
#562 — immutable descriptor table reuse.
#688 — reclamation of descriptor slots from completed command lists.
#840 — avoiding unnecessary dynamic allocations for aligned CBVs.
#887 — descriptor heap capacity pressure.
Unlike those approaches, this investigation specifically measures descriptor reservations originating in unsuccessful binds and their subsequent reuse.
Validation requested
The attached package includes:
A diagnostics-only Rust patch targeting
ffe310e.Native Rust regression tests.
Python accounting tests.
Build instructions and counter definitions.
Native Rust compilation, D3D12/WARP testing and hardware measurements remain pending.
The immediate objective is to determine whether this mechanism contributes significantly to descriptor pressure before proposing a production allocator change.
Independent validation and feedback would be appreciated.
AI-assisted development. No proprietary game files or assets were used.
</html>## ProblemOn upstream
ffe310e, a draw or dispatch requiring multiple fresh descriptor tables can successfully allocate some tables before another allocation fails.Although
State::bind()subsequently rejects the operation, the successful allocations remain infresh_tablesanddynamicuntil the command list is reset or released.These reservations are not necessarily permanent waste because subsequent operations may reuse them. However, under descriptor pressure, unrecovered reservations may contribute to further allocation failures and amplify heap exhaustion.
Technical analysis
Affected file:
crates/victory-gpu/src/draw.rs.github.com/Marvisak/VIctory@ffe310e/crates/victory-gpu/src/draw.rs (L459-L473))github.com/Marvisak/VIctory@ffe310e/crates/victory-gpu/src/draw.rs (L726-L737))The current allocation path allows partial reservations to survive an unsuccessful bind.
Synthetic example
Consider an eight-slot dynamic heap with two occupied slots:
With transactional reservation, the unsuccessful operation would leave the original six free slots available.
This is a synthetic allocator-level example, not a measured in-game workload.
Proposed investigation
Before changing allocator behavior, I developed an opt-in diagnostic patch to quantify:
The diagnostic patch preserves existing allocation behavior, cache semantics, descriptor lifetimes and bind return values.
Enable it using:
VICTORY_DESCRIPTOR_ADMISSION=1If unrecovered reservations represent a significant fraction of descriptor demand, transactional reservation could complement existing allocator and reclamation improvements.
CPU-side validation
The reservation-policy model was evaluated across 194,074 exhaustive small-heap scenarios.
The diagnostic accounting model was independently validated across:
All 12 Python tests across both models passed.
These results establish the modeled behavior and accounting invariants. They do not establish the frequency or performance impact of this mechanism in the title.
Relationship to existing work
This investigation complements:
Unlike those approaches, this investigation specifically measures descriptor reservations originating in unsuccessful binds and their subsequent reuse.
Validation requested
The attached package includes:
ffe310e.Native Rust compilation, D3D12/WARP testing and hardware measurements remain pending.
The immediate objective is to determine whether this mechanism contributes significantly to descriptor pressure before proposing a production allocator change.
Independent validation and feedback would be appreciated.
AI-assisted development. No proprietary game files or assets were used.
victory_descriptor_admission.zip
@EduAzevedo on GitHub · 2026-11-24 14:01 UTC · original
One in-game data point on where this can happen. On an RTX 2070 SUPER (NVIDIA, view heap capped at 1,000,000),
integration/testers92bc27b, which already carries the 2^18 dynamic reserve from #747, logged zerono dynamic slotsdrops and zeroa table is not madein four runs into the first playable section (about 6-11 minutes in the world each). With no failed allocation there is no partial reservation left behind, so on that tree this mechanism does not occur. On plainmainwith the 2^16 reserve the same card dropped about 262,000 draws for lack of slots in a 16-minute run, so that is where the counters would show something.I'd be glad to run
VICTORY_DESCRIPTOR_ADMISSION=1onmainthere, but could you publish the patch as a branch, like the other diagnostics here? I'd rather not build an attached archive.@MichaelSmithAI on GitHub · 2026-11-24 14:04 UTC · original
The attached
descriptor_admission.patchapplied cleanly toffe310eand built as a Win64 GNU LLVMvictory-gpudiagnostics test binary. I ran both Rust census tests under Wine. Both passed, including the case where two accepted cache hits on the same previously rejected reservation recover its slots exactly once. These are CPU-side bookkeeping tests.The fresh-table ownership behavior also persists on our comparison stack. A successful reservation is cached and attached to the recording before a later table or stage can reject the bind. An accepted bind can subsequently reuse it, and resetting or dropping the recording releases its ranges. #871 changes the allocator's free-range search, so it can prevent some failures but does not roll back a partial bind.
For interpreting a title capture, the unrecovered slot count is more informative than the count of all reservations originating in rejected binds. A failed request observed while slots are pending is an association: the request would also need a sufficiently large contiguous range after reclamation. No title frequency or GPU performance was measured here.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 14:06 UTC · original
The attached patch also builds and passes on native Windows 10 MSVC at
ffe310e. GPU diagnostics: 55 passed, 1 ignored. Clippy passed with diagnostics and-D warnings.I ran a separate synthetic WARP fixture through
State::bind, with six dynamic slots free and two fresh tables of four and three slots. The first bind was rejected and left four pending slots. The same rejected bind incrementedfailed_with_prior_pendingto 1 without recovering the table. A later successful bind reused the four-slot table and moved the census from 4 pending to 4 recovered. Dropping the recording returned those four slots to the allocator.This exercises the bind hooks and slot accounting under controlled pressure. The fixture did not submit shader work or measure title frequency. AI-assisted.
@AimLogin on GitHub · 2026-11-24 14:07 UTC · original
Thanks @FunWithFlagsDev for investigating this allocation behavior, and @EduAzevedo for providing the in-game measurements.
The RTX 2070 SUPER results are particularly interesting. Going from approximately 262,000 descriptor-exhaustion-related dropped draws on main to zero across four runs on the integration branch provides further evidence that the increased dynamic reserve discussed in #747 is effective under the tested conditions.
I've been working on a complementary approach here:
https://github.com/AimLogin/VIctory/pull/1
It includes adaptive descriptor heap sizing, separate bounds for direct and table-based bindless accesses, typed null guards, and additional diagnostic and regression tests validated on an RTX 4060 Ti and WARP.
I think the investigation in #911 complements these changes well. Increasing capacity reduces allocation pressure, while transactional reservation could prevent unsuccessful binds from unnecessarily retaining newly allocated slots.
Even if allocation failures disappear with the larger reserve in current workloads, this mechanism may become relevant again as more graphics pipelines become functional and descriptor demand increases.
It would be interesting to compare the admission counters across:
This could help distinguish insufficient capacity from avoidable reservation pressure.
@EduAzevedo, if you have the time, independent testing of my branch would also be greatly appreciated. My validation currently covers synthetic GPU tests rather than actual in-game rendering.
Thanks again for the detailed investigation and hardware testing!
@MichaelSmithAI on GitHub · 2026-11-24 14:35 UTC · original
@EduAzevedo The requested branch is available at diag/911-descriptor-admission. Commit 4935a86 is FunWithFlagsDev’s attached diagnostic patch applied unchanged to
ffe310e. Build with thediagnosticsfeature and setVICTORY_DESCRIPTOR_ADMISSION=1for the run.A separate test exercised table preparation on a real descriptor heap on RTX 4090 under Wine/vkd3d-proton 3.2. With three slots free, the first two-slot CBV table stayed cached when the second two-slot request failed. Preparing the first table again returned the same offset and moved two slots from pending to recovered. Dropping the recording made that same range allocatable again. All three focused tests passed. This control submitted no GPU work. The title measurement still needed is how many slots remain pending when later requests fail, along with the widths of those requests.
@EduAzevedo on GitHub · 2026-11-24 16:46 UTC · original
The title measurement, with the branch @MichaelSmithAI published (
4935a86, unchanged).Setup: RTX 2070 SUPER (Turing, driver 610.88, view heap capped at 1,000,000), Windows 11 26200. Diag build of
ffe310e+ #493 + #189 + #206 (the set that keeps the world up on NVIDIA, #71) +4935a86, original 2^16 dynamic reserve,VICTORY_DESCRIPTOR_ADMISSION=1,VICTORY_SHADER_LOOP_LIMIT=32. One run into the first playable section; the sums below are over everyrecording_endcensus line from entering the world to 6 minutes later (9,958 recordings). The same run logged up to 32,768no dynamic slotsdrops.Failed request widths: 2-4: 304, 5-16: 16,679, 17-64: 3,288, 65-256: 12,782, 257-1024: 1,606.
Reading it:
integration/testershere, above). Transactional reservation would trim the pending slots, but by itself it would not stop the drops; it could matter later if demand grows past 2^18.AI-assisted.
@Marvisak on GitHub · 2026-11-25 06:59 UTC · original · edited 2026-11-25 09:55 UTC
Automated triage for the maintainers.
Confirmed on
main: inState::tables(crates/victory-gpu/src/draw.rs), each fresh table goes intofresh_tablesanddynamicas soon ashost.dynamic(n)succeeds. If a later table then fails,table_faileddrops the draw or dispatch, but the earlier reservations stay with the recording until it is released. A later bind of the same table can reuse them.Open PR #1126 ("release descriptor tables after a rejected bind") addresses this. As the comment above says, it needs a rebase onto current
main. The diagnostic census attached to the issue is a measurement, not a fix.Generated by Claude Code
@JurajSimicevic on GitHub · 2026-11-25 07:34 UTC · original
An open pull request for this exists: #1126 (opened 2026-11-24, reviewed by several people). It needs a rebase; a rebased branch is offered in its thread.
AI-assisted.