Repository navigation
d3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL) - #1849
Conversation
…efault, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Intel data point: c90092b applied privately onto main98c2f7777 alongside PR1836 and local compatibility changes. Windows 11 / Intel UHD Graphics101.6314, MSVC RelWithDebInfo. d3d12_unmapped_vsharp and d3d12_console_descriptor_heap pass normally; d3d12_unmapped_vsharp also passes with Vulkan validation. No explicit LEONIDA_CONSOLE_FIX_US was set for these tests, so this checks the changed default. Full heap suite/gameplay not verified for this combination. AI-assisted (OpenAI Codex). |
madvillain91
left a comment
There was a problem hiding this comment.
Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at c90092b against main 384abe5 (PR base 98c2f77), using VS 2022 Build Tools (MSVC 19.44.35230.0, RelWithDebInfo, Ninja), Vulkan SDK 1.4.363.0, and NVIDIA GeForce RTX 3070 Ti (driver 617.14, Vulkan 1.4.351).
All targeted tests passed with LEONIDA_CONSOLE_FIX_US unset (exercising the new 0 default):
d3d12_unmapped_vsharp_test(LEONIDA_VK_VALIDATION=1): passed, 0 VUIDsd3d12_console_descriptor_heap_test(LEONIDA_VK_VALIDATION=1): passed, 0 VUIDsd3d12_existing_heap_test(LEONIDA_VK_VALIDATION=1): passed, 0 VUIDsd3d12_existing_heap_test(LEONIDA_EXISTING_HEAP_WRITE_WATCH=0and=1): 2/2 passed
Not checked: full ctest suite or retail world-frame boot. LGTM.
AI-assisted verification.
|
Thank you @madvillain91 for checking the new default on Ampere with validation. The same note as on #1827 about the write-watch variants: the variable is |
|
Retail data point from a second NVIDIA machine, including the cost the description asks about. Both halves show here: the device loss goes away, and the per-submission cost is large. RTX 4080 16 GB, NVIDIA 621.24, Windows 11 26300, 32 GB RAM. Main 71a769d (not this branch; the variable set by hand), built with SDL3, one scripted A press, host image copies at the default,
Cost with 0, from the 540 s run (the "console descriptor heap ... (copy)" lines):
So on this machine the 28 s kind of cost from the code comment still exists without the limit, as seconds per submission for minutes on end rather than one spike. With the limit unset the same phase cost 150 to 200 ms a submission before the device was lost. Not checked: this branch itself (only main with the variable), where inside the slot fix the time goes (no profile yet), host image copies off, and whether AI-assisted (Claude Code). |
|
Same stop and same workaround result on a second vendor generation: RTX 2070 SUPER, NVIDIA 616.56, Windows 11,
The pipeline name in the dump comes from #1909 (compute pipelines named through |
|
Thank you @HasiKe: a second NVIDIA generation, on plain |
|
Native Windows 11 / RTX 5070 Ti (610.74). On main On AI-assisted (OpenAI Codex, GPT-6). |
|
Correction and follow-up to my comment above. Correction: the A press in those runs was not scripted. With SDL3 the script needs Follow-up on the cost: it goes away with #1887. Same machine (RTX 4080, 621.24), a local merge of main b0f3d39 with this PR, #1887 and #1893 #1889 #1860 #1886 #1882 #1851, variable unset (so this PR's new default): the console heap phase is 3 to 5 ms a submission up to the world start and 3 to 35 ms around it (single spikes to about 380 ms), against 0.4 to 8.2 s without #1887. Six runs, no device loss, all ended at or just after the world start by my free-RAM guard or time limit (150 to 280 s), so nothing here covers later frames. So from this machine: no objection to the new default as long as #1887 goes in with it or first; without #1887 the default made the world start unusable here. AI-assisted (Claude Code). |
|
Tested on an 8 GB Ampere card: no device loss in 4 of 4 runs without the limit, against 2 of 2 losses with the 4,000 us limit. Setup: RTX 3060 Ti 8 GB, NVIDIA 621.24, Windows 11, own 1.0.2.1, retail boot with
All six reach the first The cost you named, seen once: in r7, at ~106-114 s (around submission 4,295), one submission spent 4.76 s in the console heaps. Only 4 submissions went through in 8.1 s, and that report's heap copy averaged 1,592 ms in "fixing copied slots" (422 KiB a submission, 646 slots). The other three runs without the limit never went above 7.5 ms average in a report. So 1 of 4 runs had a ~5 s stall at the story-load rewrite, far below the 28 s of speed-8, and 0 of 4 hung. Two runs per row, counts only. AI-assisted (Claude Code). |
|
Merged. Thank you, @DadaCap, and thanks to everyone who ran it.
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Test report from a combined build on a second NVIDIA machine. Counts only. Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy. Build: Shaders: translated on Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).
Recipe:
AI-assisted (Claude Code). |
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
main98c2f77, 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