Repository navigation
d3d12: a console heap's V# words are fixed once a pass, not once a slot (RT-CONSOLE-VSHARP-MEMO) - #2117
Conversation
|
Review at
Native Windows run, since the description has Wine only: GTX 1050 Ti, Windows 10 Pro 19045, NVIDIA 582.66, MSVC RelWithDebInfo, this head merged onto main AI-assisted (Claude Code). |
f71c29b to
ecc72ee
Compare
|
Data point from Windows/NVIDIA, which shows this isn't only a Wine cost. RTX 4070 Laptop, NVIDIA 621.40, During the story load, at the stall,
The heaps phase peaked at 5,342 ms per submission (max 6,274), and the title's main loop starved (finding in #1608: #1608 (comment)). With the 64 MiB default the heap copy averaged 59 ms, so more windows make "fixing copied slots" much heavier, and that is this PR's case. It now conflicts with |
…ot (RT-CONSOLE-VSHARP-MEMO) The title writes the same words into thousands of slots of its console descriptor heap, many of them data that reads as a V# into title memory with no copy, and each fix_vsharp of those costs VirtualQuery calls: a third of the submitting thread's time after the story load under Wine. refresh_console_heap now keeps fix_vsharp's answers for the pass over the copied slots and, separately, for the pass over the slots the changes since the last submission touch, and drops them after each. Retail boot, Proton, RTX 3090, 900 s: heap refresh after the story load 107.8 -> 18.8 ms a submission (max 5,332 -> 1,109), submissions after it 1,977 -> 2,527. AI-assisted; tested under WineHQ 11.22 and GE-Proton11-14 on an RTX 3090 (NVIDIA 590.48.01).
ecc72ee to
2a19104
Compare
Claimed in the coordination issue as: RT-CONSOLE-VSHARP-MEMO (#1608 (comment))
What and why
After the story load, most of
refresh_console_heap's time ("fixing copied slots" in its log line) goes tofix_vsharpon words the title repeats across thousands of slots of its console descriptor heap. Many are data that reads as a buffer V# into title memory with no copy: on my retail boot 3,000-27,000 of them a submission ("with no copy given no records"), most with identical words. Each one goes throughvsharp_addressintoresolve_title_memory/resolve_pool_memory, which call VirtualQuery, and a failure adds no alias, so the next slot with the same words pays again. Under Wine VirtualQuery is slow: withLEONIDA_SAMPLE_MS=10a third of the submitting thread's samples were VirtualQuery underfix_console_slot.fix_heap_vsharpasksfix_vsharponce for each distinct V# (all four words) in a pass over a heap's slots and gives later slots with the same words the same answer. The answers last one pass: they are dropped after the pass over the copied slots, again after the invalidation pass (which runs because a buffer was released or an alias went), and are not used by the retries or the empty-slot probe. The log line gains "answered by an earlier slot of the pass".The same retail boot, 900 s each, RTX 3090, GE-Proton, main db1a22d with #1851, #1957 and #1867,
LEONIDA_ASYNC_PIPELINES=1,LEONIDA_TITLE_WATCHDOG=0,LEONIDA_TITLE_WINDOWS_MB/LEONIDA_ARENA_MB4096, thread sampler on in both:heapsin the submit-phase lines)One run each. The slot-133 shadow refresh (about 200-230 ms a submission) is now the larger cost; this doesn't touch it.
Tested
d3d12_unmapped_vsharp: its console heap already holds 128 identical unmapped V#s, which now take one answer between them. It gains a check that a slot written later with the words the first refresh had no copy for is fixed again once their alias exists: it fails when the answers are kept across refreshes, and passes with this change.d3d12_unmapped_vsharp,d3d12_console_descriptor_heapandconsole_heap_vsharp_slotspass under WineHQ 11.22 (winewayland) and GE-Proton11-14 (winex11);console_heap_vsharp_slotspasses natively on Linux.GPUs tested: NVIDIA GeForce RTX 3090, driver 590.48.01, Debian 13 (Linux 6.12), Wine/Proton as above.
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.