mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #2370] [MERGED] d3d12, xmem: remove remap release and the console heap mirror (RT-REMOVE-REMAP-RELEASE-AND-HEAP-MIRROR) #2372
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#2372
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/2370
Author: @aslan2142
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:remove-remap-release-and-heap-mirror📝 Commits (1)
b0767fdd3d12, xmem: remove remap release and the console heap mirror📊 Changes
15 files changed (+32 additions, -796 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+6 -20)📝
runtime/CMakeLists.txt(+0 -22)📝
runtime/README.md(+0 -3)📝
runtime/shims/d3d12_com.h(+0 -4)📝
runtime/shims/d3d12_compute_input_probe.h(+3 -3)📝
runtime/shims/d3d12_geometry_views.h(+4 -4)📝
runtime/shims/d3d12_vulkan_device.cpp(+13 -91)📝
runtime/shims/xmem.cpp(+0 -64)📝
runtime/shims/xmem.h(+0 -2)➖
runtime/src/console_heap_copy.h(+0 -98)📝
runtime/src/title_geometry_watch.h(+1 -1)➖
runtime/test/console_heap_copy_test.cpp(+0 -168)➖
runtime/test/d3d12_console_heap_mirror_test.cpp(+0 -216)📝
runtime/test/geometry_views_test.cpp(+5 -5)📝
runtime/test/xmem_test.cpp(+0 -95)📄 Description
Removes two features that came in with #2350 and were made opt-in by #2356 after they broke world runs.
Claimed in the coordination issue as: RT-REMOVE-REMAP-RELEASE-AND-HEAP-MIRROR
Both were additions on top of stopgap mechanisms, not fixes of the mechanisms themselves:
LEONIDA_GEOMETRY_REMAP_RELEASE): retired geometry copies when the title remapped physical pages. With it on, a world run on the RX 7900 XTX ended in a GPUVM page fault and a lost device (#2356).LEONIDA_HEAP_MIRROR,LEONIDA_HEAP_MIRROR_CHECK): a host-RAM mirror of a console resource heap's copy for the release sweep. With it on, a world run hung the GPU (#2356).With both variables unset,
mainbehaves as it did before this change.Removed
xmem.cpp:RemapReleases,remap_releases_enabled(), the page recording inunmap_range_lockedand its four call sites.xmem.h: the test seamrt::xmem::reload_remap_release_setting().xmem_test:test_remap_releases.src/console_heap_copy.h:ConsoleHeap::copyis a plainstd::uint8_t*again, written withmemcpy/memset. That includes the zeroing site that #2350's merge of #2162 resolved asheap.copy.zero().d3d12_vulkan_device.cpp:heap_mirror_enabled(),heap_mirror_check_enabled(),check_console_heap_mirror(), the check counters and their log line.d3d12_com.h: the test APIconsole_heap_mirror_mismatches().console_heap_copy,d3d12_console_heap_mirror,d3d12_console_heap_mirror_offandd3d12_console_heap_mirror_default, with their CMake entries.runtime/README.mdrows and the paragraphs indocs/d3d12_vulkan.md.Kept
LEONIDA_GEOMETRY_HOST(geometry copies in system memory, opt-in) and its memory-type assert.retire_range'sfinal_copy,copied at retirementin thegeometry buffersline). AnXMemFreeof a title heap block reports a release while its memory stays readable, so this copy is still made without remap release. Its comments no longer mention remaps.forget_pool_spanandretired with their copy. Every retirement (free, decommit, unmap) still feeds them.title_geometry_watch.h). Unmaps report page runs too.LEONIDA_CONSOLE_RELEASE_FILTER. It predates the mirror, and its sweep reads the copy again.LEONIDA_HEAP_MIRROR_CHECKlines.Not addressed here
The root problems behind both features need proper designs. This change does not touch them:
Tests
cteston the Ryzen 9 7950X3D iGPU (RADV RAPHAEL_MENDOCINO, Mesa 26.3.1): 111/111 pass.console_heap_copyis gone.main246791612: 418 pass now, 422 before. The difference is the four removed tests. No other test changed state, andxmemandgeometry_viewspass.tests/test_ci_registration.py,test_ctest_registration.py,test_docs_env_vars.py, the othertest_docs_*and CMake list tests,test_text_write_line_endings.py,compileallandcheck_no_game_data.pyon the changed files all pass.World runs
RX 7900 XTX, RADV (Mesa 26.3.1), Wine, the settings of the Linux section in
docs/running.md:b0767fd65)mainwith both features off also stopsmainwith both variables unset is the same configuration as this branch, and it reached the title's breakpoint in an earlier run.Not tested
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.