Repository navigation
Loader: under Wine, PEB.ImageBaseAddress keeps the real main image - #93
Merged
Merged
Conversation
run_main writes the title's base into PEB.ImageBaseAddress so that GetModuleHandle(NULL) answers the title. Wine's loader looks that address up in its own module list whenever a thread starts (loader_init: get_modref(Peb->ImageBaseAddress)) and uses the result unchecked. A manually mapped image is not in that list, so the title's first thread died in ntdll with an access violation at address 0x6e. Under Wine (ntdll exports wine_get_version) the field is now left alone and a log line says so. GetModuleHandle(NULL) then answers xcl.exe there, not the title. Nothing changes on Windows. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Collaborator
|
Merged. On Windows nothing changes ( |
BBareth
pushed a commit
to BBareth/xcl
that referenced
this pull request
Nov 23, 2026
KickoffX (xcl-dev#93), Wait32/64BitValueX (xcl-dev#71/xcl-dev#72), RSSetDepthBiasX (xcl-dev#94). Conflicts with main resolved (console slots and PC overrides united; ExecuteCommandLists keeps the per-queue title-memory refresh). KickoffX resets the PC list mid-recording: it now also restores what the Reset clears and console code had set (descriptor heaps, topology, viewports, scissors, blend factor, stencil ref, vertex buffers, render targets) - on the console a kickoff leaves the list's state as it was; without the heaps a translated draw after it would read garbage descriptors.
Michael-Glaser
added a commit
to Michael-Glaser/xcl
that referenced
this pull request
Nov 24, 2026
…cl-dev#104) On newer GDK runtimes (QUEUE_SHIFTED), 20 command list console methods shift up by +2 via NEWER_LIST_SLOTS, leaving 11 older slots (xcl-dev#59, xcl-dev#60, xcl-dev#68, xcl-dev#69, xcl-dev#78, xcl-dev#81, xcl-dev#84, xcl-dev#88, xcl-dev#89, xcl-dev#93, xcl-dev#94) without another shifted method taking their old index. Those slots remained wired directly to the older layout's handlers, so a newer-layout call hit the wrong method. Wrap those orphaned slots in make_layout_split so newer-layout title calls go to a logged stub while older-layout titles keep the handler and non-title callers keep their PC target (including cl_execute_indirect at xcl-dev#59 and the original base-table stub for slots >= scanned). Slot xcl-dev#10 (Reset) stays Reset on both layouts and is not orphaned. Assisted-by: Antigravity (Gemini 4 Neon)
vincentes
added a commit
to vincentes/xcl-wasm
that referenced
this pull request
Nov 24, 2026
The null device becomes `win::d3d12x`, a device that does the memory side of D3D12.X for real and still renders nothing: - Unified memory, as on the console: a resource's GPU address is its address in the title's address space. Committed resources and heaps get graphics memory, placed resources lie in their heap, and CreatePlacedResourceX (xcl-dev#44) puts one on memory the title allocated; Map returns that address. Read-back buffers up to 64 MiB come from the fourth 4 GiB of the region, where XCL's Windows runtime keeps them. - Command lists record; a queue runs what it is given, in order, at every turn of the scheduler (`pump`): buffer copies, the console's memory commands (CopyMemoryToMemoryX xcl-dev#60, FillMemoryWith32BitValueX xcl-dev#61, Write32 / 64BitValue…X xcl-dev#69 / xcl-dev#70 / xcl-dev#89 with the GPU timestamp) and Wait32 / 64BitValueX (xcl-dev#71 / xcl-dev#72), which hold the queue until another thread writes the value. KickoffX (xcl-dev#93) starts a list before it is closed. A fence moves, and its events are signalled, when the queue gets to its Signal. - The console's layouts: device extensions from slot 44 (CreateCommandQueueX, CreateCommandListX with the DMA engine's own list interface, page pools, pipeline-state creation as objects, …), the graphics command list's console slots, AllocateUploadMemory (xcl-dev#148). - CheckFeatureSupport zeroes the whole structure; a raytracing acceleration structure view writes the console's descriptor words. Draws, pipelines, other views, PresentX and the frame clock do nothing or are missing. Dev builds optimise `xcl-emu` (the title test: 37 s → 3.3 s). Measured on macOS (aarch64): the test title passes 40 of its checks (9 of D3D12.X's 16); the 6 that fail before it aborts in its XG texture check need HLSL compilation and rendering, the frame clock, or DirectStorage. `cargo test -p xcl-guest`: 38 passed, 0 failed (the title test now checks every check by name; the staged tree was built and tested apart from the working tree). Inside the wasm64 module (1.2 MB, Node 24) the same run takes 4.4 s: 115 M instructions, most of them the 80 MiB upload check. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Michael-Glaser
added a commit
to Michael-Glaser/xcl
that referenced
this pull request
Nov 24, 2026
…vall#104) On newer GDK runtimes (QUEUE_SHIFTED), 20 command list console methods shift up by +2 via NEWER_LIST_SLOTS, leaving 11 older slots (ivall#59, ivall#60, ivall#68, ivall#69, ivall#78, ivall#81, ivall#84, ivall#88, ivall#89, ivall#93, ivall#94) without another shifted method taking their old index. Those slots remained wired directly to the older layout's handlers, so a newer-layout call hit the wrong method. Wrap those orphaned slots in make_layout_split so newer-layout title calls go to a logged stub while older-layout titles keep the handler and non-title callers keep their PC target (including cl_execute_indirect at ivall#59 and the original base-table stub for slots >= scanned). Slot ivall#10 (Reset) stays Reset on both layouts and is not orphaned. Assisted-by: Antigravity (Gemini 4 Neon)
rootw0rm
pushed a commit
to rootw0rm/xcl
that referenced
this pull request
Nov 27, 2026
The null device's plain lists ran the console memory slots (xcl-dev#60/xcl-dev#61/ xcl-dev#69-xcl-dev#72/xcl-dev#89/xcl-dev#93) as logging stubs, so the title's console_list_methods check read back 0x0 on the null backend while the identical immediate host writes already passed on Vulkan lists. The vtable now wires the same VulList_* functions into Kind::CommandList; GetDevice (xcl-dev#7), the UAV barrier (xcl-dev#146) and AllocateUploadMemory (xcl-dev#148) stay Vulkan-only with their slices (barrier/upload ride with raytracing, which still fails on null at the OPTIONS5 tail-zero assert). Failing-first: the new null_list_shares_the_console_memory_methods test fails pre-route (slot 69 stub writes nothing) and passes now (write32/fill/copy/timestamp land, pre-satisfied wait returns, kickoff is a silent no-op), mirroring the title's asserts. Gates: check -p xcl --tests EXIT 0; check --workspace EXIT 0; lib 797 passed/0 failed/1 ignored (--test-threads=4). Title e2e, fresh roots: null 12->11 FAILs (Write32 fixed, byte-identical remainder), Vulkan 9 unchanged with the real present (640x360 token 0x1 on Intel Arc). Retail HOLDS (SIGSEGV exe+0x2237320, exit 139, called_stubs 20, 0 d3d12).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_mainwrites the title's base intoPEB.ImageBaseAddressso thatGetModuleHandle(NULL)answers the title. Wine's loader looks that address up in its own module list whenever a thread starts (loader_init:get_modref(Peb->ImageBaseAddress)) and uses the result unchecked. A manually mapped image is not in that list, so the title's first thread dies in ntdll with an access violation (a read at address0x6e).Under Wine (ntdll exports
wine_get_version) the field is now left alone, and a log line says so. Nothing changes on Windows.Known cost under Wine:
GetModuleHandle(NULL)answersxcl.exethere, not the title. The test title's check for it passes here; a title that reads resources from its own image through a NULL module may need more.Validation
Linux, Wine with vkd3d-proton, GNU toolchain build,
mainat1f82be3:xcl run <testgame> -- --hello)main+ the other Wine fix (#92) onlymain+ this change + #92[PASS], 2[FAIL]on an AMD iGPU (RADV) and on an RTX 5060 TiThe two failing checks are not about this change (
xmemworking-set statistics; the console window "not cloaked" under Wine). The run needs a locally patched vkd3d-proton for reasons that have nothing to do with this change either (it asserts on objects whose vtable XCL replaced); that is a separate topic. Not run on Windows.AI-assisted.
🤖 Generated with Claude Code