Repository navigation
d3d12_xs: D3D12ConfigureVirtualMemoryX shim (first unimplemented call of the title) - #6792
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Tested on the retail engine Confirmed: |
|
Tested
AI-assisted. No game files. |
Hiiva
left a comment
There was a problem hiding this comment.
Bounded Windows startup integration review at #6792 a877d3bd8d9b50c44a17cdb6e17086d7f91f5c04 together with #6709 ecee287eafc44818c90340976bf85c8b5ddde91c, applied without production edits to main 1cc6e3c121969761d9dad8fdec99f19928213973.
No blocking issue found in this narrow synthetic scope. The configure shim registers the export with the Win64 calling convention, returns S_OK, and preserves its input block. The XMem change accepts only the two stated reserve-only pairs and leaves nonzero-attribute commits unsupported. The complete #6709 change comprises 25eb6a1b followed by ecee287e; its final commit alone is only a protection-name correction.
Native Windows 11 x64, MSVC toolset 14.44.35207, Windows SDK 10.0.26100:
| Synthetic check | Unchanged main production | Combined production |
|---|---|---|
Unchanged #6709 xmem_test.cpp |
105 checks, 2 failures at the two new reservations | 109 checks, 0 failures |
| Small registry-based configure/reservation sequence | Missing configure binding and both reservations rejected with error 50 | 20 checks, 0 failures |
The stock fixture is identical in both runs. Its check count differs because queries and release checks only run after a successful reservation. The sequence compiles the real registry, XMem and D3D12 shim sources. With LEONIDA_UNIMPLEMENTED=stop, the configure export resolves explicitly and leaves both synthetic 32-byte input blocks unchanged. Both 65,537-byte reservation requests are aligned to 64 KiB, rounded to 128 KiB, remain MEM_RESERVE, retain PAGE_READWRITE or PAGE_NOACCESS, and release successfully. The same attribute pairs with MEM_COMMIT still return ERROR_NOT_SUPPORTED. All four builds completed without compiler diagnostics.
This does not independently establish the title's configure-memory ABI or policy semantics. No title, game files, Vulkan device, GPU mapping, physical pages or gameplay were exercised. With the default unimplemented log policy, an absent configure shim already returns zero, so the two PRs have distinct effects: this PR gives the import an explicit binding, while #6709 changes the reservation result. The separately reported 2 MiB reserve-and-commit blocker remains outside both changes.
AI-assisted review.
|
Native Windows check of
I don't have the retail executable, so I can't confirm the boot passes this call here. The finding that the next stop is AI-assisted (Claude Code). No game files. |
|
Tested Guest. A ten-line
Side note on Suggestion. The PR has no test. A two-line check next to the other AI-assisted (Claude Code). |
tupacfan04
left a comment
There was a problem hiding this comment.
The code is sound, but the new docs row contradicts the page's provenance:
docs/d3d12_xs_surface.md:67saysMeasured: one pointer argument (a zeroed 32-byte block, dword +4 set to a count); the title only tests the result for failure- a retail-title/RT-5 measurement.- The same page's
Verification environment(lines 12-16) saysNo d3d12_xs.dll or game data was opened for this page, and no Wine run was made. - The confidence legend (lines 18-23) has no
Measuredcategory.
Either update the verification-environment paragraph and legend to include the retail-title measurement and its source, or mark the new note Reported/Derived and keep the measurement in the PR body/comment. No code change requested.
AI-assisted (OpenCode).
|
Tested
Outcomes only. No game files, trace contents or title addresses. AI-assisted (Claude Code). |
…all shape (RT-5) D3D12ConfigureVirtualMemoryX is the first unimplemented import the 1.0.2.1 executable calls on boot. Its shape was measured statically from the executable's only call site (read, nothing executed): - One argument: RCX points at a 32-byte block on the caller's stack, which the caller zeroes and then sets the 32-bit field at +4 of (a small count, 3 or 4, derived from the GPU virtual range it reserves right after with XMemVirtualAlloc). RDX, R8 and R9 are not loaded for the call. - The caller checks only the HRESULT (sign bit); a failure reaches a debug break. The block is not read after the call, so there are no out-parameters. On a PC the Vulkan device owns GPU virtual addresses, so the shim accepts the block unchanged and returns S_OK (E_INVALIDARG for null, which the title never passes). It logs the block's eight 32-bit words once to stderr, and gta6rt --trace records the first call as a "d3d12_configure_virtual_memory" event with those words and the caller. The unimplemented-import registry classifies the name as HRESULT by exact match, as for D3D12XboxCreateDevice, so the policy stub fails it correctly if the shim is ever removed. New test d3d12_xs_virtual_memory_test drives the shim through the registry in the measured shape (junk in RDX/R8/R9, block unchanged, nothing past 32 bytes written, null, one trace event). The docs/d3d12_xs_surface.md row now says "present". PR ItsNotRexed#6792 by undeadhuman37 added the earlier stub for this import; this builds on it with the measured argument shape, a test and the HRESULT classification, and is offered for folding into that PR. AI-assisted (Claude Code). Tested on an NVIDIA RTX 4080 SUPER, driver 617.42, Windows 11: CTest d3d12_xs_virtual_memory and unimplemented_policy pass, and gta6rt builds. No game files are used by the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on the retail Same result as above: A follow-up on top of this, if it's useful to you: seblessa@71543f3
I'd rather you fold it into this PR, or I can open it as a separate PR with AI-assisted. No game files posted. |
|
Tested a877d3b on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested a877d3b on Windows 11 Pro 10.0.26100, MSVC 19.51, using my own copy of the same executable (SHA-256
So the PR does what it claims. The next blocker on this exe is an early breakpoint/assert, not this import. Only counts and exception classes are reported here; no code, strings or bytes from the executable. AI-assisted (opencode). |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
runtime/shims/d3d12_xs.cpp adds configure_virtual_memory() returning S_OK for D3D12ConfigureVirtualMemoryX and registers it in SHIM_TABLE(d3d12_xs). docs/d3d12_xs_surface.md flips the row from "absent" to "present (returns S_OK)" with the measured call shape (one pointer to a zeroed 32-byte block; only the result is tested for failure).
Why merge
This is the first unimplemented import the title calls (exe+0x1e1cfe5) in RT-5. An explicit shim removes the unimplemented-stop and lets execution reach the next blocker. The PC/Vulkan side owns virtual memory, so accepting and ignoring the policy is correct.
Verdict: Approve
Summary
Why mergeThis is the first unimplemented import the title calls (exe+0x1e1cfe5) in RT-5. An explicit shim removes the unimplemented-stop and lets execution reach the next blocker. The PC/Vulkan side owns virtual memory, so accepting and ignoring the policy is correct. Verdict: Approve |
|
Wine data point for #6792: pass. Built
Nothing else in the import list changed. Full Nothing from the executable was run: |
…sNotRexed#6792) XMemVirtualAlloc now takes the attribute word and drops the PAGE_GRAPHICS_* bits (ItsNotRexed#6908). It still refuses the 2 MiB page mode (0x20003000), which 4 of the 14 fatal sites pass; the other 10 reach VirtualAlloc. The 6 calls refused for 0x4000/0x40000 are not fatal sites. D3D12ConfigureVirtualMemoryX has a shim returning S_OK (ItsNotRexed#6792), so it moves from "No binding" to the shims table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claim: #6603 (comment) (follow-up of RT-5).
D3D12ConfigureVirtualMemoryXwas the first import the title called (exe+0x1e1cfe5). It is now an explicit shim returningS_OK: the call passes one pointer to a zeroed 32-byte block (dword +4 set to a count) and only tests the result for failure; the PC/Vulkan side owns virtual memory. Docs row updated indocs/d3d12_xs_surface.md.Finding: this alone does not move the boot. The default 'unimplemented' policy already returned 0 for it. The crash right after it (breakpoint at exe+0x1e1d01b, exit 3) is the next call,
xmem.dll!XMemVirtualAlloc(0, size, 0x20402000, attributes 0x21, PAGE_READWRITE), which the xmem shim refuses because the attribute word is nonzero. #6709 (Stalkerino) already covers those reserve-only forms, so I did not write a second xmem change.Depends on: none (#6709 is the next blocker).
Tested: runtime built with MSVC (RelWithDebInfo, Windows 11, no Vulkan headers);
gta6rt --runon the 1.0.2.1 package passes the call (no unimplemented-stop on it) and then stops at the XMemVirtualAlloc null above. No GPU used. No game files posted.AI-assisted.
🤖 Generated with Claude Code