Repository navigation
Integrate post-story-load memory, queue and Vulkan fixes (RT-POST-STORY-RUNTIME) - #1723
Conversation
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>
…ad_sampler.h
Both headers now include <windows.h>, and the test targets that reach them
through vulkan_replay.h (replay_uav_clear_offset_test first) do not define
NOMINMAX, so windows.h's max/min macros broke the std::max/std::min calls in
vulkan_replay.h ("expected unqualified-id") and the runtime's test build
failed. Guard the include the way vulkan_gpu_labels.h already does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I ran the post-rebase pixel checks on native Windows 11, RTX 4090 (NVIDIA 616.64), at the unmodified PR head
The failing fixture sign-extends the 48-bit resource offset in With only |
|
@Moriz82 heads-up: we're merging this, but the runtime's test build doesn't compile on this head. We're fixing it on the branch (maintainer edits) together with a merge of current
AI-assisted (Claude Code, Claude Opus 5.5). |
The list-values test of #1723 installs `record_page_mapping` as the CopyPageMappingsBatchX hook and checks `g_page_mapping`, but neither was defined, so xs_proxy_mock_test did not compile. The recorder counts the calls and keeps the arguments plus a copy of the first batch's first ranges, so section 6 can tell a deferred remap of the proxy's copy from one made at the call with the caller's array. It is written from `CopyPageMappingsHook` (shims/d3d12_xs_device.h) and the fields the test reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xs_proxy_mock failed at line 4791: on a queue whose presentation is managed outside (set_presentation_handler), raw(queue, 31, 0) must be E_NOTIMPL and must not reach SuspendX. #1723's CopyPageMappingsBatchX dispatch answered every slot-31 call itself, and with no hook and no xmem (a proxy compiled alone) queue_copy_page_mappings returned S_OK having mapped nothing. The test was right. The file's own comment says that without xmem the slot is refused as before, and check_queue_copy_page_mappings expects the console-only answer every unmodelled queue slot gets in that case. The new dispatch now runs only when something can remap (a hook set with set_copy_page_mappings_hook, or xmem's copy_page_mappings_fn); otherwise the call goes on to the presentation routes and the unmodelled-slot answer as on main. With xmem linked, as in gta6rt, nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Native Windows retail boot of this head, as the description asks. One machine; counts only, no game data. Setup:
Result, 600 s run (stopped by me): no device loss and no exception, but the load stalls. On this machine without this PR, the story load loses the device at about 250 to 270 s (WRITE_INVALID,
Second run, same build plus #1671, #1691 and #1703 (the slot 57 blend, depth/raster and dual-source state, which merge cleanly with this PR). Same switches and presses, and the same picture:
So the stall reproduces across two runs, with or without the rendering PRs. Happy to rerun with any switch or diagnostic you want on this machine. AI-assisted. |
…ap slots d3d12_title_va failed at line 502 and d3d12_unmapped_vsharp at line 191: a V# the CPU writes into a bound table of a layer heap, naming an address nothing backs (an unknown high address, a view past the end of a real buffer), kept its base after the table scan, so a shader would add heap_base to it and fault. The tests were right. #1723 added fix_vsharp, which rebases a V# into the title's memory and writes one with no GPU backing as zero-size, and gave it an "inline table" path (VsharpPath::table), but only the console heap copy calls it; scan_title_table still called rebase_title_vsharp, which leaves an unbacked base as it is, and only the slot's first V#. scan_title_table now runs fix_vsharp on both V#s of each slot (the second is a UAV's counter), as fix_console_slot does. With line 502 passing, the rest of d3d12_title_va runs again, #1539's check_declined_imports and check_import_over_shadow (run by d3d12_geometry_views) included. The same executable's d3d12_api_descriptor_copy and d3d12_rebound_* registrations stopped at line 502 too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the RDNA2 iGPU (RADV) d3d12_compute went from pass (main) to fail at line 676, and #1723's d3d12_unmapped_vsharp failed at line 135 and d3d12_graphics_indirect_heap_resources at line 478. In each, a view of an upload buffer came out zero-size ("buffer SRV: address 0xffffffffffe20000 (16 bytes) has no GPU copy; zero records"). Measured there: RADV puts upload buffers below the arena, so their VA (device address minus heap_base) is negative, 0xffffffffffe30000 in unmapped_vsharp. llvmpipe puts them above it, and all three pass there. main was right. docs/design.md ("Heap-relative buffer device addresses") makes the V# base a signed 48-bit offset: the translator sign-extends it, and main wrote such an offset for the layer's own buffers. d3d12_compute's shader reads it sign-extended, as the contract says. #1723's vsharp_address accepted a negative offset only with LEONIDA_IMPORT_BELOW_ARENA=1, the switch that decides whether title memory may be imported below the arena, and wrote every other view of such a buffer as zero-size. encodable() now accepts a negative offset that fits in 48 signed bits whatever the switch says. backed() still requires a buffer registered in gpu_backings or the geometry copies, so the switch alone still decides whether there is a title import there. An already-written V# whose bit 47 is set is also read as negative when that is what names a backing. Unbacked addresses still become zero-size, as #1723 wants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… imported d3d12_xmem_placed failed at line 113 (to_cpu(dst) == dst) and line 244 (independently_mapped(gpu, size)). #1723 added View::independent_pages, the to_cpu branch and independently_mapped for a GPU-only range that queue slot 31 maps by itself, but nothing ever sets the flag: xmem calls note_reservation without it, so every pair it makes is the legacy kind, read at its CPU view. Nothing in the runtime read independently_mapped either, although its comment says a slot-133 buffer there must be a shadow, not an import. Neither side is simply right. The tests express #1723's design, but no rule exists for which of the title's pairs are independent, and none can be inferred: marking every GPU-only pair independent (tried) breaks main's xmem test, whose pair (attributes 0x23/0x3, protect 0x2004 then 0x801, two constant sets docs/xmem_exe_calls.md lists among the title's sites) must read at the CPU view, and would move where DirectStorage, slot-70 views and slot 31's CPU mirror read and write in the game. That rule is left to #1723's author. So: - title_gpu_views::set_independent_pages(gpu) marks a pair. Nothing in the runtime calls it yet, so the game's behaviour does not change. - create_host_buffer declines an import over an independently mapped range before making anything, as independently_mapped's comment asks, and the shadow answers. On llvmpipe the import otherwise succeeded and the twin was never guarded (line 264, seen with every pair marked). - d3d12_xmem_placed marks its two windows. It now also checks that xmem made them the legacy kind and that marking changes to_cpu and independently_mapped. Everything after that (slot 31 remapping only the GPU range, the CPU view untouched, the guarded twin, pins, host and kernel writes) is checked as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d3d12_rebound_tables, d3d12_rebound_second_device and d3d12_api_descriptor_copy went from pass (main) to fail at line 896 of d3d12_title_va_test: 0/64 GPU words matched on both submissions, although the mirrored CBV in the layer heap was right (checked by printing the slot after the submission). They had been hidden behind line 502 in the same executable. main was right. Its rebound-table check selects the test shader's indexed CBV mode with s5 = 0xFFFFFFFB. #1723 added a mode that returns a descriptor's words instead, also on 0xFFFFFFFB, ahead of main's branch, so the rebound tables read the words at s8 (unset, address 0) instead of the CBV's data. #1723's mode now uses 0xFFFFFFFA, which nothing else uses, and its one caller (the out[3] dispatch in check_title_va) passes that. Both checks run as written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1723's new d3d12_compile_teardown failed on llvmpipe at line 436: no pipeline_cache.session.bin after teardown. It passes on the iGPU. The runtime was right and the test assumed every driver keeps compiled pipelines in a VkPipelineCache. Measured with a print in save_session_pipeline_cache: after the warm-up build, llvmpipe's vkGetPipelineCacheData returns VK_SUCCESS and 32 bytes, the header alone (the save limit was 64 MiB). The runtime writes no file of a bare header on purpose, as it is no cache. The check now reads the driver ID (VkPhysicalDeviceDriverProperties). On llvmpipe the file must be absent; on every other driver it must be written at teardown, as before. The rest of the case (the background build ran, the worker joined) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y track the list Found by the comparison agent, not by a failing test. #1723's console list slot path still handed slots 71 and 72 to main's GPU-label hook (record_gpu_label, LEONIDA_GPU_LABELS) when its own list values track the list (track_values, on by default with LEONIDA_LIST_VALUES). The --first-run-ui profile sets LEONIDA_GPU_LABELS=1 (runtime/src/main.cpp). With both on, two threads stored to one title address, one from a Vulkan command buffer's completion and query, the other from the part's fence and a D3D12 timestamp query. A late label could rewind a rising counter or split a begin/end pair. The suite did not catch it: xbox_gpu_label_completion submits its real list straight to the queue, so only the label path landed there. The list values are the right owner. They land slots 71 to 74 in queue order behind the gates, and they also do the waits the labels cannot do. Now: - The label hook runs only for a list the list values do not track (LEONIDA_LIST_VALUES=0, bundles). Each handoff is counted in ListValueStats::labels_handed. - The --first-run-ui profile no longer sets LEONIDA_GPU_LABELS. runtime/README.md and docs/first_run_ui.md say so. - xbox_gpu_label_completion runs its label section with the list values off, as it always measured the label path alone, and checks that all five writes went there. A new section turns both on and records one write32 and one write64 on a tracked list, submitted through the queue proxy. Each lands exactly once: writes_landed == 2, labels_handed == 0, and the values are in memory. With the old condition this section fails at line 136 (labels_handed was 2), on llvmpipe and the iGPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/test/xs_proxy_mock_test.cpp: main added check_depth_provider_refusal() next to check_placed_resource_x() (#1558); this branch added the list-values checks, which must run last because they start and stop the list-values threads. Both kept, the list-values checks still last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on native Windows 11, AMD Radeon RX 7800 XT (driver 26.11.2) with #1723 + #1715 + #1728 (manually merged) and Results:
AI-assisted: yes |
The integration of the post-story-load runtime changes (#1723) reads 32 environment variables that no document named, so tests/test_docs_env_vars.py failed. Each now has a row in the D3D12 switches table of runtime/README.md with its default and what its values do, read from the code: the console heap fix and retry budgets, the per-frame and asynchronous refresh trade-offs, the title texture fill and view settings, the XMem and queue slot 31 switches, the hang exit, the thread sampler, the submit-phase line and the Aftermath extras. Diagnostic-only switches are marked so. LEONIDA_QUEUE_PAGE_MAPPINGS is read by rt::xmem::queue_page_mappings_enabled(), which nothing calls; its row says it has no effect at present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
indirect_clamp_test came with #1723 and was registered through the foreach over ${test}_test with the other self-checking Vulkan tests, which tests/test_ctest_registration.py cannot see, so it reported the executable as built but never run. It is now registered next to its own add_executable, with the same SKIP_RETURN_CODE 77 and BUILD_TESTING guard, and left out of the foreach. Built and run with ctest on Linux: passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged. Thank you, @Moriz82: on our machine this is the biggest single step of the boot so far.
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Verified the merged commit On the earlier head, Synthetic fixtures only. AI-assisted verification with OpenAI Codex. |
…(list value writes) Conflicts: - runtime/README.md: ProjectLeonida#1723's LEONIDA_GPU_LABELS row (opt-in, only for lists the list values do not track). The rows ProjectLeonida#622 changed are brought in line with ProjectLeonida#1723 in the commits after this merge. - runtime/shims/d3d12_vulkan_device.cpp: both sides. ProjectLeonida#622 tracks the arena for the label path; ProjectLeonida#1723 resets the arena's block tree under its lock and starts the arena after the null region. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rites become the list values' fallback ProjectLeonida#1723's list values own list slots 71 to 74 of the lists they track and hand 71/72 to the GPU-label path only for lists they do not track. This keeps that, and keeps what ProjectLeonida#622 adds that ProjectLeonida#1723 lacks: landing a value in the GPU address arena and on an xmem page the title's view refuses. - LEONIDA_GPU_LABELS stays opt-in (`1`), as on main and in ProjectLeonida#1723. - src/value_write_sink.h: one place for the two targets a host store cannot reach, used by both writers. The device answers for the arena (an address below its size that is not the title's memory, the rule resolve_title_memory uses); xmem registers write_title_bytes for its pages. Replaces ProjectLeonida#622's label-only sink and xmem's title_write_fn. - The pump's land(): the arena is asked before any host store, so an arena offset is never stored to as a host address; then kernel_writes::store as before; then xmem's mapping when that store faults. Counted as writes_arena and writes_title_pages. - The arena refuses its reserved start (null region, zero page, quad indices) and a write past its end, stores an aligned value in one access, and is unregistered when its device goes. - xmem's write_title_bytes stores an aligned value in one access. - The label path keeps the same order for untracked lists. Test, no game data: xbox_list_value_fallback. A tracked list's writes to title memory land through the host store; to a default-heap buffer's arena offset land in the arena (read back by a GPU copy); to the arena's reserved start are dropped; to an xmem page the title made PAGE_NOACCESS land through xmem's mapping. LEONIDA_GPU_LABELS=1 throughout, and no write is handed to the label path. Without the arena step it fails at line 168, without the xmem step at line 208 (llvmpipe and the iGPU). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…say who writes and who waits ProjectLeonida#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the only writer of 71 and 72. Under ProjectLeonida#1723 the list values record all four for the lists they track (waits included), and LEONIDA_GPU_LABELS=1 writes 71/72 only for the others. The command-object table, the value write paragraph, §5.5 of the console ABI notes and the README row now say so, and name the arena and xmem fallbacks (src/value_write_sink.h). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… value writes) No conflicts. Brings ProjectLeonida#1723's final form: the README rows for 32 LEONIDA_* variables and indirect_clamp_test's ctest registration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… replaces ours; the same-layout skip and the tests stay Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wner (#1723, #1918) Wave 10B: port unmapped-V# nulling, console heap sanitization + bounded round-robin re-probe, and 64 MiB resource-heap null tail guards from ProjectLeonida/mandy#1723 (GPL-3.0, author Moriz82, commit 9177972ae89d), plus RT-FAULT-ADDRESS-OWNER (Windows VirtualQuery + VK_EXT_device_address_binding_report tracking via LEONIDA_ADDRESS_BINDINGS=1) from ProjectLeonida/mandy#1918 (GPL-3.0, author kawaii-shakal, commit 223913540b12). Preserves all ultimate enhancements (Wave 8-1 TitleVaAliases::is_shader_va, Wave 7-1 NVIDIA host-image-copy policy, Wave 9E compile worker priority, and title_vsharp_guard/xmem-shadow guard-page semantics). Verified with Ninja + /Z7 and LEONIDA_VK_VALIDATION=1 on RTX 3080: 6/6 CTests pass (title_va_alias, title_vsharp_guard, vk_device_fault, address_binding, d3d12_xmem_shadow, d3d12_unmapped_vsharp) with 0 validation errors.
…LAS BLAS-VA translation (#1723) & boot_bench RAGE9 BLAS tracking - Add runtime/src/large_module_gate.h & runtime/test/big_compile_gate_test.cpp (adapted from TheGeogeo, ProjectLeonida/mandy#1889, RT-BIG-COMPUTE-BUDGET, GPL-3.0): dynamic RAM/commit-budgeted admission (512 B/SPIR-V byte, 3/4 free RAM/commit room), demand-over-speculative FIFO priority, Demand RAII guard, and process-wide helper. - Wire PipelineCompiles::build(run, budget) + VulkanContext::set_large_compiles() in vulkan_replay.h and vulkan_backend.h while preserving Wave 9B (#1877) and Wave 9C (#1874/#1264). - Port XDXR TLAS BLAS-address translation (FLAG_TRANSLATE / blas_address / XdxrBlasTable) from Moriz82, ProjectLeonida/mandy#1723 (GPL-3.0) across xdxr_build.comp, xdxr_build.inc, xdxr_build.h, vulkan_replay.h, vulkan_backend.h (stage_xdxr_table + set_xdxr_blas_table_provider), and add out-of-arena TLAS instance verification in d3d12_xdxr_rt_test.cpp. - Update ops/boot_bench.py to count RehydrateRaytracingAccelerationStructureBatched2X RAGE9 rehydration ok lines in rt_as_builds (not rt_as_skipped) with --selftest coverage.
Claimed as RT-POST-STORY-RUNTIME in the coordination issue.
This follows #984, which brought the offline boot through the end of the story load on Linux/Proton and native Windows. This draft brings the subsequent runtime changes onto upstream’s pipeline-worker, descriptor and queue interfaces. It includes the queue, memory and draw changes together so reviewers can exercise the same executable the integration tests cover.
What and why
Contributors. Plaaasma co-authored the changes, including XMem window handling, list values and descriptor backing. ivanepsilondelta contributed the stateful indirect graphics and pixel tests. Both are credited on the integration commit.
Tested
The accepted working build used a diagnostic configuration with title compute, indirect draws and acceleration-structure builds disabled, and stub pipelines enabled. That run establishes progress through loading. Playable world rendering and default-settings performance remain unverified.
Open checks for this draft
GPUs tested: NVIDIA GeForce RTX 4070, driver 620.73.04, CachyOS with Proton Experimental. The native Windows RTX 4070 Ti result above belongs to #984.
AI-assisted: yes
Checklist