runtime: export the title GPU registry across DLLs #514
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!514
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/514/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@agilesh08 on GitHub · 2026-11-22 08:43 UTC · original
agilesh08:feat/runtime-title-gpu-exports→main· +373 −1 · 8 files · 1 commits · closed without mergingChange
Exports the process-wide title GPU registry across DLL boundaries from
xmem.dllvia a clean, fixed-layout C ABI declared insrc/era_title_gpu_api.h.Previously,
docs/experiments.mdnoted:This change delivers that capability:
X2WTitleGpuAttach,X2WTitleGpuDetach,X2WTitleGpuTranslate,X2WTitleGpuLocate, andX2WTitleGpuGetShaderViewinsrc/xmem_shim.defandsrc/xmem_shim.cppwithX2W_TITLE_GPU_EXPORTS.xmem.dlldecoupled from directd3d12.dllimports on load so existing non-D3D12 startup tests (xmem_shim_exports) remain intact.tests/xmem_gpu_client.cppand harnesstests/xmem_gpu_cross_dll_check.cpp.xmem_gpu_cross_dll_warpinCMakeLists.txtand documents the cross-DLL contract indocs/experiments.md.Verification
On Windows x64:
Full MSVC CMake build and
xmem_gpu_cross_dll_warpexecution will be exercised in GitHub Actions Windows CI (windows.yml).Evidence and follow-up
The fixture
tests/xmem_gpu_client.cppand runnertests/xmem_gpu_cross_dll_check.cppexercise the cross-DLL C ABI round trip:E_INVALIDARG.X2WTitleGpuLocateconfirms correct resource resolution and byte offset arithmetic; out-of-bounds queries fail withHRESULT_FROM_WIN32(ERROR_NOT_FOUND).X2WTitleGpuGetShaderViewconfirms two-call capacity checking and table generation matchingTitleRangeinsrc/title_va_lookup.hlsli.X2WTitleGpuDetachbehaves idempotently, followed by clean re-attach.Checklist
Assisted by AI.
@alexander-src on GitHub · 2026-11-22 08:50 UTC · original
Reviewed
5990953by reading the diff againstsrc/era_title_gpu.{h,cpp}(static code review on Linux, did not build/run Windows tests). A few concrete issues in the C ABI and test harness:CMakeLists.txtsets onlyTIMEOUT 30onxmem_gpu_cross_dll_warpwithoutSKIP_RETURN_CODE 77, even thoughtests/xmem_gpu_cross_dll_check.cppreturns77when WARP creation fails. Also, if WARP does not supportD3D12_FEATURE_EXISTING_HEAPS,X2WTitleGpuAttach()returnsE_NOTIMPLandClientTitleGpuRoundTrip()turns that into exit code3instead of a capability skip (77), unlikegpu_alias_registry_warp.tests/xmem_gpu_cross_dll_check.cpp,MultiByteToWideChar(CP_UTF8, 0, argv[1], -1, path_buffer, MAX_PATH)does not check the return value. On a path longer thanMAX_PATH(or invalid UTF-8), it returns0andLoadLibraryWgets an empty string instead of sizing astd::wstringvia the two-call length query.src/xmem_shim.cpp,X2WTitleGpuLocate()leaves*resourceand*offsetuntouched onERROR_NOT_FOUND. Zeroing*resource = nullptr; *offset = 0;before the lookup (after the null check) avoids exposing an uninitialized out-pointer across the C ABI on a miss.src/era_title_gpu.h(lines 20-22) still states thatxmem.dllkeeps only its fourXMem*exports and cannot be reached from another DLL, which now contradictsdocs/experiments.md.@agilesh08 on GitHub · 2026-11-22 09:46 UTC · original
Closing for now to keep active review focused; will revisit after current PRs land.
Pull request closed