Commit Graph

79 Commits

Author SHA1 Message Date
3e9c4778f7 Merge pull request #1484 from kawaii-shakal/build-fallback-sandbox-user32
build_runtime: link user32 into vk_sandbox in the cl.exe fallback (BUILD-FALLBACK-SANDBOX-USER32)
2026-11-28 11:20:39 +01:00
5c79445cc4 Merge upstream main into build-fallback-sandbox-user32 2026-11-25 21:56:34 +00:00
6ee7ef89b9 Merge branch 'main' of https://github.com/ubiquitarianism/leonida into xapu-connect-layouts
main added its own runtime/shims/xapu.cpp: the boot stack's earlier xapu.dll stub, which gta6rt does not link and
xapu_test checks. This branch's xapu.dll command queue moves to runtime/shims/xapu_queue.cpp so both stay: gta6rt,
xapu_chad_test, the cl.exe fallback list in scripts/build_runtime.ps1 and the references in xapu_chad.cpp,
xapu_chad_test.cpp and docs/audio_hal_exe_calls.md name the new file; main's xapu.cpp and xapu_test are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GnGkjYHUWx92TkwvwCnAMe
2026-11-25 12:09:55 +01:00
8b771908c3 Merge main into feat/gdk-lifecycle-window-hook (#769)
scripts/build_runtime.ps1 conflicted in the $files list of the build
without CMake: main added shims\silent_audio.cpp there (#1598) after this
branch had merged main, and this branch adds shims\lifecycle.cpp. Both
entries are kept, lifecycle.cpp where this branch had it. The branch's
other change in that file (user32.lib on the link line) merged cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:41:48 -05:00
d4ce33ed42 runtime: serve a silent output endpoint when the host has none
The title creates its MMDeviceEnumerator through CoCreateInstance. On a host with no
render endpoint, GetDefaultAudioEndpoint(eRender) is 0x80070490, the title's audio device
start leaves its own output-device lock held, the audio engine never mixes, and the boot
stops on an int3 about 47 s in. A console always has an output.

com_shim's CoCreateInstance now hands that class to shims/silent_audio.cpp. A host
enumerator with a default render endpoint is returned unchanged. Otherwise (no endpoint,
no enumerator, or LEONIDA_AUDIO=silent) render questions get an in-process endpoint:
IMMDevice with a read-only property store, IAudioClient/2/3 at 48 kHz float 7.1, and
IAudioRenderClient, IAudioClock, ISimpleAudioVolume and IAudioStreamVolume. A clock drains
the padding in real time and an event-driven stream's event is signalled every 10 ms.
Every sample is discarded; no host audio device is opened. Capture keeps the host's
answer. One [rt] line names the reason when the silent device is first served.

silent_audio_test covers stand-in hosts with and without an endpoint, no host, a render
stream over a few periods, and the CoCreateInstance hook with LEONIDA_AUDIO=silent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:05:32 -05:00
f9792cc56d Merge remote-tracking branch 'ubiq/main' into feat/gdk-lifecycle-window-hook
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-25 00:58:58 -03:00
becc491880 Merge remote-tracking branch 'origin/main' into build-fallback-sandbox-user32 2026-11-25 06:55:05 +05:00
9336540a5b build_runtime: link user32 into vk_sandbox in the cl.exe fallback (BUILD-FALLBACK-SANDBOX-USER32)
CMake's Visual Studio and Ninja builds link kernel32, user32, gdi32 and the other
standard libraries into every program. A plain cl line links none of them.
vk_sandbox opens a window, so the fallback's link stopped at 14 unresolved
__imp_ symbols (CreateWindowExW, PeekMessageW, ...), and build_runtime.ps1
exited 1 on any machine without CMake and Ninja.

The new test fails any fallback cl line whose test source calls the window
API without /link user32.lib.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:23:53 +05:00
d033c3f74b build_runtime.ps1: the cl.exe fallback compiles console_registry.cpp
#984 adds shims/console_registry.cpp to gta6rt's sources in CMake but not to the cl.exe fallback's list, so the fallback would stop at link time and tests/test_build_runtime_fallback.py fails (on #984's head too).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 20:07:37 -05:00
39879ce0fd Merge main into RT-PROTON-STORY-LOAD (#984)
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>
2026-11-24 19:38:04 -05:00
19559fec60 scripts: build xapu.cpp in the cl.exe fallback (review of #1144)
The fallback file list in build_runtime.ps1 must match the gta6rt sources
CMake has; xapu.cpp was missing, so test_build_runtime_fallback failed
and a build without CMake would have had no xapu.dll shim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:27:07 +01:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (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>
2026-11-24 11:42:12 -06:00
d0da7dade8 Merge pull request #404 from ubiquitarianism/feat/acphal-xma2-decoder
acphal: ACP message queue and background XMA ring decoding with the Rust XMA2 decoder (RT-ACPHAL-XMA2)
2026-11-24 08:44:46 -05:00
de223bed9e Merge pull request #357 from ubiquitarianism/feat/ws2-offline-shim
runtime: add offline loopback-only Winsock2 (ws2_32.dll) shim
2026-11-24 08:44:13 -05:00
b358d9062d lifecycle: suspend callbacks on window close and fit the title window (split from #401)
RegisterAppStateChangeNotification / UnregisterAppStateChangeNotification under
api-ms-win-core-psm-appnotify-l1-1-0/-l1-1-1 and kernelbase.dll, and CreateWindowExW/A under
user32.dll and ext-ms-win-rtcore-ntuser-window-l1-1-0/-l1-1-1, plus CreateWindowExA under
ext-ms-win-rtcore-ntuser-window-ansi-l1-1-0, the set the title's import table names. The title's
first top-level window is fitted to the work area and hooked: SC_CLOSE runs the suspend callbacks
(quiesced TRUE) and ends the run through the title's ExitProcess, with a 1 s deadline.

Split from #401 (a02134a9c), as the maintainer asked for one topic per pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:33:06 -03:00
cfcedb58e2 acphal: decode XMA contexts with runtime/xma_decoder when cargo is available
Replace the hand-written C++ XMA2/WMA Pro decoder with the Rust decoder
already on main. runtime/CMakeLists.txt builds it at configure time when
cargo is on PATH and links it into gta6rt and acphal_test
(LEONIDA_HAVE_XMA2_DECODER); without cargo, if that build fails, or with
the cl.exe fallback, XMA voices output silence for each packet's frame
count.

The ring engine decodes whole 2048-byte packets: the read offset and the
loop points are used per packet, so a loop plays its end packet in full
and restarts with a fresh decoder at the packet holding the loop start.
The C ABI gains leonida_xma2_decoder_create_hardware (no first-frame drop,
no 64-sample start skip), since the context carries its own skip.

Tested: acphal_test 129 checks (silence) and 125 checks (Rust decoder,
gnullvm build), 0 failures, 3 runs each, clang 23 / mingw x64; cargo fmt
and cargo test (gnullvm); pytest build/docs suites 204 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 03:53:37 -03:00
7f7a596856 Merge remote-tracking branch 'ubiq/main' into feat/ws2-offline-shim
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-24 02:34:35 -03:00
4750df6a06 acphal: add portable XMA2 decoder, ACP message queue, and SHAPE XMA worker
- Add portable C++20 XMA2 packet parser and WMA Pro frame decoder
  (runtime/src/xma2_decoder.{h,cpp}, following FFmpeg wmaprodec.c /
  wmaprodata.h LGPL-2.1-or-later under Leonida's GPL-3.0-or-later)
  with cross-platform xma2_decoder_test.
- Implement IAcpHal command/message queue protocol (REGISTER_MESSAGES,
  UNREGISTER_MESSAGES, LOAD_FLOWGRAPH, COMMAND_COMPLETED, DISCONNECTED,
  queue-full dropped counters, and APU notification word writes) in
  runtime/shims/acphal.cpp.
- Wire a lazily-started, cleanly-joined background XMA2 decoder thread
  pumping enabled SHAPE_XMA_CONTEXT output rings in APU memory.
2026-11-24 01:44:00 -03:00
5dbd92b92d build scripts: refuse a folder with % in its path up front
cmd.exe expands %...% on every line of the generated _build.cmd (twice on a CALL line), and cl.exe rejects a % in the
path-valued /D definitions of the runtime's test targets (D8038) however it is quoted, so a checkout with % in its path
failed in configure, or a few hundred Ninja steps in once the batch was escaped (@ezbyDev's measurements in the original repository).
build_runtime.ps1 now stops before looking for Visual Studio when the checkout path has a %, and build_llvm_mc.ps1 when
-Temp has one, each naming the folder; docs/testing.md gets a Known-problems row. tests/test_build_percent_path.py runs
both scripts with such a path, with git, python and vswhere hidden so that a missing check can't start a real build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 07:09:02 +03:00
9b59db02f9 ws2_offline: add offline loopback-only Winsock2 (ws2_32.dll) shim (RT-WS2-OFFLINE) 2026-11-24 00:53:14 -03:00
2d7be48dec runtime: restore the console DirectStorage shim (DStorageGetFactory) on main
The merge that brought the mirrored pull requests into main (6dece9231) left the DirectStorage shim out, noting
that it "needs the typed-error zlib inflate". The shim's commits (f87d05fdd, ac1843da2, 00551ba00, by
mariuslozo-boop and Kelebek) are ancestors of main, but its files are not in the tree, so the retail
executable's XCRDAPI.dll!DStorageGetFactory import is unimplemented (issue #47, stop 5 of
docs/retail_boot_chain.md).

- shims/dstorage.cpp, shims/dstorage_xs_abi.h, test/dstorage_test.cpp and docs/directstorage.md are back as
  those commits left them.
- leonida::zlib_inflate reports why it failed through an optional ZlibError* (header, data, checksum, limit),
  which the shim turns into its E_DSTORAGE_ZLIB_* codes. This is the same interface the shim was written
  against, added to main's current table-driven inflater; callers that pass no pointer behave as before.
- registry.cpp classes xcrdapi.dll!DStorageGetFactory as an HRESULT import, the retail spelling #47 found
  missing.
- CMake and scripts/build_runtime.ps1 build the shim into gta6rt, and CMake builds and registers dstorage_test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
2026-11-23 20:23:21 -06:00
6dece92317 Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.

Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.

Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
2026-11-23 19:42:33 -05:00
17bbb2dfb8 Merge remote-tracking branch 'origin/pr/8946' 2026-11-23 17:41:06 -05:00
f48adad761 Merge remote-tracking branch 'origin/pr/9523'
# Conflicts:
#	runtime/CMakeLists.txt
#	scripts/build_runtime.ps1
2026-11-23 17:38:03 -05:00
ff8ff4dd96 Merge remote-tracking branch 'origin/pr/9516'
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 17:37:15 -05:00
f7b3afcda9 Merge remote-tracking branch 'origin/pr/9754'
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 17:29:12 -05:00
b055a73352 Merge remote-tracking branch 'origin/pr/9712' 2026-11-23 17:24:39 -05:00
ad6e5d6bbe gta6rt: --init/--run stop with a clear message on a host without AVX
The game runs AVX code from its TLS callbacks on, so a CPU or OS without
AVX (a QEMU qemu64 guest) died with a bare 0xC000001D. Check CPUID.1
AVX/OSXSAVE and XCR0 YMM state first, print one line and exit 4 (3 is
LEONIDA_UNIMPLEMENTED=stop). --dry-run is unchanged and
LEONIDA_SKIP_CPU_CHECK=1 skips the check.

AI-assisted.
2026-11-23 23:07:51 +01:00
196ca722bb build_runtime.ps1: the cl.exe fallback compiles every gta6rt source CMake has
xg_xs.cpp (already missing on main), acphal.cpp, xapu_chad.cpp and
d3d12_xs_pso_stream.cpp were in CMake's add_executable(gta6rt) but not in
the fallback's list. pso_stream is called from d3d12_xs_device.cpp (link
error); the others register their shims at startup, so a fallback build
would have run without them. tests/test_build_runtime_fallback.py checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:07:49 +00:00
1cd7eb9e7c build_runtime: the cl.exe fallback builds vk_sandbox and vk_ps_sweep (EGEN-FALLBACK-SANDBOX-SWEEP)
tools/sandbox.py starts runtime/build/vk_sandbox.exe (without it the tool ends at 'unsupported: vk_sandbox is not built'), and tools/ps_sweep.py --exe / tools/ab_control_flow.py --all-attachments start runtime/build/vk_ps_sweep.exe. CMake builds both in its Vulkan tools loop; the fallback built neither, so a fallback build had no harness for either pixel check of translated shaders.

tests/test_build_runtime_fallback.py collects the harness names every Python tool under tools/, scripts/ and runtime/test/shaders/ starts and requires the fallback to build them: vk_sandbox and vk_ps_sweep fail on 5d74c272 and pass with the two cl lines.
2026-11-23 22:59:31 +01:00
f967225be8 runtime/shims: shim bcrypt.dll provider lifecycle and RNG with deterministic seed support
Refs: https://github.com/ItsNotRexed/Leonida/issues/9065#issuecomment-7114352737
2026-11-24 04:23:26 +07:00
ced87bf258 runtime/shims: shim api-ms-win-core-com-l1-1-0..3 lifecycle and helpers
Refs: https://github.com/ItsNotRexed/Leonida/issues/9065#issuecomment-7114294575
2026-11-24 04:21:05 +07:00
ccd36246f7 runtime: acphal.dll shim with APU heap management and SHAPE context allocation (RT-5, ASSET-587)
- Resolve Stop 28 boot blocker preventing GTA 6 from launching: acphal.dll!ApuCreateHeap and AcpHalAllocateShapeContexts.
- Implement genuine APU physical memory management (ApuCreateHeap, ApuAlloc, ApuFree, ApuIsVirtualAddressValid, ApuMapApuAddress, ApuMapVirtualAddress):
  - Support cached and non-cached heap allocations with flags routing (flags=2 to non-cached, flags=1/0 to cached).
  - Genuine block tracking allowing proper memory reclamation and reuse upon ApuFree.
  - Disjoint APU 32-bit physical address space mapping with round-trip address conversions.
- Implement IAcpHal interface in AcpHalCreate:
  - Slot 0 (connect): S_OK.
  - Slot 1 (disconnect): S_OK.
  - Slot 2 (submit_command): S_OK (unblocks fatal int3 at +0x43ad94e at boot).
  - Slots 3 and 4 (pop_message, get_num_messages): return 0.
  - Slot 5 (release): releases object.
- Implement GDK SHAPE_CONTEXTS and exact layout:
  - Six context counts and arrays: SRC, EQCOMP, FILTVOL, DMA, XMA, PCM.
  - Structure alignment with xmaContextArray at offset +0x38, matching retail executable measurement (350 contexts x 64 bytes).
  - AcpHalReleaseShapeContexts releases allocated context arrays.
- Classify acphal.dll HRESULT imports in registry.cpp and update unimplemented_policy_test.cpp.
- Add acphal_test in runtime/CMakeLists.txt and python verification test tests/test_acphal_abi.py.
- Update fallback file list in scripts/build_runtime.ps1.

No game data. AI-assisted.
2026-11-23 22:19:47 +01:00
f37693fe39 build_runtime.ps1: the cl.exe fallback links gta6rt with the same /BASE as CMake 2026-11-23 20:49:19 +01:00
a1751a9f0e ladder-frame: build_runtime.ps1's cl.exe file list keeps its ForEach-Object tail
The #7516 merge resolution left a stray "`" fragment at the end of the $files
list and dropped its ForEach-Object tail, so PowerShell rejected the script.
Reported by ScarionWorkspace and tugasky on #7154; the parser reports 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 20:16:58 +01:00
8644ce10dc Merge branch 'pr7516' into ladder-frame
# Conflicts:
#	runtime/shims/d3d12_xs_device.cpp
#	scripts/build_runtime.ps1
2026-11-23 19:35:07 +01:00
1e03b40435 Merge branch 'pr4348' into rebase/4348-on-main
# Conflicts:
#	docs/README.md
#	runtime/CMakeLists.txt
2026-11-23 18:17:51 +01:00
242a5dbf14 runtime: serve XboxBvhBuilder.dll with the layer's XDXR builder (RT-5, boot stop 18)
The package's XboxBvhBuilder.dll creates 52 console compute programs as
pipelines in its constructor, on the title's thread. Translated, they take
25-60 s to compile on a cold driver cache (#7231/#7049: 31.2 s for one on
an RTX 4080, 59.5 s for all 52 on an RX 9070 XT), longer than the title's
~30 s startup watchdog, so a first boot ends at the builder.

runtime/shims/xbox_bvh_builder.cpp serves the seven exports the executable
imports (measured statically on 1.0.2.1: constructor 1 call site,
destructor 1, Set64BitMortonCodes 8, GetRaytracingAccelerationStructure-
PrebuildInfo 3, BuildRaytracingAccelerationStructureBatched2X 6,
CopyRaytracingAccelerationStructure 2, RehydrateRaytracingAcceleration-
StructureBatched2X 4) with the layer's own XDXR builder (D3D-178). The
loader binds imports to a shim before a bundled module, so the DLL is not
loaded and its programs are never created.

- each BATCHED_DESC2 element (docs/xdxr.md §1) is one layer build with its
  postbuild descriptions; the offline-statistics type (0x10), which the DLL
  refuses by throwing, skips the element instead (a shim must not throw);
- XDXR stream records and Set64BitMortonCodes tune the console builder's
  heuristics and are ignored (logged once);
- prebuild sizes and copies are the layer's;
- the builder's state is kept in a table keyed by `this`: nothing is
  written into the title's object, whose size isn't known;
- rehydration answers E_NOTIMPL for now (stage 2);
- LEONIDA_BVH_BUILDER=console keeps the bundled DLL.

xbox_bvh_builder_test (12 checks) calls the exports through the shim
registry as the title binds them; xdxr_bvh.py check-build validates the
BLAS, TLAS and compacted BLAS it builds (0/1000 rays differ on each).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 17:57:27 +01:00
ac700c42b1 Fix CMake batch invocation for caret paths (BUILD-2278) (#6787)
Squash-merged after diff review of PR #6787 - Fix CMake invocation in caret checkout paths (BUILD-2278)
2026-11-23 09:55:44 -06:00
c646bf8367 Speed up make_game by overlapping stages and showing progress. (#1797)
Squash-merged after diff review of PR #1797
2026-11-23 09:32:22 -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
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
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
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
d9a52b5520 Merge remote-tracking branch 'origin/main' into rt/directstorage
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-23 06:37:38 +01:00
7a1e3193ea Merge pull request #2717 from Wasler
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:01 -05:00