| Age | Commit message (Collapse) | Author |
|
GetTempPath (TEST-TEMPDIR-STRIPPED-ENV)
With TMP, TEMP and USERPROFILE all unset, GetTempPathW returns C:\Windows\, and the throwing create_directories/copy_file/ofstream on C:\Windows\leonida_* aborts with 0xc0000409 before the test body runs. runtime/test/test_temp_dir.h grows one entry, testfiles::temp_dir(): LEONIDA_TEST_DIR when set, the current directory when the temp environment is stripped (Windows), else the standard temp resolution. Fifty-two test files and the tiny_game fixture that called GetTempPathA/W or temp_directory_path directly now use it; d3d12_queue_handover_test.cpp also checks the _sopen_s result in capture_stderr instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it: tls_host_clone_dir in runtime/src/pe_loader.cpp (the loader_tls tests). Rebased onto current main after its D3D-448 additions to d3d12_mesh_test.cpp (3-way; the mesh test keeps both). Verification on a Windows VM: stripped environment - the previously crashing d3d12 tests exit 77 (no usable Vulkan device) instead of aborting, file_system_test runs all 505 checks and loader_test all 95 with zero failures; normal environment - identical outcomes; LEONIDA_TEST_DIR honored under a fully stripped environment (the scratch folder observed mid-run inside it, cleaned up after the pass). The finding is whoalin1's (coordination issue #14, 02:37:44Z).
AI-assisted.
|
|
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by
one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the
two solve one problem in two ways the base's is the frame and #939's plugs into it.
A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h,
d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions
ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's
proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease,
raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages),
the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's
duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in.
A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow
#939's rule that a device which ever had a handler has no queue fallback.
B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h,
pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile
and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps
the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad
lists as triangle indices.
B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list,
shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where
both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch,
executable shaders, default A8 views).
C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h,
rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp,
replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its
rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the
label fence on the base's submit.
D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test,
main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with
#939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's
answering first; --first-run-ui kept without host speech in its profile.
E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py,
scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's
v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the
base's executable-shader step with #939's cache fix; 366 registered tests.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
The case that loads fspx/, fspx_gfx/ and bvh/ indexes calls itself synthetic and runs against index files it writes itself, but two of its keys were the SHA-256 digests of two programs of the game's pipeline library (the ones docs/fspx.md cites as programs 842 and 843), with those numbers in the file names. A hash is not content, but a synthetic test has no reason to carry real ones, and nothing in the case depends on the values. They are 3333... and 4444... now, next to the 1111... and 2222... the case already used, with file names _00001 and _00002.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
#984's new slot 25 case first checks that the PC device refuses a depth-stencil texture with unordered access. Microsoft's runtime (WARP) does; Wine's vkd3d sizes the texture without validating the flag pair, so under Wine device_proxy and device_proxy_trace failed at that line (on #984's head as well as on the merge; both pass on main, which has no such case). The control now runs only where the host is Microsoft's, the way the other host comparisons do it (host_wine.h). The checks of the proxy itself are unchanged and run everywhere.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 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>
|
|
Three files conflicted; in each, both sides had added something and both
are kept.
runtime/shims/d3d12_xs_device.cpp: this branch still had the Xbox device
slot routes inline, followed by its fixed handlers for slots 86, 101 and
108; main has since moved the same six routes into
route_xbox_device_slot() (#385). The generic path now calls the helper and
then the three fixed handlers, so a configured route still wins over
them, as this branch's second commit intends. device_slot_overridden()
has main's list plus 86, 101 and 108.
runtime/shims/d3d12_xs_device.h: the comment lists both sides' slots.
runtime/test/xs_proxy_mock_test.cpp: the mock device keeps main's case 13
(CheckFeatureSupport) and this branch's case 68
(GetResourceAllocationInfo2); check_xbox_slots keeps main's slot 41 and 61
cases, one combined list of handled slots, and this branch's slot 86, 101
and 108 cases.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
(RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.
Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.
Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.
Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.
No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.
Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
Reopened from #7201 (closed in the PR reset), rebased on current main.
Slot 86 (CreatePipelineState stream) -> PC slot 47, slot 101
(CreateStateObject) -> PC slot 62, slot 108 (GetResourceAllocationInfo2)
-> PC slot 68. Slot 108 accepts the console C-ABI order (return buffer
first) and the PC order, reads the title's 56-byte D3D12_RESOURCE_DESC
entries, expands each into a zeroed D3D12_RESOURCE_DESC1, normalizes
Xbox layout words and flag bits, and refuses a count with a null array.
Rebase: kept main's slot 133 (CreatePlacedResourceX) next to the new
slots, and slot 108 now masks flags with slot 133's PC set (0x5FF, which
keeps USE_TIGHT_ALIGNMENT and drops 0x200) instead of 0x1FF.
(cherry picked from commit 1b07215c84443b87ad152ffdc8d23b0356125456)
|
|
first-run UI
Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic.
The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
|
|
console-form calls only
With the console tile sizes applied to every caller, a PC-form call through the proxy no longer answered what the
PC device answers, and the code that compares the two failed on Windows: device_proxy_test's two slot 25 checks
and d3d12_vulkan_device_test's allocation_mismatches (reported on #375 from MSVC builds on AMD and NVIDIA, the
first bad commit being the one that cleans the descriptions). Together with b4d1ba179, which scopes the cleaning
the same way, a PC-form caller now gets the PC device's own answer for its own description; the title's call,
which comes in the console form, gets the cleaned description and the console sizes as before.
xs_proxy_mock_test: the PC-form slot 25 case expects the mock device's size (it expected the console size), and
the mixed slot 56 case is asked in the console form. device_proxy_test includes d3d12_xs_desc_clean.h for the
cleaned description b4d1ba179's check compares with.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
|
|
(cherry picked from commit b4d1ba179436a73989b7c33dfcdd1eda473575f4)
|
|
CPU handles
(cherry picked from commit 355201c51e6aba95c582e2df344782b22e97bb31)
|
|
their block
The slot 25/26 cases added before this block call slot 26 four times, so its absolute counts (3, then 4) failed
on Windows. The counts are now increases from the block's start, and the forwarding check no longer shares a
line with a counter, so a counter failure is not reported as a forwarding failure.
Patch by BadgersMC, from the review of #362 (found and tested on native Windows with WARP; device_proxy_test
does not run under Wine here).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
|
|
The retail executable calls GetCustomHeapProperties (device slot 26) with the
C convention: the hidden return buffer in RCX and the device in RDX. The
proxy's generic forwarder assumed the PC C++ form (this in RCX, buffer in
RDX), took the buffer for the device and crashed on its vtable right after
D3D12XboxCreateDevice.
Slots 25 (GetResourceAllocationInfo, same rule, inferred) and 26 (measured)
now get thunks that accept either form: whichever of the first two arguments
is the device proxy is `this`. The runtime's own code still calls the proxy
through d3d12.h in the PC form. device_proxy_test calls both slots in both
forms against WARP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5dbc30bed79b399b527460501c0ee33f28712096)
Adapted to main by Mumogg: slot 26 keeps the thunk it already has (86b8e04e4), so of this commit's two thunks
only slot 25's is installed.
|
|
The retail executable calls GetCustomHeapProperties with the return buffer in RCX and the device in RDX. The forwarder took RCX for the proxy and faulted.
AI-assisted.
(cherry picked from commit 86b8e04e4c707350a10af7ef16f77b2c2e17b1ae)
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/shims/d3d12_xs_device.h
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/shims/d3d12_xs_device.h
# runtime/test/xs_proxy_mock_test.cpp
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/shims/d3d12_xs_device.h
# runtime/test/xs_proxy_mock_test.cpp
|
|
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/shims/d3d12_xs_device.h
# runtime/test/xs_proxy_mock_test.cpp
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/shims/d3d12_xs_device.h
# runtime/test/xs_proxy_mock_test.cpp
|
|
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
# runtime/test/xs_proxy_mock_test.cpp
|
|
preserve ClearDepthStencilView FLOAT Depth
#7021 translates title-owned CPU descriptor handles (__XMemAllocationHooks__) on
device slots 17-24, and #2490 wraps console-ABI command lists in ListProxy, but
neither wires translate_cpu_handle into the five graphics command-list methods
that consume CPU descriptor handles:
- console slot 50 (PC 46): OMSetRenderTargets (RTV array / single-range + DSV)
- console slot 51 (PC 47): ClearDepthStencilView (DSV handle)
- console slot 52 (PC 48): ClearRenderTargetView (RTV handle)
- console slot 53 (PC 49): ClearUnorderedAccessViewUint (CPU handle; GPU kept)
- console slot 54 (PC 50): ClearUnorderedAccessViewFloat (CPU handle; GPU kept)
Also installs a typed WINAPI thunk for console slot 51 (ClearDepthStencilView):
on the Windows x64 ABI, FLOAT Depth (4th argument) is passed in XMM3 rather than
R9, so the generic all-uint64_t list_slot template dropped/clobbered Depth before
forwarding to the real list.
Adds synthetic mock coverage across all five slots (including single-range RTVs,
null/zero-RTV cases, count > 8 bounds safety, outside-range passthrough, and
XMM3 float preservation) plus an end-to-end WARP/Vulkan GPU clear and readback
check in device_proxy_test.
|
|
|
|
created without it (stand-in)
The console allows ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS on a texture; the PC runtime refuses the pair and
slot 25 answered UINT64_MAX for it. pc_resource_flags drops the UAV bit from depth-stencil textures (slot 25 through
pc_resource_desc, and slot 76). Their UAV views then write no descriptor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Device slot 80 (WaitFrameEventX, from #6935) numbered its tokens with a
counter of its own, while XboxPresentation's pacer refuses any token above
the ones it issued itself. A title that waits through the device and
presents through the device's XboxPresentation therefore had every
PresentX refused with E_INVALIDARG once its tokens ran ahead of the
pacer's.
leonida::FrameTokenSource is now the counter both use: a pacer takes an
optional shared source (a standalone pacer still owns its own and numbers
as before), the device proxy owns one and exposes it through
rt::d3d12_xs::device_frame_tokens, and XboxPresentation passes a given
source to its pacer. A token that was never issued is still refused.
Reported by rafaelpssz in #7496.
|
|
|
|
description, the PC device's answer for the console layout word is UINT64_MAX (found by devnull34 on #7110)
|
|
|
|
slot 25 return-buffer form kept from #6973
|
|
|
|
|
|
AI-assisted.
|
|
Slot 48 goes through proxy_create_command_queue_xbox (filtered 16-byte prefix) via main's
queue_x route; the explicit slot 48 branch and the duplicate note_slot are gone. The
slot-48 header, slot name and tests follow, and device_proxy_test passes a 32-byte desc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Squash-merged after diff review of PR #6935 - d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80
|
|
CPU handles
|
|
The retail executable calls GetCustomHeapProperties with the return buffer in RCX and the device in RDX. The forwarder took RCX for the proxy and faulted.
AI-assisted.
|
|
The retail executable calls GetCustomHeapProperties (device slot 26) with the
C convention: the hidden return buffer in RCX and the device in RDX. The
proxy's generic forwarder assumed the PC C++ form (this in RCX, buffer in
RDX), took the buffer for the device and crashed on its vtable right after
D3D12XboxCreateDevice.
Slots 25 (GetResourceAllocationInfo, same rule, inferred) and 26 (measured)
now get thunks that accept either form: whichever of the first two arguments
is the device proxy is `this`. The runtime's own code still calls the proxy
through d3d12.h in the PC form. device_proxy_test calls both slots in both
forms against WARP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
too (RT-310)
|
|
slot
note_slot, note_heap_slot and note_child_slot did a fetch_add on the slot's hit
counter and a compare_exchange_strong on its first-call flag for each proxied
call. The compare-exchange takes the cache line for writing also when it
fails, and the flags of all slots share one or two lines, so threads that
call different slots slowed each other.
The first-call flag is now read before the compare-exchange. The hit counters
are test helpers: they count from the first call of a *_slot_hits reader or
of reset_device_proxy_stats, so a title's calls do not write them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
|
|
|
Device slot 9 (CreateCommandAllocator) now returns an allocator proxy,
the fourth command object after the queue and fence (BUILD-231) and the
list (D3D-136): the public chain (9 slots, Reset at 8) is forwarded, a
slot past it up to the end of a 64-slot table is logged and refused with
E_NOTIMPL, and a read past the table faults in its own guard region. The
console allocator's extra methods are not measured and not guessed.
A list takes the title's allocator in CreateCommandList and Reset, so a
proxy is only safe where the list side resolves it. Slot 9 therefore
wraps an allocator only when it answers kLeonidaCommandAllocatorTag (the
Vulkan layer's CommandAllocator, whose from() resolves the proxy for both
calls); a PC runtime allocator is handed out unchanged, logged once,
until a command-list proxy unwraps it at Reset. Allocator proxies are
unwrapped in the residency calls like heap, queue and fence proxies.
Device slot 12 is not touched.
Tests: allocator_proxy_test (WARP, a hardware adapter, the Vulkan device:
forwarding, refused tail, guard region, identity, D3D12's allocator rules,
a list created and Reset on the proxy with GPU copies through the queue
and fence proxies read back), mock cases for allocators with and without
the tag and their failure paths, and device_proxy_test's slot-9
expectations. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Name all four pointer and size pairs in the XboxNativeComputePipelineStateDesc
struct as kinds 0, 1, 6, 7 per docs/fspx.md and name the slot
DeserializeComputePipelineStateX in slot_name, matching the DLL's messages.
This prepares the description struct for the runtime FSPX resolver follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
CreateComputePipelineState (RT-99)
Xbox device slot 67 takes (desc, riid, out) with IID_ID3D12PipelineState and a console-only
descriptor with the root signature at +0x00 and code blob pointer/size at +0x28/+0x30.
Previously it logged and returned E_NOTIMPL.
Route it to CreateComputePipelineState on the PC device (slot 11) like slot 62, mapping the
console descriptor to D3D12_COMPUTE_PIPELINE_STATE_DESC. On the Vulkan device this resolves
through the translator via fssm_program and ShaderLibrary.
- Implement proxy_create_compute_pipeline_from_native_code in d3d12_xs_device.cpp
- Update device_proxy_test to verify slot 67 thunk, compute PSO creation over WARP, and argument checks
- Update d3d12_compute_test to verify slot 67 compute PSO creation on the Vulkan device
- Update documentation in d3d12_command_objects.md and d3d12_vulkan.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
The FidelityFX DLL's messages around the slot-67 call name it
DeserializeComputePipelineStateX ("DeserializeComputePipelineStateX
FAILED ... falling back to NewBE"). The slot name, the one-time log line
and the comment use that name and point at docs/fspx.md for the desc:
the root signature, then pointer/size pairs for the FSPX entries with the
native program at +0x28. Behaviour is unchanged: the proxy still refuses
it with E_NOTIMPL.
|
|
Device slots 8 (CreateCommandQueue), 75 (CreateCommandQueue1), 36
(CreateFence) and 32 (OpenSharedHandle of a fence) now return queue and
fence proxies. They forward the public chain in PC order (19 queue slots,
11 or 12 fence slots), refuse and log a slot past it up to the end of the
proxy's table, and name a read past the table through a guard region and
a vectored handler.
Heap, queue and fence proxies are unwrapped wherever a device or queue
method hands them to the real runtime: queue Signal/Wait, device slots
31/34/35/45/46/50. Arrays are copied without exceptions. QueryInterface
answers only the modelled interfaces, and logs one the real object has
but the proxy does not model. Outputs are cleared on failure as for
slots 14/62/76. --trace-d3d12 records proxy calls in the README grammar.
Every function a thunk hands its words to keeps them in the same
positions, because a title passes only as many as the method takes.
Tests: queue_proxy_test (host WARP, host hardware, Vulkan device;
differential per-process error cases, guard faults, identity, threads,
raw-slot client, child-runner self-test), xs_proxy_mock_test (older
devices, fences without Fence1, OpenSharedHandle branches, allocation
failures; three guard-setup fault modes), and device_proxy_test through
the D3D12XboxCreateDevice shim. No game files.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
failing
d3d12.h declares these outputs _COM_Outptr_ (NULL on failure), and the
inner Vulkan device clears it, but the Xbox-ABI proxy returned an error
with the caller's pointer untouched: slot 14 created into a local, and
slots 62/76 and heap slot 7 checked riid/desc before touching out.
|
|
|
|
XMemGetWorkingSetStatistics and device slot 67
amd_fidelityfx_upscaler_xbox.dll, measured with Ghidra 12.2 (through REA)
and run by fsr_dispatch_test on PC devices (RTX 2000 Ada and WARP) behind
the Xbox-ABI proxy.
Backend descriptor: the provider's create walks the chain for type
0x01000002, {header, device} with the device at +0x10, and ends in
FFX_API_RETURN_ERROR without it (what RT-3 got with 0x0200000x). With it
the DLL creates its backend through the proxy: device slots 14, 15, 18, 19,
27, 38 and 76 and heap slot 9, at the shapes the PC order and the measured
overrides predict; slot 76 takes the seven CreateCommittedResource
arguments. No earlier test here reached slot 76 or heap slot 9.
Two runtime bugs it found:
- XMemGetWorkingSetStatistics takes (kind, stats*): all seven call sites
pass kind 0x20000001 in ECX and a stack buffer in RDX. The one-argument
shim wrote to address 0x20000001.
- Device slot 67 is a console-only compute-pipeline call (a code blob in its
desc), not the PC CreateProtectedResourceSession1 the proxy forwarded it
to. The proxy now refuses it (E_NOTIMPL).
The context: on the RTX 2000 Ada the create stops at the DLL's HRESULT
check, because the driver refuses its R9G9B9E5_SHAREDEXP texture with
ALLOW_UNORDERED_ACCESS (WARP takes it). The test reports that stop and
retries with one PC stand-in (that texture as R32_UINT). On the context it
records one ffxDispatch into a logging command list that is never executed.
The console command list, from that run and the DLL's recorder (RVA
0x59a0), the same 13 calls on both devices: slots 14, 15, 25 and 26 at
their PC positions, then SetDescriptorHeaps at 32 (PC 28, seen in the run),
SetComputeRootDescriptorTable at 35 (PC 31), ClearUnorderedAccessViewUint
at 53 (PC 49, seen in the run), ExecuteIndirect at 61 (PC 59), and
console-only methods at 85 and 141. 33 and 41 fit SetComputeRootSignature
and SetComputeRootConstantBufferView by shape; the docs mark them inferred.
The logging list forwards only measured slots. The list object also carries
a write cursor and limits (+0x18, +0x28, +0x30) the DLL writes root
arguments and dispatches through while there is room; with the cursor at
the limit every command takes the vtable. These are the fields docs section
3.4 measured in the BVH builder without a meaning.
The dispatch stops at the DLL's compute pipeline: its 29 shaders are DXBC
with an ACCC part (payload tag FSPX) and no DXIL, and the PC runtime
refuses them at slot 62; the dispatch goes on with the null pipeline and
faults, which the test reports as the documented PC limit. Its C++ `throw`
also shows the loader gap: _CxxThrowException finds no image base for a
manually mapped image.
The test's fault report gives the faulting module and RVA, the access, the
C++ throw's ThrowInfo, image base and unwound stack, and the HRESULT the
DLL formatted with the DLL frames that made the failing call.
Docs: d3d12_vulkan.md Appendix A.3 and open question 2,
d3d12_command_objects.md 3.4 and 3.5a, design.md and runtime/README.md.
|
|
device_proxy and d3d12_xs_root_signature need a WARP adapter, which
Wine doesn't have: without one they exit 77, which CTest reads as a
skip (SKIP_RETURN_CODE). A missing DXGI factory still fails.
root_sig_test checked that the host serializer rejects the Xbox flag
byte. Microsoft's d3d12.dll does; Wine's (vkd3d) doesn't validate it.
That is a property of the host, not of the shim, so a host that accepts
it is reported as a skip, as the deserializer check already does.
|
|
The proxy read device slot 62 as (desc, riid, out), so XboxBvhBuilder's constructor, the only
known caller, got E_POINTER on its first compute PSO and threw it. Recorded on 1.0.2.1: the
DLL calls slot 62 with (desc, 0, 0, &IID_ID3D12PipelineState, out), the shape the prior art
had documented (d3d12_vulkan.md, sections 4.8 and 7). Read the IID and the output from the
fourth and fifth arguments, and log the two extra words once if they are ever non-zero.
device_proxy_test now calls slot 62 in that shape.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
- Wrap the PC ID3D12Device in a copied-vtable proxy: per-slot thunks swap `this` to the PC device, with IUnknown refcounting/QueryInterface, per-slot hit counters and XS_TRACE=1 first-call logging.
- Override Xbox slot 62 to the PC CreateComputePipelineState (PC slot 62 is CreateStateObject) and Xbox slot 76 to CreateCommittedResource (PC slot 27). The 56-byte description prefix is copied and its 0x101/0x1 layout word replaced by ROW_MAJOR for buffers and UNKNOWN for textures.
- Slot 14 wraps the created descriptor heap. On the measured PC runtime the heap getters take the hidden return pointer in RDX, while the Xbox ABI expects the 8-byte handle in RAX; heap slots 9/10 convert between them. Device slots 9/10 stay CreateCommandAllocator/CreateGraphicsPipelineState, because the measured handle getters are ID3D12DescriptorHeap methods.
- Heap slot 7 GetDevice returns the device proxy, not the raw PC device. The heap holds a device-proxy reference, so GetDevice cannot dangle; the device proxy does not reference heap proxies, so there is no cycle.
- Add device_proxy_test (WARP, no game executable): shim-created proxy, QI/refcount, slot 14 heap, heap GetDevice/refcount, raw RAX handles vs the PC hidden-pointer result, slot 9/16/30/43 forwarding, slot 76 buffer and texture, slot 62 compute PSO, and counter checks. Register it with ctest.
- Wire both CMake and scripts/build_runtime.ps1.
Verified against Windows SDK 10.0.26100 d3d12.h (slot counts through ID3D12Device14; no Device15/16 exists there) and a live WARP device. Still unknown: PresentX, queue/fence/command-list extensions, Xbox vtable order beyond the measured slots, and struct returns other than the heap handles.
Clean-room: implemented from the measured ABI-facts spec; no americas-recomp or AnyPS5 source was read or copied.
|