mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:40:53 +01:00
[PR #2407] [MERGED] d3d12: console heap slots record what their V#s resolved to; a release re-fixes only the slots naming it (RT-VSHARP-SLOT-RECORDS) #2407
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#2407
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/2407
Author: @aslan2142
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:vsharp-slot-records📝 Commits (1)
84db5cdd3d12: console heap slots record what their V#s resolved to; a release re-fixes only the slots naming it (RT-VSHARP-SLOT-RECORDS)📊 Changes
14 files changed (+909 additions, -770 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+12 -2)📝
docs/running.md(+1 -1)📝
runtime/CMakeLists.txt(+4 -4)📝
runtime/README.md(+1 -2)📝
runtime/shims/d3d12_vulkan_device.cpp(+172 -203)➕
runtime/src/console_heap_slot_records.h(+227 -0)➖
runtime/src/console_heap_vsharp_slots.h(+0 -115)➖
runtime/src/descriptor_range_changes.h(+0 -46)📝
runtime/src/title_va_alias.h(+31 -16)➕
runtime/test/console_heap_slot_records_test.cpp(+347 -0)➖
runtime/test/console_heap_vsharp_slots_test.cpp(+0 -334)📝
runtime/test/d3d12_unmapped_vsharp_test.cpp(+63 -15)📝
runtime/test/geometry_views_test.cpp(+15 -11)📝
runtime/test/title_va_alias_test.cpp(+36 -21)📄 Description
A console heap's copy now keeps a record per V# of what it resolved to. A released buffer, a removed alias range or a
retired copy re-fixes only the slots that name it. Before this, every live slot of the heap was walked. Nothing walks
the heap any more.
Claimed in the coordination issue as: RT-VSHARP-SLOT-RECORDS
What was wrong
every live V# slot of the console heap: about 580,000 in our world runs.
LEONIDA_CONSOLE_RELEASE_FILTER=1, the walk read words 0-2 of both halves of each slot fromheap.copy. Thatcopy is in ReBAR VRAM, so these were uncached reads. Without the variable, it fixed every live slot again.
was held for about 70% of the wall time.
What changes
runtime/src/console_heap_slot_records.h(new, portable). For each V# half (the buffer V# and the UAV counter),a record of:
64 KiB, so a range lookup visits only the entries near the range.
calloc, so pages for slots that are never written stay untouched.fix_console_slotis still the only writer of a slot's copy, and now also the only writer of its records.mutex for the list:
backing()add and release;title_block_gone;forget_copy:TitleVaAliasesnow tells listeners as each changehappens;
refresh_console_heapstakes the whole list and every heap re-fixes exactly the slots ittouches:
probe of 8 slots every 32 submissions.
slot records per submission: N changes, N slots looked at, N fixed again, N ms.What is removed
live_vsharpswalk and its bitset:src/console_heap_vsharp_slots.hand its test.LEONIDA_CONSOLE_RELEASE_FILTERand its README row.LEONIDA_CONSOLE_GPU_FILTER(GPU heap pass, opt-in) nowdefaults to unset instead of copying that variable's value.
released_backingsandTitleVaAliases::invalidations().DescriptorRangeChangesring (src/descriptor_range_changes.h), whose overflow fell back to a fullsweep, and
changed_ranges().retry_unmapped_slots. The second was never reached: nocaller set its
unmappedflag.retry_console_slots, the T# retries. Textures are not backings, so they need their own index (step A3).Tests
console_heap_slot_records_test(portable, CPU only):that only partly overlaps a slot's range; two slots naming the same backing; a buffer that comes back; a refused
alias copy that is backed later; a large span; a destroyed heap.
d3d12_unmapped_vsharp_test(Wine/Windows):all 128 restored at the first submission after their alias is added, and none after it is removed.
title_va_alias_testandgeometry_views_testcheck the listener in place of the ring and the invalidation counter.ctest(RelWithDebInfo, Ryzen 9 7950X3D iGPU, RADV, Mesa 26.3.1): 113 of 113 pass,2 skipped (as on
main).main2d43417d4: 423 pass, 23 fail, 39 skipped on both. The 23 failures are the same presentation, bcrypt andfile-system tests as on
main. The only differences areconsole_heap_slot_recordsadded andconsole_heap_vsharp_slotsremoved. No test went from pass to fail.tests/test_ci_registration.py,tests/test_docs_*.py,tests/test_text_write_line_endings.pyandscripts/check_no_game_data.pyon the changed files all pass.World run
RX 7900 XTX, RADV (Mesa 26.3.1), Wine, from a local build of
mainfac8b4bb9with this change and two others (RT-BINDLESS-DIMENSION-LIMITS and #2230), same settings as a run of plainmain:rescansand noCPU release filterlines in the whole run.submit phasesis 2.2 to 2.4 ms per submission in the world, where plainmainhad 32 to 321 ms at the same run time.slot records per submissionshows changes arriving and slots fixed again (for example 19.6 changes, 4,610 slots looked at, 22.5 fixed again, 0.074 ms).mainhere (three of nine earlier runs). In the windows before it there were no slot changes at all, and the paths that release or move a backing were checked again against the code; nothing shows this change as its cause. The run did not reach play, so the frame time in play is not measured yet.Not tested
rescansand noCPU release filterlines;slot records per submissionline: slots looked at in the thousands, not about 580,000;submit phases;AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #2407] d3d12: console heap slots record what their V#s resolved to; a release re-fixes only the slots naming it (RT-VSHARP-SLOT-RECORDS)to [PR #2407] [MERGED] d3d12: console heap slots record what their V#s resolved to; a release re-fixes only the slots naming it (RT-VSHARP-SLOT-RECORDS)