Repository navigation
Conversation
|
A native Windows data point, and some questions from reading the import path. Run: GeForce GTX 1050 Ti (Pascal, 4 GB, no Resizable BAR), NVIDIA 582.66, Windows 10 Pro 19045, MSVC RelWithDebInfo, this PR at What the tests do not reach, from reading
Items 2 and 3 matter most for the boot as I read it: streaming lives in mapped xmem pages, so a buffer larger than one page is the normal case there. No game files. AI-assisted (Claude Code, with Antigravity for the build and test run). |
…, and failure tracking
|
@qhukz13 Thank you for the native Windows 10 / GTX 1050 Ti run and the thorough review! Addressed all 5 points in
Re-verified after
AI-assisted: yes |
aslan2142
left a comment
There was a problem hiding this comment.
Thanks, the table and the importer are tidy and the tests pass here. A few things need fixing before this can go in, and one question is for the owner (next comment).
- Lazily committed pages are lost for good.
map_pageregisters a page before a reserve-only section commits it; the first submission sees it uncommitted, callsmark_failed, and nothing retries. Pages only the GPU or DMA writes are never imported. - Two threads can import the same range (the submission path, and a view creation or lookup). The second
mark_importedretires the first import while a CBV may already hold its address. - The retire hook calls
vkDeviceWaitIdleon title threads, fromunmap_pageunderg_phys_mutexand the exclusive fault lock, while other threads may be submitting. - One
VkDeviceMemoryper 64 KiB page reachesmaxMemoryAllocationCount(4096 on NVIDIA under Windows) at about 256 MiB of mapped pages. TitleVirtualFreewithMEM_RELEASEand size 0 unregisters only the firstRegionSizerun; imports past it stay alive on freed memory.- Sharing mode: the imports are
EXCLUSIVE, while the layer creates its own buffersCONCURRENTacross queue families. - Scope:
resolve_shader_vacovers views the API creates. Root arguments and descriptors the title writes into its own memory, which is the black-frame path, are untouched. - Claim:
RT-TITLE-HOST-REGIONis roanh47's claim from 13:24 UTC, and I found no handover in #14. Could you sort that out with them there?
Tested on main 507029d1e + 31c072a42: Linux portable ctest on llvmpipe, 77 of 77; the Windows suite under Wine on llvmpipe and an RDNA2 iGPU (RADV), no test from pass to fail; title_host_regions and title_host_region_gpu pass on both, and the iGPU run took the import path.
AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).
|
@ubiquitarianism this is the first title-memory PR to reach review, and merging it would pick a direction for What #1273 commits
The two approaches that have been shown to run
Two questions
Nothing past the black frame can be merged without this, and the stack to the frame loop is going in now (#375 to #391 so far). AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
|
Two notes from a real boot on Windows 11 / RTX 4070 SUPER, for when this is rebased:
AI-assisted (Claude Code, Claude Opus 5.5). |
Follow-up to #927 (which added the
vk_host_region_import_testprobe) for RT-TITLE-HOST-REGION on #14.Summary
runtime/src/title_host_regions.h: Thread-safe (std::mutex) non-overlapping interval table (leonida::TitleHostRegions) mapping[host_va, host_va + size)to{gpu_bda, tag, handle}withfind(),resolve_bda(), partial-unmap splitting inunregister_range(),pending_imports(),mark_imported(),take_retired(), and process-widetitle_host_regions().runtime/src/vulkan_title_regions.h: LazyVK_EXT_external_memory_hostimporter (leonida::VulkanTitleRegions) creatingVkBuffers withVK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT,VirtualQuerycommitted-page validation on Windows,HOST_WRITE -> SHADER_READbarrier (record_host_write_barrier()), andvkDeviceWaitIdlecleanup of retired regions (collect_retired()).VK_ERROR_OUT_OF_HOST_MEMORYon 16 GB hosts.runtime/src/vulkan_backend.h,runtime/shims/d3d12_vulkan_device.cpp,runtime/shims/xmem.cpp:TitleVirtualAlloc,TitleVirtualFree(added toSHIM_TABLE(title_memory)),XMemVirtualAlloc(MEM_COMMIT),map_page, andunmap_page.VulkanContext::title_regions_whenhost_pointer_alignment != 0, syncs pending imports and emits the host-write barrier at command-buffer start, and falls back totitle_regions_.lookup(...)inreplay_.buffer_atandreplay_.host_at.runtime/test/title_host_regions_test.cpp: interval table, partial unmap splitting, retired handle lifecycle, and concurrent access.runtime/test/title_host_region_gpu_test.cpp: end-to-endVulkanContextimport,host_at/buffer_at/resolve_title_bda, GPU copy + readback verification of CPU-written bytes, and clean retirement before freeing host pages.Verification (NVIDIA GeForce RTX 3060 Ti)
ctest):title_host_regionsPassed (9.35 s),title_host_region_gpuPassed (0.23 s).clang-cl+xwin) under Wine 11.22:title_host_regions_test.exe: PASStitle_host_region_gpu_test.exe:ok (align=4096, bda supported)AI-assisted: yes