mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #1972] [CLOSED] xmem: a slot-31 copy leaves the title's own mappings at the paired CPU range (RT-SLOT31-CPU-TWIN-TITLE-PAGES) #1980
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#1980
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/1972
Author: @kurrutako
Created: 11/25/2026
Status: ❌ Closed
Base:
main← Head:rt/slot31-cpu-twin-title-pages📝 Commits (2)
ca00cc0xmem: a slot-31 copy leaves the title's own mappings at the paired CPU range28fc026d3d12_xs, test: say which route slot 31 remaps through; cover the retail route📊 Changes
4 files changed (+138 additions, -5 deletions)
View changed files
📝
runtime/shims/d3d12_xs_device.cpp(+6 -0)📝
runtime/shims/xmem.cpp(+42 -4)📝
runtime/test/d3d12_xmem_placed_test.cpp(+77 -0)📝
runtime/test/xmem_test.cpp(+13 -1)📄 Description
Claimed in the coordination issue as: RT-SLOT31-CPU-TWIN-TITLE-PAGES
What and why
copy_page_mappings(queue slot 31,CopyPageMappingsBatchX) mirrors every page it maps or unmaps at a GPU-only destination onto the paired CPU range (title_gpu_views::to_cpu, from255f17001). It did this even where the title had mapped that CPU page itself. A copy replaced the title's page, and an unmap (kind 2) left the title's CPU page only reserved. The title's next read of it was a fault in a window, left to the title, and the run ended. The commit that added the mirror names this risk: if the pairing is wrong, "the mirror replaces the title's own mappings in that CPU range".The console's
CopyPageMappingsBatchXedits only the GPU-only range's page table. So a CPU page that holds one of the title's own mappings (XMemMapPhysicalPages,XMemMapPhysicalPagesScatter, or a slot-31 copy onto that address) is now left as it is. Pages the mirror made itself, zero plants and pages with no mapping still follow the GPU-only range, so the D3D12 layer's reads at the CPU view still work. Each page left alone is counted, and the first ones are logged.The unmaps on these paths now carry their own label in the read-fault report, instead of the default
unmap:CopyPageMappingsBatchX: unmap, paired CPU page, remap, holeXMemMapPhysicalPagesScatter: unmap, remapTested
xmem_test(MSVC, RelWithDebInfo):test_copy_page_mappings_cpu_viewgains two checks. A copy onto, and an unmap of, a GPU-only page whose paired CPU page the title mapped must keep the title's bytes at the CPU page. Both checks fail on the old code and the whole test passes with the fix.Retail boot, own copy, RTX 5070: current
mainplus #1851, #1827, #1849, #1862 and #1886, Series S device type, same switches every time.scattermappingsBefore the change, each read fault's report matched a default-cause unmap of the same page 0.7–1.9 s earlier. The screen stays black at about 0.4 frames/s at this stage, as it did before the change. One boot is not proof that the crash is gone, but none of these reads came back.
GPUs tested: NVIDIA RTX 5070
AI-assisted.
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.