mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1849] [MERGED] d3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL) #1861
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#1861
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/1849
Author: @DadaCap
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:console-fix-no-null📝 Commits (1)
c90092bd3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL)📊 Changes
3 files changed (+8 additions, -7 deletions)
View changed files
📝
runtime/CMakeLists.txt(+1 -1)📝
runtime/README.md(+1 -1)📝
runtime/shims/d3d12_vulkan_device.cpp(+6 -5)📄 Description
RT-CONSOLE-FIX-BUDGET-NULL, claimed and found in #1608.
What
LEONIDA_CONSOLE_FIX_US(the time one submission may spend fixing changed console heap slots, #1723) defaults to0, no limit, instead of 4,000 us. The variable still sets a limit for whoever wants one. Thed3d12_unmapped_vsharptest no longer needs to set it.Why
Past the limit a changed slot is written to the GPU's copy of the heap as a null descriptor until its retry, so a shader reads zero from a buffer the title has filled. At the first world frame that hangs the GPU:
lib_cs_01144(64x32x1 groups) bounds its loops bycvt_u32(size0 / size1 * pixel), withsize1in one of the nulled slots. The compute input probe shows the slot zero in the GPU's copy and valid in the title's memory.lib_cs_01144LEONIDA_CONSOLE_FIX_US=0Cost: nothing I can measure here. Average time in the heap copy per submission, at the same stages: 3.2 to 17.2 ms with the limit, 3.7 to 10.8 ms without, and the longest single one 581 ms against 593 ms (such spikes exist in both). With the limit 7,891 to 30,249 slots an interval were left to retries around the world start.
The comment in the code gives 28 s for one submission as the reason for the limit. I do not see that cost on this machine, but @Moriz82 measured it (speed-8); if it still occurs there, the alternative is to keep a limit for image descriptors whose texture is still missing and never defer buffer descriptors.
It does exist elsewhere: quartz-heron-58 measured, with no limit, 0.4 s rising to 8.2 s a submission in this phase at and after the world start on an RTX 4080 (2.3 ms before it, 150 to 200 ms with the limit), 146 submissions in 435 s; with #1887 on top the phase is 3 to 5 ms up to the world start and 3 to 35 ms around it. aslan2142 measured about 1.25 s a submission on an RX 7900 XTX. #1887 should follow this.
Tests
On
main98c2f7777, RTX 5080, Windows 11, VS 18 RelWithDebInfo:d3d12_unmapped_vsharp(now with the default),d3d12_console_descriptor_heap,d3d12_existing_heapand its two write-watch variants pass. No new test: exceeding a time limit on purpose is not deterministic, and the limit stays off by default. Not run: the wholectestset, other GPUs.AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.