D3D12.X: unresolved standin::Shell pointers leak into native MakeResident, Evict, StorePipeline, and PC CreateCommandList #2455
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2455
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@microwave805 on GitHub · 2026-11-25 19:30 UTC · original
Static audit on
main @ c7e1799found that several D3D12 APIs acceptingID3D12PipelineState*/ID3D12Pageable*pass unresolvedstandin::Shellpointers directly into nativeD3D12Core.dll. Part of #1333, Part of #1833. (Note: open PR #2369 hardensstandin::query_interface, but does not hook these device / pipeline-library entry points.)Where
crates/xcl/src/hle/d3d12x/standin.rs:106(Box::into_raw(Box::new(Shell { ... })))crates/xcl/src/hle/d3d12x/real.rs:912-964, 2855-2920(unhooked residency & pipeline-library vtable slots)crates/xcl/src/hle/d3d12x/real.rs:3163(dev_create_command_listPC vtable override)crates/xcl/src/hle/d3d12x/real.rs:3651(Kind::PipelineLibraryadoption)Root cause
standin::shell()returns a RustBox<Shell>(standin.rs:106), not a nativeD3D12Core.dllCOM object. The following methods acceptID3D12PipelineState*(or its baseID3D12Pageable*) without resolving stand-ins:ID3D12Device::MakeResident(slot 34),Evict(slot 35),ID3D12Device1::SetResidencyPriority(slot 46),ID3D12Device3::EnqueueMakeResident(slot 51): unhooked inreal.rs:2858-2886, so a title passing a stand-in PSO in theppObjectsarray passes*mut Shellstraight toD3D12Core.dll.ID3D12PipelineLibrary::StorePipeline:real.rs:3651adoptsKind::PipelineLibrarywith zero method overrides inreal.rs:2855-2920, passing*mut Shellstraight intoD3D12Core.dll.ID3D12Device::CreateCommandListoverride (real.rs:3163): forwardsa4(pInitialState) unresolved (console slot 12 routes throughdevice_x::create_command_list_pc, which does resolve, but direct PC-vtable calls do not).Trigger
A title with
XCL_LAZY_PSO=1/ async stand-ins passes a stand-in PSO pointer toMakeResident,Evict,SetResidencyPriority,EnqueueMakeResident,ID3D12PipelineLibrary::StorePipeline, or PCCreateCommandList(..., pInitialState, ...)→D3D12Core.dllcasts*mut Shellto internalCPageable/CPipelineState→ immediate access violation / heap corruption.Fix direction
MakeResident,Evict,SetResidencyPriority, andEnqueueMakeResidentto replace any stand-in elements inppObjectswith their underlying driver pipeline (viastandin::pipeline_of/pso_async::resolve_for_bind) in a temporary stack/vec copy before calling native D3D12.ID3D12PipelineLibrary::StorePipelineto resolve (or reject/skip storing) stand-in PSOs rather than handing*mut ShelltoD3D12Core.dll.a4(pInitialState) indev_create_command_list(real.rs:3163).AI use
main @ c7e1799and issue drafting.@oni-swr on GitHub · 2026-11-25 21:10 UTC · original
Claiming this issue: resolving
standin::Shellpointers inMakeResident,Evict,SetResidencyPriority,EnqueueMakeResident,ID3D12PipelineLibrary::StorePipeline, and PCdev_create_command_list, with CPU unit tests.AI use: Claude Code (Claude Opus 5.5).
@KOLESNiii on GitHub · 2026-11-26 01:10 UTC · original
A related cache-facing entry point on
mainatb49be18. Verified: the shell’s ownGetCachedBlobcalls slot 8 on its shared dummy PSO. That call has no lookup of the asynchronously built PSO, so it still selects the dummy after the real one is ready. On compute the dummy containsdummy().cs. This differs from the nativeStorePipelinepointer path in the issue description. Shell method · Dummy compute descriptor · Normal resolutionIf a title asks for and persists this blob, its cache can record dummy bytecode identity. A title-side size probe could likewise report a stand-in size. Title calls and driver behavior remain unobserved here. Logging the receiver and HRESULT before and after the build completes would establish which case matters.
AI use was OpenAI Codex (GPT-6, exact serving variant unavailable) for static review and drafting.