startup: resource and heap lookups queue on note_lock behind every view creation and descriptor copy #3392
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3392
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?
@lukaslw-lab on GitHub · 2026-11-28 18:52 UTC · original
In the main executable's startup run (#870),
note_lockis one reader-writer lock for the view records, thedescriptor shadows and the tables of resources, slot 133 placements and descriptor heaps. View creation (
note_view)and descriptor copies (
note_copy) take it exclusively on every call, about 180,000 times per second late in the load.Four lookups read only the resource, placement and heap tables:
resource_info,placed_buffer_range,memory_srv_destinationandresolve_title_table. Together they take it shared about 490,000 times per second, soeach of them queues behind those writers although the tables they read change only when a resource or heap is created
or a placement is retired.
Windows 10 22H2, i7-4790K (4 cores, 8 threads), RTX 3080 Ti, NVIDIA 32.0.16.1047, release, warm shader cache, scripted
input, 250 s, merged switches (#2949, #2977, #3028, #3315). Lock waits from a local measurement build:
mainaec2e084with #3097 and #3379 merged, plus per-site wait and hold timers around everynote_locktake (not part ofthe proposal); window ~100k–175k loaded blocks:
note_locktakenote_view(exclusive)note_copy(exclusive)memory_srv_destination(shared)resolve_title_table(shared)resource_info(shared)placed_buffer_range(shared)work under the lock.
near-constant ~9 µs each while the title makes about twice as many per frame at 175–200k as at 100–125k.
Proposed in #3393: an opt-in
X2W_D3D12_TABLE_LOCK=1that gives those tables their own lock, so the four lookups stopqueueing on
note_lock. The default stays as onmain.This report was prepared with AI assistance (Claude); the runs are mine.
github-bot referenced this issue2026-11-28 19:40:51 +00:00
github-bot referenced this issue2026-11-28 22:11:21 +00:00