upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authormariuslozo-boop <254631011+mariuslozo-boop@users.noreply.github.com>2026-11-22 23:12:53 +0100
committermariuslozo-boop <254631011+mariuslozo-boop@users.noreply.github.com>2026-11-22 23:12:53 +0100
commit87d608fef2d637a385e8a82aeb6ec5b7f3499b8b (patch)
tree50224a9f977a8c2a64499927adf7c313bb4031c8 /docs
parentf847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff)
tools: compare XCL's synthetic test title under gta6rt and under XCL
tools/xcl_compare.py starts XCL's fake console executable under gta6rt --run and under XCL, records each check's result, the unimplemented imports it hit, and the thread stacks of a hung check (cdb), restarts after a hang with that check skipped, and writes report.json; --gui shows the checks live. It holds no XCL code: it only runs binaries from a separate XCL checkout. docs/xcl_compare.md has the licence boundary, how to run it, and the first result (XCL 50/50, gta6rt 5 pass, 43 fail, 2 hang), with each difference mapped to an open item or recorded as a lead. Both hangs are the documented deadlock of XTaskQueueTerminate(wait = true) from a manual queue's dispatching thread, not a runtime bug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/README.md1
-rw-r--r--docs/xcl_compare.md73
2 files changed, 74 insertions, 0 deletions
diff --git a/docs/README.md b/docs/README.md
index 5eff8e3c1..da5612c4c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -63,6 +63,7 @@ method, scope and caveats. No game data is included.
63| [xdxr.md](xdxr.md) | `BATCHED_DESC2` (`0x50`) and `XDXR_STREAM_DESC` (`0x10`) from `XboxBvhBuilder.dll`'s reads; stream records' offsets and defaults; offline statistics not in the package. | 63| [xdxr.md](xdxr.md) | `BATCHED_DESC2` (`0x50`) and `XDXR_STREAM_DESC` (`0x10`) from `XboxBvhBuilder.dll`'s reads; stream records' offsets and defaults; offline statistics not in the package. |
64| [d3d12_command_objects.md](d3d12_command_objects.md) | Measured command queue/list/fence/`PresentX` surface; verified vs prior art vs open. | 64| [d3d12_command_objects.md](d3d12_command_objects.md) | Measured command queue/list/fence/`PresentX` surface; verified vs prior art vs open. |
65| [runtime_imports.md](runtime_imports.md) | The 16 shipped modules' measured imports and shim/host/unimplemented split. | 65| [runtime_imports.md](runtime_imports.md) | The 16 shipped modules' measured imports and shim/host/unimplemented split. |
66| [xcl_compare.md](xcl_compare.md) | XCL's synthetic test title under `gta6rt --run` and under XCL (`tools/xcl_compare.py`): 5 of 50 checks pass here, both hangs are the documented manual-queue terminate deadlock, and each other difference mapped to an open item or a lead. |
66| [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. | 67| [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. |
67| [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). | 68| [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). |
68| [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. | 69| [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. |
diff --git a/docs/xcl_compare.md b/docs/xcl_compare.md
new file mode 100644
index 000000000..fbee70d24
--- /dev/null
+++ b/docs/xcl_compare.md
@@ -0,0 +1,73 @@
1# Comparing the runtime with XCL's test title
2
3`tools/xcl_compare.py` runs one synthetic console executable under `gta6rt --run` and under
4[XCL](https://github.com/ivall/xcl), and lists where the two runtimes disagree. XCL already runs retail Xbox Series
5titles, so a check that passes there and fails here points at a loader, shim or D3D12 gap. It is a lead to
6investigate, not proof of a bug: some of the title's checks test XCL's own design choices.
7
8## Licence boundary
9
10XCL is GPL-2.0-only, which is not compatible with this repository's GPL-3.0-or-later (see
11[related_projects.md](related_projects.md)). The tool contains no XCL code, headers or tables. It starts programs
12built from a separate XCL checkout that you point it at, reads what they print, and writes a report outside the
13repository. Do not copy the test title, its sources or its output into this repository.
14
15## What the test title is
16
17XCL's test title (the `testtitle` and `testgamedll` crates in XCL's repository) is a fake console executable. Its
18import table names `kernelx.dll`, `xgameruntime.dll`, `xmem.dll` and a bundled game DLL, so plain Windows cannot
19start it. It runs about 50 checks (title memory, TLS, exceptions, modules, console paths, XGameRuntime, task
20queues, users, storage, D3D12.X, DirectStorage, XAudio2) and prints `[PASS] <check>` or `[FAIL] <check>: <reason>`
21for each. No game files are involved.
22
23## Run it
24
251. Build XCL in its own checkout: `cargo build --release --workspace` (Rust and the Windows SDK; XCL looks up
26 `dxcompiler.dll` in the Windows SDK).
272. Build the runtime: `scripts/build_runtime.ps1`, or CMake as in [testing.md](testing.md).
283. Run:
29
30```powershell
31python -I tools/xcl_compare.py --xcl C:\src\xcl
32python -I tools/xcl_compare.py --xcl C:\src\xcl --gui # the checks live in a window
33```
34
35The work folder defaults to `%TEMP%\leonida_xcl_compare`. It must not be on `D:`: XCL maps the console drive `D:`
36to the game folder, so a real `D:\` path is not reachable inside XCL and the title fails to load. The report is
37`report.json` in the work folder (`--out` to change it).
38
39A check that prints nothing for `--timeout` seconds (15 by default) is a hang. The tool records the stacks of the
40title's threads with `cdb.exe` from the Windows SDK debugging tools (when installed), stops the title, and starts it
41again with that check skipped, so a hang does not hide the checks after it. `--skip <fragment>` skips checks by
42name. Both need two small local changes to the title's `check` function, which upstream XCL does not have: print
43`[RUN] <check>` before each check, and return early with `[SKIP] <check>` when `XCL_TESTTITLE_SKIP` holds part of
44its name. Without them the check in progress is taken from XCL's order, and a hang ends the run (the tool notices
45the repeat and stops).
46
47## Result, 2026-11-22
48
49Windows 11, RTX 5070 Ti (driver 616.92), MSVC 19.44, Windows SDK 10.0.26100, runtime at `f847748c`, XCL at
50`055b0ad` with the two local changes above in its test title.
51
52| Runtime | Pass | Fail | Hang |
53|---|---:|---:|---:|
54| XCL | 50 | 0 | 0 |
55| gta6rt | 5 | 43 | 2 |
56
57XCL passes all 50 on this NVIDIA GPU, so its open gap on 32-wide-wave GPUs (wave64 compute, geometry and mesh
58programs refused) does not affect this title. The D3D12 call traces were recorded (`--trace-d3d12`), but the runtime
59never reaches a D3D12 call, so there is nothing to compare there yet.
60
61What the differences come down to:
62
63| Difference | Reading |
64|---|---|
65| Both hangs: `XTaskQueueTerminate(queue, wait = true)` on a manual queue, from the thread that dispatches it (`TaskQueueImpl::Terminate` waits on its condition variable) | Not a runtime bug. The reference implementation in `third_party/xtaskqueue` behaves this way, and Microsoft's `XTaskQueueTerminate` documentation warns that waiting from the dispatching thread can deadlock. XCL returns there; the title relies on that. |
66| `GetModuleHandle(NULL)` and `current_exe` name `gta6rt.exe`, not the title | Covered by open #2075 (the mapped executable's module identity). |
67| `G:\` and `T:\` console paths | RT-218 (claimed). |
68| Persistent local storage | RT-219 (claimed). |
69| XUser, XGameSave folder | #279 and #3363 (open). |
70| `XAudio2Create` | RT-197, #3831 (open). |
71| `d3d12_xs.dll!D3D12CreateDevice` not found (16 D3D12.X checks) | The runtime serves the console's `D3D12XboxCreateDevice`; the title asks for `D3D12CreateDevice`. Whether the console's `d3d12_xs.dll` exports that name is not measured here. |
72| `kernelx.dll` imports `XMemAlloc`, `XMemVirtualAlloc`, `TitleMemoryStatus`, `GetConsoleType`, `SetThreadName`/`GetThreadName`; `xmem.dll` physical pages; `xcrdapi.dll!DStorageGetFactory`; `MFResetDXGIDeviceManagerX` | Unimplemented here. None is in the measured imports of the shipped modules ([runtime_imports.md](runtime_imports.md)), and the executable is not available to measure, so they are leads, not known needs. `xmem.dll!XMemAlloc` is served; the same name under `kernelx.dll` is not. |
73| The title's window is not a hidden 1920x1080 tool window | An XCL design choice (its console screen), not a console fact. |