Commit Graph

60 Commits

Author SHA1 Message Date
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
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
f87d05fdd3 runtime: console DirectStorage (DStorageGetFactory) with file-to-memory reads
Serve the Xbox DirectStorage API (IDStorageFactoryX2, IDStorageQueueX2,
IDStorageFileX, IDStorageStatusArrayX) under dstorage_xs.dll, xcrdapi.dll and
dstorage.dll. Declarations are our own (shims/dstorage_xs_abi.h), written from
the public GDK reference; layouts are pinned with static_asserts.

- OpenFile goes through the registry's kernel32!CreateFileW, so GAME: paths use
  the console path mapping and the write overlay. GetHandle returns a ReOpenFile
  handle with its own file position.
- One worker thread per queue runs submitted entries in order: file and memory
  requests, status arrays, ID3D12Fence::Signal, EnqueueSetEvent (on a duplicate
  of the title's handle taken at enqueue).
- Auto-submit at half the capacity (or disabled through DSTORAGE_QUEUE_OPTIONS),
  enqueue into a full queue waits, CancelRequestsWithTag (a cancelled request is
  a success and not a failure), error record and error event, Close and the last
  Release drain the queue, IDStorageFileX::Close waits for the file's submitted
  reads.
- Request checks: reserved bits, source type, BCPack/swizzle ranges, sizes,
  1 GiB limit, null and foreign objects and closed files (also for zero-size
  requests), end of file, inaccessible memory.
- zlib, BCPack, swizzle and physical pages return E_NOTIMPL (later PRs).
- Interface ids of the X interfaces are not public: a creating call accepts and
  logs a new id per object kind, but refuses system COM ids (IMarshal,
  IAgileObject, ...) and the PC DirectStorage ids; QueryInterface accepts only
  IUnknown, the PC IDStorageStatusArray id (same shape) and the ids creating
  calls accepted for that kind. Bad arguments are logged once per method.
- registry.cpp classifies xcrdapi.dll!DStorageGetFactory as HRESULT; the cl.exe
  fallback in build_runtime.ps1 builds the new shim too.

ctest dstorage: 258 checks over synthetic files in %TEMP%, no GPU, no game data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:48:51 +01:00
35616ce677 build_runtime.ps1: fall back to native cmake + ninja on PATH
# Conflicts:
#	scripts/build_runtime.ps1
#	tests/test_build_runtime_fallback.py
2026-11-23 00:04:40 +02:00
1a193dbf9c Merge pull request #3825 from haizenc 2026-11-22 17:04:05 -05:00
53ce9b6c7f Merge pull request #3554 from ezbyDev 2026-11-22 17:02:40 -05:00
d5000c56e4 Merge pull request #3363 from romainveurrier 2026-11-22 17:01:41 -05:00
d9129f7a10 build_runtime.ps1: build vk_sampler_test in the cl.exe fallback 2026-11-22 23:50:40 +02:00
fc3bda5cd7 scripts: start _build.cmd with cmd /s /c ""path"" so & and ^ survive
build_runtime.ps1 and build_llvm_mc.ps1 started the generated batch with
`cmd.exe /c "path"`. cmd.exe drops those quotes when the path holds a
special character such as & or ^, then runs only the part before it, so a
checkout (build_runtime) or -Temp/%TEMP% (build_llvm_mc) in a folder like
`a & b` failed at once with "C:\...\a is not recognized". With /s and a
second pair of quotes, cmd.exe strips only the outer pair.

tests/test_build_batch_launch.py takes each script's launch line as written
and runs it on a stub batch in folders named plain, `a & b`, `a&b`, `x^y`,
`sp (x)` and `東京 & co`: the stub must run and its exit code (0 and 7) must
come back. It also checks that the old form fails there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:53:58 +01:00
056661d125 xgameruntime: serve XUserImpl (offline local user) through QueryApiImpl
A GDK title links the XUser* functions statically (xgameruntime.lib); each
thunk asks QueryApiImpl for XUserImpl and calls one slot with the function's
arguments after `this` (docs/runtime_imports.md). QueryApiImpl refused the
class, so XUserAddAsync, the call a title makes at boot before nearly
anything else, could not succeed.

runtime/shims/xgameruntime_user.cpp serves it, in its own file so the other
class PRs touching xgameruntime.cpp only meet it at one line:

- ids and slot order from xgameruntime-docs (facts only), signatures, enum
  values and E_GAMEUSER_* codes from the public GDK reference;
- IXUserImpl..IXUserImpl6 answer with one 50-slot vtable, IXUserGamertagImpl
  (XUserGetGamertag) with a second;
- one offline user, always signed in: XUserAddAsync (silent or not;
  AllowGuests with AddDefaultUserSilently is E_INVALIDARG), fixed ids,
  FindUserById/ByLocalId, Duplicate/Close/Compare, not a guest, adult, every
  privilege, ResolvePrivilegeWithUi, AddByIdWithUi, IsStoreUser, change-event
  tokens; gamertag from LEONIDA_GAMERTAG, "Player" otherwise;
- tokens, gamer picture, MSA tokens and resolve-issue fail synchronously
  before starting; no sign-out deferral; private and PC-only slots log once.

xgameruntime_user_test (40 checks) drives every served slot; a second ctest
run checks LEONIDA_GAMERTAG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:21:21 +01:00
94d402f410 Merge pull request #3250 from desamodeth 2026-11-22 15:16:11 -05:00
cc1d9926ef runtime: honor the Windows build job limit from make_game
BUILD-952

AI-assisted-by: Codex Astra 6.2 High
2026-11-22 22:52:23 +03:00
15f5b2fbc0 Fix what the round-41 merges broke
- tests/semantic: BaseVertex/BaseInstance read 0 in the wave interpreter; the LDS MockGens follow
  SHADER-309 (lds_bound, lds_access, lds_atomic); abs emission tests load their operand, since
  SHADER-315 folds scalar ALU on constants.
- test_translate: the dynamic gather sampler is a loaded word, not s16 + 0 (SHADER-315 folds it).
- test_world_build: DDS downscale weights colours by alpha (62804d0d).
- test_fspx_shaders_stage: the fake disassembler writes the listing make_game now checks.
- xgameruntime_test: re-read the package id after clearing the LEONIDA_PACKAGE_ID override.
- docs: one row per topic again in design.md (72 topics) and README.md; one Other languages line;
  embedded_shaders.md keeps one copy of each bullet; animation.md links the heading anchor.
- tools/scripts: character_textures uses report_paths.same_report_path; stdout guard on six programs;
  LF write in vs_input_survey; the cl.exe fallback compiles winhttp_offline.cpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:30:33 -05:00
4ac33f7e88 Merge pull request #2648 from skankhunt42 2026-11-22 13:16:47 -05:00
2212eadd1b Merge pull request #2520 from Dominik 2026-11-22 13:15:53 -05:00
90f399e953 Runtime: warn loudly (or fail) when CMake finds no Vulkan headers
Without Vulkan headers everything under if(TARGET Vulkan::Headers) is left
out: the D3D12 COM objects, the Vulkan D3D12 device in gta6rt
(LEONIDA_D3D12=vulkan) and most of ctest. The only output was a STATUS line
naming four test tools, so a build whose VULKAN_SDK never reached CMake ran
45 of 125 tests and reported "100% tests passed".

- runtime/cmake/vulkan_headers_missing.cmake: a WARNING that names what is
  left out and that CMakeCache.txt keeps the failed lookup.
- LEONIDA_REQUIRE_VULKAN=ON turns it into a configure error; both CI
  configures pass it, and scripts/build_runtime.ps1 does when VULKAN_SDK is set.
- tests/test_cmake_vulkan_missing.py runs the module with cmake -P and checks
  that CMakeLists.txt and CI use it; docs/testing.md gets a troubleshooting row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:41:47 +01:00
22bc8d44fa build_runtime.ps1: the cl.exe fallback compiles shims/file_system.cpp (BUILD-680)
main.cpp calls rt::fs::configure (GAME: paths), but the direct-cl.exe
fallback (VS Build Tools without the CMake component) left
shims/file_system.cpp out of the launcher's sources, so gta6rt failed to
link (LNK2019/LNK1120, found by @Ingenioeren). Added to $files.

test_build_runtime_fallback: every .cpp in CMake's add_executable(gta6rt
...) must be in the fallback's launcher list, so the two can't drift apart
again (fails before this change on shims\file_system.cpp).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:20:07 +00:00
8ff14b1400 Preserve Unicode paths in the Windows runtime build wrapper (BUILD-681) 2026-11-22 18:14:53 +01:00
ddd4b7a8b5 scripts/build_runtime.ps1: switch to UTF-8 (chcp 65001) so Ninja /showIncludes tracks headers on non-English Windows 2026-11-22 14:41:41 +01:00
6f5b59ea81 runtime: serve LoadLibrary/GetProcAddress of shim-owned modules; xgameruntime.lib's run-time entry points
The package's GDK modules don't import xgameruntime.dll. libHttpClient.GDK.dll and XCurl.dll have no import
entry for it, but both carry the wide string "xgameruntime.dll" and the names InitializeApiImpl[Ex|Ex2],
QueryApiImpl and UninitializeApiImpl next to a statically linked XGameRuntimeInitialize: xgameruntime.lib's
thunks LoadLibraryW the runtime and GetProcAddress those names. Bound to the host, that bypasses the offline
shim. The executable is very likely built the same way.

- library_loader.cpp: LoadLibrary*/GetModuleHandle*/GetProcAddress/FreeLibrary for kernel32, kernelbase and the
  api-ms-win-core-libraryloader sets. A module the registry owns (rt::shims::owns_dll) gets a pseudo-handle and
  GetProcAddress resolves through the registry; an unserved name is NULL with ERROR_PROC_NOT_FOUND. Every other
  module goes to the host.
- xgameruntime.cpp: the five entry points, with the signatures and the unknown-class error documented by
  xodus-gaming/xgameruntime-docs (GPL-3.0, facts only). QueryApiImpl logs the class and interface ids and refuses
  them, so the first boot with the executable names the COM interfaces to implement.
- xgameruntime_test drives the path through XCurl.dll's api-set binding; docs/runtime_imports.md records the
  measurement and the new dry-run counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:58:12 +00:00
f4ee349968 build_runtime.ps1: the cl.exe fallback builds the GPU test harnesses the tools need
Without VS's "C++ CMake tools" component, build_runtime.ps1 compiles
with cl.exe directly, and that list never built vk_compute_test,
vk_store_test or vk_harness (the programs check.py and run_gpu_tests.py
require and valu_fuzz.py/lds_fuzz.py run), nor vk_image_fuzz
(image_fuzz.py's harness). TEST-71 on that path stopped at
"vk_compute_test not found". Build them the way the fallback builds
vk_texture_test. tests/test_build_runtime_fallback.py checks that the
fallback builds every harness those tools name and that each source it
compiles exists.

Found by @derekhearst.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:46:54 -06:00