Repository navigation
d3d12, xmem: remove remap release and the console heap mirror (RT-REMOVE-REMAP-RELEASE-AND-HEAP-MIRROR) - #2370
Merged
aslan2142 merged 1 commit intoNov 26, 2026
Conversation
Both came in with ProjectLeonida#2350 as additions on top of stopgap mechanisms, broke world runs (remap release: a GPUVM page fault and a lost device; the mirror: a GPU hang) and were made opt-in by ProjectLeonida#2356. They go completely; with both variables unset, main behaves as before. Remap release (LEONIDA_GEOMETRY_REMAP_RELEASE, from 36771ec): - xmem.cpp: RemapReleases, remap_releases_enabled() and the page recording in unmap_range_locked; the four call sites (XMemMapPhysicalPages, the scatter call, both copy_page_mappings). - xmem.h/xmem.cpp: the test seam rt::xmem::reload_remap_release_setting(). - xmem_test: test_remap_releases (and the title_geometry_watch.h include only it used). - README row, the docs/d3d12_vulkan.md paragraph; comments that named it. Console heap mirror (LEONIDA_HEAP_MIRROR, LEONIDA_HEAP_MIRROR_CHECK, from 7460590): - src/console_heap_copy.h goes. ConsoleHeap::copy is a plain std::uint8_t* again, written with memcpy/memset as before the mirror, including the zeroing site that ProjectLeonida#2350's merge of ProjectLeonida#2162 resolved as heap.copy.zero(); the compute-input probe reads it directly again. Without the mirror, view() was the copy itself, so nothing changes. - heap_mirror_enabled(), heap_mirror_check_enabled(), check_console_heap_mirror(), the per-heap check counters and log line, and the test API console_heap_mirror_mismatches() (d3d12_com.h). - Tests console_heap_copy, d3d12_console_heap_mirror, _off and _default with their CMake entries; README rows and the docs/d3d12_vulkan.md sentences. Kept, because other paths use them or main's behaviour with the variable unset depends on them: - LEONIDA_GEOMETRY_HOST and its DeviceState memory-type assert (dc9ef1a). - The final copy at retirement (GeometryViews::retire_range's final_copy, "copied at retirement" in the geometry buffers line): XMemFree of a title heap block (free_title_block) reports a release while the block's memory stays committed and readable, so that copy is still made without remap release. Comments now say that instead of naming remaps; geometry_views_test case 15 stays. - forget_pool_span and "retired with their copy" in the title memory line: any retirement (free, decommit, unmap) feeds it. - The release queue's joining of touching ranges (title_geometry_watch.h): unmaps report page runs too; geometry_views_test case 16 stays. - LEONIDA_CONSOLE_RELEASE_FILTER, which predates the mirror; its sweep reads the copy again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merging. This is a self-merge.
AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2) |
DadaCap
added a commit
to DadaCap/leonida
that referenced
this pull request
Nov 26, 2026
… mirror test (ProjectLeonida#2370); the shadow_keep test stays Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gt9hwNPurxyJ9LAfUbNiYr
Kokonotcu
added a commit
to Kokonotcu/leonida
that referenced
this pull request
Nov 26, 2026
…our game-save packing kept - XDXR builder: upstream's update source check (MODE_CHECK, FLAG_IF_REFIT / FLAG_IF_BUILD) and vertex_count with our FLAG_PAGED and dispatch base: flags paged 8, translate 16, if_refit 32, if_build 64; the push block holds both sides' last word (vertex_count, base: 112 bytes, xdxr_build.h and .comp in the same order); xdxr_build.inc regenerated with glslc --target-env=vulkan1.2 -O -mfmt=c. - xmem: upstream dropped RemapReleases; our PhysLock stays. - Game saves: ours. Upstream's aligned blob packing (ProjectLeonida#2359) made the retail title assert at 0x1455AA5EB and fault on a string read as a pointer a few seconds into the boot; with our packing it boots to the loading screen as before. - Tests: upstream removed the console heap mirror test (ProjectLeonida#2370); its shadow-keep refill tests are added. - Console queues: one line per queue made (the retail title makes 1 direct, 4 compute and 1 copy queue) and per queue its executes at powers of two, to place the chained lists against the queues the title uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (d3d12, xmem: remap release and console heap mirror only on request (RT-GEOMETRY-REMAP-AND-HEAP-MIRROR-OPT-IN) #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 (d3d12, xmem: remap release and console heap mirror only on request (RT-GEOMETRY-REMAP-AND-HEAP-MIRROR-OPT-IN) #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 [integration] RT-LINUX-AMD-WORLD: what drew the world on Linux/AMD, with eleven runtime PRs, docs for running per GPU #2350's merge of d3d12: never defer buffer V#s past console-fix budget (RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP) #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).