diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-25 23:20:52 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 09:07:51 -0500 |
| commit | 74605901144918b3fec4c5ea87f79925ed7d172d (patch) | |
| tree | 6399b3b3a2a838d414d77d7a0454549d829c95f1 /runtime/src/pe_loader.cpp | |
| parent | cc0ae0b91ff68f7a4f77249bd3b3df6d8981c7a9 (diff) | |
d3d12: host-RAM mirror of a console heap's copy for the release sweep
A console resource heap's translated copy lies in the GPU address arena when the
import of host memory is not used, and the arena prefers DEVICE_LOCAL |
HOST_VISIBLE memory (ReBAR): the filtered release sweep
(LEONIDA_CONSOLE_RELEASE_FILTER=1) read words 0-2 of both V# halves of every
live slot from it, uncached across PCIe, 0.9-1.0 s a rescan in game runs.
ConsoleHeap::copy is now a leonida::ConsoleHeapCopy (src/console_heap_copy.h):
the copy plus an optional host-RAM mirror of the heap's bytes. Every CPU write
goes through write()/zero(), which write both; CPU reads use view(). The raw
pointer is no longer reachable by accident, so a missed write site does not
compile. No mirror for a copy in an import of host memory, for a sampler heap,
with LEONIDA_HEAP_MIRROR=0, or once the LEONIDA_CONSOLE_HEAP_GPU pass writes
the copy (dropped at attach).
LEONIDA_HEAP_MIRROR_CHECK=1 compares the mirror with the copy at every release
sweep and logs the first differing slots and a count per heap log line.
The sweep over 536k live slots of an 18 MiB heap with the mirror: about 5 ms
(console_heap_copy_test, host RAM). Tests: console_heap_copy (portable) and
d3d12_console_heap_mirror (first refresh, title writes and zeroes, a filtered
release sweep; again with LEONIDA_HEAP_MIRROR=0).
AI-assisted (Claude Code, Claude Opus 5.5).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions