diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 04:55:14 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-27 04:55:14 -0500 |
| commit | b6990788936eb3ada0265bd052ff7536ddb84cb4 (patch) | |
| tree | 340a68b9b1f930dc264d77033aacac0b2cdddac3 /runtime/test/memory_breakdown_test.cpp | |
| parent | 11c6647c6e950f47fd7a956e2178ddda31029daf (diff) | |
d3d12, xmem: the page mirror: the title's GPU-readable pages at heap_base + their title address (RT-PAGE-MIRROR)
A V# or 64-bit pointer the title writes into its own memory names a title address, and the translated shaders read
heap_base + sext48(address). Nothing was there: run 63 lost the device on such a V# into the stream pool's GPU-only
window, which read zeros before step 2. The mirror puts the title's bytes there.
- src/title_mirror_space.h: xmem places every XMemVirtualAlloc reservation the title lets it place (address null) in
[16 TiB, 48 TiB), handed out in order at reservation time, so no title pointer ever holds an old address. RADV makes
sparse buffers at a chosen address only in its top 64 TiB, where heap_base (the sparse arena) is; heap_base + an
address there stays inside it. A reservation the range cannot take is placed by the host, as before.
- src/title_mirror.h (TitleMirror, Vulkan through hooks): 2 GiB sparse chunks at heap_base + title address
(bufferDeviceAddressCaptureReplay), one home per physical page (64 KiB of a 32 MiB host-visible unit), every page
that shows a physical page bound to its one home (aliases share bytes and GPU writes; a remap is a rebind), the binds
of a submission in one batch (the last bind of a page wins), homes freed after the retire ticket.
- src/title_frames.h Feed/Attach, xmem: every change of what a page of the range shows (host views in note_mapping,
table pages in note_table_page), in order, with the physical page's scratch bytes; attaching feeds the pages mapped
now under g_phys_mutex.
- src/title_mirror_tracking.h: the dirty set behind a small interface (watch, unwatch, collect: re-armed before the
caller copies), with GuardTracking (a geometry-watch cell guard per page) until a measured policy replaces it.
- DeviceState::create_page_mirror / refresh_page_mirror (first in the before-execute hook): chunks for new
reservations, the feed bound, written pages filled again once, the batch on the arena's bind queue signalling a
timeline value; VulkanContext::note_mirror_bind makes every queue's next submission wait for it (the ordering rule).
Off, with one line saying why, without capture-replay addresses, aliased strict sparse buffers, the bind queue, a
sparse arena, signed V# offsets, xmem or the write-fault handler (llvmpipe), or with LEONIDA_PAGE_MIRROR=0.
page_mirror_covers / page_mirror_address for the readers that move onto it. A log line every 10 s.
Tests: vk_title_mirror_test (native and under Wine, Raphael iGPU and RX 7900 XTX): a title-written V# read from a buffer
and dereferenced as the translated shaders do reaches its page, an alias the same, an unbound page reads zero; a remap,
a write (one upload for two aliases) and an unmap reach the next dispatch that waits for the batch; a home is freed only
after its ticket. d3d12_page_mirror_test (Wine, the game's device over xmem's pages): after slot-31 copies the GPU-only
page, its twin and the title's view hold the bytes at heap_base + address; a title write through its view reaches them
with one upload; a remap is a rebind with no host remap; an unmapped page reads zero. xmem_test: reservations land in
the range, the pair still pairs, the feed reports attach, host maps, table copies and unmaps in order, nothing after
detaching. Linux ctest (llvmpipe) 121/121.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/memory_breakdown_test.cpp')
0 files changed, 0 insertions, 0 deletions