Repository navigation
d3d12_xs: device slot 61 is CreateSamplerX for the title's calls, again (RT-SLOT61) - #383
Conversation
746e7c9 to
6d4cf2c
Compare
…stack Contains ProjectLeonida#375 ProjectLeonida#377 ProjectLeonida#383 ProjectLeonida#385 ProjectLeonida#391 ProjectLeonida#395 ProjectLeonida#396 ProjectLeonida#403 ProjectLeonida#414 ProjectLeonida#416 ProjectLeonida#427 ProjectLeonida#430 ProjectLeonida#432. # Conflicts: # runtime/shims/d3d12_com.cpp # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/command_list.h
…ateSampler The retail title calls device slot 61 as CreateSamplerX(desc, dest handle), once per sampler, after its descriptor heaps exist (stop 20 of the RT-5 boot measurements in the coordination issue). The generic thunk forwarded it to the PC slot 61, which is CreateMetaCommand, so the sampler was never written. Slot 61 now has its own handler, like 62 and 67. It passes the description's PC D3D12_SAMPLER_DESC prefix and the handle to the PC CreateSampler (slot 22). That was enough to get the title past this call under Wine. Whatever follows the prefix in the console description is not known and is not read. A null description is skipped and logged once. A handle in the title's own heap range is #7021's translation. xs_proxy_mock_test: slot 61 reaches the mock's slot 22 with the same two words and never its slot 61; a null description reaches nothing. With main's d3d12_xs_device.cpp the new check fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit e229944)
…t caller gets PC CreateMetaCommand The proxy also serves host callers: d3d12_vulkan_device_test drives the Vulkan device through it, and its ID3D12Device5::CreateMetaCommand call (PC slot 61) landed in proxy_create_sampler_x (found by nullmarsh on #7115: the test stopped at line 5763 instead of main's known line 6574). Slot 61 now checks the caller's return address with a classifier the runtime installs (set_console_caller, the name #7490 uses): D3D12XboxCreateDevice installs rt::shims::mapped_image_base, so only a caller in an image the guest loader mapped gets CreateSamplerX. Any other caller, and every caller when no classifier is installed, is forwarded to the PC slot 61. xs_proxy_mock_test checks all three cases: no classifier (PC slot 61), a guest caller (PC CreateSampler with the same words; a null description skipped) and a host caller under an installed classifier (PC slot 61). d3d12_vulkan_device_test again stops at line 6574, as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 8f756ebe048af042638ce51a61490f35f4f44ee3) (cherry picked from commit c915e1d)
…riptor range Slot 61 passed the destination handle to the PC CreateSampler as given. With the title's descriptor range honoured (__XMemAllocationHooks__), a handle in that range has to be translated to the real heap's, as device slots 17 to 24 do (asked for in review on ProjectLeonida#377). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
6d4cf2c to
484962e
Compare
|
Backport check on current main: the routing commits apply and the suite passes, but the retail call is behind the pool gate I backported the two routing commits (
Branch for reference: |
One conflict, in docs/d3d12_vulkan.md: both sides added a row to the same table. Both are kept, in slot order: this branch's "Device slot 61" row, then main's "Device slot 81, queue PresentX/SuspendX/ResumeX" row. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Merged. Mumogg is still away and this is the next rung on What it does: device slot 61 is Conflict: one, in Holds and dependencies: there is no hold or maintainer request on this PR itself. The owner's hold on the stack was the Tests (clang-cl with the xwin SDK; Wine, headless; llvmpipe and an RDNA2 iGPU):
Follow-ups, none blocking the boot path:
#385 (device slot 74) is the next rung. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
Merges main at 1154976 into the integration branch at 273b3bd (merge base ece4ba5). 42 files conflicted; this commit is the resolution only. Build and test repairs follow in their own commits. Rule of resolution: where both sides added different things, both stay; where both made the same change in two forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two changed the same code for different purposes, both purposes are kept. Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h, d3d12_xs_desc_clean.h, registry.cpp): - d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and list slot 139 (#396). - Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider pc_resource_desc, S_OK for queue slots past the PC table. - Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base list proxy, its null-view slot 70 and its refusing slot 133. Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp): - Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra cases added; main's --env-slots-74 and #984's --env-slots-70. - Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy, the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases. D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h, frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp, d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp, vk_pipeline_check.cpp, vk_test_device.h): - Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's origin, so both pools run on disjoint sets of textures. - frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter. - main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4 stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980). - shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it. - Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it. Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp, runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp): - ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file. - gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries. - Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped. Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1, make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py, runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md, runtime/README.md): - Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake. - rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped. - shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags. - shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants. One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claimed in #14 as
RT-SLOT61. Depends on: #349, #350, #356, #362, #369, #375, #377 (their commits come first here; this pull request is the last two commits).What and why
After #377 the title calls device slot 61 once per sampler, as
(description, destination handle). On the PC that slot isCreateMetaCommand, andmainforwards it by number: a host access violation, reading through one of the title's words.Two commits by mrp1no, cherry-picked with
-x(authorship kept; ancestors ofmainwhose content is not in the tree):e22994464: slot 61 is routed to the PCCreateSamplerwith the same two words.c915e1da4: only for callers in an image the guest loader mapped. The proxy also serves host callers (d3d12_vulkan_device_testcallsID3D12Device5::CreateMetaCommandthrough it), and they get the PC slot 61 as before.The first commit conflicted where neighbours have been added since (slot 41's handler and test case, the slot lists, a docs table row); both sides are kept. The second applied cleanly.
Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on
mainece4ba5b3, with #142 and #328 applied on top for the boot runs (they are not in this branch).--runint3; the last traced call isID3D12Device9::ShaderCacheControl failed, reached through device slot 74 forwarded by numberSo the next stop is device slot 74, another console slot at a PC method's position.
xs_proxy_mock_testunder Wine passes with the three cases of the second commit: no classifier installed (PC slot 61), a guest caller (PCCreateSamplerwith the same words; a null description skipped) and a host caller under a classifier (PC slot 61).Not built with MSVC and not run on Windows; I did not run
d3d12_vulkan_device_test, which the second commit is about (it fails under Wine here onmainas well).AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt