Skip to content

Olympus: emulate geometry wave64 on wave32 - #14

Merged
ivall merged 3 commits into
xcl-dev:mainfrom
bmjask:codex/olympus-wave32-geometry
Nov 21, 2026
Merged

ivall merged 3 commits into
xcl-dev:mainfrom
bmjask:codex/olympus-wave32-geometry

Conversation

@bmjask

@bmjask bmjask commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • run legacy geometry ES work as two native wave32 halves when the PSO device lacks native wave64
  • synchronize ES output before re-entering GS on the first native wave
  • reject cross-half operations that are not safely emulated instead of silently miscompiling them
  • preserve the original single-wave geometry path on native-wave64 adapters
  • share exact-device path selection across production and direct geometry execution

Validation

  • GS pipeline integration test: passed on fixed-wave32 hardware
  • direct geometry execution: passed with 6 vertices, 2 triangles, validated attributes/indices, and 496 covered pixels
  • multi-group geometry regression: passed with vertex/triangle and raster validation
  • path-selection and cross-half hazard regressions: passed
  • xcl library tests: 202 passed, 13 ignored, 0 failed

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

ivall commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks – merged. Checked on an RX 9070 (native wave64): the game's sampled shaders translate to identical HLSL, the GS pipeline tests pass, and gpu_geometry_mode_es_gs_strip runs the split wave32 form on it too. Rejecting the cross-half operations instead of guessing is the right call.

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).
ivall added a commit that referenced this pull request Nov 22, 2026
…ist layouts

Unicorn Overlord runs on a newer console D3D12 runtime from its own game OS.
It reports the same SDK version (0x20004) as XDefiant and Minecraft, but some
vtables are laid out differently:

- Command queue: there are two more methods before Signal. Signal is at #16,
  Wait #17, GetTimestampFrequency #18, SignalX #25 and PresentX #32. The
  title's Signal used to land on GetTimestampFrequency, which wrote 100 MHz
  over the fence's vtable, and the game crashed. queue_dispatch now handles
  the title's queue slots from #14. A fence passed to #16 or #17 marks the
  newer layout; the older layout never passes one there.
- Command list: the console methods from CopyTextureRegionX onward sit two
  slots later (#85 instead of #83). The texture uploads used to hit
  SetPredicationBufferX, so every texture stayed zero and the screen showed
  only shapes and gradients. guard::make_layout_split now picks the method
  at each call and leaves the argument registers, xmm ones included,
  untouched.

Also:
- Console-only resource state bits (0x100000 on the 4K display target) are
  masked off when a resource is created. The PC refused the resource and
  the title threw.
- The title commits 2046 of 2048 MB of unified memory at start. XCL's
  per-draw arena now has its own 64 MB pool at the end of window 0, so
  draws are no longer skipped.
- FENCES is a read-write lock. end_title reads it while the title's threads
  are suspended, so a suspended reader no longer blocks it.

Diagnostics:
- XCL_WATCH=rva sets a write watchpoint in the exe; the calling thread is
  armed at once.
- XCL_WATCH_FENCE=n watches the n-th fence.
- The log now shows the device's SDK version, console-only interface
  requests, the title's file opens with their flags, DirectStorage
  requests, unified-memory use, and (in traces) whether title textures hold
  data in memory.

README: Unicorn Overlord is listed as fully playable. Bink's GPU-assisted
mode is no longer listed as missing: it needs no Bink-specific support.
Hull, domain and amplification shaders are dropped from the list too, since
none of the games use them.
gbuyssens added a commit to gbuyssens/xcl that referenced this pull request Nov 23, 2026
… CPU check at start (xcl-dev#104, xcl-dev#106)

- Until the title has passed a fence to Signal / Wait, queue slot xcl-dev#18 is GetDesc on the older
  layout and GetTimestampFrequency (a UINT64 out-parameter) on the newer one. A GetDesc
  answered in full wrote 16 bytes into a newer title's UINT64 (xcl-dev#104 item 4): now only the
  descriptor's first 8 bytes until a fence tells the layout (one from xcl-dev#14 / xcl-dev#15: the older).
- The launcher refuses to start on a CPU without the console Zen 2's extensions (AVX2, FMA,
  F16C, BMI1 / BMI2, LZCNT, POPCNT, MOVBE, SSE4.2) with a message naming them instead of the
  title's illegal-instruction crash (xcl-dev#106); XCL_SKIP_CPU_CHECK=1 runs anyway.
ivall pushed a commit that referenced this pull request Nov 23, 2026
Until a title's queue calls show which console layout its runtime has,
queue #18 went to the older layout's GetDesc, which writes a 16-byte
D3D12_COMMAND_QUEUE_DESC. On the newer layout #18 is
GetTimestampFrequency(UINT64*), so a call before the first Signal wrote 8
bytes past the title's out-param.

A Signal / Wait with a fence at #14 / #15 now marks the older layout. Until
one of the layouts is known, #18 writes only the first 8 bytes of the
description (type and priority) and logs a warning once. After that it is
the full GetDesc (older) or GetTimestampFrequency (newer), as before.

Test queue_slot_18_before_the_layout_is_known_writes_8_bytes (fake adopted
queue).
CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
queue_slot_18_before_the_layout_is_known_writes_8_bytes passed a bare
number (0x5EED_0000) as the title's fence to a Signal at queue xcl-dev#14. That
Signal goes on to the title-fence bookkeeping: list_x's sync graph and
fence_x keep the fence, and later queue calls from other threads ask it
for its completed value (prune_title_fence -> GetCompletedValue). In a
parallel run, a list_x test that checks for cycles after this test
called through 0x5EED_0000 and the test process ended with
STATUS_ACCESS_VIOLATION (xcl-dev#1487). One thread at a time it never showed:
list_x's tests run before real's.

The test now uses a static fence object whose GetCompletedValue answers
u64::MAX, so the bookkeeping drops its signal the first time it looks.

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.
theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 25, 2026
…zero samplers

Review of d4624b7: its test covered only pc_samplers() and that D3D12 makes a
2 048-sampler shader-visible heap. Sizing the PC heap with the title's count
again, or filling only the title's slots, passed every test; the second leaves
indexes 128 to 2047 unwritten sampler descriptors, which D3D12 leaves
undefined, the hazard d4624b7 removes.

The PC heap's description moves into pc_descriptor_heap_desc and the zero
sampler fill into zero_samplers, which now fills every sampler the PC heap
holds (its own GetDesc, called from XCL, so the PC's) instead of a count passed
beside it. No behaviour change.

The new test a_shader_visible_sampler_heap_has_the_zero_sampler_at_every_index
makes a shader-visible sampler heap of 128 slots through device xcl-dev#14 on a WARP
device adopted as a title's, and checks that its PC heap holds 2 048 samplers
and that the descriptor bytes of every one, 2047 included, are those of slot 0.
Checked that it fails with the PC heap sized at the title's 128 ("the PC heap":
128, not 2048) and with the fill stopped at 128 ("PC sampler 128": zero bytes).

Tested on the software adapter only (WARP). Not run on the hardware GPU or on a
title.

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

Review of d4624b7: the PC heap behind a shader-visible console sampler heap
now holds 2 048 samplers, and descriptor heap xcl-dev#8 GetDesc was not hooked, so a
title asking its 128-slot sampler heap for its description read 2 048. A title
that sizes an allocator or a loop from that count makes samplers or copies at
console handles past its 128 16-byte slots: console_heap::slot finds none
there, dev_create_sampler_x hands the handle to the PC CreateSampler as it is,
and the driver writes a sampler descriptor at that address in the title's
memory. A view heap already read twice its slots, and one whose views are in
the shared heap read no shader-visible flag. Whether the retail title calls
GetDesc on these heaps was not checked (no trace taken).

Device xcl-dev#14 now keeps the description each console CBV/SRV/UAV and sampler heap
was made with (the title's type, 4 included, count, flags and node mask) until
the heap's last Release, and xcl-dev#8 answers it to calls from the title's images,
returned through the hidden pointer called the C++ way or the C way
(this_first, as device xcl-dev#25 / xcl-dev#26). Other heaps, and every call from XCL itself
(the split slot: list_x::pc_heaps reads the PC flags), get the PC
description as before.

New test a_console_heap_describes_itself_as_the_title_made_it, on a WARP device
adopted as a title's: a shader-visible sampler heap of 128 made through device
xcl-dev#14 answers [1, 128, 1, 0] both ways while XCL's own GetDesc says 2 048; a view
heap answers the PC description until it is known as a console heap of type 4
and 64 slots, then that; both are forgotten when released; xcl-dev#8 is in the
descriptor heap's console slots. Checked that it fails with the hook answering
the PC description ("the sampler heap": [1, 2048, 1, 1]). The view heap's
recording at creation is not covered (making a view heap through xcl-dev#14 makes the
process-wide shared heap).

Tested on the software adapter only (WARP). Not run on the hardware GPU or on a
title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
raylitebull pushed a commit that referenced this pull request Nov 25, 2026
CreateDescriptorHeap with a null out pointer is D3D12's validation call:
no heap is made and it returns S_FALSE. dev_create_descriptor_heap_x read
*ppv on any success code, so the call crashed for CBV_SRV_UAV and SAMPLER
heaps. It now registers the heap only when ppv and *ppv are not null, as
dev_create_descriptor_heap already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GustavoEllwanger added a commit to GustavoEllwanger/xcl that referenced this pull request Nov 25, 2026
…xcl-dev#2401)

CreateDescriptorHeap with a null out pointer is D3D12's validation call:
no heap is made and it returns S_FALSE. dev_create_descriptor_heap_x read
*ppv on any success code, so the call crashed for CBV_SRV_UAV and SAMPLER
heaps. It now registers the heap only when ppv and *ppv are not null, as
dev_create_descriptor_heap already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…#2127, xcl-dev#2476, xcl-dev#2479, xcl-dev#2467, xcl-dev#2444, xcl-dev#2447, xcl-dev#2448

Integrates compositor RT tracking fix (xcl-dev#2480), split shader cache budget
(xcl-dev#2475), foreign-thread deferred release (xcl-dev#2474), Wine 4-thread DXC cap
(xcl-dev#2127), DXIL feature/reload fixes (xcl-dev#2476, xcl-dev#2479), DXC loader cleanup
(xcl-dev#2467), console xcl-dev#14 null ppv guard (xcl-dev#2444), root-sig flag stripping
(xcl-dev#2447), and two-pass stream canonicalization (xcl-dev#2448).

Assisted-by: Antigravity (Gemini 4 Neon)
GustavoEllwanger added a commit to GustavoEllwanger/xcl that referenced this pull request Nov 26, 2026
…xcl-dev#2401)

CreateDescriptorHeap with a null out pointer is D3D12's validation call:
no heap is made and it returns S_FALSE. dev_create_descriptor_heap_x read
*ppv on any success code, so the call crashed for CBV_SRV_UAV and SAMPLER
heaps. It now registers the heap only when ppv and *ppv are not null, as
dev_create_descriptor_heap already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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