Skip to content

Olympus: harden GameSave read results - #10

Merged
ivall merged 2 commits into
xcl-dev:mainfrom
bmjask:codex/olympus-gamesave-safety
Nov 21, 2026
Merged

ivall merged 2 commits into
xcl-dev:mainfrom
bmjask:codex/olympus-gamesave-safety

Conversation

@bmjask

@bmjask bmjask commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate counted blob-name arrays before dereferencing guest pointers
  • preserve completed GameSave read results when callers retry after an undersized result buffer
  • keep malformed guest inputs contained behind HRESULT failures

Validation

  • focused GameSave tests: 2 passed
  • xcl library tests: 201 passed, 13 ignored, 0 failed

No package protection or DRM behavior is touched.

@ivall
ivall merged commit 7897f13 into xcl-dev:main Nov 21, 2026
@ivall

ivall commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks – merged. Good catch on keeping the result for the retry after a too-small buffer.

ivall added a commit that referenced this pull request Nov 21, 2026
Device #55 creates a pipeline from a base pipeline's description with
patched parts: { u32 part; payload } at a 0x14C stride, parts 0-3 =
depth-stencil, rasterizer, blend state, sample mask (part 5 ignored).

Title graphics pipelines (#10, #60 and derived ones) keep their desc with
the input layout copied; the shaders stay the title's and are checked by
hash before deriving. The test title draws with a #60 pipeline and one
derived from it with a blend patch.
ivall added a commit that referenced this pull request Nov 21, 2026
From runs of the user's XDefiant dump (each was a stop of the title after a
failed D3D12 call):
- D: is mounted on the game folder by default (d:\hunter\...); new default
  mounts are merged into existing configs;
- the title's unhandled-exception filter goes behind XCL's; crash records
  have all registers, the vtable module of the objects they point at and
  the callers on the stack;
- CheckFeatureSupport with the console's larger structures (D3D12_OPTIONS
  0x40 bytes) is retried with the PC size;
- device #25 GetResourceAllocationInfo called the C way (return buffer
  first) no longer writes over the device;
- the DMA list has its own vtable: Close #9, Reset #10, CopyBufferRegion
  #11, CopyTextureRegion #12, CopyResource #13, CopyTiles #14;
- the PC runtime writes its vtable into a copy list on Reset: XCL's is put
  back;
- device #27 CreateCommittedResource from console code: buffers and
  textures in unified memory (the title clears a texture through its GPU
  address).
It now stops where the title's inline D3D12.X code writes graphics records
into the command list object. Diagnostics: XCL_WATCH_DEVICE / XCL_WATCH_DMA
(hardware write watchpoints), XCL_D3D12_DEBUG (debug layer messages into
the log).

Console shader kernels: local arrays indexed per lane, switch in nested
loops, 16-bit floats and integers (11 kernels, all the same as the PC).
gbuyssens pushed a commit to gbuyssens/xcl that referenced this pull request Nov 23, 2026
…and offset (from xcl-dev#169)

The retail game called xcl-dev#10 (a stub returning E_NOTIMPL) and then wrote to address 0 at
+0x2215c35. xcl-dev#10 / xcl-dev#11 are GetSubresourceLayout / GetSubresourceOffsetBytes: the
XG_SUBRESOURCE_LAYOUT of a subresource, or its byte offset.

Only xg.rs of xcl-dev#169 is taken: its DSV format 118 remap is covered more completely by
xcl-dev#163 (merged with xcl-dev#170: resource descs, pipelines, depth buffers that are UAVs).
gbuyssens pushed a commit to gbuyssens/xcl that referenced this pull request Nov 23, 2026
…and offset (from xcl-dev#169)

A title called xcl-dev#10 (a stub returning E_NOTIMPL) and then wrote to address 0.
xcl-dev#10 / xcl-dev#11 are GetSubresourceLayout / GetSubresourceOffsetBytes: the
XG_SUBRESOURCE_LAYOUT of a subresource, or its byte offset.

Only xg.rs of xcl-dev#169 is taken: its DSV format 118 remap is covered more completely by
xcl-dev#163 (merged with xcl-dev#170: resource descs, pipelines, depth buffers that are UAVs).
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 23, 2026
… render-target and texture-address fixes

Open upstream pull requests applied as they are (their authors' work):
- xcl-dev#151 (gbuyssens): clzero / clwb / rdpru / monitorx / mwaitx / rdpid emulated
  on CPUs that lack them (HANDOFF.md hunk left out, it did not apply).
- xcl-dev#163, xcl-dev#170 (Sr-0w): Xbox D16S8 depth formats, depth + UAV buffers, console
  mesh pipeline streams, null stand-in shaders.
- xcl-dev#168 (ShyVortex): GetGPUVirtualAddress of a placed texture.

Local changes:
- xg: XGTextureAddressComputer xcl-dev#10 as GetResourceTiling, from the layout model
  (not checked against the console's library).
- d3d12x: a UAV of a texture made without ALLOW_UNORDERED_ACCESS is a null UAV
  (the real call removed the device); a committed texture gets memory when the
  title asks for its address; clear values and view descriptions get pc_format;
  formats 86 / 115 -> R8G8B8A8, 116 / 117 -> R16G16B16A16_FLOAT.
- Debug layer log: 8 messages per id instead of 200 in all.
- The earlier "AS slot ignored" workaround stays but is no longer reached (xcl-dev#170).
- CHANGES.txt, README status and installer version for build 3.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
gbuyssens added a commit to gbuyssens/xcl that referenced this pull request Nov 23, 2026
…he console library's code)

The library's vtable, disassembled: slot 10 takes ID3D12Device::GetResourceTiling's six
arguments for the computer's resource – it reads *pNumSubresourceTilings, writes a
D3D12_PACKED_MIP_INFO, a D3D12_TILE_SHAPE and D3D12_SUBRESOURCE_TILINGs indexed by D3D12
subresource skipping the packed levels. E_FAIL unless the swizzle mode is a 64 KiB one
(8–11, 16–19, 24–27), E_NOTIMPL for 1D and 3D textures; the standard tile in elements goes
by their size (256×256 for 1 byte … 64×64 for 16), reported in texels; a level's tiling is
its padded size over the tile, its start tile the level's offset in 64 KiB tiles plus the
slice's; the packed levels take one tile at the first one's offset. A title's texture
streaming asks this for every texture it places in a tiled pool.

The guess taken from xcl-dev#169 (GetSubresourceLayout / Offset, sniffing which arguments
are pointers) answered E_INVALIDARG by luck with the real arguments (the "plane" was the low
half of a pointer) and would have written 0x70 bytes over a 12-byte tile shape otherwise.
Slot 11 is GetDescriptor(plane, 32-byte hardware descriptor), not modelled: a stub again.

Test: resource_tiling_of_a_64kb_texture.
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 23, 2026
…09) applied

xcl-dev#192: XGTextureAddressComputer xcl-dev#10 as GetResourceTiling, read from the console library's code - replaces the local version, which was not checked against it. xcl-dev#191: recompiler wave32 src_vccz / src_execz and SDWA f16 inline constants. Their authors' work, applied as it is. 200 s run through the title's menus: no change in the picture, no regression.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 23, 2026
xcl-dev#192 reads the method from the console library; the version here was derived from the layout model and differs from it for 4 KiB modes, 3D textures and packed levels (review on xcl-dev#195).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ivall added a commit that referenced this pull request Nov 23, 2026
…y physical pages, PC view formats

GPU-owned textures placed at title addresses are reserved (tiled) resources on 64 KiB
pages of video memory, one per page of the title's address and shared by every target
there; arenas remain for what the driver will not tile. Straddling placements had made
15 GB of union arenas in two seconds (video memory is charged to the process's commit),
and the device was removed. Physical pages mapped into plain reservations are committed
on first CPU access (a vectored handler; ReadFile, DirectStorage and CPU writes commit
first). Title GPU heaps go to the coherent window when it fits; free sparse pools go.

The device removal at ~14 s was a B5G5R5A1 UAV of a target the PC makes R8G8B8A8: views
get the PC's format for their resource – depth buffers are typeless with R24_UNORM_X8 /
R32_FLOAT views (stencil: plane 1), 116/117 are half floats, B5G5R5A1/B4G4R4A4 targets
R8G8B8A8. XG #10 is GetResourceTiling (checked against the console library), the
D16S8 family is laid out as the console's. Pipelines with the console MS in the AS slot
are refused (translated, the title rendered nothing).

From PR #195, in parts: index/vertex buffers outside unified memory are mirrored, rect
lists are two triangles a rectangle, committed textures get an address on request,
the debug layer logs per message id. XCL_ACTIVITY logs commit and video memory.
ivall pushed a commit that referenced this pull request Nov 23, 2026
Console code calls descriptor heap #9 / #10 (GetCPU / GetGPUDescriptorHandleForHeapStart)
with only `this` and takes the handle in rax, as the real backend already answers it
(real.rs heap_cpu_start_x). The null device used the PC form and wrote the handle through
rdx, whatever the caller had left there. Under Wine 11.22 with no D3D12 device (no GPU),
the test title runs its GPU checks on the null device: its rdx pointed into its read-only
.rdata and the title ended with 0xC0000005 in Heap_GetHandleStart (where rdx happens to
be writable, the stray write goes unnoticed). The handle now comes back in rax and rdx is
not touched. Windows: the same for the null device (no D3D12 device or graphics = "null");
the real backend is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019twRmXSjLgBbFAokwc63ad
ivall pushed a commit that referenced this pull request Nov 23, 2026
…gnature

The test for descriptor heap #9 / #10 called them through a two-argument fn pointer
(`this` plus a stray pointer) although they take only `this`: a Rust call through a fn
pointer of another signature is undefined behaviour, even where Win64 lets it pass. Its
checks were also weak: a start that is not 0 and not the stray pointer, so #9 / #10
returning the constant 1 still passed.

The test now creates two heaps and reads each heap's start from the object
(CreateDescriptorHeap's handle range: not 0, a different one per heap), then calls #9 and
#10 as `fn(this) -> u64` and wants exactly that start. On x86_64 Windows it also calls them
through a small asm shim that passes `this` in rcx and leaves a writable sentinel pointer in
rdx, as console code can: the sentinel must be unchanged and rax the exact start. Checked
under Wine: #9 / #10 returning 1 fails the test, and so does the old PC form that wrote the
handle through rdx. Test only, the null device is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019twRmZMiGWQ8zSxFiGaz6b
Ahmet-Dedeler added a commit to Ahmet-Dedeler/xcl that referenced this pull request Nov 23, 2026
- kernelx: XMemIsToolsMemAvailable (TRUE; the title stops at an int3 on FALSE);
  XMemMapPhysicalPagesScatter without a page array unmaps the addresses.
- xgameruntime: 128 vtable slots per object (later GDKs call past 96), the XDisplay HDR
  class (XDisplayTryEnableHdrMode: Disabled).
- d3d12x: device xcl-dev#101 CreateStateObject from console code fails cleanly (E_NOTIMPL) instead
  of S_OK with no object.

Dropped as upstream has its own: XG xcl-dev#10 GetResourceTiling, illegal-instruction bytes in the
crash line.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
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)
Ahmet-Dedeler added a commit to Ahmet-Dedeler/xcl that referenced this pull request Nov 24, 2026
- kernelx: XMemIsToolsMemAvailable (TRUE; the title stops at an int3 on FALSE);
  XMemMapPhysicalPagesScatter without a page array unmaps the addresses.
- xgameruntime: 128 vtable slots per object (later GDKs call past 96), the XDisplay HDR
  class (XDisplayTryEnableHdrMode: Disabled).
- d3d12x: device xcl-dev#101 CreateStateObject from console code fails cleanly (E_NOTIMPL) instead
  of S_OK with no object.

Dropped as upstream has its own: XG xcl-dev#10 GetResourceTiling, illegal-instruction bytes in the
crash line.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
vincentes added a commit to vincentes/xcl-wasm that referenced this pull request Nov 24, 2026
…nsole

- `xcl::hle::xg` (the console's texture layout: planes, mips, the GFX10
  tiling) now builds on every target: only its COM glue is Windows code.
  Its three unit tests run off Windows too.
- `win::xg`: `XGCreateTextureComputer` on the guest, answering from that
  model: the resource layout structure, size and alignment, mip and texel
  offsets, CopyIntoSubresource / CopyFromSubresource on title memory.
  GetResourceTiling (xcl-dev#10) is not there.
- The software D3D12.X device lays textures out the same way: a texture
  resource takes what the console's layout of it takes;
  CopyTextureRegion (whole subresources) untiles into a buffer's placed
  footprint, tiles from one, or copies between textures;
  GetCopyableFootprints places a texture's subresources as D3D12 does;
  PresentX untiles the back buffer into the frame's rows.

Measured on macOS (aarch64): the test title runs to its end, 43 of its 50
checks pass ("a texture in title memory (XG layout, xcl-dev#44) follows CPU
writes", "a texture in a streaming pool gets its texels once pages are
mapped in" and "committed textures … a readback buffer still gets
coherent memory" are new). The 7 that fail: 4 compile HLSL and render,
DirectStorage (in work by another agent), Media Foundation, XAudio2.
On the staged tree in a separate copy: `cargo test -p xcl --lib`: 136
passed; `cargo test -p xcl-guest`: 47 passed; `cargo +nightly check -p
xcl --target x86_64-pc-windows-gnu --all-targets`: no errors; the wasm64
smoke test (1.31 MB, Node 24): 43 pass, 7 fail, 5.4 s.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
rickyfahrez pushed a commit to rickyfahrez/xcl that referenced this pull request Nov 24, 2026
…dled exception

Still a diagnostic, off by default. With the waits cut to 20 ms a title
still ends 30 s after its last frame, its submitting thread waiting in its
own code (crash context: an unsignaled cross-queue barrier). The trace now
keeps each command queue method the title calls (slot and two arguments,
ExecuteCommandLists as xcl-dev#10) and CPU fence signals, and an unhandled
exception logs the last 400 events and every fence's queued / completed /
cell value.

Not built and not tested: written on macOS.

Assisted-by: Claude Code (Fable 5.2)
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)
gbuyssens added a commit to gbuyssens/xcl that referenced this pull request Nov 24, 2026
Upstream reached a retail game's first menu: GPU-owned textures on tiled pages of video memory
instead of arenas, physical pages committed on first CPU access, PC view formats for depth
buffers and 16-bit targets, XG xcl-dev#10 as GetResourceTiling, lazy pipelines, free sparse pools
released, XCL_ACTIVITY with commit and video memory.

Where both sides had implemented the same thing (lazy pipelines, the PC's view formats, XG xcl-dev#10,
the debug layer's message cap, free pool release), upstream's version is kept; the fork's memory
line goes with it, XCL_ACTIVITY covers it. The fork keeps code bytes on every crash line.
wondercrash added a commit to wondercrash/xcl that referenced this pull request Nov 24, 2026
A list split at a recorded memory wait records on in a second PC list; the
console object's Reset (xcl-dev#10) resets the first one and makes the others
spares. The newer layout's Reset (xcl-dev#139, how a retail title resets the lists
of its pool) was forwarded to the active PC list like any other slot: it
reset the last segment only, the recording went on there, and the object
kept its segments. Every later ExecuteCommandLists of that list ran the
first PC list again, with the first part of the recording it had been
split in: its draws and dispatches on memory the title used for other
things since, and its Write64 values after newer ones.

xcl-dev#139 is now the object's Reset when the title's runtime has the newer
layouts (looked at in each call, as the list's other moved slots are).

What run 13 shows of it: an ExecuteCommandLists of 10 lists with two lists
without one mark since they last ran (not even Close), each followed by a
list made later; the GPU stood 30 s between the lists before the first of
them. And one cell's Write64 of 0x50f submitted on q4 after 0x510, then
on q3 after 0x511.

Test: hle::d3d12x::title_list::tests::the_newer_layouts_reset_resets_the_primary_list_and_ends_the_split
Assisted-by: omp (anthropic/claude-mythos-5-2)
CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
…PC descriptors

The command list's console xcl-dev#53 / xcl-dev#54 (ClearUnorderedAccessViewUint /
Float) were remapped straight to PC xcl-dev#49 / xcl-dev#50 (`console_remap`) with no
override, so a title's call reached the PC method with its handles as
they were. Console code takes its descriptor handles from heap xcl-dev#9 / xcl-dev#10,
which give it the address of its console heap slots in unified memory
(`console_heap::start`), not PC descriptor handles: the PC clear got a
GPU handle outside the bound shader-visible heap and a CPU handle
pointing at T# words. Only the opt-in console-list replay
(XCL_CONSOLE_LISTS=1) translated them.

xcl-dev#53 / xcl-dev#54 now go to `list_x::clear_uav_uint_x` / `clear_uav_float_x`
(same arguments as the PC methods): two console slots become their PC
UAVs (GPU: `pc_gpu_uav`, in the heap lists bind; CPU: `pc_uav`, in the
title's CPU-only heap), as the replay does; two PC handles go through as
they are; a mix, or a slot without a shader-visible UAV, is skipped and
logged once.

Test on WARP: an R32_UINT buffer UAV in a CPU-only and a shader-visible
console heap, xcl-dev#53 with the console handles and 0xDEADBEEF. With the
handles passed through (the old path) the test process dies with
STATUS_ACCESS_VIOLATION in the PC clear; with the translation the buffer
reads back 0xDEADBEEF.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
raylitebull pushed a commit that referenced this pull request Nov 25, 2026
Part of #480.

Add integration tests comparing D3D12.X runtime wrappers against host
ID3D12Device objects and console ABI contracts across:
- ID3D12Resource Map, Unmap, GetGPUVirtualAddress (including lazy
  TITLE_ADDRESS texture fallback and UMA buffer placement), and
  WriteToSubresource
- ID3D12DescriptorHeap console slot #9/#10 start handles and
  console_heap::start lifecycle on host and console #14 heaps
- ID3D12CommandQueue GetDesc, GetTimestampFrequency,
  GetClockCalibration (host parity and pre/post-QUEUE_OLDER console
  calls), ExecuteCommandLists, Wait, Signal, and SignalX (#23)
- ID3D12Fence slot #12 64-byte-aligned completed-value cell and CPU
  Signal updates, plus ID3D12CommandAllocator::Reset (#8)

Verified on AMD Radeon RX 9070 XT (debug, release, XCL_D3D12_DEBUG=1),
AMD Radeon(TM) Graphics, and WARP.
raylitebull pushed a commit that referenced this pull request Nov 25, 2026
A console lets a title Reset a command list and submit the new recording
on the same queue while the GPU still runs the previous one. The PC does
not let a list be submitted again before its last execution is done
(debug layer id 553, "the command queue fence has not advanced past
previous executions of the command list"); on NVIDIA the device is
removed about 12 s later. The retail title's world load does it (#1452):
note_resubmits logs "a new recording, the same queue", 8 lists at once.

A title's list is a title_list wrapper whose PC lists already change
(mid-list split segments, a spare pool per list), so the fix uses that:
at the title's Reset, when alloc_pool says the primary PC list's last
submit has not completed, the new recording goes onto a spare whose
submits are done (or a new PC list), reset like the primary would be
(reset_pc), and push_segments submits it in the primary's place
(SegmentBook::first). The next Reset after the GPU is done records on the
primary again and the stand-in goes back to the spares. pop_spare now
skips spares still on the GPU, so split segments do not hit the same
error. No CPU wait. When the primary is not in flight nothing changes.

The retail title does not Reset through the wrapper's #10: its runtime
has the newer console list layout, whose Reset is #139 (allocator, NULL,
0). The wrapper's #139 is a thunk to the active PC list (F_BACKING), and
there NEWER_LIST_SLOTS's layout split runs the #10 handler, reset_x, on
that PC list. So the wrapper's Reset, and its in-flight check, never ran
(measured: the stand-in 0 times, 64+ resubmits, each list last reset in
reset_x and still the wrapper's active PC list). reset_x now hands a Reset
of a PC list a wrapper records on to the wrapper's Reset; the PC list's
own Reset is reset_pc, which the wrapper and the stand-in call. This also
resets a split list from its primary on #139, not from its last segment.

Test: a list reset and submitted three times while a queue Wait holds the
first submit records on three different PC lists and note_resubmits sees
none, then on the primary again once the GPU is done; once with the
wrapper's #10 and once with reset_x on the active PC list, as #139 does.
Without the stand-in the second submit is the primary and the test fails;
without the hand-over in reset_x the #139 round fails the same way.

Part of #1452.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
emirduran707 added a commit to emirduran707/xcl that referenced this pull request Nov 25, 2026
…PC descriptors

The command list's console xcl-dev#53 / xcl-dev#54 (ClearUnorderedAccessViewUint /
Float) were remapped straight to PC xcl-dev#49 / xcl-dev#50 (`console_remap`) with no
override, so a title's call reached the PC method with its handles as
they were. Console code takes its descriptor handles from heap xcl-dev#9 / xcl-dev#10,
which give it the address of its console heap slots in unified memory
(`console_heap::start`), not PC descriptor handles: the PC clear got a
GPU handle outside the bound shader-visible heap and a CPU handle
pointing at T# words. Only the opt-in console-list replay
(XCL_CONSOLE_LISTS=1) translated them.

(same arguments as the PC methods): two console slots become their PC
UAVs (GPU: `pc_gpu_uav`, in the heap lists bind; CPU: `pc_uav`, in the
title's CPU-only heap), as the replay does; two PC handles go through as
they are; a mix, or a slot without a shader-visible UAV, is skipped and
logged once.

Test on WARP: an R32_UINT buffer UAV in a CPU-only and a shader-visible
console heap, xcl-dev#53 with the console handles and 0xDEADBEEF. With the
handles passed through (the old path) the test process dies with
STATUS_ACCESS_VIOLATION in the PC clear; with the translation the buffer
reads back 0xDEADBEEF.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
MacieGx pushed a commit to MacieGx/xcl that referenced this pull request Nov 26, 2026
A console lets a title Reset a command list and submit the new recording
on the same queue while the GPU still runs the previous one. The PC does
not let a list be submitted again before its last execution is done
(debug layer id 553, "the command queue fence has not advanced past
previous executions of the command list"); on NVIDIA the device is
removed about 12 s later. The retail title's world load does it (xcl-dev#1452):
note_resubmits logs "a new recording, the same queue", 8 lists at once.

A title's list is a title_list wrapper whose PC lists already change
(mid-list split segments, a spare pool per list), so the fix uses that:
at the title's Reset, when alloc_pool says the primary PC list's last
submit has not completed, the new recording goes onto a spare whose
submits are done (or a new PC list), reset like the primary would be
(reset_pc), and push_segments submits it in the primary's place
(SegmentBook::first). The next Reset after the GPU is done records on the
primary again and the stand-in goes back to the spares. pop_spare now
skips spares still on the GPU, so split segments do not hit the same
error. No CPU wait. When the primary is not in flight nothing changes.

The retail title does not Reset through the wrapper's xcl-dev#10: its runtime
has the newer console list layout, whose Reset is xcl-dev#139 (allocator, NULL,
0). The wrapper's xcl-dev#139 is a thunk to the active PC list (F_BACKING), and
there NEWER_LIST_SLOTS's layout split runs the xcl-dev#10 handler, reset_x, on
that PC list. So the wrapper's Reset, and its in-flight check, never ran
(measured: the stand-in 0 times, 64+ resubmits, each list last reset in
reset_x and still the wrapper's active PC list). reset_x now hands a Reset
of a PC list a wrapper records on to the wrapper's Reset; the PC list's
own Reset is reset_pc, which the wrapper and the stand-in call. This also
resets a split list from its primary on xcl-dev#139, not from its last segment.

Test: a list reset and submitted three times while a queue Wait holds the
first submit records on three different PC lists and note_resubmits sees
none, then on the primary again once the GPU is done; once with the
wrapper's xcl-dev#10 and once with reset_x on the active PC list, as xcl-dev#139 does.
Without the stand-in the second submit is the primary and the test fails;
without the hand-over in reset_x the xcl-dev#139 round fails the same way.

Part of xcl-dev#1452.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 78fba7b)
rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 27, 2026
The null device wrote RaytracingTier at +8 but left the oversized-probe
tail untouched, so the title's raytracing_surface check died at the
16-byte 0xAA tail assert on null while the identical probe passed on
Vulkan. Port the Vulkan tail-zero block (bytes past 12 zeroed, 4 KiB
sanity cap) into the null Device_CheckFeatureSupport.

Failing-first: new null_check_feature_support_zeroes_options5_tail test
fails pre-fix ([170 x4] vs [0 x4]) and passes now; other-feature and
short-struct probes pass through untouched on both paths.
Gates: check -p xcl --tests EXIT 0; check --workspace EXIT 0; lib 798
passed/0 failed/1 ignored (--test-threads=4). Title e2e, fresh roots:
null stays 11 FAILs (raytracing now clears the tail assert and stops one
leg deeper at the AS SRV descriptor, which needs the Vulkan-only RTAS
view + xcl-dev#146/xcl-dev#148 — that is the unlocked next slice, not this one; all
other null FAILs byte-identical to the pre-fix baseline, 0 non-GPU),
Vulkan 9 unchanged. Retail HOLDS (SIGSEGV exe+0x2237320, exit 139,
called_stubs 20, 0 d3d12).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants