mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #1092] [CLOSED] vulkan: retain a valid bindless table under pressure (RT-BINDLESS-TABLE-DEGRADE) #1125
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1125
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1092
Author: @Moriz82
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:split/rt-bindless-table-degrade📝 Commits (1)
84de57cvulkan: retain a valid bindless table under pressure (RT-BINDLESS-TABLE-DEGRADE)📊 Changes
2 files changed (+91 additions, -6 deletions)
View changed files
📝
runtime/src/vulkan_bindless.h(+2 -0)📝
runtime/test/vk_bindless_grow_test.cpp(+89 -6)📄 Description
Claimed in the coordination issue as: RT-BINDLESS-TABLE-DEGRADE (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 contains the integration. #425 covers descriptor-set
recycling and its pool budget. This child can land independently of it.
What and why
Under device-local memory pressure, a bindless table rebuild could fail
and cause ExecuteCommandLists to refuse the whole submission. The smaller
sampled-image arrays could also fill during streaming.
A replacement table can use coherent host-visible memory. If allocation
fails, the runtime releases completed generations and retries. An idle
table can be rewritten in place if it still fits. When those paths fail,
work can use the last table submitted to the GPU. New keys resolve to the
fallback and removed indices stay reserved until the table catches up.
The first upload must reach the queue before any submission can use this
fallback. Device loss still propagates.
Device limits now permit up to 16,384 sampled 2D-array images and 4,096
each for 3D and 1D. The existing layout and per-stage limits still apply.
Tested
Release cross-build with clang-cl 23.1.5 and an xwin SDK on CachyOS,
kernel 7.3.5. Runtime tests used Proton Experimental (Wine 11), a Ryzen
5 5600X, 16 GB RAM and an RTX 4070 12 GB with NVIDIA 620.73.04. CMake
omitted the optional XMA2 decoder because the Rust Windows target was
unavailable.
The sizing test passed, with 152,929 descriptors on synthetic RTX
5070-like limits. The GPU pressure test passed 41/41 checks. It observed
one host-memory fallback, one idle rewrite and two degraded flushes, then
recovered to a 256-slot table. It also rejected a first upload under
pressure, a discarded upload and a simulated device loss.
D3D12 churn passed all four runs. Each compared 98,304 texels over 96
frames on direct and compute queues, with zero mismatches. The two
deferred-retirement runs each made three generations and recorded zero
device-idle waits. The two legacy runs each recorded three waits.
The semantic suite passed 6,168 tests across 470 files. The content and
whitespace checks passed.
Review round 1. A review proposed keeping descriptor writes pending
across a degraded flush, so that a key rebound while the old table is
kept does not find the fallback. That is not taken: the device destroys
a removed texture's views right after
remove_image, so a removedimage's descriptors must go back to the fallback at the next flush even
when that flush keeps the old table. Otherwise a key the old table still
maps to that index finds a destroyed view. The pressure test now records
what every image descriptor names and checks after each flush that the
current set names no destroyed view. It passes 50/50 checks on this head
(41 before the new checks), natively on Linux and as a Windows program
under Wine 11.22, on an RTX 4070 (NVIDIA 620.73.04). With pending writes
kept, it exits 1 at the removal between the two degraded flushes: the
current set's binding 0, element 256 names a destroyed view. The runs
described above and below were made on the head before this round; only
the test file changed since.
For the control, rebuild the GPU pressure test with only the previous
refusal restored. Change the guard in BindlessSet::flush from
!written && must_replace && !table_on_gpu_to!written && must_replace. Link with the same flags and run the sametest. The control passed 17 checks and stopped at check 18 with exit 1:
the busy flush refused the submission. The remaining 23 checks did not
run in this control.
The sizing control omits the three new calls to grow the 2D-array, 3D
and 1D bindings. It passed the first five checks, then exited 1 at the
first check for the larger sampled-image arrays.
Two integration runs on Windows 11 (i9-13900K, RTX 4070 Ti, NVIDIA
630.20) used host memory and continued without refusing a batch. Neither
run exercised a degraded flush. This standalone child was not run on
native Windows, AMD or Intel, with validation layers, or in a game boot.
GPUs tested: NVIDIA GeForce RTX 4070.
AI-assisted: yes
Checklist
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.