Commit Graph

4696 Commits

Author SHA1 Message Date
4eeb61b301 d3d12: OpenExistingHeapFromAddress backs a heap with the caller's memory (VK_EXT_external_memory_host)
The retail executable opens the 64 KiB graphics region it has just committed with XMemVirtualAlloc
through device slot 48 right after its first queue and fence; the layer answered E_NOTIMPL and the
title asserted.

The call now answers as the host runtime does on an RTX 4090 and WARP (six cases measured in
d3d12_existing_heap_test): the base of a VirtualAlloc allocation committed read-write over its whole
size opens a heap of that size, 64 KiB aligned, CUSTOM / WRITE_BACK / L0, SHARED |
SHARED_CROSS_ADAPTER | ALLOW_SHADER_ATOMICS; an inner address, a partial or reserve-only commit
and a read-only range are E_INVALIDARG. The backing is the range itself, imported with
VK_EXT_external_memory_host, which the device and the test device enable when present.
CheckFeatureSupport(EXISTING_HEAPS) follows the extension. Placed resources in such a heap are
refused (E_NOTIMPL, logged) until the placed path addresses memory outside the arena.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:33:40 +01:00
86b8e04e4c d3d12_xs: device slot 26 takes the console's struct-return form
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.
2026-11-23 16:33:12 +01:00
8f208d09a2 rdna2spirv: 8/16-bit MUBUF loads and stores (buffer_load_ubyte/ushort/d16, buffer_store_byte/short) (#1864)
Squash-merged after diff review of PR #1864
2026-11-23 09:32:35 -06:00
5dbc30bed7 d3d12_xs: device slots 25/26 take the title's C-ABI struct return
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>
2026-11-23 16:32:28 +01:00
0cde63d618 d3d12_xs: device slot 48 creates a command queue proxy from the 32-byte Xbox description
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:30:47 +01:00
4b76715cf6 d3d12_xs: extend the device proxy table to 192 slots so slots past the PC vtable refuse with E_NOTIMPL
The retail title calls device slot 133, past the 128-entry table; the call read an empty entry and jumped to 0.
Every slot beyond the PC device's vtable now reaches the generic thunk. Mock test covers slot 133.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:30:44 +01:00
4224c53b14 xgameruntime: serve XErrorReport, the sixth name the GDK thunks look up
libHttpClient.GDK.dll and XCurl.dll reach the GDK runtime through
xgameruntime.lib's thunks: LoadLibraryW("xgameruntime.dll"), then
GetProcAddress of InitializeApiImpl, InitializeApiImplEx,
InitializeApiImplEx2, QueryApiImpl, UninitializeApiImpl and XErrorReport.
The shims served only the first five. Without XErrorReport the thunks
refuse the runtime before they call any initializer: under gta6rt --run,
HCInitialize returned 0x89240101 (E_GAMERUNTIME_DLL_NOT_FOUND) and
curl_global_init returned CURLE_FAILED_INIT.

XErrorReport is now served by the function behind IXErrorImpl slot 3, so
a report reaches the XErrorSetCallback callback either way.
xgameruntime_test and the tiny_gdk_load fixture check all six names and
that a report through the export reaches the callback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:30:02 +00:00
3092fdfc4b runtime: preserve Unicode module basenames (#6287)
Squash-merged after diff review of PR #6287 - BUILD-2035: load mapped images with Unicode basenames
2026-11-23 08:23:32 -06:00
14b6deeb58 test(runtime): make vk_queue_test cap/timeout backlog check deterministic (#6281)
Squash-merged after diff review of PR #6281 - test(runtime): make vk_queue_test cap/timeout backlog check deterministic
2026-11-23 08:23:27 -06:00
962cacc0d9 Exercise signed and unsigned BC6H in the D3D12 format runner (#6252)
Squash-merged after diff review of PR #6252 - Test BC6H signed and unsigned sampling in the D3D12 format runner
2026-11-23 08:21:51 -06:00
57aafb761b Measure emitted geometry primitives in synthetic Vulkan draws (#6316)
Squash-merged after diff review of PR #6316 - TEST-GS-PRIMITIVE-READBACK: count emitted primitives in synthetic geometry draws
2026-11-23 08:21:47 -06:00
55200be11e dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station (#6301)
Squash-merged after review of PR #6301 - dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station
2026-11-23 08:16:35 -06:00
c6384dfc81 d3d12_buffer_tiles: compare the layer with its own adapter's D3D12 (#6334)
Squash-merged after review of PR #6334 - d3d12_buffer_tiles: compare the layer with its own adapter's D3D12
2026-11-23 08:16:31 -06:00
6d55b156e3 file_system test: run to its summary under Wine (RT-451) (#6313)
Squash-merged after review of PR #6313 - file_system test: run to its summary under Wine (RT-451)
2026-11-23 08:15:23 -06:00
c26d78af85 rdna2spirv: a pixel lane off at the last color export is not written; without vm, EXEC at the color export decides (#3988)
Squash-merged after review of PR #3988 - rdna2spirv: a pixel lane off at the last color export is not written; without vm, EXEC at the color export decides (measured on RDNA2)
2026-11-23 08:12:32 -06:00
7c51695b30 xgameruntime: serve XGameRuntimeFeature and XSystemAnalytics offline through QueryApiImpl (#3476)
Squash-merged after review of PR #3476 - xgameruntime: serve XGameRuntimeFeature and XSystemAnalytics offline through QueryApiImpl
2026-11-23 08:12:29 -06:00
0f2b802a4b rdna2spirv: ds_cmpst_f32 and the global/buffer fcmpswap atomics (#3153)
Squash-merged after review of PR #3153 - rdna2spirv: ds_cmpst_f32 and the global/buffer fcmpswap atomics
2026-11-23 08:12:11 -06:00
8c8c1de1c3 check_sparse_queue_family: run api_dump and validation apart (TEST-1089) (#4900)
Squash-merged after review of PR #4900 - check_sparse_queue_family: run api_dump and validation apart (TEST-1089)
2026-11-23 08:11:09 -06:00
e76cb47fb5 Runtime: D3D12 queues share a VkQueue when the GPU has no free one (Intel UHD 770 queueCount 1), plus a CPU-signal hang fix (#5110)
Squash-merged after review of PR #5110 - Runtime: D3D12 queues share a VkQueue when the GPU has no free one (Intel UHD 770 queueCount 1), plus a CPU-signal hang fix
2026-11-23 08:11:02 -06:00
82c6e08dd5 w64_graphics: fail when a subgroup probe fails (#4890)
Squash-merged after review of PR #4890 - TEST: fail wave64 graphics checks on subgroup probe errors
2026-11-23 08:10:58 -06:00
3735209c12 TEST-1147: record the FMA mode in shader metadata and honor it in check.py (#5094)
Squash-merged after review of PR #5094 - TEST-1147: record the FMA mode in shader metadata and honor it in check.py
2026-11-23 08:10:46 -06:00
546aacc7f0 gta6rt: link with an 8 MB stack; a game thread with the default size had 1 MB for a driver's compiler (RT-400) (#5468)
Squash-merged after review of PR #5468 - gta6rt: link with an 8 MB stack; a game thread with the default size had 1 MB for a driver's compiler (RT-400)
2026-11-23 08:09:40 -06:00
64890ac263 gpu tests: the unsigned view of the implicit 2D integer sample row (#5900)
Squash-merged after review of PR #5900 - GPU test: the unsigned view of the implicit 2D integer sample row, GPU-checked on Intel UHD 630
2026-11-23 08:08:11 -06:00
a09865ce19 test(runtime): check complete frames after held presents (Codex) (#5928)
Squash-merged after review of PR #5928 - test(runtime): check complete frames after held presents (Codex)
2026-11-23 08:08:09 -06:00
d582abc17f runtime: reject deleting read-only package files (#5946)
Squash-merged after review of PR #5946 - BUILD-1899: Respect read-only attributes when deleting package files
2026-11-23 08:07:54 -06:00
2cc83a803f xgameruntime: a closed XGameSave container stays expired when its address is reused (#6312)
Squash-merged after review of PR #6312 - xgameruntime: a closed XGameSave container stays expired when its address is reused
2026-11-23 08:06:44 -06:00
0e1ecbb8d3 d3d12_clear_test: castable-format clears on hosts without relaxed format casting (#6333)
Squash-merged after review of PR #6333 - d3d12_clear_test: castable-format clears on hosts without relaxed format casting (Windows 10, 23H2)
2026-11-23 08:06:38 -06:00
085fe1efd4 xmem: serve XMemTransferMemory (RT-449) (#6351)
Squash-merged after review of PR #6351 - xmem: serve XMemTransferMemory (RT-449)
2026-11-23 08:06:21 -06:00
0a08dbb02b d3d12 Vulkan: align copyable footprints from BaseOffset, not from 0
GetCopyableFootprints started the layout at BaseOffset and aligned every
subresource to D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT as an absolute
address. The PC runtime lays the subresources out from 0 and adds the base
afterwards: with base 513 the host returns offset 513 for subresource 0,
ours returned 1024, and the totals differed by the gap.
GetCopyableFootprints1 wraps the same function.

compare_footprints now also runs bases 513 and 2^32 + 1 (both unaligned)
next to 0 and 1024. Against the hardware host device on an AMD Radeon
RX 7600, on main 561b65a8, the old code gives 652 mismatching fields
(offsets and totals), all at the two new bases: with only 0 and 1024 it
gives none, which is why this went unnoticed. With the fix there are none
at any base. No caller in the runtime passes an unaligned base (the only
internal caller is GetCopyableFootprints1).

AI-assisted. Tested on AMD Radeon RX 7600, driver 26.11.2 (LLPC),
Windows 10 22H2 (in-box d3d12core 10.0.19041), MSVC 14.44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 09:31:05 -03:00
279898ee6c vk_harness, vk_store_test, vk_texture_test, vk_sampler_test: opt-in validation with LEONIDA_VK_VALIDATION
The four programs that run every pixel, store, texture and sampler case of scripts/run_gpu_tests.py
built their instance without layers and ignored LEONIDA_VK_VALIDATION, and a validation message
never changed their exit code, so a validation run of the suite could not fail on them. Each now
takes the instance setup from runtime/test/vk_validation.h, like vk_compute_test (TEST-877): the
layer, VK_EXT_debug_utils and a messenger when the variable is set, and main ends through
OptInValidation::exit_status, so a counted validation error exits 1 with "N validation errors".
Without the variable nothing changes. docs/testing.md now lists every shader test program as
reading the variable, and drops the by-hand VK_INSTANCE_LAYERS recipe that only covered them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:53:17 +00:00
561b65a832 Merge remote-tracking branch 'origin/main' into triage-r44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	.github/workflows/runtime.yml
#	tests/test_first_look_shim_report.py
2026-11-23 06:28:03 -05:00
a4d7182243 Restore #4098: xdxr_build_check failed on #2753's BLAS index check, not on the builder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:50:22 -05:00
18151aedfb Revert #4098: a second rewrite of the XDXR builder on top of #3315's, and xdxr_build_check fails with both
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:43:12 -05:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
e2ac2238fa Runtime test clashes: typeless clears accept WARP's nearest-even tie (#521), three close-parity copies now match WARP, the source-size checks start from 300x200 again after ResizeTarget, one test_attribute_trace in xmem_test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:41:22 -05:00
64b45d07ac Runtime: offline XDisplayImpl (HDR off, LEONIDA_HDR=1 on) and XUserDeviceImpl
XDisplayTryEnableHdrMode answers Disabled for the SDR host output, or Enabled
with the documented default tone-map luminances under LEONIDA_HDR=1. Every
device belongs to the offline user (XUserFindForDevice hands out a real
XUserHandle via xgameruntime_user.cpp); association and audio-endpoint
registrations hand out tokens; no audio endpoint of the user's own; finding a
controller shows no UI and gives an all-zero id, as on desktop.

ctest 163/163 (xgameruntime_offline twice: SDR and LEONIDA_HDR=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:56:45 -05:00
45c39cf6f4 Merge remote-tracking branch 'origin/main' into rt/directstorage
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 06:56:08 +01:00
ec34b54fe1 Runtime: offline XGameEventImpl, XGameUiImpl, XGameStreamingImpl
XGameEventWrite succeeds and drops the event (LEONIDA_LOG_GAME_EVENTS=1 logs
them). A message or error dialog has no screen: its title, text and buttons go
to the log and it completes with the default button, so an error the game
shows at boot is readable. Other UIs fail before starting. Streaming: never
streamed, no clients, a connection-state token that never fires; per-client
slots answer E_GAMESTREAMING_NOT_INITIALIZED, whose low byte reads false for a
bool caller. Ids and slot order from xgameruntime-docs, signatures from the
GDK reference; two parameter lists marked ASSUMPTION.

xgameruntime_offline_test: 18 checks. ctest 162/162.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:52:45 -05:00
81b99fd28a Merge remote-tracking branch 'origin/main' into rt/directstorage
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 06:51:26 +01:00
594f3485ee Runtime: offline XStoreImpl (the game license, package licenses, empty queries)
A GDK title checks its license at boot. QueryApiImpl now serves XStoreImpl
(IXStoreImpl..6, 84 slots from xgameruntime-docs' layout; signatures from
the public GDK reference): the game license is active and not a trial,
package licenses are acquirable and valid, no add-ons, no products, no
package updates; license-changed/lost registrations hand out tokens and
never fire. Purchases, consumables, tokens, downloads and store UIs fail
before starting (E_FAIL, logged once); the undocumented slots answer
E_NOTIMPL.

UNVERIFIED: STORE_SKU_ID_SIZE 18, SKU_ID_SIZE 5, TRIAL_UNIQUE_ID_MAX_SIZE
64 (XStoreGameLicense 104 bytes) - the public pages give no values; to be
confirmed against the executable before a boot relies on them.

xgameruntime_store_test: 22 checks. ctest 161/161.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:45:20 -05:00
a009a97c43 Merge remote-tracking branch 'origin/main' into rt/directstorage
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 06:42:09 +01:00
ac1843da2e DirectStorage: refuse unpaged buffers over 32 MiB, count stats at submit, /EHa under clang-cl
Review fixes for #4348 (Flyander, AirKyzzZ):
- DSTORAGE_REQUEST allows a buffer over 32 MiB only with 64 KiB or 2 MiB
  pages, which are not implemented yet, so such a request now fails with
  E_DSTORAGE_REQUEST_TOO_LARGE before any memory is touched.
- TotalRequestCount and the byte totals grow when a request is submitted,
  not when it is enqueued, and PendingRequestCount counts the request the
  worker is processing (DSTORAGE_PRIORITY_STATS).
- dstorage.cpp is built with /EHa under clang-cl, so guarded_move's __try
  catches an access violation in a title's buffer there too.

Tests: an over-limit and an at-limit 32 MiB copy, and stats checked
before Submit and while a copy is held on a guard page. The three new
failing checks fail with the previous shim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 06:40:52 +01:00
de67135246 Runtime: offline XGameSaveImpl (save provider, containers, blobs, updates)
A GDK title opens its save provider at boot; QueryApiImpl now serves
XGameSaveImpl (IXGameSaveImpl..3, 33 slots from xgameruntime-docs' layout,
signatures and error codes from the public GDK reference). Saves are files
in LEONIDA_SAVE_DIR\local-user\<container>\<blob> (default
%LOCALAPPDATA%\Leonida\saves), %-encoded: the layout tools/saves.py import
already writes. Updates are buffered and committed by write-then-rename;
container names follow the documented rule; the 16 MB update limit, the
documented E_GS_* codes, async variants through XAsync, and the
XGameSaveFiles folder/quota slots. Assumptions (quota, blob-name length,
nullptr blob list) are marked in the source and docs.

xgameruntime_gamesave_test drives every slot (50 checks). The two tests that
used XGameSaveImpl's id as "a class not served" now use a made-up id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:38:01 -05:00
28ea6b971b Merge remote-tracking branch 'origin/main' into rt/exe-tls-slot0
# Conflicts:
#	runtime/src/main.cpp
2026-11-23 06:37:38 +01:00
d9a52b5520 Merge remote-tracking branch 'origin/main' into rt/directstorage
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 06:37:38 +01:00
2e52b2f1d7 Docs after round 44: one row per topic, escaped literal pipes, one copy of each repeated line and list item, one i18n row per language
Also: #2490's committed conflict markers in fssm_crosscheck.md resolved to main's text, the SHADER-605 section
moved below the troubleshooting table it split, a header rule for the export-format table, two backticked
paths that name no Leonida file, and the BOM dropped from anim_move.py and its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:24:16 -05:00
84eec8302d Merge main into ds-append (#3976)
docs/design.md

AI-assisted.
2026-11-23 05:18:28 +01:00
6735a52038 Merge pull request #4667 from Clavert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:17:00 -05:00
f0aaf26cc1 Merge pull request #4662 from kapitche
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:57 -05:00
bedd5b1e09 Merge pull request #4658 from Clavert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:54 -05:00