upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/boot.md
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 16:38:20 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-25 16:38:20 -0500
commitc116c3fa28983444cd47feea0461e1e7eaac83b5 (patch)
treef2f4821b744b678f0cf1ce98638e981ea737b0c6 /docs/boot.md
parent5866d6974e86fc2d39e6ce0691af63b354f6c8b9 (diff)
parent24d8af66af151f024b0b520fb397d899924f5486 (diff)
Merge main into t-drive-overlay
docs/boot.md: main added LEONIDA_WRITE_DIR / LEONIDA_SAVE_DIR to the --overlay bullet and a new "Under Wine on Linux" section; keep both and the T: paragraph of this branch after main's sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/boot.md')
-rw-r--r--docs/boot.md74
1 files changed, 64 insertions, 10 deletions
diff --git a/docs/boot.md b/docs/boot.md
index 91dbe4816..cfdc57cad 100644
--- a/docs/boot.md
+++ b/docs/boot.md
@@ -1,13 +1,9 @@
1# First boot: the runbook and the two traces 1# First boot: the runbook and the two traces
2 2
3**Status: `--dry-run` and `--init` have been run on the retail executable; `--run` has not.** The package in the 3The Windows integration has a dedicated [offline first-run UI profile](first_run_ui.md). The original dry-run
4repository's test corpus does not contain `game_scarlett_master.exe` (RT-5); the dry-run on an executable supplied 4and initialization measurements used a separately supplied executable and identified 30 unimplemented imports.
5separately maps it and leaves 30 imports unimplemented, and `--init` runs its TLS callbacks and the package DLLs' 5The Winsock shim restricts connections to loopback and the WinHTTP shim refuses outbound requests. Keep retail runs
6`DllMain`s without an exception 6offline and traces on the player's machine. [Original import measurements](runtime_imports.md#the-retail-executable-rt-5)
7([`runtime_imports.md`](runtime_imports.md#the-retail-executable-rt-5)), so this page is still the procedure and the
8trace tool for the first boot. Outbound `ws2_32.dll` and `winhttp.dll` calls are restricted offline by the shims
9(`ws2_offline.cpp` permits loopback only; `winhttp_offline.cpp` refuses all requests), though running with the network
10off remains good defence in depth. Nothing here quotes game data; a real trace stays on the player's machine.
11 7
12## 1. What the first boot produces 8## 1. What the first boot produces
13 9
@@ -99,18 +95,47 @@ Useful switches:
99 This switch covers imports only; it does not affect the D3D12 outcomes. 95 This switch covers imports only; it does not affect the D3D12 outcomes.
100* `LEONIDA_SKIP_CPU_CHECK=1` skips the AVX preflight of `--init` and `--run`, which otherwise exits 4 with one line 96* `LEONIDA_SKIP_CPU_CHECK=1` skips the AVX preflight of `--init` and `--run`, which otherwise exits 4 with one line
101 naming the missing feature on a host without AVX (a QEMU `qemu64` guest; under Rosetta, set 97 naming the missing feature on a host without AVX (a QEMU `qemu64` guest; under Rosetta, set
102 `ROSETTA_ADVERTISE_AVX=1` instead). The game itself still needs AVX, so this is for the #UD emulation work. 98 `ROSETTA_ADVERTISE_AVX=1` instead). The game itself still needs AVX, so this is for the #UD emulation work (see
99 [cpu_features.md](cpu_features.md#hosts-without-avx) for what works on a host without AVX).
103* `LEONIDA_SKIP_INT3=1` (with `--trace`) steps over each int3 in guest code and logs it once per address as an 100* `LEONIDA_SKIP_INT3=1` (with `--trace`) steps over each int3 in guest code and logs it once per address as an
104 `int3_skipped` event, so a boot can be followed past soft asserts (an int3 followed by code that carries on). 101 `int3_skipped` event, so a boot can be followed past soft asserts (an int3 followed by code that carries on).
105 Diagnostic only: a correct run reaches none, so each skipped address is a finding, not a fix. A failed guest file 102 Diagnostic only: a correct run reaches none, so each skipped address is a finding, not a fix. A failed guest file
106 open is always traced as `file_open_failed` (path, error, caller) when `--trace` is on. 103 open is always traced as `file_open_failed` (path, error, caller) when `--trace` is on.
104* `LEONIDA_STUB_PIPELINES=1` creates a pipeline whose translated shader is missing (no shader library, or no entry
105 for its program) as a no-op stub instead of failing `CreateGraphicsPipelineState` / `CreateComputePipelineState`.
106 The stub is never registered, so `SetPipelineState` binds no PSO and its draws and dispatches are no-ops (D3D-482).
107 Diagnostic only, like `LEONIDA_SKIP_INT3`: it follows a boot past every pipeline the title creates without
108 translating or running a game shader, so nothing the title draws reaches the screen. Each stub is logged with a
109 power-of-two count.
110* During `--run` on Vulkan, the runtime paints the package shell splash when the title shows its window. The first
111 direct queue presents it on the window's swapchain. Startup clears keep the splash visible until the first
112 non-black output replaces it. The runtime reads `ShellVisuals/SplashScreenImage` from
113 `MicrosoftGame.Config` or `SplashScreen/Image` from `appxmanifest.xml`, preserves the image's aspect ratio and
114 uses the same swapchain for PresentX. A surface without readback hands off at the first title present.
115 Set `LEONIDA_PACKAGE_SPLASH=0` to disable the splash.
107* `LEONIDA_VK_VALIDATION=1` enables the Khronos validation layer with the Vulkan backend (startup overhead; it is a 116* `LEONIDA_VK_VALIDATION=1` enables the Khronos validation layer with the Vulkan backend (startup overhead; it is a
108 diagnostic). 117 diagnostic).
118* `LEONIDA_DEVICE_FAULT=1` enables Vulkan device-loss diagnostics and checkpoints where available. The first
119 observed loss prints a `[rt] device-fault:` report to stderr.
120* `LEONIDA_TITLE_HUD=1` shows live counters in the title bar of the window the title presents in
121 (`runtime/shims/title_hud.h`). It updates twice a second with:
122 - the frame rate and the average and worst frame time from PresentX, or, when no frame came in that half
123 second, how long since the last one (a hang reads "0 fps, no frame for 12.5 s");
124 - the process's private memory and working set;
125 - its local GPU memory against the DXGI budget, and its shared GPU memory;
126 - the graphics and compute pipelines created, and the seconds spent in `vkCreate*Pipelines` in the last half
127 second. A pipeline compiled in the frame shows up there as a hitch. This needs `LEONIDA_MEM_PROBE`; without it
128 the field reads `PSO -`.
129 - the time since the first present.
130
131 A thread of its own sets the text with `SendMessageTimeout`, so a busy window thread never holds a present.
109* `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their 132* `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their
110 implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known 133 implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known
111 problems"). 134 problems").
112* `--overlay DIR` sends the guest's writes to DIR instead of the default `<game-dir>\overlay` (useful when the 135* `--overlay DIR` sends the guest's writes to DIR instead of the default `<game-dir>\overlay` (useful when the
113 package drive is read-only); the package itself is never written. The title's `T:` drive (its temporary drive, 136 package drive is read-only); the package itself is never written. Set `LEONIDA_WRITE_DIR` to override that folder
137 for one run (it wins over `--overlay`). For a fresh first-run profile, also set `LEONIDA_SAVE_DIR` to a separate
138 empty directory for the local game-save provider. The title's `T:` drive (its temporary drive,
114 where it writes its crash dump `T:\<guid>.dmp` and crash log) is a folder of each process's own inside the overlay, 139 where it writes its crash dump `T:\<guid>.dmp` and crash log) is a folder of each process's own inside the overlay,
115 `<overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>` (the process's start time in UTC and its id). 140 `<overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>` (the process's start time in UTC and its id).
116 The folder is reserved with a create-only `CreateDirectoryW` when `gta6rt` starts the title (or on the first `T:` 141 The folder is reserved with a create-only `CreateDirectoryW` when `gta6rt` starts the title (or on the first `T:`
@@ -121,6 +146,35 @@ Useful switches:
121 one folder for every run, a `CREATE_NEW` of a name an earlier run had left failed with `ERROR_FILE_EXISTS` (80) 146 one folder for every run, a `CREATE_NEW` of a name an earlier run had left failed with `ERROR_FILE_EXISTS` (80)
122 and no report landed (old upstream issue 7913). 147 and no report landed (old upstream issue 7913).
123 148
149### Under Wine on Linux
150
151The prefix has to supply a `d3d12.dll` that exports `D3D12SerializeVersionedRootSignature`, because the executable
152imports it. Wine's own `d3d12.dll` does not answer that export for the runtime's shim, and the failure is quiet:
153the D3D12 trace ends at about 1,658 calls, the startup trace ends in an access violation inside the executable,
154and the one line that names the cause is
155`[rt] d3d12_xs: host d3d12.dll has no D3D12SerializeVersionedRootSignature`. The run never reaches
156`CreateRootSignature`.
157
158Copying the DLLs a Proton prefix installs is not enough on its own: Wine keeps preferring its own copy next to
159them. Name them in the overrides.
160
161```bash
162GE=$HOME/GE-Proton11-13-x86_64/files/lib/wine
163cp "$GE/vkd3d-proton/x86_64-windows/d3d12.dll" \
164 "$GE/vkd3d-proton/x86_64-windows/d3d12core.dll" \
165 "$GE/dxvk/x86_64-windows/dxgi.dll" "$WINEPREFIX/drive_c/windows/system32/"
166export WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,b"
167export LEONIDA_D3D12=vulkan
168export LEONIDA_SHADERS='Z:\path\to\shaders\spirv'
169wine ./gta6rt.exe --run 'Z:\path\to\game_scarlett_master.exe' --game-dir 'Z:\path\to\the\package' \
170 --trace /tmp/boot.jsonl --trace-d3d12
171```
172
173With those three DLLs and the override, the same prefix reaches the frame loop: about 1.4 million D3D12 calls in
17490 s, no exception, `PresentX ready`, against 1,658 calls and an access violation without them, measured on Wine
17511.13 (GE-Proton 11-13) with an RDNA2 iGPU. A prefix that Proton itself created already carries these files and
176needs no override.
177
124## 3. Triage order 178## 3. Triage order
125 179
126Read the startup trace first; the first event that is not the expected one is the run's first fact. 180Read the startup trace first; the first event that is not the expected one is the run's first fact.