Commit Graph

4696 Commits

Author SHA1 Message Date
00551ba009 DirectStorage: inflate zlib requests (file and memory sources)
A request with ZlibDecompress alone now reads SourceSize bytes of the file or of memory into a staging buffer,
inflates them with the runtime's RFC 1950 inflater (leonida::zlib_inflate in src/shader_library.h) and copies the
result to Destination only when it is exactly DestinationSize bytes. A failed stream leaves the destination
untouched, and a memory source inside its own destination inflates correctly.

Checks follow DSTORAGE_REQUEST and dstorageerr.h: DestinationSize must be larger than SourceSize with zlib
(E_DSTORAGE_INVALID_DESTINATION_SIZE), a zlib FileOffset must be 16-byte aligned (E_DSTORAGE_INVALID_FILE_OFFSET),
IntermediateSize stays 0 without BCPack. Stream failures map to E_DSTORAGE_ZLIB_BAD_HEADER, _ZLIB_BAD_DATA,
_ZLIB_PARITY_FAIL (Adler-32) and E_DSTORAGE_DECOMPRESSION_ERROR (a result of another size). GetStats counts
the inflates, the pending ones and the decompression errors.

zlib_inflate gains an optional failure reason (header, data, checksum, limit); its existing callers are unchanged.
BCPack, swizzle and physical-page requests still fail with E_NOTIMPL.

dstorage_test: synthetic streams only (Python zlib levels 9 and 1, stored blocks built by the test), from a file
and from memory, with every failure code; shader_library_test checks the new failure reasons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:06:16 +03:00
4c04c0f4e3 d3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41)
The retail title creates five one-argument command signatures with no root
signature at startup (device slot 41, CreateCommandSignature at its PC
position). One has the console argument type 105 and a 12-byte stride, next
to a DISPATCH and a DISPATCH_MESH of 12 bytes. The PC layer refuses the
unknown type, which is stop 19 of the RT-5 boot measurements.

Read statically from the title's call sites (shapes only): the two
ExecuteIndirect sites of that signature pass MaxCommandCount 1 and an offset
into the same argument buffer as the DISPATCH sites. Right before, they set
the same compute state as the DISPATCH path (pipeline, compute root signature,
tables, constants, SRV and UAV); they record on a second command list of the
title's context. So the argument is taken as a D3D12_DISPATCH_ARGUMENTS.

Slot 41 now has its own handler. A description that holds type 105 is copied
with that type replaced by DISPATCH (logged once). Any other description is
forwarded as the same pointer. What the console does differently for type 105
is left open in docs/d3d12_vulkan.md (section 4.9).

xs_proxy_mock_test: a two-argument description (a root constant, then type
105) reaches the PC slot 41 as a copy with DISPATCH, the same stride, count,
root signature, IID and output, and the caller's description is untouched; a
PC description is passed through unchanged. With main's d3d12_xs_device.cpp
the new check fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:05:11 +01:00
26fdf4170b file_system: CopyFile2 falls back to CopyFileExW on Wine 9 (RT-237) (#3655)
Squash-merged after diff review of PR #3655
2026-11-23 10:04:42 -06:00
edd0091db6 Merge remote-tracking branch 'origin/main' into rt-xs-slot133-placed-resource
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	runtime/shims/d3d12_xs_device.h
#	runtime/test/xs_proxy_mock_test.cpp
2026-11-23 17:03:46 +01:00
9ec92918ae d3d12_xs: slot 127 calls the queried ID3D12Device10, keeps tight alignment, refuses null heap properties; tests pin heap flags, session and reference counts
Review of #7052: dispatch and release through the ID3D12Device10 interface pointer (not the base device's vtable); keep every PC-valid resource flag bit, 0x400 included; null heap properties return E_POINTER; the test now passes non-zero heap flags and a protected session, checks the single release returns 0 for texture and buffer, and covers a distinct Device10 pointer.
2026-11-23 17:01:58 +01:00
a4551a1ce4 Merge branch 'pr-6953' into slot133-host-va 2026-11-23 17:01:43 +01:00
a637671a94 mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast (#6724)
Squash-merged after diff review of PR #6724 - mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast
2026-11-23 10:00:38 -06:00
0d73e8b95d Merge origin/main: slot 26 next to the Xbox slot routes
AI-assisted.
2026-11-23 16:59:58 +01:00
d5c9490611 d3d12_xs: an env override that moves an Xbox route onto device slot 70 wins over the built-in slot 70 handler
With LEONIDA_XS_FRAME_INTERVAL_SLOT=70, (0, 16667, 1, 0) reached the null-SRV writer and sent latency 1 as the CPU descriptor handle. The routes now live in route_xbox_device_slot, which slot 70 asks first. New xs_proxy_mock_env_slots_70 test fails before and passes after.
2026-11-23 16:59:43 +01:00
4da521de3e xgameruntime: serve XAccessibilityImpl and XLauncherImpl offline (speech synthesis, launcher) (#6810)
Squash-merged after diff review of PR #6810 - xgameruntime: serve XAccessibilityImpl and XLauncherImpl offline (speech synthesis, launcher)
2026-11-23 09:58:41 -06:00
35b4a8e00d d3d12_xs: D3D12ConfigureVirtualMemoryX returns S_OK (RT-5 first call) (#6792)
Squash-merged after diff review of PR #6792 - d3d12_xs: D3D12ConfigureVirtualMemoryX shim (first unimplemented call of the title)
2026-11-23 09:58:30 -06:00
62b410e756 gta6rt: emulate the Zen 2 instructions a desktop CPU may lack (INSERTQ/EXTRQ, CLZERO, MONITORX/MWAITX, CLWB)
The executable uses SSE4a INSERTQ, CLZERO and MONITORX/MWAITX (AMD only) and CLWB (Intel since Ice Lake)
without asking CPUID (docs/cpu_features.md). A host without one raises #UD there. src/cpu_emulation.h adds
a vectored handler that recognises those encodings at the faulting RIP, does the same work on the CONTEXT
and steps past the instruction; gta6rt installs it before any image code runs, after the startup trace's
handler so it runs first. One [rt] line names what the host lacks, one more per instruction on first use.

cpu_emulation_test checks the decoder on hand-written encodings, the bit-field helpers and apply() on a
synthetic CONTEXT, then runs every form for real from an executable buffer: natively on a Zen host,
through the handler on an Intel one, with the same expected values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:57:59 +01:00
e22994464b d3d12_xs: Xbox device slot 61 is CreateSamplerX, routed to the PC CreateSampler
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>
2026-11-23 16:57:30 +01:00
c7ca0f2d1c d3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16)
The title's descriptions carry the Xbox layout word and flag bits above the PC ones. Slot 25 now passes a copy with PC flags and a PC layout; the title's array is not written. Depends on #7078.
2026-11-23 16:56:52 +01:00
f20e99a528 Merge main 108c36ef7 into #6954
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>
2026-11-23 16:56:08 +01:00
2ae127201c runtime: build host_adapter_test only with the Windows runtime (#6783)
Squash-merged after diff review of PR #6783 - runtime: build host_adapter_test only with the Windows runtime
2026-11-23 09:55:52 -06:00
059f79129b presenter: recover a lost surface instead of a sticky E_FAIL (#6832)
Squash-merged after diff review of PR #6832 - presenter: recover a lost surface instead of a sticky E_FAIL
2026-11-23 09:55:22 -06:00
9b72d0d2cc tests: check sparse buffer sharing evidence within each API dump record (#6756)
Squash-merged after diff review of PR #6756 - tests: verify sparse queue-family indices within each buffer record
2026-11-23 09:55:11 -06:00
8714c3503b [RT-197] Add the XMA2 decoder C ABI boundary (#3441)
Squash-merged after diff review of PR #3441
2026-11-23 09:54:45 -06:00
9a9ca1ec14 d3d12: match Windows recording-time ExecuteIndirect validation (#6830)
Squash-merged after diff review of PR #6830 - d3d12: match Windows recording-time ExecuteIndirect validation
2026-11-23 09:53:12 -06:00
c3f171d0cb allocator_proxy, queue_proxy tests: take the guard fault's code in the filter (#6864)
Squash-merged after diff review of PR #6864 - allocator_proxy, queue_proxy tests: take the guard fault's code in the filter (Wine 9)
2026-11-23 09:53:02 -06:00
e1b51bf95c Exercise bounded integer 2D texel fetches in the pixel sweep (#6785)
Squash-merged after diff review of PR #6785 - Exercise bounded integer 2D texel fetches in the pixel sweep
2026-11-23 09:52:44 -06:00
87c6c2b261 file_system_test: a refused delete keeps the host's attributes, not the ones set (#6861)
Squash-merged after diff review of PR #6861 - file_system_test: a refused delete keeps the host's attributes, not the ones set
2026-11-23 09:52:38 -06:00
8897855399 d3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17)
The retail title asserts when its first full-screen render targets leave more than 2 MiB of a fixed budget unused (docs/retail_boot_chain.md, #6982). The PC size is about width x height x element bytes; the console takes whole RDNA2 SW_64KB tiles. Slot 25 adds the difference per render target description and never lowers a size. Depends on #6973.
2026-11-23 16:52:16 +01:00
ee56bf9335 runtime: a timed condition-variable wait releases its mutex on Wine 9 (#6847)
Squash-merged after diff review of PR #6847 - runtime: a timed condition-variable wait releases its mutex on Wine 9
2026-11-23 09:51:06 -06:00
3073250df5 d3d12_xs: Xbox device slot 70 writes a null shader-resource view instead of reaching PC CreatePlacedResource1 (retail boot chain stop 14) 2026-11-23 16:50:56 +01:00
1d73504242 runtime: retain import report when initialization fails (#6835)
Squash-merged after diff review of PR #6835 - RT-486: Retain the import binding report when initialization fails
2026-11-23 09:50:42 -06:00
8d622049ae d3d12_xs: device slot 127 creates the committed resource (CreateCommittedResource3 with Xbox descriptors, RT-5 stop 15)
Slot 127 is past the PC device vtable and was refused with E_NOTIMPL. It has the argument list of ID3D12Device10::CreateCommittedResource3; the proxy now calls the PC device's with the Xbox layout word and flag bits cleaned as slot 76 does. Measured in #6982.
2026-11-23 16:49:34 +01:00
2c72b0d281 d3d12: validate DXR acceleration-structure prebuild and recording inputs (#6825)
Squash-merged after diff review of PR #6825 - d3d12: validate DXR acceleration-structure prebuild and recording inputs
2026-11-23 09:49:28 -06:00
43a9c04501 Exercise translated pixel image_load through a matched integer descriptor (#6833)
Squash-merged after diff review of PR #6833 - Exercise translated pixel image_load through a matched integer descriptor
2026-11-23 09:48:21 -06:00
11aee7e0a8 d3d12_xs: device slot 133 places a resource as a committed DEFAULT one (CreatePlacedResourceX stand-in)
Xbox device slot 133 is (va, desc, initial_state, clear_value, riid, out), the shape of the console's
CreatePlacedResourceX. With #6953 the call reaches the beyond-table refusal and the title asserts on the
E_NOTIMPL. The proxy now answers it before that refusal: a committed DEFAULT-heap resource from the
description with the PC flag bits only, slot 76's layout rule, COMMON for a buffer or the all-ones state,
and the clear value only for render-target and depth textures. The resource is not backed by the memory
at va; that needs the physical-page mapper.

xs_proxy_mock_test: a mock CreateCommittedResource that records its arguments, and a slot 133 case over a
76-slot device (buffer, render target, all-ones state, null arguments, a failed creation). The
beyond-table check moves to slot 134.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:47:55 +01:00
e6515ea41d runtime: xapu.dll and chad.dll shims, connections that succeed with an empty result queue
The executable's ten APU and audio DSP imports (one call site each, four for XApuEnqueueCommand) now bind to runtime/shims/xapu_chad.cpp instead of the unimplemented thunk. Both connects return a handle; the APU connect also returns a zeroed shared buffer. Commands are accepted and dropped, the result count is 0 and dequeuing fails. xapu_chad_test calls all ten in the call-site shapes.
2026-11-23 16:45:35 +01:00
df9745bdf1 acphal: AcpHalAllocateShapeContexts writes a pointer only for a non-zero count 2026-11-23 16:45:34 +01:00
5457ec52de acphal: slots 3 and 4 answer 0 instead of E_NOTIMPL, so a message poll reads no message 2026-11-23 16:45:34 +01:00
1e431dfa94 runtime: AcpHal.dll shim, the audio heap with a 32-bit address mapping and a no-op hardware object 2026-11-23 16:45:34 +01:00
cc26796455 xg_xs: serve XGCreateTextureComputer and XGSuggestSwizzleMode as traced E_NOTIMPL 2026-11-23 16:45:24 +01:00
bc773d3073 rdna2spirv: v_pk_mul_lo_u16 forms each half as ((x << 16) * y) >> 16 (#6836)
Squash-merged after diff review of PR #6836 - rdna2spirv: v_pk_mul_lo_u16 forms each half as ((x << 16) * y) >> 16 (AMD driver drops the mask)
2026-11-23 09:45:17 -06:00
997d130892 dxgi_device_test: under Wine 9 the default adapter provider finds no adapter (#6873)
Squash-merged after diff review of PR #6873 - dxgi_device_test: under Wine 9 the default adapter provider finds no adapter
2026-11-23 09:44:00 -06:00
23e9c9535d d3d12_xs: say what is known about slots 25 and 43
AI-assisted.
2026-11-23 16:42:53 +01:00
2dbcb882c9 d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 (#6935)
Squash-merged after diff review of PR #6935 - d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80
2026-11-23 09:42:42 -06:00
355201c51e d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles 2026-11-23 23:42:40 +08:00
936675b975 d3d12_xs: appendix A.4 names the one claim from the executable; wrap two comments
AI-assisted.
2026-11-23 16:40:19 +01:00
e15e2c59ea RT-5: the retail executable reaches 17 GDK runtime classes through 161 linked thunks, and imports no xgameruntime.dll (#6751)
Squash-merged after diff review of PR #6751 - RT-5: the retail executable reaches 17 GDK runtime classes through 161 linked thunks, and imports no xgameruntime.dll
2026-11-23 09:39:20 -06:00
4d3d1e4448 d3d12: a write-combined range opens as a WRITE_COMBINE existing heap, an uncached one is refused
Measured on the RTX 4090 and WARP: PAGE_READWRITE | PAGE_WRITECOMBINE is accepted with
CPUPageProperty WRITE_COMBINE, PAGE_READWRITE | PAGE_NOCACHE is E_INVALIDARG. Two new cases in
d3d12_existing_heap_test; 8 of 8 match both host devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:36:33 +01:00
51d010100d xgameruntime notes: settle the assumptions the executable's thunk list answers (RT-5 follow-up) (#6865)
Squash-merged after diff review of PR #6865 - RT-5 follow-up: settle the xgameruntime assumptions the executable's thunk list answers
2026-11-23 09:35:55 -06:00
a365b5c85c xgameruntime_store: measure XStoreGameLicense's 104-byte layout from the retail executable (#6884)
Squash-merged after diff review of PR #6884 - xgameruntime_store: measure XStoreGameLicense's 104-byte layout from the retail executable
2026-11-23 09:35:34 -06:00
b4adb75081 Startup trace: name failed guest file opens, and LEONIDA_SKIP_INT3 to follow a boot past soft asserts (#6937)
Squash-merged after diff review of PR #6937 - Startup trace: name failed guest file opens, and LEONIDA_SKIP_INT3 to follow a boot past soft asserts
2026-11-23 09:35:20 -06:00
ced4057a98 TEST-468/469: GPU test tools request shaderInt64 only when a module declares Int64; vk_bindless_test honours LEONIDA_VK_DEVICE (#2647)
Squash-merged after diff review of PR #2647
2026-11-23 09:35:16 -06:00
695792de7a xmem: record XMemVirtualAlloc's attribute word and drop the PAGE_GRAPHICS_* protection bits (retail exe GPU pools) (#6908)
Squash-merged after diff review of PR #6908 - xmem: record XMemVirtualAlloc's attribute word and drop the PAGE_GRAPHICS_* protection bits (retail exe GPU pools)
2026-11-23 09:35:03 -06:00
56e607ac85 Runtime: pipeline-statistics queries around mesh draws (D3D-291) (#2359)
Squash-merged after diff review of PR #2359
2026-11-23 09:34:02 -06:00