mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #2195] [MERGED] d3d12: keep the ExecuteCommandLists serial stack out of TLS callbacks (RT-XMEM-STARTUP-FASTFAIL) #2199
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#2199
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/2195
Author: @brandostrong
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:fix/geometry-view-tls-callbacks📝 Commits (1)
eaf0b8dd3d12: keep the replay serial stack a plain thread_local📊 Changes
1 file changed (+29 additions, -6 deletions)
View changed files
📝
runtime/shims/d3d12_vulkan_device.cpp(+29 -6)📄 Description
Item: RT-XMEM-STARTUP-FASTFAIL (claim: #1608 comment 7182512479).
861bb0546(#2138) made the title fail-fast at startup:0xC0000409,info0=0x7, ~1.6 s in, before any D3D12 call. Bisecting the 49 commits fromad41fd517to0b11d86bc:ad41fd517boots,861bb0546is the first bad commit, and its only new runtime construct is thethread_local std::vector<std::uint64_t>ingeometry_execute_serials().Cause
A function-local
thread_localwith a destructor ingta6rt.exeadds TLS callbacks to the image. The loader's TLS index-0 move must not have any (pe_loader.cpp,reserve_tls_index0), andVulkanContext::stage_xdxr_tablealready keeps its equivalent list a member for that reason. With the callback present, the title's static-CRT startup reaches ucrtbase's one-shot_register_thread_local_exe_atexit_callbackguard (ucrtbase+0x92170) after the token is taken and callsterminate; the fast-fail stack isucrtbase!terminate->abort.Change
The same per-thread LIFO of replay serials, held in a fixed aggregate (
GeometryExecuteSerials, 32 entries): no destructor, no TLS callbacks. A replay nested deeper than 32 is not tracked, reported once; the innermost replays end first, so skipped entries unwind correctly.Testing
gta6rt(MSVC 14.44, RelWithDebInfo).LEONIDA_D3D12=vulkanon the retail 1.0.2.1 package: the same build without the change exits0xC0000409at ~1.5 s with no D3D12 activity; with it the run passes startup and keeps submitting (20 s check, slots/shadows counters advancing).NVIDIA RTX 4090, driver 616.64, Windows 11.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.