GPU and shaders: a host that caps its view heaps gets heaps at its ca… #2461
No reviewers
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!2461
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2461"
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?
@lhnizdo on GitHub · 2026-11-25 14:01 UTC · original
lhnizdo:pr/nvidia-heap-limit→main· +241 −44 · 7 files · 6 commits · openTranslated shaders clamp view indices below
HEAP_VIEWS(2²¹) and read the null buffer views two below it. That assumes a host view heap that large, but NVIDIA caps shader-visible view heaps at 1,000,000. On such a card the current code:The comment in
HostHeap::newalready notes that such a host "faults on an index past them". On Windows 10 with an NVIDIA card, the device was removed (DXGI_ERROR_INVALID_CALL) about a minute in, while still loading.The change:
probe_view_limitasks once whether the host takes a view heap ofHEAP_VIEWS, before the first translation and before the first heap (the title makes pipelines before its heap).set_view_heap_limitlowers the limit to the host's cap. Shaders clamp below it, andnull_buffer_view()(replacing theNULL_BUFFER_VIEWconstant) is two below it.Hosts that take a heap of
HEAP_VIEWSare unchanged.Checked on Windows 10 with an NVIDIA wave32 card:
victory-gputests that fail there onmainnow pass:dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views(142 pass instead of 140). The remaining failure, the placed-view format test, fails onmaintoo.victory-shadertests fail in the same set as onmain(no SM 6.6 device in that test harness).🤖 Generated with Claude Code. The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a
Co-Authored-By: Claudeline.Translated shaders clamp view indices below HEAP_VIEWS (2^21) and read the null buffer views two below it, which assumes a host heap that large. NVIDIA caps shader-visible view heaps at 1,000,000: the heap fell back to the cap with 2^16 dynamic slots, no room for the null buffer views ("no room for the null buffer views"), title slots past its end, and indices up to 2^21 - 1 that read past the heap. On a Windows 10 machine with an NVIDIA card the device was removed (DXGI_ERROR_INVALID_CALL) about a minute in, still loading. Whether the host takes a heap of HEAP_VIEWS is now asked once, before the first translation and the first heap (probe_view_limit). A host that does not lowers the view limit to its cap (set_view_heap_limit): shaders clamp below it and read the null buffer views two below it, and the heap is made at the cap with the full 2^18 dynamic range (2^16 ran out in the world there), room for 8,192 copy view pairs, the null views and a last null slot at its top, and the title's slots below them (721,469; the title's highest index seen is about 720,000). The limit is part of the shader cache key. On that machine the heap and title-memory tests (dynamic slots, lists_share_a_table) now pass; hosts that take HEAP_VIEWS are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018sSQTeDQ6Kc6DEkgPbAww8@kotekompotek on GitHub · 2026-11-25 14:13 UTC · original
Reviewed — of the heap-cap PRs (#2185, #2121, #2189), this is the most complete take:
shader_cache::build→probe_view_limit), so the limit is set before translation and the key carries it — the exact ordering hole #2185 had (translate keyed at 2M, runtime heaps at 1M) is closed here.view_heap_limit, atomic,setbefore translation) means indices past the NVIDIA 1M heap end can't fault the device even if a title computes one — previously they clamped to a heap that doesn't exist on capped hosts.DYNAMICrange (2^16 ran out in the world, per the comment) +CAPPED_PAIRS+ nulls, at the cost of title slots above ~983K — pragmatic given the highest title index seen is ~720K, and logged when it happens.null_buffer_view() = limit - 2keeps the null SRV/UAV pair at the heap top under both limits;pairs_endgating unchanged.Subsumes #2185. One soft spot: "set before any translation" is documented but not enforced — a translate path that skips
shader_cache::buildandHostHeap::newbefore emitting would clamp atHEAP_VIEWSon a capped host. Iftranslate --pipelineshas such a path, worth a probe call there too.@lhnizdo on GitHub · 2026-11-25 14:46 UTC · original
Thanks for the careful review and the RTX 5090 run. Both points had one root:
victory_shader::emit::host, which the shader tests andtranslate --pipelinesuse, never probed the cap. I've pushed a commit whereHost::newasks the device for a heap ofHEAP_VIEWSand, if that's refused while 1,000,000 is taken, lowers the view limit as the runtime does. That should fixstride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros(#1835) on the 5090. I can't run it here (no SM 6.6 device in my test harness), so a re-run there would confirm it.One limit remains: shaders translated before the first
Host::newkeep the limit they were made with. That's noted in the code.@upipibi on GitHub · 2026-11-25 14:58 UTC · original
A small suggestion for
probe_view_limit(victory-gpu/src/descriptor/host.rs:109at this head). It learns the cap by creating aHEAP_VIEWS(2^21) heap and falling back to 1,000,000 when that fails. D3D12 can report the cap directly:D3D12_FEATURE_DATA_D3D12_OPTIONS19::MaxViewDescriptorHeapSize. This PR already callsCheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS19, …)inpipeline/host.rs:374andemit/host.rs:234, but reads onlyAnisoFilterWithPointMipSupportedthere.crates/xcl/src/hle/d3d12x/console_heap.rs,global_captakesMaxViewDescriptorHeapSizefrom OPTIONS19, with 1,000,000 when the runtime doesn't know OPTIONS19.CreateDescriptorHeapat startup on NVIDIA.Keeping the probe as a fallback for a runtime without OPTIONS19 would cover older systems. Read from the code only; not run.
AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 16:39 UTC · original · edited 2026-11-26 00:23 UTC
Automated triage for the maintainers.
Merge candidate. Re-reviewed at
2b5f652, rebased onto currentmain(merges cleanly).probe_view_limit(crates/victory-gpu/src/descriptor/host.rs) runs before the shader cache key is built and before the first heap. On a host that refuses a 2^21 view heap, it lowersvictory_shader::emit::view_heap_limit, so shaders clamp below the real heap andnull_buffer_view()sits at the heap's top. The limit is part of the cache key (shader_cache::key). The shader crate's owncreate_deviceprobes the same way. The capped branch inHostHeap::newnow keepsmin(count, 1,000,000 - MIN_DYNAMIC)= 934,464 title slots, the same asmain's portable fallback. The dynamic range ends at the reserved null pair, andpair()falls back to dynamic slots. I checked thatpairs_endand the null placement agree for the 1,245,184-slot case.On your reply: taking yumaste's title-slots-first commit answers the remaining point from the earlier review. The new
capped_view_heap_preserves_title_slots_and_reserves_nullstest passes on an RTX 2080 and an RTX 5080 per the thread. The 7-minute in-game run shows no dropped draw from a left-out slot and no device removal. upipibi'sOPTIONS19::MaxViewDescriptorHeapSizesuggestion would be a reasonable follow-up, but it does not block this. This subsumes the earlier heap-cap PRs (#2185 and related). CI:checkpassing.Generated by Claude Code
@lhnizdo on GitHub · 2026-11-25 18:07 UTC · original
Rebased onto current
main(13f91ca). The only conflicts were inemit/mod.rs: a reworded doc line next to ours, and the newVIEW_*exports next to the heap-limit ones. Nothing else needed changing: no new code usesNULL_BUFFER_VIEW. Clippy is clean onvictory-gpuandvictory-shader.@yumaste on GitHub · 2026-11-25 20:36 UTC · original
I verified
cbbe8acon Windows 11 (build 26300.9974) with an RTX 5080 Laptop GPU, NVIDIA driver 621.01, and Rust 1.98.1.Both targeted
victory-gpuheap tests passed with this PR. The existinga_heap_buffer_read_where_no_buffer_view_is_reads_zerostest also reported a pass, so I checked the documented initialization-order caveat directly. With translation first, lowering selected null SRV index 2,097,150, while the NVIDIA heap had 1,000,000 slots and its null SRV was at 999,998. An assertion before dispatch caught the mismatch. With the host probe first, lowering and the heap both used 999,998, and the test passed.Here is a test-only patch that probes the host before translation and checks that the fallback slot agrees with the dispatch heap. I confirmed the assertion fails with the old order and passes with the patch on the RTX 5080 Laptop GPU.
Test patch against cbbe8ac
Test automation and write-up assisted by Codex.
@lhnizdo on GitHub · 2026-11-25 21:01 UTC · original
Thanks @yumaste, both for checking the ordering caveat directly and for the test patch. I've added it to this PR as is, with you as the commit's author (
00c9c5b). Clippy is clean onvictory-shader. I can't run the shader tests here (no SM 6.6 device in my test harness), so your RTX 5080 Laptop run is the check that counts.@yumaste on GitHub · 2026-11-25 21:25 UTC · original
I tried the title-slot-first layout suggested in review. yumaste/VIctory@a06e33b is a single commit on top of
00c9c5b.On a host capped at 1,000,000 descriptors, a large title heap now keeps the same 934,464 title slots as the portable fallback, up from 721,469 on this PR's current head. Slots 999,997 through 999,999 are reserved for the null UAV, SRV, and final null view. This leaves 65,533 dynamic slots at the maximum title size. Copy pairs share that range when dedicated space runs out. Smaller title heaps can still use the larger dynamic range and dedicate spare slots to copy pairs.
The new regression failed at 721,469 before the patch and passed at 934,464 with it on the capped hardware adapter. It also checks that table and pair allocations stop before the reserved slots and that a released pair can be reused. The diagnostics GPU suite passed 199 tests with one ignored on both hardware and WARP. Strict GPU Clippy and the shader null-buffer fallback test passed. In-game dynamic-slot pressure and frame time remain unmeasured. The tests used no game data. AI-assisted with Codex.
@lhnizdo on GitHub · 2026-11-25 22:42 UTC · original
Thanks @yumaste. I've added a06e33b to this PR as is, with you as the author (now
2b5f652), and rebased the branch onto currentmain(f3578e3), which conflicted after #2462 was merged.emit::host(the shared WARP device,create_device), so the shader host's heap probe now sits at the end ofcreate_device, and both the hardware device and the shared WARP device get it. Main had also added aView::NullBuffersuse ofNULL_BUFFER_VIEW, which is nownull_buffer_view(). Your new test and main's newview_addresses_cover_tables_made_afreshlanded at the same place indescriptor/host.rs; both are kept.cargo clippy -p victory-shader -p victory-gpu --all-targets -- -D warningsis clean.cargo test -p victory-gpu --lib: 229 passed, 0 failed. Your test reports a 1,000,000 cap, 934,464 title slots, 65,533 dynamic slots and 999,997 as the first reserved null slot, the same as on your 5080.cargo test -p victory-shader --lib: 299 passed, 3 failed, all three unrelated to this PR. Two fail identically on plainmainon this card:pops_wait_loop_exits_immediately_for_inactive_laneswants a shader model 6.6 WARP device, which Windows 10's WARP isn't, andgathers_at_a_level_match_the_hardwaregets another texel on NVIDIA. The third,a_heap_buffer_read_by_element_takes_the_views_stride, is the NVIDIA structured-view read that #2464 addresses.D3D12SDKVersionandD3D12SDKPathfrom the test binaries. I'll propose that as a separate PR.main+ #2460 + this PR + #2464, plus #2851 locally (without it the world load crashes inalias_source, #2847). With a story save that loads straight into the world, about 7 minutes in the world at 1,000–3,000 draws a frame:for_draw=false: no draw needed a slot that was left out.@fuzeofficlal on GitHub · 2026-11-26 00:38 UTC · original
Independent RTX 5090 (1M view-heap cap hardware) + WARP + DXIL verification at head
2b5f65282ebbmerged cleanly ontomain(63bcca43c6a0;emit/lower.rs=520,572B, safely under the 512 KiB cap):VICTORY_D3D12_DEBUG=1):victory-gpu(descriptor::host::tests memory::tests descriptor::tests): 31/31 passed — both pre-existingmainfailures on RTX 5090 (descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views) plus the newcapped_view_heap_preserves_title_slots_and_reserves_nullsnow pass cleanly with 0 D3D12 Debug Layer errors.victory-shader(stride_tests emit::lower::tests,dxil.dll10.0.26100.0): 40/41 passed — fixesemit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros(which failed withdispatch failed: E_INVALIDARGonmain63bcca43). The single remaining failure (a_heap_buffer_read_by_element_takes_the_views_stride) reproduces identically on cleanmain63bcca43on RTX 5090 and is unrelated to this PR.--features diagnostics,VICTORY_D3D12_DEBUG=1/VICTORY_WARP=1):victory-gpu(descriptor::host::tests memory::tests descriptor::tests): 31/31 passedvictory-shader(stride_tests): 8/8 passedcargo xtask policy(191 files ok),cargo clippy --locked -p victory-gpu -p victory-shader --tests -- -D warnings(default +--all-features, 0 warnings).Confirmed to fix all three NVIDIA 1M view-heap cap failures on RTX 5090 hardware; LGTM.
@DenRakEiw on GitHub · 2026-11-25 14:04 UTC · original · approved these changes
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 (Blackwell) and WARP:#1744) on RTX 5090!cargo test -p victory-gpu descriptor::host::tests: 5/5 passed on RTX 5090, 5/5 passed on WARP (includingdynamic_slots_are_held_until_released).cargo test -p victory-gpu memory::tests: 3/3 passed on RTX 5090 (includinglists_share_a_table_and_copies_keep_their_views).cargo clippy -p victory-gpu -p victory-shader --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.victory-shader'sstride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosstill hits the pre-existing#1835E_INVALIDARGon RTX 5090 becauseemit::hostallocatesHEAP_VIEWSslots directly.)AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 14:11 UTC · original · reviewed
Host that caps view heaps gets heaps at cap (CAPPED_PAIRS). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Overlaps #2451 in descriptor/host.rs; convergence needed.
@fyernald on GitHub · 2026-11-26 02:21 UTC · original · approved these changes
Ampere data point at
2b5f652: RTX 3080 (617.42, 1,000,000-view cap), Windows 10 19045,main63bcca4+ #486 + #2596, with #2885 applied as well. The two merge cleanly ontomainand with each other.--test-threads=1.victory-gpu --lib: 230 passed, 3 failed.dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsandcapped_view_heap_preserves_title_slots_and_reserves_nullspass. Both of the first two fail on this card without this PR, including with #2885 alone. The three left are the Windows 10 in-box-runtime failures (no SM 6.6 root flags, noID3D12Device10) that are unrelated to this PR.victory-shader --lib: 303 passed, 1 failed.a_heap_buffer_read_where_no_buffer_view_is_reads_zerospasses (it fails without this PR). The one left needs an SM 6.6 WARP, which Windows 10 doesn't have.@lhnizdo on GitHub · 2026-11-26 08:33 UTC · original
@yumaste, thanks again for the layout. I measured it in the world, which neither of us had done yet, and it costs draws there, so I've reverted it on this PR (
dae68bb, a plain revert commit). Here's the data so you can judge it yourself.main+ #2460 #2461 #2464, plus local work (#1960 and an experimental console mode), so not plainmain; the only difference between the two builds is a06e33b. Each build ran 10 minutes from a story save that loads straight into the world.for_draw=false)So in the world, the 213,000 extra title slots weren't read by any draw, while the smaller dynamic range ran out once the scene got busy. I couldn't see it in the earlier world check because the cold shader cache was still dropping thousands of draws a frame for missing pipelines.
The GPU tests still pass with the revert (
victory-gpu, 228 passed on this card). If a scene turns up that reads title slots past 721,469, a middle ground would be easy: for example 131,072 dynamic slots, leaving about 856,000 for the title. I'd rather see such a case first than guess.AI-assisted (Claude Code); the runs were on my machine. No game data.
@fuzeofficlal on GitHub · 2026-11-26 11:39 UTC · original · approved these changes
Reviewed and verified
dae68bb7on Windows 11 with an RTX 5090 (1,000,000 shader-visible view heap cap), WARP, D3D12 Debug Layer (VICTORY_D3D12_DEBUG=1), and Windows 11 SDKdxil.dll.probe_view_limit()runs ahead of shader-cache key construction, shader translation, and heap creation;view_heap_limit()is folded intoshader_cache::key, andvictory-shader'screate_deviceapplies the same cap probe so offline/test shader compilation and runtime heaps agree.2^18dynamic range inHostHeap::new(dae68bb7) gives a consistent capped layout on RTX 5090 (limit=1000000,null_view=999998,count=721469,dynamic=262144,pairs_end=999997) with no Debug Layer errors on heap creation.Verification results:
cargo xtask policy(190 files ok) andcargo clippy -p victory-gpu -p victory-shader -p victory --tests -- -D warnings(default and--all-features): clean.VICTORY_D3D12_DEBUG=1with--features diagnostics):descriptor::host::tests15/15,memory::tests8/8,descriptor::tests7/7, andshader_cache::tests4/4 all pass — fixing both pre-existing NVIDIA view-heap baseline failures (dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views).VICTORY_D3D12_WARP=1+VICTORY_D3D12_DEBUG=1with--features diagnostics):descriptor::host::tests15/15,memory::tests8/8,shader_cache::tests4/4 all pass.victory-shaderstride_tests(RTX 5090 + WARP + SDKdxil.dll): 7/8 pass, fixinga_heap_buffer_read_where_no_buffer_view_is_reads_zeroson both adapters (the remaining failure,a_heap_buffer_read_by_element_takes_the_views_stride, is the pre-existing NVIDIA structured-view failure onmain).One minor non-blocking note for a follow-up: under
VICTORY_D3D12_DEBUG=1on RTX 5090, the intentionalCreateDescriptorHeap(2_097_152)probe logs a single startup Debug Layer error (NumDescriptors 2097152, but the limit for shader visible view heaps is 1000000). CheckingD3D12_FEATURE_D3D12_OPTIONS19::MaxViewDescriptorHeapSizefirst (keeping the probe as fallback) would silence that and cover other hardware caps cleanly.@lhnizdo on GitHub · 2026-11-26 12:00 UTC · original
@fuzeofficlal, thanks for the review and the debug-layer note. It's in
6544a52.MaxViewDescriptorHeapSize(D3D12 options 19) of at least 1,000,000 (the size every binding tier takes), that's the limit, and no heap is tried. Otherwise the probe runs as before. Same invictory-shader's test device.descriptor::host::tests::a_reported_view_heap_size_is_the_limit. The limit is the reported size, a heap of it is made, and withVICTORY_D3D12_DEBUG=1no debug-layer error mentions a heap that was tried.CreateDescriptorHeap: D3D12_DESCRIPTOR_HEAP_DESC.NumDescriptors 2097152, but the limit for shader visible view heaps is 1000000. With it, it passes.descriptor::tests: 23 passed.AI-assisted (Claude Code); tests on my machine. No game data.
@JurajSimicevic on GitHub · 2026-11-26 12:52 UTC · original
In the world on an RTX 5080 (Blackwell): A/B with and without this PR
Setup: RTX 5080, driver 617.42, Windows 11 26200.
main63bcca4+ #2178 (structured buffer reads on NVIDIA), with and without this PR atdae68bb. The only conflict was the cache key inshader_cache.rs, where I kept both settings.VICTORY_D3D12_DRED=1.The two builds differ only in this PR.
no dynamic slots for root views/for its tables)for_draw=true)Without the PR, most of the dropped draws are mesh and indirect mesh draws. With the camera still, parts of the scene came and went from one frame to the next, which fits drops that vary from 0 to 4,080 per frame. With it, I saw no drop for dynamic slots in the world at all. As on lhnizdo's RTX 2080, no draw read one of the 523,715 title slots left out.
Since then
6544a52takes the cap from options 19 instead of the probe. The heap layout is the same, so I don't expect it to change these numbers, but I haven't run that head.What stays the same with and without the PR is the picture frozen in screen space described on #841. The lit target is never cleared, so this PR's extra draws are laid over older frames' content. That is a separate problem.
Local diagnostics only. No game data: log counts only.
AI-assisted.
@lhnizdo on GitHub · 2026-11-26 13:14 UTC · original
@JurajSimicevic, thank you for running this in the world on Blackwell. It's the comparison the layout needed: 0 drops for dynamic slots with the PR against a median of 1,167 per frame without it, and still no draw reading a left-out title slot. It matches what I saw on the RTX 2080, on a second architecture.
You're right that
6544a52shouldn't change the layout: options 19 reports the same 1,000,000 on NVIDIA, and the capped branch is unchanged. It only stops the probe's oversized heap from being tried.AI-assisted (Claude Code). No game data.
@potatoe0100 on GitHub · 2026-11-26 14:20 UTC · original · reviewed
RTX 4060 8 GB (Ada), driver 621.14, Windows 11 Pro 26300. Head
6544a52merged ontomain63bcca4(clean).cargo test -p victory-gpu -p victory-shader --lib --locked -- --test-threads=1 --skip heap_direct_texture_reads_mark_their_heap_index(#2571):mainFixed here:
dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsanda_heap_buffer_read_where_no_buffer_view_is_reads_zeros. The two left fail onmaintoo and are separate:a_heap_buffer_read_by_element_takes_the_views_stride(#2178 / #2464) andgathers_at_a_level_match_the_hardware.a_reported_view_heap_size_is_the_limitpasses: options 19 reports 1,000,000 on this card, so no oversized heap is tried.Two notes from reading the code:
The triage note above describes
2b5f652(934,464 title slots, 2^16 dynamic). That layout was reverted indae68bb. The head keeps 721,469 title slots and 2^18 dynamic, which is the layout the RTX 2080 and RTX 5080 world runs in this thread measured.The capped branch takes 721,469 title slots for every title heap size, including heaps
mainmirrors whole. A throwaway test callingHostHeap::new(false, count)on this card:mainkept / dynamicFor the retail heap (1,245,184) that is the intended trade. But 933,888 is the heap #1760 gets by lowering the title's page count so it fits the cap whole, and with this PR 212,419 of those slots would be left out again. Not a blocker for this PR. A follow-up could keep every title slot when the title plus at least
MIN_DYNAMICand the null slots fit under the cap, and use 721,469 only when they don't.Minor: a title index read straight from the heap (not through a table) between 721,469 and 999,996 now lands on a dynamic or pair slot instead of null. On
mainthat window was 934,464 to 999,999, and anything past 1,000,000 faulted, so this is still a net improvement. #2628 sends such indices to the null view if it turns out to matter.AI-assisted (Claude). Unit tests only, no game data.
@lhnizdo on GitHub · 2026-11-26 14:41 UTC · original
@potatoe0100, thank you for the RTX 4060 run and the careful read. On the two notes:
Right, the triage note describes
2b5f652, whichdae68bbreverted. The head keeps 721,469 title slots and 2^18 dynamic slots, the layout the RTX 2080 and RTX 5080 world runs measured.Agreed, it's a real trade, and your table shows it well. What decided it here is that 2^16 dynamic slots run out in the world:
for_draw=truenever appeared for the 523,715 left out).So keeping all 933,888 title slots, with only 2^16 dynamic slots left under the cap, would bring those drops back.
A follow-up along the lines you suggest makes sense once #1760 lands and its title actually indexes past 721,469. The rule would be to keep every title slot whenever the title plus 2^18 dynamic slots, the pairs and the null slots fit, and only cut it when they don't. If such a title needs more of its slots than that leaves, a middle ground such as 2^17 dynamic slots (about 856,000 title slots) can be measured in the world then. I'd rather choose that point from a run than guess it now.
On the minor note: agreed, and #2628 sending such indices to the null view would close that window cleanly.
AI-assisted (Claude Code). No game data.
@neonbyte1 on GitHub · 2026-11-26 18:20 UTC · original
Tested in game on an RTX 5090 (driver 620.73.04), Linux, GE-Proton11-14 Wine with its vkd3d-proton.
Build:
mainplus a few unmerged PRs this setup needs, with this PR (6544a52) merged on top. Two files conflicted with our base (descriptor/host.rs,shader_cache.rs); I kept this PR's capped branch,CAPPED_PAIRSand theprobe_view_limitcall. 10-minute runs in the opening yard.as reported, OPTIONS19 through vkd3d-proton)no room for the null buffer viewswarningstitle slot past the host heap(allfor_draw=false)So on vkd3d-proton the reported cap works. The null views now have their slots, and about 50k more title slots are mirrored.
The pictures at frames 1500 and 1700 match the run without this PR (mean difference about 2/255). The second run's higher median frame time is GPU time in a slow middle stretch (up to 1,126 ms) before it settled at 815–852 ms; the first run starts at about 1,000 ms the same way. The minimums match, so I read it as this scene's run-to-run variation, not as a cost of this PR. Nothing past the cap is read by a draw in this scene, so the gain here is correctness, not frame time.
AI-assisted (Claude); measured on my machine, no game data shared.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.