54 Commits

Author SHA1 Message Date
255b6752ce Merge pull request #1056 from robot00f/docs/d3d12-other-pages-consistency
docs: align the other pages with the measured CreateDevice block size and slot 62/76 (D3D12-OTHER-PAGES-CONSISTENCY)
2026-11-29 22:12:30 +01:00
ca89cb0189 Merge pull request #1045 from robot00f/docs/agent2
docs(d3d12_command_objects): 0x48/0x50 are heap handle getters on heap objects (D3D12-HEAP-HANDLE-SLOTS)
2026-11-29 15:41:39 +01:00
01c555a3c1 Merge pull request #687 from kotekompotek/work/d3d12-xs-list-slot80-dispatch
d3d12_xs: map console list slot 80 DispatchX to PC Dispatch slot 14
2026-11-29 09:10:46 +01:00
00131bb85e main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia
After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:

- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
  fixtures are left out.

What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.

Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:58:38 -05:00
b87abdef57 Merge mandy's main into port/d3d12-nvidia
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.

Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.

Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:50:37 -05:00
79d905c4ce runtime: console D3D12 slot tables from VIctory, with the Device11 switch
The device, queue, list and fence proxies now take each slot's meaning
from data, runtime/shims/d3d12_xs_slots.h, built from victory-gpu
(device.rs:402-458, queue.rs:957-1001, list.rs:2055-2173,
fence.rs:141-154) and Leonida's own measurements, each entry citing its
source; static_asserts refuse two entries for one slot. VIctory's switch
(device.rs:149-168) picks the layout: a device created as ID3D12Device11,
as the title's is, gets the console layouts; any other keeps the PC order
that Leonida's PC-interface tests (device_proxy_test, queue_proxy_test,
tiny_frame) drive. This replaces the guessed +4 list rule and the
PC-order queue and fence proxies for the title.

Console layout:
- Queue: Signal 16, Wait 17, GetTimestampFrequency 18 -> PC 14/15/16;
  GetDesc 28 -> PC 18; ExecuteCommandLists 10 and ExecuteX 35 -> PC 10
  (list proxies unwrapped); Signal2X 34 -> PC 14; PresentX 32 -> the
  device's present handler (set_present_handler), else S_OK, as VIctory
  answers; markers 11-13 ignored; 23/24 (SuspendX/ResumeX) and 31
  (CopyPageMappingsBatchX) refused as open; every other slot refused.
- Fence slot 12: the address of a 64-bit word kept at the real fence's
  completed value. CPU Signal and GetCompletedValue update it at once; a
  console queue Signal registers SetEventOnCompletion on one process-wide
  event whose thread-pool wait re-reads the listed fences.
- Device: 25/26/108 take the return buffer first (V resource.rs:802-811,
  840-849, 2583-2593; Leonida retail_boot_chain 3.1; the title faults at
  26 without it), either order accepted; 48 takes the console queue
  description {type, flags, engine/pipe, queue} (queue.rs:464-495); 69 is
  ignored; 74/75 keep page pools; 127 -> PC CreateCommittedResource3 with
  a PC description and ALLOW_DISPLAY cleared (CreateCommittedResource in
  COMMON before Device10); 57 is refused with its output nulled; 12 makes
  console list proxies; every allocator is wrapped and its slot 9 is
  accepted; a slot from 44 on that no source names is refused instead of
  reaching the PC method at that number.
- List: queries 28-30 -> PC 52-54, the +4 block 32-55, 61 ExecuteIndirect,
  80 DispatchX -> Dispatch, 85/86 -> CopyTextureRegion/CopyResource,
  129 -> DispatchMesh, 139 ResetX -> Reset, 146 -> Barrier; 51 and 70
  (float arguments) through thunks with the real prototype; the 59 marker
  and VIctory's hints and syncs ignored; the console List5/List6 ids
  answered (the list is made as ID3D12GraphicsCommandList).
Both layouts: device 78-81 are VIctory's frame clock (frame.rs), not the
HLE stand-in that returned at once.

Where the sources disagree (evidence from the title wins):
- List: the +4 rule sent 56-58 to the PC queries, 60 to EndEvent and 31
  to ExecuteBundle. VIctory has the queries at 28-30 and names none of
  27, 31, 56-58, 60, which are now refused. Leonida's 59 marker (FSR DLL)
  fits VIctory's newer layout, where ExecuteIndirect moved to 61.
- Device 48: retail_boot_chain 3.2 read a PC description and had to
  clamp Flags; VIctory's layout explains it (the pipe lands there).
- Device 75: PC CreateCommandQueue1 in Leonida, UnregisterPagePool in
  VIctory: VIctory's in the console layout.
- Device 45/46/50: PC Device1/3 methods in Leonida; console methods
  nobody names per VIctory's counts: refused in the console layout.
- Device 67: VIctory leaves it unimplemented with the same (desc, iid,
  out) shape; Leonida's DeserializeComputePipelineStateX (FSR DLL) stays.
- Queue GetDesc: VIctory takes `this` first (queue.rs:950), the device's
  struct returns take the buffer first; the queue accepts both.
- Frame clock: the stand-in made a token on every poll and refused a null
  token; VIctory's (S_FALSE time-outs, a token only with flag 2) paces
  the title.

Open: list 62, 71-74, 100 and 148 still return 0 (no Vulkan-layer path
for title addresses); queue 23/24/31 and device 61/70/71/86 refused;
XboxPresentation is not attached (gta6rt has no window, and its
FramePacer issues its own tokens and models only the origin event); a
title write to the fence word does not move the fence. Not run on the
title: it stops earlier, while DirectStorage is being ported.

Tested (MSVC 19.44, RelWithDebInfo, no Vulkan headers): xs_proxy_mock_test
checks every console queue (128) and list (160) slot against the tables
and through the proxies, the struct returns in both orders, 48, 69,
74/75, 127, 57, the refused device slots, the fence word with deferred
signals, PresentX and the frame clock (40 runs, no failure);
device_proxy_test runs the console layout on WARP. ctest: 116 of 117 pass
without loader; root_sig fails on the base commit too, and loader (no
D3D12 code) times out here. The Vulkan-only tests were not built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:39:29 -05:00
42b6b66ab2 docs: align the other pages with the measured CreateDevice block size and slot 62/76 (D3D12-OTHER-PAGES-CONSISTENCY) 2026-11-25 19:11:02 -03:00
6ea4ac39f5 docs: record the retail IID inventory the iid scan answers (D3D12-IID-INVENTORY-RETAIL) 2026-11-25 16:03:44 -03:00
f005d7ab22 Adapt #622 to #1723: the slot 71-74 rows say who writes and who waits
#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the
only writer of 71 and 72. Under #1723 the list values record all four
for the lists they track (waits included), and LEONIDA_GPU_LABELS=1
writes 71/72 only for the others. The command-object table, the value
write paragraph, §5.5 of the console ABI notes and the README row now
say so, and name the arena and xmem fallbacks (src/value_write_sink.h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:20 -05:00
0fcca5ef26 d3d12_xs: map console list slot 80 DispatchX to PC Dispatch slot 14 2026-11-25 12:44:12 +05:00
9b74691f74 docs: the console's value-write slots 71 to 74
The four rows of the measured console list slots, with the slot numbers the retail title's trace gives and the attribution of the call shapes and the write model.
2026-11-25 13:17:09 +08:00
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
6994562bda docs(d3d12_command_objects): 0x48/0x50 are heap handle getters on heap objects 2026-11-24 14:12:24 -03:00
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
89268c6c1c Merge pull request #4299 from abilliontokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:13:17 -05:00
2e3fd36d79 Merge pull request #3951 from Jan Trencansky
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 23:09:52 -05:00
a6f9bc4b24 slot 67: the description pinned from the DLL's code, a test built the DLL's way, every failed call logged
A tester on #3951 saw a slot-67 lookup miss with the real FidelityFX DLL where the base build had none, and read it as
the proxy taking one program's kind 6 with another program's kind 0.

Pinned from the DLL's code and run on all 29 payloads: its FSPX reader (0x1a20) and the same loop inline for a
container store kinds 0, 1, 6 and 7 in four pairs from one payload, and the pipeline function copies them to +0x08,
+0x18, +0x28 (the kind-6 copy, with kind 6's own size at +0x30) and +0x38 of the description. That is the layout the
proxy reads, and code and state of one call always come from the same program. A harness that maps the DLL without
running it, calls its reader on each payload and builds the description that way resolves every translated program
to its own entry through slot 67 on the Vulkan device (26 of 29 on main aa2988cc; the other 3 are refused), on
llvmpipe, the integrated GPU and the RX 7900 XTX.

So the proxy does not mix programs. What fits the report: with slot 11 answered, the DLL goes on to its next pipeline,
which that translation (20 of 29) does not have; only the first call of a slot is announced, so the miss read as the
first call's.

- d3d12_xs_device.cpp: every failed slot-67 call is logged with its number and the four sizes.
- d3d12_fspx_compute_test: dll_slot67 builds the description from a container's own directory the way the DLL does
  (reader pair order, pointers into the payload, kind 6 copied into a 256-rounded buffer padded with 0xcc); each
  program resolves to its own translation with its own state. A proxy that read kind 0 from +0x18 or kind 6 with
  the rounded size fails the test.
- docs/fspx.md, d3d12_command_objects.md, d3d12_vulkan.md: how the layout was pinned, and what happens when a later
  program is not translated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:54:26 -05:00
cf5c0f7fbf docs+tools: no shipped module passes an unknown GUID at a call site (D3D-441)
The call-site scan tools/d3d12_guid_sites.py enumerates every 16-byte constant
a module's code can name (RIP-relative lea targets, absolute data pointers,
adjacent movabs immediates, import-slot loads) and classifies it against the
SDK's IID set. Over the 16 modules of the 1.0.2.1 package only the ten known
IIDs of the two D3D12 clients appear; no unknown GUID exists at any call site,
no module imports IID data, and no code-referenced static queue description
carries a list type outside the PC enum. The compute/copy console list IIDs
and the DMA type's numeric value therefore have no static source in the
package (consistent with #3520's export-table negative) and stay reachable
only through the running title.
2026-11-22 16:35:11 -08:00
cf2a45fc38 docs: README/d3d12_command_objects reflect the landed console-ABI work
The Xbox D3D12 row listed buffer views, root signatures, pipelines,
draws, placed resources, 1D textures and a swapchain as missing — all
implemented — and predates the console list proxy, the PresentX wiring
and the upload arena. The slot-148 note now describes the arena and VA
translation that replaced the "must" wording.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 17:06:08 -07:00
34c130c36c docs: slot 67 passes the dispatch state on; what pipeline slot 11 does with 0, measured (RT-99)
- d3d12_command_objects.md section 3.5a: slot 67 now passes all four pairs; for slot 11, what the DLL does on failure
  and with 0 (measured in its code), the object's shape, why no program needs a scratch size (measured over the 29),
  what is implemented and what stays open.
- fspx.md: the slot-67 payload and its checks, and slot 11.
- d3d12_vulkan.md and runtime/README.md: the new parts of d3d12_fspx_compute_test; the DLL's own dispatch was not run
  here (fsr_dispatch_test needs MSVC structured exception handling).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:26:34 -05:00
ba718cc685 Merge pull request #3218 from CLHelper
# Conflicts:
#	docs/design.md
2026-11-22 15:15:51 -05:00
88cdcb900b Merge pull request #3192 from mrp1no 2026-11-22 15:15:36 -05:00
c6fc317c25 Merge pull request #3052 from NiiRoZz 2026-11-22 15:14:22 -05:00
b488d32fef Merge pull request #3002 from AREA52 Agent 2026-11-22 15:13:57 -05:00
781b0763a0 docs: the allocator note says how the exports were read, and points to §3.5
From the review on #3192: the FSR DLLs' exports are named and the tool that
listed them (dumpbin /exports) is given, so the measurement can be repeated,
and what §3.5 already says is a pointer instead of a repeat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:05:23 +01:00
7cbb0d006f docs: the console allocator's slots past 8 can't be measured from the package
D3D-360. Read statically on a 1.0.2.1 package whose 16 images all match
game/xbox-1.0.2.1.json: none of them is d3d12_xs.dll, which owns the
allocator's vtable. None contains IID_ID3D12CommandAllocator, and no export
takes an allocator: the BVH builder's take a device or a command list, and the
two FidelityFX DLLs export the five ffx* entry points. No shipped module
creates, receives or calls an allocator, so only the game executable could
show a call past slot 8, and the proxy keeps logging and refusing those.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:39:14 +01:00
ca438076bc feat(tools): inline_scan finds inline command-list writes and whether each checks the cursor limit
The package's DLLs check before every inline write (BVH builder 196/196, FSR 9/9), so a layer that keeps
the cursor at the limit sees every command. Whether the game's executable does the same was open until it is
available; inline_scan answers it in one pass over a dumpbin listing. Baseline in d3d12_command_objects.md,
day-one step in design.md.
2026-11-22 19:37:55 +00:00
56839d2dd9 D3D-350: device slots 8, 9, 12 and 36 cannot be measured from the package
The package ships no D3D12 runtime (d3d12_xs.dll is part of the console OS),
and the device clients it does ship never create a queue, allocator, command
list or fence: neither XboxBvhBuilder.dll nor amd_fidelityfx_upscaler_xbox.dll
contains those IIDs or imports GUID data from d3d12_xs.dll, and none of their
indirect calls at 0x40/0x48/0x60/0x120 is made on the device. The callers are
in the game executable, so the slots stay Open.

tools/d3d12_iid_scan.py reports which ID3D12 IIDs (from the SDK's d3d12.h) an
image contains and what it imports from d3d12_xs.dll, warning on imports that
could be IID data. It prints names and counts only.

docs/d3d12_command_objects.md section 2.1 records the result with counts and
how each column was measured. tests/test_d3d12_iid_scan.py covers the tool on
a hand-written header and hand-built PE images (no game files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:13:37 +01:00
98de744499 d3d12_command_objects: document the geometry-descriptor validation and the batched-build slot map corrections (D3D-293)
Extends section 7 with the CPU-side geometry descriptor validation that gates
BuildRaytracingAccelerationStructureBatched2X before the first list-vtable call
(the step the D3D-293 dynamic logging proxy stopped at), integrates the static
iced-x86 cross-check results: undocumented slot 90 (+0x2d0) as the worker's first
list call, the +0xd0 barrier being bss-gated (never fired in the shipping DLL),
the +0x490 global UAV barrier group, and slot 148 (count * 40) upload allocation.

Fixes D3D-293.
2026-11-22 20:04:57 +01:00
fffde0c8a5 docs: drop the superseded inline-dispatch observation row
The later review pass added the 0x1d047 call with 0x8020 to the same 0x149ba row; keep that one and remove the older short copy.
2026-11-22 19:33:20 +01:00
5e27b4840f Merge pull request #1950 from CLHelper
# Conflicts:
#	docs/d3d12_command_objects.md
2026-11-22 11:40:54 -05:00
507ab37e19 docs: address review of the inline-dispatch notes
- move the new notes after the list-setup paragraph instead of splitting it
- list the fourth slot-80 fallback (0x1d047, W = 0x8020) in the section 3.3a row and the bullets
- write the header as table[root] + ((count - 1) << 16)
- say what is read from the code (the slot-80 fallback) and what stays inferred (slot 80's meaning)
2026-11-22 16:33:44 +00:00
66bfad8e1f Merge pull request #1950 from CLHelper 2026-11-22 10:39:41 -05:00
00a0f7f993 docs: how the console list's inline root-argument header word is built
The header word is the root parameter's entry at +0x344 + 4*root. For
several 32-bit constants the builder adds (count - 1) << 16 (0x120000 for
19, 0x70000 for 8, 0x30000 for 4); for one constant at a non-zero offset
it adds 4 * destOffset (0xc at 0x19fca, 0x14 at 0x1a346, matching their
slot-37 fallbacks (2, value, 3) and (2, value, 5)). Descriptor tables and
root CBV/SRV/UAV write the entry unchanged, then 4 bytes or the full
8-byte address. Every reader tests the entry against 0xC0000000 (98 sites
in the builder, 7 in the FSR DLL) and sets +0x140 only when both bits are
clear.
2026-11-22 15:39:25 +00:00
51345fc6b1 docs: the five-word inline dispatch and byte +0x143 of the console list
Section 3.5a names the four-word inline dispatch. The BVH builder also
writes a five-word form, 0x4003cc00, x, 1, 1, W, at 0x14972, 0x15215,
0x1536a and 0x1d002. It is the inline form of console slot 80: when the
buffer is full each site calls +0x280 with the same (x, 1, 1, W). W is
0x8020 at two sites and 0x20 at the other two.

Byte +0x143 is read at 31 sites in the builder and one in the FSR DLL
and written by neither; every store into +0x140..+0x143 is a byte store
to +0x140 or +0x141. A replacement list can leave it 0. The slot-80 row
of section 3.3a points at the packet and the 0x20 calls.
2026-11-22 15:11:45 +00:00
7015ba98f8 docs: the five-word inline dispatch and byte +0x143 of the console list
Section 3.5a names the four-word inline dispatch. The BVH builder also
writes a five-word form, 0x4003cc00, x, 1, 1, W, at 0x14972, 0x15215,
0x1536a and 0x1d002. It is the inline form of console slot 80: when the
buffer is full each site calls +0x280 with the same (x, 1, 1, W). W is
0x8020 at two sites and 0x20 at the other two.

Byte +0x143 is read at 31 sites in the builder and one in the FSR DLL
and written by neither; every store into +0x140..+0x143 is a byte store
to +0x140 or +0x141. A replacement list can leave it 0. The slot-80 row
of section 3.3a points at the packet and the 0x20 calls.
2026-11-22 15:11:45 +00:00
508e94d659 docs/d3d12_command_objects.md: the translator takes 17 of the 29 FSPX programs
The paragraph still said 13, from before the dot-product rule (#1754). docs/fspx.md, "Translation status", has 17
and lists what stops the other 12; the paragraph now points there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 10:06:06 -05:00
7886972a6b Merge upstream main
# Conflicts:
#	docs/d3d12_command_objects.md
2026-11-22 09:48:41 -05:00
088447e117 FSPX programs: translated by the shaders stage, found at run time by their kind-6 bytes (RT-99)
The FidelityFX DLL creates its compute pipelines from FSPX programs (docs/fspx.md): through slot 67 with the bare
kind-6 program, then through slot 62 with the DXBC container whose ACCC part holds the payload. Both ended in
E_INVALIDARG: the layer took only FSSM bytecode, the build never translated the DLL and the index had no key for it.

- make_game.py: the shaders stage unpacks the package's DLL with tools/fspx_unpack.py --disasm into
  <work>/shaders/fspx and translates it into <work>/shaders/spirv/fspx, with the same wave64 mode and fallback
  flags. The step is redone as a whole when the DLL, its tools, llvm-mc or the flags change (fspx_build.json,
  written last) and never makes the game's shaders run again.
- tools/shader_meta.py: an entry of a program without an FSSM blob gets fspx_code_sha256, the SHA-256 of
  fspx/<name>.code.
- runtime/src/shader_library.h: the library also loads <dir>/fspx/index.json and finds entries by
  fspx_code_sha256. compute_program() takes an FSSM program as before, the kind-6 bytes of an ACCC container or of a
  bare FSPX payload, and a bare kind-6 program recognized by its prologue; the directory is parsed with the DLL
  reader's rules and bounds-checked, so a malformed one is refused.
- create_compute: looks the program up by the key of its kind and uses those bytes as the code base.
- Tests: shader_library_test (parsing, malformed directories, lookup, the fspx folder), d3d12_fspx_compute_test
  (PSOs from both forms, a dispatch each, refused inputs) and tests/test_fspx_shaders_stage.py.
- Docs: the lookup in docs/fspx.md; slots 62 and 67 in d3d12_command_objects.md and d3d12_vulkan.md. The size the
  slot-67 description carries at +0x30 is kind 6's own size, read from the DLL's code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:22:54 -05:00
f61946cfe1 Merge pull request #1795 from AimLogin 2026-11-22 09:15:24 -05:00
2123a02506 Runtime: Xbox-ABI proxy for the command allocator (device slot 9)
Device slot 9 (CreateCommandAllocator) now returns an allocator proxy,
the fourth command object after the queue and fence (BUILD-231) and the
list (D3D-136): the public chain (9 slots, Reset at 8) is forwarded, a
slot past it up to the end of a 64-slot table is logged and refused with
E_NOTIMPL, and a read past the table faults in its own guard region. The
console allocator's extra methods are not measured and not guessed.

A list takes the title's allocator in CreateCommandList and Reset, so a
proxy is only safe where the list side resolves it. Slot 9 therefore
wraps an allocator only when it answers kLeonidaCommandAllocatorTag (the
Vulkan layer's CommandAllocator, whose from() resolves the proxy for both
calls); a PC runtime allocator is handed out unchanged, logged once,
until a command-list proxy unwraps it at Reset. Allocator proxies are
unwrapped in the residency calls like heap, queue and fence proxies.
Device slot 12 is not touched.

Tests: allocator_proxy_test (WARP, a hardware adapter, the Vulkan device:
forwarding, refused tail, guard region, identity, D3D12's allocator rules,
a list created and Reset on the proxy with GPU copies through the queue
and fence proxies read back), mock cases for allocators with and without
the tag and their failure paths, and device_proxy_test's slot-9
expectations. No game files.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:53 +01:00
af236e196b d3d12_xs: route slot 67 compute pipeline from native code to CreateComputePipelineState (RT-99)
Xbox device slot 67 takes (desc, riid, out) with IID_ID3D12PipelineState and a console-only
descriptor with the root signature at +0x00 and code blob pointer/size at +0x28/+0x30.
Previously it logged and returned E_NOTIMPL.

Route it to CreateComputePipelineState on the PC device (slot 11) like slot 62, mapping the
console descriptor to D3D12_COMPUTE_PIPELINE_STATE_DESC. On the Vulkan device this resolves
through the translator via fssm_program and ShaderLibrary.

- Implement proxy_create_compute_pipeline_from_native_code in d3d12_xs_device.cpp
- Update device_proxy_test to verify slot 67 thunk, compute PSO creation over WARP, and argument checks
- Update d3d12_compute_test to verify slot 67 compute PSO creation on the Vulkan device
- Update documentation in d3d12_command_objects.md and d3d12_vulkan.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:34:10 +05:30
54575594ab Merge pull request #1661 from omardev29 2026-11-22 08:08:35 -05:00
627b0d6ae2 docs: record slot 146 Barrier call-site evidence (D3D-201) 2026-11-22 04:46:50 -08:00
f669f59fd0 docs: slot 67's name and desc, FSPX decoded, and the C++ throw after #965
d3d12_command_objects.md 3.5a: slot 67 is DeserializeComputePipelineStateX
with its full desc (kind 0, 1, 6, 7 pointer/size pairs), and the open
"what FSPX holds" line now points at fspx.md (13 of 29 translate).
d3d12_vulkan.md A.3: the same name, and the throw: before #965 it carried
an image base of 0; with #965 it carries the DLL's base and still reaches
the caller (fsr_dispatch_test, LEONIDA_FSR_NO_STANDIN=1).
2026-11-22 13:42:04 +01:00
9b3f8388b9 Merge pull request #1470 from CLHelper 2026-11-22 06:38:11 -05:00
e948729a25 Merge pull request #1469 from CLHelper 2026-11-22 06:38:11 -05:00
932287398d docs: FSR DLL list slots 54/55/59/85, pipeline slot 11 and the device +0x18 copy switch
Static reading of the FSR DLL's call sites, added to section 3.5a:

- 54 is ClearUnorderedAccessViewFloat and 55 DiscardResource (both +4).
- 59 is one console slot with a bool first argument, used for both ends of a
  GPU event; the two slots the console lacks are among 56-60.
- 85 takes the six CopyTextureRegion arguments (two copy locations), not one
  pointer: buffer-to-texture with a footprint from device slot 38, or
  texture-to-texture.
- Pipeline slot 11 (console-only) gives a per-pipeline scratch value; the
  largest times 0xd0 sizes FFX_XBox_ComputeScratch, and slot 141's fourth
  argument is the bound pipeline's value.
- A byte at device +0x18 selects between the DLL's own 32-byte descriptor
  copy and device slot 24 CopyDescriptorsSimple.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:24:15 +00:00
a3460331ff docs: builder command-list slots in console order; +0x490 is Barrier (slot 146)
Re-read the BVH builder's command-list call sites in the console order of section 3.5a:
+0x108 is SetComputeRootSignature, +0x138 SetComputeRoot32BitConstants and +0x168
SetComputeRootUnorderedAccessView (the PC-order readings SetComputeRoot32BitConstant,
SetComputeRootShaderResourceView and SOSetTargets do not fit the argument registers or the
inline writes). RDX at the +0xc8 call is the pipeline. +0x490 (console slot 146) is the
public enhanced Barrier with one global compute-to-compute UAV barrier.

New section 3.3a: slots 37/39/43/45 at other sites, 148 (upload allocator whose pointer is
used as the GPU address), 80 (dispatch with an extra word), 71/73 (label write/wait,
unreachable in the shipping DLL) and the second Barrier site.
2026-11-22 11:08:48 +00:00
62593f47ca Runtime: Xbox-ABI proxies for the command queue and the fence (BUILD-231)
Device slots 8 (CreateCommandQueue), 75 (CreateCommandQueue1), 36
(CreateFence) and 32 (OpenSharedHandle of a fence) now return queue and
fence proxies. They forward the public chain in PC order (19 queue slots,
11 or 12 fence slots), refuse and log a slot past it up to the end of the
proxy's table, and name a read past the table through a guard region and
a vectored handler.

Heap, queue and fence proxies are unwrapped wherever a device or queue
method hands them to the real runtime: queue Signal/Wait, device slots
31/34/35/45/46/50. Arrays are copied without exceptions. QueryInterface
answers only the modelled interfaces, and logs one the real object has
but the proxy does not model. Outputs are cleared on failure as for
slots 14/62/76. --trace-d3d12 records proxy calls in the README grammar.
Every function a thunk hands its words to keeps them in the same
positions, because a title passes only as many as the method takes.

Tests: queue_proxy_test (host WARP, host hardware, Vulkan device;
differential per-process error cases, guard faults, identity, threads,
raw-slot client, child-runner self-test), xs_proxy_mock_test (older
devices, fences without Fence1, OpenSharedHandle branches, allocation
failures; three guard-setup fault modes), and device_proxy_test through
the D3D12XboxCreateDevice shim. No game files.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:08:53 +01:00