98 Commits

Author SHA1 Message Date
ivall 7a033c8cd1 Retail game goes past its first menu: struct-returning device methods tell the return buffer from the device
GetResourceAllocationInfo and the other struct-returning device methods take either argument
order (return buffer, device / device, return buffer), told apart by which argument looks
like an adopted object. A retail game's stack return buffer held a stale copy of the
device's vtable pointer: both looked adopted, the result went over the device object, and
the next call read slot 25 of "vtable" 0x1000 (the title's crash filter then ended the
process with no trace). real::this_first: when both look adopted, the one on the thread's
stack, or the one that is not the device, is the buffer.

XCL_TRACE_FAULTS=1 logs access violations as they are raised (the first 32), before the
title's handlers - what found this one.
2026-11-23 22:49:43 +01:00
ivall ed4af10817 Merge PR #190 2026-11-23 22:06:35 +01:00
ivall 0636e7a235 Merge PR #151 2026-11-23 21:49:41 +01:00
ivall 38b05b7b69 Retail game shows its first menu: target pages instead of arenas, lazy 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.
2026-11-23 21:47:00 +01:00
Guyliano Buyssens 9392eae914 XCL_TRACE_IMPORTS: every call of an HLE import logged with its arguments and result
A call-through thunk (guard::make_call_tracer) saves the register arguments,
forwards eight stack arguments, calls the original and logs the call when it
returns, with unwind info so an exception raised inside unwinds through it.
Pointer arguments show the string or the first words they point at.
resolver::resolve_import wraps the HLE imports (system ones with 'all',
include/exclude prefixes of dll!Function otherwise).
2026-11-23 19:54:56 +00:00
Guyliano Buyssens 0b28a39139 Console CPU instructions a PC CPU lacks are emulated: clwb, clzero, rdpru, monitorx / mwaitx, rdpid
A title compiled for the console's Zen 2 raises STATUS_ILLEGAL_INSTRUCTION on
an Intel CPU before Ice Lake / Alder Lake (clwb, sha) or on any Intel CPU
(clzero, rdpru, monitorx, mwaitx). insn::decode recognises them at the
faulting address; the vectored handler emulates them and steps over. Other
illegal instructions and ud2 are logged with their code bytes, in the
first-chance handler and in the crash line.
2026-11-23 19:54:56 +00:00
ivall 956a476bf7 Retail game reaches 30 fps: frame events sharing a deadline, ExecuteCommandListsX, big pipelines in the background
The frame clock fired one event type per deadline; a title scheduling the origin and
type 2 at the same offset waited on type 2 for ever after two frames. Now every type
due fires. Newer console layout: queue #35 is ExecuteCommandListsX, list #61 is
ExecuteIndirect (the shift by two from #59 on). Bottom-of-pipe writes into memory the
GPU does not see are done by the CPU after the queue's work, waits there read it on the
CPU. Compute pipelines of 256 KB of DXIL or more are built in the background (2 at a
time), a bind of one not started builds it itself. DXC -O1 from 1 MB of HLSL.
`xcl shaders --precompile --pipelines` warms the driver's cache.
2026-11-23 19:11:12 +01:00
ivall db5dc26cba Shader loading: dumps on request, translations kept on disk, precompile of compute
Every new shader was dumped (blob, FSSMs, disassembly, HLSL from a second translation)
on the title's thread at each start: now only with XCL_DUMP_SHADERS=1 (the retail game:
4.8 GB of dumps). Translations (DXIL and static samplers) are kept on disk by the console
bytes and the XCL binary's hash, so a start does not translate again. `xcl shaders
--precompile --only cs` fills both caches through the title's path. XCL_FRAME_DUMP=n,
frames shown at the end of a timed run, each translation failure logged once.
2026-11-23 18:03:31 +01:00
ivall 66e8e97460 Retail game: commit physical page homes once, the DSP, list Reset #139, rect lists
A home in a sparse window is only reserved until its page is used there and gives its
memory back while the page is mapped elsewhere: the retail game's 5.7 GB of pages were
committed twice, with video-memory tiles (28.7 GB of commit, now 16-17 GB). chad.dll
(XDsp) connects and takes commands; the newer list layout's #139 is Reset; console rect
lists are drawn as triangles; a stream without a topology type is TRIANGLE.
XCL_TRACE_MEM=n logs the first n allocations.
2026-11-23 17:26:38 +01:00
ivall 9add7213c6 Retail game bring-up: physical pages, 1D/3D layouts, newer device, list and fence methods
Placeholder VirtualAlloc, XMemMapPhysicalPagesScatter with 4 KiB page numbers, the
title's allocation hooks, pipeline streams translated as plain descs, fence #12,
GetResourceAllocationInfo2, 1D / 3D textures in xg (checked against the console's
library), the newer list layout from #72 on, and XCL_NETWORK=0.

Not playable yet: the title runs out of memory while compiling pipelines (HANDOFF).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:44:36 +01:00
ivall 484dd57990 HANDOFF: PR #133 checked on the RX 9070 2026-11-23 15:39:47 +01:00
Foniass af0311d481 Wave64 VS / PS in 32-lane waves: the lanes 32..63 they read
On a GPU with 32-lane waves only (NVIDIA) the driver runs a console wave64
VS / PS in waves of 32: a console wave whose lanes 32..63 are not populated.
Those lanes exist on the console (inactive) and hold what v_writelane or
whole-wave code put there; here they do not exist, and WaveReadLaneAt of a
lane >= 32 reads lane & 31.

The 749 programs wave_hazards flagged in the retail pack (748 PS, 1 VS):
- 1 082 reads in 436 programs: whole-wave reductions (identity into the
  lanes outside the mask, DPP8 xor 1/2/4, row_mirror, v_permlanex16,
  v_readlane 32 for the upper half; min_u32 / max_u32 / or_b32). Right only
  because lane 32 reads lane 0 and those ops are idempotent.
- 355 reads in 353 programs: waterfall reads, v_readlane v, s_ff1(mask &
  EXEC) - a lane < 32. Right.
- 200 reads in 11 programs: SGPR spill slots in lanes 32..47. Wrong: the
  v_writelane is lost, the read gets another slot.

upper_lanes.rs follows what the console's lanes 32..63 hold through the
program (forward pass: EXEC's upper word through the SGPRs as 0 / all ones /
anything; per VGPR lane unwritten / a constant / a spill slot / unknown,
evaluating whole-wave moves, selects, integer min / max / logic / add and
their DPP forms). With split_wave64 a wave64 VS / PS reads a lane >= 32 that
holds a constant as the constant, and a spill slot from a scalar shadow its
v_writelanes also write, when WaveGetLaneCount() < 64. Spill slots < 32 come
from their shadows at any wave size: a lane a partial wave did not launch
loses its slot (287 PS spill to lanes < 32). Only programs with such a read
get the form (613 of the pack; DXC compiles all). Without split_wave64 the
HLSL of all 26 698 programs is unchanged, and so is the 32-lane form of the
other modes (digests compared with main, retail_wave64_graphics_lane_forms).

wave_hazards now reports only reads the pass cannot follow: none in the pack.

GPU tests on an RTX 5070 Ti: gpu_wave64_ps_whole_wave_reductions (the pack's
reduction as min and as a sum, and the waterfall read, per hardware wave
against a console wave of the same lanes), gpu_wave64_ps_spill_slots (full
target and a 6-pixel triangle), gpu_wave64_vs_spill_slots_and_identity (3
vertices). With the old form all three fail there.

Not exact yet, on every GPU: whole-wave code in a partial wave reads lanes
the PC never launched. On the 5070 Ti they read 0, so a min reduction gives
0 in a partial pixel wave (325 programs have one); max / or are right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:22:06 +01:00
ivall 95bda116cf HANDOFF: PRs #110-#130 (merged, held, closed) 2026-11-23 15:13:33 +01:00
ivall fdeacf0529 FidelityFX: the console FSR4 upscaler's passes translate and a frame runs on the GPU
AMD's console upscaler (amd_fidelityfx_upscaler_xbox.dll) creates its 29 pipelines with
CreateComputePipelineState on blobs that carry no DXIL: an ACCC part holding FSPX, the console
driver's own container (numthreads, COMPUTE_PGM_RSRC1/2, the RDNA2 code). pso::fspx reads it
and the program goes through the recompiler as a compute shader – all 29 translate and compile.

The packed 8-bit dot products (v_dot4(c)_i32_i8, v_dot4_u32_u8) are SM 6.4's dot4add_i8packed /
dot4add_u8packed instead of shifts and multiplies: FSR4's network passes are thousands of them,
and the biggest went 1.55 -> 1.23 MB of DXIL and 604 -> 74 s in DXC; the AMD driver had refused
it with E_OUTOFMEMORY.

The FSR probe (XCL_CONSOLE_LISTS=1 XCL_PROBE_FSR=1 XCL_PROBE_FSR_DISPATCH=1, new
XCL_PROBE_FSR_EXECUTE=1) uploads inputs (a grey gradient, depth 0.5, no motion), records a
1280x720 -> 1920x1080 frame (20 dispatches, all records recognised), runs it on the GPU and
reads the output back: finite, and the gradient survives (RX 9070, ~11 ms). New ignored test
fspx_containers_translate_and_compile (XCL_SAMPLE_FSPX). Based on PR #33's research, rebuilt
on current main (the FSPX path carries the real thread geometry; #33 guessed it).
2026-11-23 14:56:58 +01:00
ivall 58309b9c27 XDefiant's UI text back: v_interp of int / uint PS inputs converted again (#107 regression)
Bisected on XDefiant (warm DXIL cache): 668f550 draws the title screen's text, c813f08 (#107
alone) does not. #107 made v_interp_mov_f32 / v_interp_p2_f32 of an int / uint input a bit copy
(what the ISA does). XDefiant's UI pixel shader reads its RenderType (an int input) that way and
compares it with 1 / 2: with the bits the text takes those branches (image_sample_d of the
font / four image_sample_lz taps at offsets from ds_swizzle derivatives) and draws nothing; with
the converted value it takes the default branch and draws the text (red – whether that is the
console's colour is not known). Those branches are the open bug; tried and not it: a
helper-lane-aware ballot in pixel shaders, not zeroing ds_swizzle sources. #107's test checks the
conversion now. The survey takes XCL_DXC_ARGS (comparing DXC optimisation levels).

HANDOFF: the regression, the RenderType finding, DXC compile-time measurements; the cold-cache
note corrected (the text missing for good was this regression).
2026-11-23 13:33:43 +01:00
ivall f90e644ad4 README: a Controls section (gamepad recommended, keyboard and mouse as a gamepad), "What is missing" removed; HANDOFF: PRs #107-#109 2026-11-23 12:32:36 +01:00
ivall 668f550f33 HANDOFF: PRs #95-#102 2026-11-23 12:25:22 +01:00
ivall c85cd6fcfa HANDOFF: XDefiant's cold-cache UI checked – not a bug, the text's pipelines compile in a later burst 2026-11-23 12:14:25 +01:00
ivall 60599a948f HANDOFF: #92-#94, XDefiant in the split wave64 form on AMD 2026-11-23 12:02:51 +01:00
ivall f5999e4304 Merge pull request #94 from hexgeon1/wave64-local-masks 2026-11-23 11:57:05 +01:00
hexgeon1 b4019c41fd Split wave64: masks read only lane by lane stay in their half
In the split wave64 form (#67) every mask write exchanges the two wave32
halves' ballots. A mask whose readers take only the reading lane's own bit
(v_cndmask_b32's selector, the carry-in of v_add_co_ci / v_sub(rev)_co_ci)
needs no exchange: xcl_x_ballot_local gives the half's own word.

x64_masks.rs finds them with a backward liveness pass over the SGPRs. A
register is whole-live when some path may read its whole value before it is
written again. The rules follow the emitter, not only the operand tables:
s_cmov*, s_addk, s_mulk, s_bitset*, s_movreld and SDWA compares into their
SDST are not overwrites; s_movrels reads every register from its base; SDWA
scalar sources and SMEM register offsets are reads; EXEC, indirect jumps, the
kernel runner's end and loop exits through LOOP_GUARD count as whole reads
(loop ranges from the translator's loop_ranges, now shared). Masks into NULL
or constant false are never exchanged. Geometry mode keeps its exchanges.
XCL_X64_ALL_MASKS=1 exchanges every mask, for comparison.

bench_split_wave64 now counts each iteration's exchanges and times GPU work
only (runner::dispatch_timed: timestamps, median of 9; before, the wall time
of a whole dispatch with pipeline creation and copies). RTX 3090, all masks
(3 runs) vs default (5 runs), split / wave32:
- mask only: 1.64-1.68x -> 1.04-1.11x (one console wave per group),
  3.90-4.14x -> 1.07-1.16x (four, counter-paired)
- with a v_readfirstlane: 1.99-2.02x -> 1.74-1.81x, 6.45-6.64x -> 4.09-4.34x
The benchmark's mask is exactly the kind the pass keeps local: it shows the
exchange gone, not how much real shaders gain.

Tests: 16 for the analysis, gpu_split_wave64_lane_local_masks,
gpu_split_wave64_masks_read_whole_after_partial_writes (one kernel per rule;
the halves' SGPRs differ without it) and
gpu_split_wave64_local_and_exchanged_masks_in_diverging_waves (counter-paired,
waves on different paths). Workspace, release, RTX 3090: 459 passed, 0 failed;
XCL_WAVE64_SPIN=1: 224 passed. Not checked: real compute shaders (Minecraft's
273 wave64 programs as compute have 38 mask writes, all local), AMD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:51:12 +02:00
ivall ecbad66275 HANDOFF: PRs #87-#91, issue #73 2026-11-23 11:47:43 +01:00
ivall 1f82be3b76 HANDOFF: PRs #80-#82, #85, #86
The previous commit (9284dcd, titled like this one by mistake) is the follow-up to #86:
placed textures that get memory of their own retry with COMMON when the PC refuses the
title's state, as the past-the-end fallback does, instead of falling back to the overlapping
placement.
2026-11-23 11:36:22 +01:00
ivall d70f8e92e2 HANDOFF: PRs #74-#79 2026-11-23 11:29:11 +01:00
ivall 71c4b9bafc HANDOFF: PRs #61-#66 and #72 2026-11-23 11:20:35 +01:00
ivall b4edefb42e HANDOFF: #46 merged, #43 held (MSAA against the console's XG), XG versions in the samples 2026-11-23 11:13:47 +01:00
ivall 55df81be1d HANDOFF: PRs #84, #68, #67, #69 and the 2-D group lane layout found on AMD 2026-11-23 10:59:23 +01:00
ivall 9f353e7dbf Merge pull request #67 from Foniass/wave64-on-wave32 2026-11-23 10:47:28 +01:00
ivall 848e740ab5 HANDOFF: PRs #53-#60 and what was measured on Windows 2026-11-23 10:43:14 +01:00
Foniass 21bbb85ce5 README / HANDOFF: wave64 programs on 32-lane GPUs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:26:27 +01:00
ivall 521ec08e5d Shader compilation shown for every DXC compile; with little commit left, compiles go one at a time
The XCL window's title counted only pipelines queued for the background.
XDefiant builds part of its pipelines in its own calls (no stand-in for
them), so its cold-cache start showed nothing. The title now counts DXC
compiles of programs the disk cache does not have, wherever they come
from: "compiling shaders: N running, M done[, Q pipelines queued]",
kept 2 s after the last one.

dxc::wait_for_memory held every compile up to a minute while less than
6 GB of commit was left. With XDefiant's own ~10 GB committed only ~4 GB
were, so its last ~160 shaders came a few a minute and the start looked
hung at ~1600. With less than 6 GB left a compile now goes alone (one at
a time) instead. XDefiant from an empty cache: ~1750 shaders in ~2 min
15 s.
2026-11-22 23:13:28 +01:00
ivall 4de9016b56 Committed console resources XCL does not place get the PC's description
A committed console resource that is not placed in unified memory went
to the PC with the console's desc, only its layout field fixed. The
console's flag bits and alignment made the PC refuse it. With the 512 MB
coherent window (and the room committed textures leave free) Fortnite's
menu reached that path for its 3264x1836 scene targets: E_INVALIDARG,
and the game crashed reading the missing resource. The fallback now uses
device_x::pc_resource_desc, like placed console resources.
2026-11-22 21:44:55 +01:00
ivall bb9f0b5f82 Committed console textures leave the coherent window room; memory and fps diagnostics
The runtime layout's coherent window is 512 MB. Unicorn Overlord makes
2.2 GB of committed console textures and had it full in its first
second, so a later readback heap or XCL block could not get memory.
Committed textures now take it only while 128 MB stay free; beyond that
they are plain PC textures, as most of Unicorn's already were (the
picture is unchanged, the window stops at 384 MB). Putting them in the
sparse windows instead made XDefiant render black – not understood yet,
noted in HANDOFF.

XCL_TRACE_MEM also logs each coherent-window allocation of 1 MB or more
and each failed one, with the XCL code that asked (Uma::alloc is
track_caller) – that is how the textures were found. The log has the
frame rate every 300 PresentX frames, to compare runs.
2026-11-22 21:18:24 +01:00
ivall acbbc55974 Sparse VRAM: keep window 0's descriptor range out of the title's memory
Window 0 kept its top 512 MB for 32-bit descriptor heaps only against
XCL's own allocations. XDefiant reserves 8 GiB + 4 MiB first thing, more
than windows 1..2 hold; the reservation fell back to the start of window
0 and took all of it, no console descriptor heap could be made ("no room
in UMA") and every frame was black.

The descriptor range is now the 512 MB after window 0's first 64 KiB
(which stay unused: a console address of 0 reads as null). Reservations
and graphics allocations never take it, and the title still gets one
contiguous 11.5 GiB range. Tested with Minecraft, Unicorn Overlord,
Fortnite and XDefiant.
2026-11-22 20:59:37 +01:00
ivall 126268c772 Unicorn Overlord is playable: the newer console runtime's queue and list 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.
2026-11-22 20:00:05 +01:00
ivall bb58372126 Minecraft is playable: Ore UI gamepad, no draw skipped, keyboard and mouse as a gamepad
Ore UI ignored the gamepad. Minecraft marks a controller as connected only
from XUserRegisterForDeviceAssociationChanged; a GameInput device arrival
just attaches it to the user's player. Ore UI's GameControllerInputHandler
drops events from a controller it never saw connect. XCL now calls that
callback (the gamepad goes from no user to the local user) once the user
reaches the title. It runs on the title's task queue, through the PC XAsync
object when that one owns the queues.

The world flickered. bind_abi put each draw's io, argument table and res
in three Uma::alloc_in blocks, and every block is a whole 64 KiB grain.
Thousands of draws a frame filled the 2 GB of unified memory in seconds,
after which most draws were skipped. Per-draw data now comes from
uma::Arena: 256 KiB blocks cut into 256-byte pieces, freed with the
command allocator as before. A test run had 16.7 M draws and 0 skipped.

Keyboard and mouse now play as the gamepad while the XCL window has the
focus (hle::kbm; keyboard_mouse and mouse_sensitivity in xcl.toml):
- WASD is the left stick.
- The mouse is the right stick, by speed. It is read with Raw Input and
  the cursor is held in the window; Alt+Tab frees it.
- Mouse buttons are the triggers and the wheel is the bumpers.
- Shift and Ctrl are the stick clicks; E and Q are Y and X.

Diagnostic: XCL_PROBE=rva,... puts hardware breakpoints on the title's
code and logs each call that has new arguments. The game is not changed.

README: Minecraft is fully playable; the Fortnite and XDefiant entries now
say they work fully, as far as each game allows offline.
2026-11-22 18:30:41 +01:00
ivall 550d979b01 Minecraft's create-world screen: helper lanes of other quads, unread VS inputs, PLS drive
The Ore UI create-world screen had white dashed bands along the diagonal and the
edges of its image and text quads. Renoir's pixel shader reads its draw type with
v_readfirstlane after s_wqm. The first lane of EXEC is often a helper lane on a
primitive's edge, and before SM 6.7 a wave read of another quad's helper lane is
undefined (0 in practice), so the wave's other quads drew the solid type-0 quad.
rla now takes such a lane's value with a quad read inside its own quad, then a
wave read from a live lane of that quad. This applies to every pixel shader.

Also, all general:
- An ISG1 input the vertex shader never reads gets no fetch-shader VGPRs
  (fetched_registers). Counting one put every vertex of the UI draws on one
  point, so the create-world screen drew nothing.
- A placed texture that is larger on the PC than its console (XG) size gets
  memory of its own instead of failing; Minecraft ended with 0xC0000409.
- Persistent local storage is a drive root (S:\, a default mount onto
  {data}\pls), as on the console, and GetDiskFreeSpace(Ex)A/W answer for
  console paths. Minecraft no longer reports very little free space.
- The previous run's xcl.log and report.json are kept as *.prev.*.

Diagnostics (env vars): XCL_TRACE_SHADERS / XCL_TRACE_MANY (draws of chosen
shaders with root arguments and their vertices at the present), XCL_FRAME_DUMP_FULL,
XCL_DEBUG_PS_SUB / PS_EXPR / MAGENTA / LOD0, XCL_DEBUG_NO_STENCIL / NO_CULL, and
XCL_PRESS_AT for scripted controller presses.

README: Discord link and a table of the games that run.
2026-11-22 17:37:54 +01:00
ivall e80ce8d9f9 Whole shader pack: effect-qualified records, far jumps, every program translates
pack::scan rejected record names with a `:` (`alphaResolve:CS_…_Wrapped`), so 2 634 of
the 26 503 records of the retail shader pack were missing (55 more were found only under a
truncated alias name). Names may now be qualified; issues #34 and #36.

The new compute shaders exposed three translator gaps, all general:
- ds_swizzle_b32 told its modes apart wrongly: the bit mode with xor >= 16 (0x401F swaps
  the 16-lane halves) was rejected as FFT/rotate, while real FFT/rotate offsets were taken
  for quad permute. Now as the ISA defines all four modes.
- The compiler's far jump (s_getpc_b64, add of a constant, s_setpc_b64) beyond the
  s_branch range is resolved to a direct branch (rdna2::resolve_far_jumps).
- term() and the block emission scanned all instructions per block; a 76 699-instruction
  program with 15 995 blocks did not finish translating. Binary search: 4.7 s.

Survey of the whole pack: 26 698 / 26 698 FSSM variants in full, 0 errors (90 s, debug).
2026-11-22 16:44:53 +01:00
ivall 1903ff6876 No Xbox Live tokens by default: titles take their offline paths
XUserGetTokenAndSignature(Utf16)Async now fails with 0x80072EFD, as it
does on a console that cannot reach Xbox Live. Set xbox_live_tokens = true
in xcl.toml to get XCL's local placeholder token back, which only a backend
of your own accepts.

Before this, Minecraft sent the placeholder to PlayFab, was refused, and
showed its "Microsoft account - connecting" dialog forever. It now shows its
offline message once (code "jasnoglaz") and stays in the menu. Fortnite
(RTA) and XDefiant (people hub, presence) behave as before.

Token requests are logged. Unit tests cover the offline default, and the
test title now expects no token.
2026-11-22 14:54:23 +01:00
ivall 9e759de1f2 Minecraft reaches its main menu: title window as the console screen, heap buffers in unified memory
- The title's top-level window is the console's screen: frameless, 1920x1080,
  client area = window (WM_NCCALCSIZE), cloaked. A PC overlapped window gave
  a 1904x1041 client area. Minecraft sized its back buffer from it, the
  1920x1080 resolve overran it and the device was removed.
- ResourceBarrier drops VERTEX_AND_CONSTANT_BUFFER / INDEX_BUFFER for
  non-buffers. The console takes them for textures; the PC list failed to
  close.
- FreeLibraryWhenCallbackReturns is a no-op for XCL-mapped modules.
  msvcp140's thread-pool callbacks raised 0xC000070E, then a fail-fast.
- A GPU address the title gives is translated only when it is the title's
  memory (Uma::is_title_address). A PC resource's address can fall in a
  window's range by number.
- Buffers placed in the title's heaps live in unified memory. A heap gets a
  block when its first buffer is placed. Console code reads root CBVs and V#s
  from unified memory, and Minecraft's constants read as zero.
- Diagnostics: PSO states, resolves, depth clears, vertex-buffer bindings
  and the per-draw fixed-function state under XCL_TRACE_FRAME;
  XCL_TRACE_UI_ANY; graphics reservations under XCL_TRACE_MEM.
2026-11-22 14:34:17 +01:00
ivall 8eb3cf429b Fortnite UI and title screen draw: PS attributes and VS params are registers
- exp param N (VS, MS) and v_interp attrN (PS) name a signature register, not an
  element; the console's compiler numbers only the registers its code reads. The
  mapping now comes from the FSSM's own tables (ps_input_table, vs_output_table),
  checked on every cached shader of three titles. Fortnite's Slate PS sampled at
  ORIGINAL_POSITION instead of TEXCOORD1 (UI text and images drew nothing);
  XDefiant's packed UI registers read ClipPosition as UV.
- SPI_PS_INPUT_ENA and the tables sit 8 bytes earlier in FSSM sub-version 5
  (Fortnite's GDK) than in 6.
- sparse: VirtualFree tells sparse before it decommits, and pages decommitted
  inside a mapped tile are holes (not read, video memory zeroed) - the submit
  thread's copy of CPU writes faulted on them (exit 3).
- Title textures a GPU copy wrote are not uploaded again from the stale CPU view;
  empty sampler slots hold the console's zero S#.
- Diagnostics: process end logged with its stack (thread dump on a non-zero
  status); XCL_TRACE_FRAME logs draw kinds with shader hashes, GPU read-backs of
  sampled title textures and copies into title textures.
2026-11-22 13:48:59 +01:00
ivall 3a8bc96a18 Fortnite reaches its splash screen: TLS slot 0, deferred texture uploads, console heaps and resources, merged ES+GS
- Run from <Game>/Binaries/XSX: the package root is the folder above whose
  MicrosoftGame.config names the exe.
- XMemGetWorkingSetStatistics writes only the limit and the use (the structure
  differs between GDK versions; zeroing 0x78 bytes broke EOSSDK's stack cookie).
- The title's executable takes TLS slot 0, as a process's executable has it
  (code built with /GA reads it without _tls_index); xcl.exe's TLS moves.
- Command queue #23 SignalX.
- Title textures: the first upload waits for the title's next submit and all
  uploads go in batches (one list, one wait); XCL's own submits do not refresh;
  close write-watch ranges are scanned as one. The render thread no longer stalls
  in CreatePlacedResourceX (UE's garbage collector ended the game after 10 s).
- CreateHeap and CreatePlacedResource (#29) with console flags / layouts retried
  the PC's way.
- Merged ES+GS of older kits: an ES program ends with s_setpc_b64 into the GS.
- end_title suspends the title's threads before releasing its fences (a running
  title reset command allocators the GPU still ran: device hang at the end).
- Diagnostics: stack-cookie failures reported with the function, the CRT's
  invalid-parameter handler, first-chance C++ exceptions of title code,
  THREADNAME_INFO, XCL_THREAD_DUMP_AT (unwound stacks), XCL_ACTIVITY.
- HANDOFF: Fortnite's state (splash screen; the login is an Xbox Live sign-in).
2026-11-22 12:24:17 +01:00
ivall 507c44158a XDefiant title screen: shared descriptor heap, quad lane reads, audio processor, GameInput
- Console view descriptors are values: titles create them in a CPU-only heap and
  copy them into the shader-visible one as memory (the header's inline
  CopyDescriptorsSimple). T# word 0 was an index into each heap's own PC heap, so
  every copied T# named an empty descriptor (all frames black). All console view
  heaps now share one shader-visible PC heap (T# word 0 indexes it, lists bind
  it, the title's own heap is a CPU-only mirror).
- Write-watch scans cover only what the GPU sees (textures kept in step, sparse
  tiles with video memory) instead of 16+ GiB per submit: ~2 -> ~40 fps.
- Pixel shaders read lanes of their own quad with QuadReadLaneAt (helper lanes
  included): derivatives taken across a quad were wrong along triangle edges
  (seams on large quads); test with the console compiler.
- acphal / xapu: APU memory, the processor's channel (commands acknowledged,
  audio frames ticking), SHAPE context arrays, the decoder answering with
  silence - the title's audio setup no longer aborts (still silent: SHAPE is
  not run).
- GameInput: the GDK v0 interfaces with one gamepad (XInput controller,
  keyboard), ordinal #1; XCL_PRESS_A_AT for tests. The title screen takes A.
- Diagnostics under XCL_TRACE_FRAME (heap census, descriptor copies, full-screen
  dispatch arguments), sparse upload timing; HANDOFF updated.
2026-11-22 11:03:46 +01:00
ivall 660f6dc2f0 XDefiant: title memory on the GPU (sparse windows), graphics root arguments, vertex buffers
- Sparse windows: the title's own 64 KiB-page reservations get addresses in
  UMA windows 1-3; on the GPU each is a 4 GiB reserved buffer whose tiles map
  onto video memory as pages are committed. CPU writes go to the tiles before
  each submit, only the 64-byte chunks that changed (GPU-written data on the
  same page is kept). Placed buffers there get reserved resources over the
  same tiles.
- Graphics root arguments of console code passed the console way on draws
  (user SGPRs from s8, measured with the console compiler; end-to-end test).
- Console #48 IASetVertexBuffers translates the title's addresses (the
  untranslated ones caused NaN render targets and GPU hangs); #83
  CopyTextureRegionX; #59 ExecuteIndirect on XCL's ABI; console-only
  GraphicsCommandList5/6 IIDs answered by the list object; Map of resources
  at title addresses; aliasing barriers; window functions made Unicode.
- Safety: XCL_RUN_SECONDS ends the title itself (fences released, queues
  drained) instead of an outside kill that left the process stuck in the
  driver; translated loops capped at 65 536 iterations; at most 6 shader
  compiles at once, waiting while commit is low; the title is stopped when
  the device is removed.
- Diagnostics: XCL_TRACE_FRAME, XCL_FRAME_DUMP raw histograms and render
  target dumps, XCL_TRACE_ADDRESSES, XCL_DRED, XCL_TRACE_MEM.

XDefiant now runs 90 s without a GPU hang; its frames are still black.
2026-11-22 01:01:09 +01:00
ivall f6ad90c16e Aliased GPU-owned textures in title memory (video-memory arenas)
The title places render targets, depth buffers and UAV textures at addresses
that already hold a resource and expects them to share the memory (16 such
placements in XDefiant's first seconds, also of other formats). These now go
to default heaps standing for ranges of title addresses, at their address's
offset, so resources at one address alias as on the console. Placements at
an occupied address are logged.
2026-11-21 23:44:19 +01:00
ivall 58c1f42b08 Probe: D3D12 heaps over title address space (sections in placeholders)
GPU copies only: heaps over SEC_COMMIT file mappings work, SEC_RESERVE ones
are refused even fully committed; SEC_COMMIT sections mapped into a
placeholder reservation at chosen addresses open as independent heaps,
coherent with the CPU. The base for a GPU page table over title memory
(plan in HANDOFF).
2026-11-21 23:37:24 +01:00
ivall 97e103d02a Graphics root arguments of console code; title-memory resources; diagnostics
- bind: graphics root signature and arguments are kept and passed the
  console way on DrawInstanced / DrawIndexedInstanced with a translated
  pipeline: user SGPRs from s8 (24), the rest in the table at s[0:1] -
  measured with the console's compiler (tests/console_shaders.rs).
- Map of a resource in unified memory returns its console address; buffers
  at addresses that are not 64 KiB-aligned are placed from below and copies
  add the difference; graphics reservations come from unified memory.
- XCL_FRAME_DUMP (presented frames as BMP), XCL_TRACE_MEM (allocations
  outside unified memory), draw / dispatch counters in the log.

XDefiant's main pool is one 8 GB reservation it places resources in - larger
than XCL's unified memory; noted in HANDOFF.
2026-11-21 23:33:33 +01:00
ivall f12d724dd9 Console command lists of the title's own code; compute root arguments; safety nets
- title_list: console code gets command list objects of the console's shape
  whose record buffer never has room, so the SDK's inline writers call the
  list methods instead; each runs on the adopted PC list behind it.
- bind: compute root signature and arguments of console code are packed by
  the root signature's layout and passed the console way (user SGPRs, table)
  on each Dispatch with a translated pipeline.
- ResourceBarrier: aliasing barriers cover any resources (the PC allows them
  only between placed / reserved ones; the list failed to Close).
- Safety: translated shader loops have a per-lane iteration budget; the
  title is stopped when the D3D12 device is removed.

XDefiant now runs: 957 presents in a minute, 3 443 pipelines from 966
translated console shaders, no crash.
2026-11-21 23:15:39 +01:00
ivall e555b87c07 XDefiant: the first stops on the way in; more console shader kernels
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).
2026-11-21 22:49:58 +01:00
ivall 18cb400400 XG metadata planes; the console shader compiler as a recompiler test generator
XG: render targets get a CMASK plane, depth buffers HTILE + depth + stencil,
depth-stencil formats two planes, as the console library lays them out
(checked on 1 872 render target / depth descs).

tests/console_shaders.rs (XCL_SAMPLE_DXC = the console's dxcompiler_xs.dll):
HLSL kernels compiled by the console compiler, run through XCL's translation
on the PC GPU next to the PC compile of the same source - the same memory.
It found two bugs, fixed:
- root arguments: the console passes them in user SGPRs s4..s15 while they
  fit, only the rest in the table at s[0:1] (console list dispatches);
- the high 32x32 multiply as a 64-bit product made DXC emit
  umul.with.overflow (invalid DXIL); now from 16-bit parts.
2026-11-21 22:20:01 +01:00