Commit Graph

55 Commits

Author SHA1 Message Date
efc1929908 runtime: eliminate Windows 11 full-space commit_pages_locked broadcast storm, ShadowPages/TitleTextureCells guard conflict, and streaming budget bursts 2026-11-30 04:34:17 -05:00
a58d22fe2e Merge upstream ProjectLeonida/mandy main (ddfe24fba) into fix/rendering-correctness 2026-11-29 09:37:37 -05:00
b17397f0dd tests: derive every test's scratch folder from test_temp_dir::temp_dir, not GetTempPath (TEST-TEMPDIR-STRIPPED-ENV)
With TMP, TEMP and USERPROFILE all unset, GetTempPathW returns C:\Windows\, and the throwing create_directories/copy_file/ofstream on C:\Windows\leonida_* aborts with 0xc0000409 before the test body runs. runtime/test/test_temp_dir.h grows one entry, testfiles::temp_dir(): LEONIDA_TEST_DIR when set, the current directory when the temp environment is stripped (Windows), else the standard temp resolution. Fifty-two test files and the tiny_game fixture that called GetTempPathA/W or temp_directory_path directly now use it; d3d12_queue_handover_test.cpp also checks the _sopen_s result in capture_stderr instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it: tls_host_clone_dir in runtime/src/pe_loader.cpp (the loader_tls tests). Rebased onto current main after its D3D-448 additions to d3d12_mesh_test.cpp (3-way; the mesh test keeps both). Verification on a Windows VM: stripped environment - the previously crashing d3d12 tests exit 77 (no usable Vulkan device) instead of aborting, file_system_test runs all 505 checks and loader_test all 95 with zero failures; normal environment - identical outcomes; LEONIDA_TEST_DIR honored under a fully stripped environment (the scratch folder observed mid-run inside it, cleaned up after the pass). The finding is whoalin1's (coordination issue #14, 02:37:44Z).

AI-assisted.
2026-11-28 19:01:06 +00:00
b699078893 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>
2026-11-27 04:55:14 -05:00
b73375f59d xmem: a slot-31 copy of a reused page number gives the table page the memory behind the number now (RT-MEMORY-MODEL)
Found by two world runs on the step-2 build (60, 61) that lost the device at the start of the 3D opening with a GPU
read of a garbage address, deterministic, where a run without step 2 (62) went past it.

map_table_page returned early when the table page already held the copy's page number. A number is not a page of
memory: XMemFreePhysicalPages puts the slot on g_free_slots and the next XMemAllocatePhysicalPages takes it back
first, naming a page of a new section. A stream pool's pages are freed and allocated again while the title keeps the
table entries, so the next copy of the same number left the table page on the freed page's frame (its entry holds
that section alive), and the readers of the GPU-only page and its CPU twin got the freed page's old bytes. Before
step 2 the twin was a host view, and map_page maps the number's current page every time, so the readers followed;
the GPU-only page had no readers.

The early return now also requires the frame the entry holds to be the number's current page (section and offset).

Test: xmem_test test_copy_page_mappings_reused_number: copy a page onto a paired GPU-only page, free it, allocate
again (the same number, asserted), map and fill it, copy again: the GPU-only page and its twin read the new page.
It failed before the change ("the table pages read the new page behind the number, not the freed one") and passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 04:07:03 -05:00
b54413e879 xmem: slot-31 copies onto a paired range make no host call; the host reads and writes those pages through the frame table (RT-MEMORY-MODEL)
Step 2 of the memory model. After step 1 the console queue's CopyPageMappingsBatchX gave a paired GPU-only page its
physical page by table, but still host-mapped the paired CPU page (the "twin") for the D3D12 layer and DirectStorage,
which read and write GPU-only memory there: one unmap plus MapViewOfFile3 per page through Wine's server. In the newest
local world run that was 47% of slot 31's pages and most of its 1.7-2.5 s of mapping per 10 s. By the log every host
remap was such a twin (pages by table minus pages by host equals the twins the title mapped itself, which are kept);
destinations with no CPU pair were none.

Now the twin is a table page too (map_table_page), and the host reaches table pages through their frames:
- src/title_frames.h: xmem's lookup (page -> its section's scratch view, held alive), its peers, monotonic bounds so
  other memory costs two loads, and for_each_part / run_end to split a range into table and host parts.
- xmem: g_table_frames under its own SRW lock (readers never wait behind g_phys_mutex), g_page_tables per physical
  page. A table page is aliased, its alias peers being its physical page's host views (note_mapping keeps them in
  step), so #1867's alias cells guard it where the title's CPU can write it. The title's unmap of a table page now
  tells its readers. transfer_physical pins and notifies table pages too.
- Readers: copy_guarded, texture_memory_readable, readable_page / readable_run_end (stream-pool extents),
  to_host_view, the ShadowPages walk and fill (a table page is read like a read-only page that is not the tracker's,
  clean while its cells are; a block with no host view anywhere is armed on its own cell), the geometry provider,
  the title buffers for vertex and index views, raw sampled surfaces, console value reads.
- Writers: kernel_writes::write and store write the frame and pin its peers; read_file reads into a bounce buffer
  first. DirectStorage goes through these.
- The slot-31 line keeps "pages N by table, M by host remap" and adds the paths behind them.

Not through the table: imports (a table page has no host pages; such buffers are shadows), GPU write-back into a
table page (left out like every aliased page; per-frame write-back is step 6), the LEONIDA_MAP_READBACK diagnostic,
the fsdraw and compute-input probes (host pages only), the batch hook's LEONIDA_SLOT31_CPU_TWIN mirror (not installed
in retail runs), and the title's own ReadFileEx/ReadFileScatter (the title has no CPU mapping there on the console).

Tests: title_frames_test (portable); xmem_test copy_page_mappings_cpu_view (no host view at either page, no host map,
reads and host writes through the frame, a write through the title's own mapping seen, remaps, kept twins, views
replaced once); d3d12_xmem_placed queue_remap_default_route (slot-133 buffers over the GPU-only pages and the twin read
them, a guarded title write through the pool's own mapping and a remap reach the GPU, no host remap).
Linux ctest (llvmpipe) 119/119; Wine suite on the iGPU against main e5a7c8942: no pass-to-fail (432 pass, the same 23
failures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 18:52:44 -05:00
8f606046f4 xmem: slot-31 page copies onto a paired GPU-only range are table updates, not host remaps (RT-MEMORY-MODEL)
The console queue's CopyPageMappingsBatchX goes through xmem's range callback in a retail run. It host-mapped every
destination page of a paired GPU-only range twice: the GPU-only page and its CPU twin. Each map is a VirtualQuery, a
placeholder split and a MapViewOfFile3/UnmapViewOfFile2, which are wineserver round trips under Wine. All of it ran on
the render thread under g_phys_mutex, which DirectStorage's page transfers take too. A local world run spent 3.9-6.0 s
mapping per 10-12 s.

Nothing on the host reads a GPU-only address of a paired range:
- the D3D12 layer, DirectStorage and the texture refresh read the CPU twin (title_gpu_views::to_cpu);
- the runtime reads a page by number through its section's scratch view (host_page);
- the title's CPU never touches the range (PAGE_NOACCESS on the console).

So such a page now gets its physical page in g_mapped and g_table_pages alone, with no host view, as the console edits
GPU page tables only. The twin is mapped as before, and so is a destination with no CPU pair: an independent-pages
range (LEONIDA_SLOT31_RUNS), whose pages are read where they are.
- A view the title mapped there itself is unmapped once when a copy lands on it.
- unmap_range_locked drops table pages in its range, so the title's own unmap or release clears them.
- A table page is not one of its physical page's host addresses (no note_mapping, no alias peer). It can be neither
  written nor guarded on the host, so a twin plus a GPU-only page is no longer "aliased" for the slot-133 shadows and
  the geometry watch.
- A table update raises title_memory_map::changed and geometry_writes::notify(replaced) for the GPU-only address, as
  a host remap did. A remap changes bytes, not what a V# resolves to, so the slot-record change list is not involved.
- The periodic slot-31 line gains "pages N by table, M by host remap" (slot31_mapping_counts).

Tests (Wine):
- xmem_test, test_copy_page_mappings_cpu_view: no host view on the GPU-only range; one host remap per page, not two;
  a copy from a GPU-only page finds what its table entry holds; a page the title mapped there is replaced by a table
  entry; the title's unmap clears the table.
- d3d12_xmem_placed, queue_remap_default_route: it read the GPU-only pages directly (the old behaviour). It now reads
  them through a slot-31 copy and checks that they have no host view.

Wine suite on the iGPU: 425 pass / 23 fail, the same as main e5a7c8942, nothing changed. Linux ctest on llvmpipe:
115/115.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 17:33:58 -05:00
b0767fd657 d3d12, xmem: remove remap release and the console heap mirror
Both came in with #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 #2356. They go completely; with both
variables unset, main behaves as before.

Remap release (LEONIDA_GEOMETRY_REMAP_RELEASE, from 36771ec53):
- 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 746059011):
- 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 #2350's merge of #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 (dc9ef1a0b).
- 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>
2026-11-26 10:43:18 -05:00
4a6a8a633e xmem: read LEONIDA_GEOMETRY_REMAP_RELEASE once, with a test seam to read it again
GetEnvironmentVariableA at every remap ran under g_phys_mutex in every scatter call; with it, xmem_test's split race
("the reader of the views' last pages never faults or misreads") failed in two full Wine runs in a row, where main
passed it twice. The value is cached as before #2350's default changed; rt::xmem::reload_remap_release_setting lets
test_remap_releases switch it. Two full runs since: no change against main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:05:43 -05:00
1f7cbeff9a xmem: a remap retires geometry copies only with LEONIDA_GEOMETRY_REMAP_RELEASE=1
Since #2350 a remap of physical pages that gives a page another frame retired the geometry copies over it, on by
default. In the first world run of that main on an RX 7900 XTX (RADV) the copies were retired by the thousand
(evicted 15010 in about 40 s) and the run ended in a GPUVM page fault (TCP read) and a lost device; the same build
settings without it ran eight minutes with evicted 0 and no fault.

A remap leaves the address valid on the console, so the title keeps using what names it, and not everything that
names a copy's address is rewritten when the copy goes:

- a root view is resolved while its list is recorded (d3d12_com.cpp, GraphicsCommandList::address); a list recorded
  before the retirement and executed in an ExecuteCommandLists begun after it is not among the replays the
  retirement waits for (kAfterExecutes covers only those in progress), so it reads the freed copy;
- a placed buffer view written outside a console heap carries the copy's address for as long as the descriptor lives.

The remap release is now off unless the variable is 1, read at every remap; the copies follow the new pages through
the refresh, as before #2350. Freeing, decommitting and unmapping still retire copies.

Tests: xmem_test test_remap_releases checks that a remap releases nothing by default and with 0, then the existing
checks with 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:57:50 -05:00
63c4978d2a Merge #1972 from kurrutako: a slot-31 copy leaves the title's own mappings at the paired CPU range (RT-SLOT31-CPU-TWIN-TITLE-PAGES)
Head 28fc0262d. Closed by its author as incomplete; merged because world run 41 had it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:32:25 -05:00
f5f67b4a9d Merge #2240 from zmasi: sync TitleTexture readability against title_memory_map between passes (RT-TITLE-TEXTURE-MAP-GEN)
Head d088ea79b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:16:27 -05:00
36771ec53d d3d12: geometry copies in system memory, and retired when the title remaps their pages
Geometry copies held 4.4-6 GB of VRAM in world runs and were never evicted: a view retired only when its range was
freed, decommitted or unmapped, and the title streams by remapping the frames of its pools.

- LEONIDA_GEOMETRY_HOST (unset by default): 1 puts the copies in system memory outside VRAM, write-back where the
  device offers a cached host type; 2 write-combined. The memory type is picked among the host-visible types that are
  not device-local (memory_type_order alone would give the BAR first); a device with none keeps its types. Logged once
  and in the geometry buffers line.
- LEONIDA_GEOMETRY_REMAP_RELEASE (on by default, 0 off): XMemMapPhysicalPages with pages, the scatter call and
  CopyPageMappingsBatchX report the pages whose frame changed (or went) as released (xmem's RemapReleases, collected
  under the fault lock, reported after it), so GeometryViews retires the copies over them through #2094's
  drain_released and kAfterExecutes reaping. A page mapped again to its own frame is no change.
- A retired view is copied once more from its pages when they are readable: a list recorded before a remap that took
  the view's address reads the new bytes, as the refresh this replaces would have given it.
- A stream-pool extent backed by a retired copy leaves pool_spans (it was kept for the device's life).
- A full release queue joins touching ranges before it collapses into one covering range.

Tests: geometry_views_test cases 14-16, xmem_test test_remap_releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:07:51 -05:00
d088ea79b8 Sync title texture readability with map journal between refresh passes
Between periodic refresh_title_textures passes, synchronous slot-70 view creation and the async fill worker checked TextureReadability with a constant generation, missing title_memory_map range changes since the last pass. Track the map generation on TextureReadability and consult title_memory_map::changes_since outside refresh passes so unmapped or decommitted pages defer before hashing and newly mapped pages publish immediately without waiting for a submission.

Also mark mix_words and hash_bytes LEONIDA_GUARDED_NO_BUILTIN using an unaligned 64-bit load so clang-cl cannot emit CRT memcpy calls inside the __try frame, and classify non-title read faults over unmapped title pages in xmem::physical_page_fault as FaultExit::passed_guarded.
2026-11-26 02:02:47 -08:00
ca00cc0e03 xmem: a slot-31 copy leaves the title's own mappings at the paired CPU range
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). It did so even where the title had mapped that CPU
page itself with XMemMapPhysicalPages or XMemMapPhysicalPagesScatter: a copy
replaced the title's page, and an unmap (kind 2) left the title's CPU page
reserved. The title's next read of it faulted, and the run ended.

The console's CopyPageMappingsBatchX edits only the GPU-only range's page
table, so a CPU page holding a mapping of the title's (physical, scatter 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 keep working. Each page kept is
counted and the first ones are logged.

The unmaps these paths make are now labelled in the read-fault report
(CopyPageMappingsBatchX unmap / paired CPU page / remap / hole,
XMemMapPhysicalPagesScatter unmap / remap) instead of the default "unmap".

xmem_test: test_copy_page_mappings_cpu_view now checks that a copy onto, and
an unmap of, a GPU-only page whose paired CPU page the title mapped keep the
title's bytes at the CPU page. Both checks fail on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:02:47 +01:00
ba626820ec Integrate post-story-load memory, queue and Vulkan runtime changes
Preserve physical window aliases across remaps, order console list values,
and replay bounded indirect graphics with captured draw state. Coordinate
pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU
and GPU coverage for the integrated paths.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
2026-11-25 03:44:43 -06:00
7ea226e65b Merge main (0aecc5efa: #984 and #968) into the #939 merge
main now holds the #984 merge (18a22c1ae) and #968, queue slot 31 as CopyPageMappingsBatchX. Two conflicts: the include list of d3d12_xs_device.cpp (both includes kept) and the call order in xmem_test.cpp (the two page-mapping tests of #968 run after test_physical_pages, after the early return of #939's file-pools mode). The slot 31 dispatch of #968 stays ahead of the presentation routes, so #939's rule for queue slots 30 to 32 on a device that had a presentation handler does not reach it where xmem is linked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 21:09:27 -05:00
c5510733e9 Merge main (with #984) into RT-QUEUE31 (#968)
main now contains the #984 merge this branch was built on, plus its last
commits (the five tests of #984 settled under Wine, and the title's hang
watchdog staying armed by default). No conflicts: runtime/test/xmem_test.cpp
and docs/d3d12_vulkan.md merged cleanly, with test_copy_page_mappings and
test_copy_page_mappings_cpu_view each defined and called once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:38:14 -05:00
38bd89d44e Merge the #984 result as of 71a783e56 into the #939 merge
Fourteen commits the #984 merge gained after 8a242efeb: its own failing tests (xmem_test under Wine, check_tls_index0, vk_bindless_grow, xs_present_lazy_test), the console-heap probe and the poke experiment behind their switches, Python tool fixes, and the title watchdog default. No conflicts.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:37:26 -05:00
154e4ec034 Merge the #984 result (main + RT-PROTON-STORY-LOAD) into #939
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.

A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.

A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.

B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.

B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).

C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.

D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.

E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:26:00 -05:00
2deadb0763 xmem_test: view checks that hold under Wine, and say what Wine cannot show
Three checks of the physical-page views fail under Wine, two of them on main as well (xmem is a known Wine failure there) and one that #984 adds; with #984 registering the test twice more (xmem_write_watch, xmem_no_write_watch) that made three red tests. Measured under Wine 11: a page of a reserved section view that has been written and reads back is still reported by VirtualQuery as MEM_RESERVE with protection 0 (type MEM_MAPPED, allocation protection PAGE_READWRITE), where Windows reports MEM_COMMIT and PAGE_READWRITE.

- 'unmapping one of them afterwards keeps the others' memory' (#984) asked whether the neighbours were still mapped through reserved_only(), which is the reported state. It asks for the view itself now (in_view: the region's type is MEM_MAPPED), which is what the check is about, and also that the unmapped page is no longer in one. Same on both hosts.
- The two checks of the reported state and protection of a written view page print SKIP with the reason when the host is Wine and gives exactly that answer; the first then still checks that the page is a read-write view holding what was written. On Windows both run as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:18:35 -05:00
255f170017 xmem: map slot-31 copies at the GPU-only range's paired CPU view too
Applies the fix oscarlosu-lab proposed on #968:
https://github.com/ubiquitarianism/leonida/pull/968#issuecomment-7142206199

What was wrong: queue slot 31 (CopyPageMappingsBatchX) targets the title's
GPU-only reservation, but the D3D12 layer reads that memory at its paired CPU
view (title_gpu_views::to_cpu). copy_page_mappings mapped the pages only at the
GPU-only address, so the paired CPU view stayed reserved and the layer's reads of
that memory (the slot-70 views waiting for readable memory) never became
possible.

The change, in copy_page_mappings:
- when the destination is in a paired GPU-only range and its CPU range is a
  physical-page window, every page mapped or unmapped at the destination is
  mapped or unmapped at the CPU address as well, with that window's protection;
- a source page not mapped at a GPU-only address is looked up at its CPU
  address.

Cost: a second view per copied page, so such a page is mapped at three
addresses (pool, GPU-only, CPU) and counts as aliased: the shadow tracker copies
it at every submission. Risk: the pairing is a heuristic (the CPU reservation of
the same size made just before the GPU-only one); if it is ever wrong, the
mirror replaces the title's own mappings in that CPU range.

The comment reports 9 alias checks but does not give them, so the test is new:
xmem_test's test_copy_page_mappings_cpu_view reserves a CPU + GPU-only pair and
checks that after a batch copy onto the GPU-only range the CPU range is
committed and shows the same bytes (and a write there is one memory with the
pool), that a GPU-only source mapped only at its CPU range is found there, and
that a null source unmaps both ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:17:45 -05:00
6fdeadfe50 Merge main with #984 into RT-QUEUE31 (#968)
Merges the local m984-on-main (1d89b20c5f), main with #984
merged, into #968's head f2268abea.

Conflicts and their resolutions:

- runtime/shims/xmem.h: both sides appended to the end of rt::xmem. Kept
  geometry_aliases and transfer_physical from #984 and appended #968's
  CopyPageMappingsFn typedef and the inline copy_page_mappings_fn after them.
- runtime/shims/xmem.cpp: copy_page_mappings and the self-registering
  g_copy_page_mappings_set stay right after XMemMapPhysicalPagesScatter,
  followed by #984's shadows_write_watch. One-line port: #984's g_mapped stores
  the page number itself (HostUnorderedMap<uintptr_t, uint64_t>), so
  `it->second.page` becomes `it->second`.
- runtime/shims/d3d12_xs_device.cpp:
  - includes: #968's "xmem.h" beside "d3d12_trace.h", then #984's includes;
  - constants: #984's block kept, kQueueCopyPageMappingsBatchX = 31 added after
    kQueueExecuteCommandListsX and its static_assert;
  - the slot-31 section (ConsolePageRange/Batch, copy_console_page_range,
    queue_copy_page_mappings) goes after #984's queue_execute_command_lists and
    before the "PresentX is at queue slot 30" comment;
  - child_slot: #984's queue block kept; the slot-31 dispatch (beyond the PC
    table and with xmem's hook set) goes just before the qroutes lookup, ahead
    of the presentation routes and the console-only S_OK tail. Newer-layout
    PresentX is 32, so 31 does not clash.
- runtime/test/xs_proxy_mock_test.cpp:
  - includes: "../shims/xmem.h" beside #984's d3d12_xs_frame_events.h;
  - #984's descriptor-heap and later checks kept, check_queue_copy_page_mappings
    after them. Without xmem the merged proxy answers slot 31 with the
    console-only S_OK, so that check's `== E_NOTIMPL` becomes `== S_OK` (and its
    summary line says so);
  - main: `|| check_queue_copy_page_mappings()` appended after
    check_presentation_wiring().

runtime/test/xmem_test.cpp merged without conflict: test_copy_page_mappings runs
after test_physical_pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:09:14 -05:00
39879ce0fd Merge main into RT-PROTON-STORY-LOAD (#984)
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted;
this commit is the resolution only. Build and test repairs follow in their own commits.

Rule of resolution: where both sides added different things, both stay; where both made the same change in two
forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two
changed the same code for different purposes, both purposes are kept.

Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, registry.cpp):
- d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device
  routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device
  slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the
  console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and
  list slot 139 (#396).
- Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's
  completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is
  attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider
  pc_resource_desc, S_OK for queue slots past the PC table.
- Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its
  undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base
  list proxy, its null-view slot 70 and its refusing slot 133.

Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp):
- Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra
  cases added; main's --env-slots-74 and #984's --env-slots-70.
- Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy,
  the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases.

D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h,
frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp,
d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp,
vk_pipeline_check.cpp, vk_test_device.h):
- Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's
  ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's
  origin, so both pools run on disjoint sets of textures.
- frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter.
- main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4
  stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980).
- shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it.
- Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count
  refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it.

Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp,
runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp):
- ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on
  ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file.
- gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries.
- Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped.

Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1,
make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py,
runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md,
runtime/README.md):
- Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake.
- rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's
  restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped.
- shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags.
- shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants.

One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC
compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 19:38:04 -05:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
f2268abead d3d12_xs: queue slot 31 is CopyPageMappingsBatchX, mapped through xmem (RT-QUEUE31)
The retail title calls its command queue's slot 31 (game_scarlett_master.exe+0xf2cc7f) with a batch count, 24-byte
batches {destination, range count, ranges}, the base and page count of its physical-page pool, and 0. Each 12-byte
range {kind, start, count} maps pool pages at the destination: 0 a run, 1 one page repeated, 2 unmapped, 3 unchanged.
main refused the slot with E_NOTIMPL; the title does not test the result and goes on to read the destinations.

Each range now reaches rt::xmem::copy_page_mappings_fn, which maps the physical page behind every source page at its
destination page (a second view of the same section, so both addresses are one memory) and unmaps where the source has
nothing or the kind is 2. The hook is set by xmem.cpp; tests that compile the proxy alone keep the old refusal.

Tests: xmem_test (a run, one page repeated, an unmapped source page, a null source, an overlapping range, bad
addresses) and xs_proxy_mock_test (the four kinds, a range past the pool, an unknown kind, xmem refusing, no xmem).

AI-assisted.
2026-11-24 15:58:40 +00:00
db19bbd345 runtime: connect native pipelines and title resources to the offline first-run UI
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.

The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
2026-11-24 21:19:30 +08:00
6c1d939509 runtime: honor LEONIDA_TITLE_MEMORY_MB in XSystemGetAppMemoryUsageLimit and XMemGetWorkingSetStatistics 2026-11-24 00:21:59 -05:00
f70ed489f5 xmem_test: the write-combine window's page is written before its view is queried
main's xmem commits a physical page on first touch, so the check added with the view-protection fix has to touch
the page first, as the read-write case above it does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-23 21:10:20 -06:00
80ed5dd304 xmem: map physical pages without a cache modifier in the view protection
Three of the retail executable's five physical-page windows carry 0x400
(PAGE_WRITECOMBINE on the PC) next to PAGE_READWRITE. host_protect drops only the
PAGE_GRAPHICS_* range, so map_page passed PAGE_READWRITE | PAGE_WRITECOMBINE to
MapViewOfFile3, which refuses it with ERROR_INVALID_PARAMETER: the first
XMemMapPhysicalPages into such a window failed and the title's descriptor-heap
setup returned false.

view_protect now drops PAGE_WRITECOMBINE, PAGE_NOCACHE and PAGE_GUARD.
xmem_test maps a page into a window reserved with that protection.

AI-assisted.

(cherry picked from commit 7e8e3c1db1)
2026-11-23 21:09:28 -06:00
ced3615124 local: merge #7584 (docs conflict: ours) 2026-11-23 13:34:47 -06:00
61c95045e4 test(xmem): multi-page unmap across views, remap inside a live run, freed page refused
The coverage gaps isfcrctfs listed on #7584.
2026-11-23 16:30:36 -03:00
b170ab90ee fix(xmem): cap host views at 1024 pages so a single-page unmap stays cheap
unmap_range splits a view by unmapping it and remapping both sides; with one view per run
that cost grew with the run (review on #7584). Capping views at 64 MiB bounds it.
2026-11-23 14:57:59 -03:00
af75a43dc9 xmem: judge a fault on a committed page by the protection at the faulting address
The handler queried the protection at the start of the 64 KiB page, so
a write to a 4 KiB part the title had made read-only looked allowed and
was resumed, faulting again forever instead of reaching the title's own
handler. It now looks the record up by the page and the protection up
by the faulting address. xmem_test writes to a read-only 4 KiB part of
a read-write page and expects the fault.
2026-11-23 12:48:20 -05:00
4a7bfd5c4d xmem: map a run as one view per host placeholder it spans
After a partial unmap or remap, a run of consecutive pages can lie across several host placeholders, and
MEM_REPLACE_PLACEHOLDER needs the view to fill one placeholder exactly, so mapping the whole run again failed with
ERROR_INVALID_PARAMETER. map_view now maps one view per placeholder the run spans; a fresh window is still one view.
Found and fixed by dotaku22 in review; xmem_test gains their check (the whole run maps again over a split range).
2026-11-23 14:43:57 -03:00
75c2b87a75 xmem: take the fault lock before reading or changing a mapped page's record
unmap_page moved the record out of g_mapped before taking the exclusive
lock, so a first-touch fault on that page could read a moved-from
section, and map_page made the view live before recording it, so a
fault in between was not recognised. unmap_page now holds the exclusive
lock from the lookup to the erase, and map_page holds it across mapping
the view and recording it. xmem_test adds four threads writing into a
window while 256 slices of pages are mapped and unmapped under them.
Reported by tupacfan04 in the review of #7556.
2026-11-23 12:37:42 -05:00
abd85df49f xmem: rt::xmem::commit_physical_pages commits pages by page number
A writer that copies into physical pages through its own view of their
section (a DirectStorage destination given as page numbers, #7652) sees
reserve-only memory for pages the title has not touched yet, and no
fault handler can resolve that address. commit_physical_pages commits
the given pages through each section's own view, one VirtualAlloc per
contiguous run, so such a writer can commit before it copies. Raised by
nurtrino in #7599.
2026-11-23 12:26:16 -05:00
5ba2a7f95f xmem: map consecutive physical pages as one view, so a 100,000-page XMemMapPhysicalPages fits the title's hang watchdog under Wine
One view per page cost a placeholder split and a MapViewOfFile3 per 64 KiB page. Under Wine that took
0.36 ms a page and more as views accumulate; the retail boot's 99,776-page call ran past the title's
30-second hang watchdog. Consecutive pages of one allocation now map as one view. A page remapped or
unmapped later splits its view and the neighbours are mapped again from the same section.
2026-11-23 14:06:59 -03:00
a07c8c0e89 xmem: commit physical pages on first touch, not when they are allocated
XMemAllocatePhysicalPages backed each call with one SEC_COMMIT section, so
the title's ~6.1 GiB page-pool request after boot stop 17 was charged in
full at once and fails with ERROR_COMMITMENT_LIMIT on a 16 GB machine.
Mapping the pages right away (as the title does) would charge most of it
within seconds too, so the commit now follows first access.

The section is SEC_RESERVE. A vectored handler commits the faulting 64 KiB
page through a reserve-only view of the whole section when the address
lies in a live mapping, so every view of that page sees it. Faults on
committed pages whose protection forbids the access, and faults outside
the mapped pages, go on to the next handler, and a failed commit is not
swallowed. rt::xmem::commit_physical_range commits a range up front for
shims that hand guest memory to the kernel.

Reported by controldebils and rafaelpssz in #7333.
2026-11-23 12:01:49 -05:00
7e8e3c1db1 xmem: map physical pages without a cache modifier in the view protection
Three of the retail executable's five physical-page windows carry 0x400
(PAGE_WRITECOMBINE on the PC) next to PAGE_READWRITE. host_protect drops only the
PAGE_GRAPHICS_* range, so map_page passed PAGE_READWRITE | PAGE_WRITECOMBINE to
MapViewOfFile3, which refuses it with ERROR_INVALID_PARAMETER: the first
XMemMapPhysicalPages into such a window failed and the title's descriptor-heap
setup returned false.

view_protect now drops PAGE_WRITECOMBINE, PAGE_NOCACHE and PAGE_GUARD.
xmem_test maps a page into a window reserved with that protection.

AI-assisted.
2026-11-23 13:50:59 -03:00
042c5f3783 xmem: physical pages, default allocators, XMemIsToolsMemAvailable; XMemVirtualAlloc takes 2 MiB pages and placeholders (#6919)
Squash-merged after diff review of PR #6919
2026-11-23 10:40:07 -06:00
695792de7a xmem: record XMemVirtualAlloc's attribute word and drop the PAGE_GRAPHICS_* protection bits (retail exe GPU pools) (#6908)
Squash-merged after diff review of PR #6908 - xmem: record XMemVirtualAlloc's attribute word and drop the PAGE_GRAPHICS_* protection bits (retail exe GPU pools)
2026-11-23 09:35:03 -06:00
085fe1efd4 xmem: serve XMemTransferMemory (RT-449) (#6351)
Squash-merged after review of PR #6351 - xmem: serve XMemTransferMemory (RT-449)
2026-11-23 08:06:21 -06:00
e2ac2238fa Runtime test clashes: typeless clears accept WARP's nearest-even tie (#521), three close-parity copies now match WARP, the source-size checks start from 300x200 again after ResizeTarget, one test_attribute_trace in xmem_test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:41:22 -05:00
2750153ed1 Merge pull request #2401 from Sc4ros
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:05:35 -05:00
be8570ace1 Merge remote-tracking branch 'origin/main' into triage-r43
# Conflicts:
#	docs/runtime_imports.md
#	runtime/CMakeLists.txt
#	runtime/shims/xgameruntime.cpp
#	runtime/test/xmem_test.cpp
#	tools/rdna2spirv.py
2026-11-22 22:12:50 -05:00
cf82fc26fd Merge pull request #3401 from 0xTehuti 2026-11-22 17:01:52 -05:00
fdf73f6696 Runtime: record each distinct XMemAlloc/XMemFree attribute word in --trace
xmem.cpp ignores the attributes argument, and the bits of the Scarlett
XALLOC_ATTRIBUTES word are not known yet. With gta6rt --trace FILE, the first
XMemAlloc and the first XMemFree for each distinct raw attribute word now
write an "xmem_attributes" event (api, the word, the size for an allocation,
the caller as module+RVA), so the bits can be decoded from a real run without
logging every allocation. Off: one relaxed load per call.

xmem_test opens a trace and checks one event per word and API, the size of the
first call, a caller on every event, and nothing recorded while the trace is
off. README.md documents the event.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 23:01:17 +01:00
4c52ce27a6 Seven fixes from an outside contributor (sent as patches, applied without the author's name)
- rdna2spirv: declare each packed vertex input register once; a register whose elements disagree on the component
  type is refused (SHADER-644).
- runtime: a title's VirtualAlloc drops the console's MEM_GRAPHICS / MEM_TITLE type bits the host rejects (RT-217).
- runtime: XPersistentLocalStorageImpl is served from <overlay>\persistent with the package's 2048 MB quota
  (RT-219; layout from the public docs, not measured in a caller).
- runtime: G:\ names the package and T:\ a scratch folder in the overlay; paths under the configured folders and
  every path with no folders configured stay host paths (RT-218).
- winhttp_offline: header blocks and timeouts the host WinHTTP rejects are rejected the same way.
- cfg_structure.run: a limit of zero or less runs no blocks.
- shader_meta: an s_movk_i32 with a register operand and a float immediate beyond float32 are left unknown instead
  of raising.

Each comes with a test that fails on the old code. Conflicts with main resolved here (internal_dir() hides T:'s
folder; both file_system_test blocks kept).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:55:46 -05:00
c2ac1ea34f xmem: strengthen registry +0 test against ullTotalPhys and qualify telemetry evidence (RT-220) 2026-11-22 21:46:27 +01:00