diff options
| author | DadaCap <167002618+DadaCap@users.noreply.github.com> | 2026-11-24 21:09:02 +0100 |
|---|---|---|
| committer | DadaCap <167002618+DadaCap@users.noreply.github.com> | 2026-11-24 21:09:02 +0100 |
| commit | bc245e5046124941bbdc7bb5c3bd7c739da4e03e (patch) | |
| tree | 5b780fbcbc1dd131ee635980dfe3e996ac72928f /docs/boot.md | |
| parent | 30450e0e96e1df700bbfa9505433c9b9940e8694 (diff) | |
| parent | 58be9cdf8df9a31bc7f6c068991f1aed381f7f4d (diff) | |
Merge remote-tracking branch 'origin/main' into vcc-tuple-resync
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/boot.md')
| -rw-r--r-- | docs/boot.md | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/docs/boot.md b/docs/boot.md index 1ff3fa2f4..31a7ba3d1 100644 --- a/docs/boot.md +++ b/docs/boot.md | |||
| @@ -5,8 +5,9 @@ repository's test corpus does not contain `game_scarlett_master.exe` (RT-5); the | |||
| 5 | separately maps it and leaves 30 imports unimplemented, and `--init` runs its TLS callbacks and the package DLLs' | 5 | separately maps it and leaves 30 imports unimplemented, and `--init` runs its TLS callbacks and the package DLLs' |
| 6 | `DllMain`s without an exception | 6 | `DllMain`s without an exception |
| 7 | ([`runtime_imports.md`](runtime_imports.md#the-retail-executable-rt-5)), so this page is still the procedure and the | 7 | ([`runtime_imports.md`](runtime_imports.md#the-retail-executable-rt-5)), so this page is still the procedure and the |
| 8 | trace tool for the first boot. The executable's `ws2_32.dll` imports bind to the host's, so run `--run` with the | 8 | trace tool for the first boot. Outbound `ws2_32.dll` and `winhttp.dll` calls are restricted offline by the shims |
| 9 | network off. Nothing here quotes game data; a real trace stays on the player's machine. | 9 | (`ws2_offline.cpp` permits loopback only; `winhttp_offline.cpp` refuses all requests), though running with the network |
| 10 | off remains good defence in depth. Nothing here quotes game data; a real trace stays on the player's machine. | ||
| 10 | 11 | ||
| 11 | ## 1. What the first boot produces | 12 | ## 1. What the first boot produces |
| 12 | 13 | ||
| @@ -28,8 +29,11 @@ Two traces are written independently: | |||
| 28 | 29 | ||
| 29 | `tools/boot_trace.py` reads both and prints the triage units: modules, unimplemented calls and callers, | 30 | `tools/boot_trace.py` reads both and prints the triage units: modules, unimplemented calls and callers, |
| 30 | DllMain/TLS results, exceptions with their stack frames, the exit, and the D3D12 calls by outcome and first call | 31 | DllMain/TLS results, exceptions with their stack frames, the exit, and the D3D12 calls by outcome and first call |
| 31 | per method. The `[rt]` lines in the same stderr log carry the device parameters, feature ids and warnings; the | 32 | per method. When `XboxPresentation` logs its teardown `[rt] present: pacing summary ...` line (BL-6), the D3D12 |
| 32 | summary leaves them as a count, so grep `^\[rt\]` for those. | 33 | summary also reports the frame count, interval count, target interval, mean and drift against target, `p50`/`p95`/`p99` |
| 34 | frame times, and `p50`/`p95`/`p99` origin-to-present latencies (and includes the numeric `frame_pacing` object in | ||
| 35 | `--json` and `--counts-only`). The remaining `[rt]` lines in the same stderr log carry the device parameters, feature | ||
| 36 | ids and warnings; the summary leaves them as a count, so grep `^\[rt\]` for those. | ||
| 33 | 37 | ||
| 34 | For `xmem_physical_pages`, the shim records the first request for each distinct attribute word. The text and | 38 | For `xmem_physical_pages`, the shim records the first request for each distinct attribute word. The text and |
| 35 | JSON summaries list the API, raw attribute word, requested page count and caller for the first `--limit` | 39 | JSON summaries list the API, raw attribute word, requested page count and caller for the first `--limit` |
| @@ -46,7 +50,8 @@ $exe = "C:\path\to\game_scarlett_master.exe" | |||
| 46 | $pkg = "C:\path\to\the\package" | 50 | $pkg = "C:\path\to\the\package" |
| 47 | $trace = Join-Path $env:TEMP boot.jsonl | 51 | $trace = Join-Path $env:TEMP boot.jsonl |
| 48 | $log = Join-Path $env:TEMP d3d12.log | 52 | $log = Join-Path $env:TEMP d3d12.log |
| 49 | .\runtime\build\gta6rt.exe --run $exe --game-dir $pkg --trace $trace --trace-d3d12 2>&1 | | 53 | & { $ErrorActionPreference = 'Continue' |
| 54 | .\runtime\build\gta6rt.exe --run $exe --game-dir $pkg --trace $trace --trace-d3d12 2>&1 } | | ||
| 50 | ForEach-Object { $_.ToString() } | | 55 | ForEach-Object { $_.ToString() } | |
| 51 | Out-File -LiteralPath $log -Width 4096 -Encoding utf8 | 56 | Out-File -LiteralPath $log -Width 4096 -Encoding utf8 |
| 52 | python -I tools\boot_trace.py $trace --d3d12 $log | 57 | python -I tools\boot_trace.py $trace --d3d12 $log |
| @@ -56,6 +61,13 @@ The capture pipeline writes each message as text to avoid PowerShell 5.1 wrappin | |||
| 56 | narrow output width. The tool also reads existing UTF-16LE logs saved with `2>` in PowerShell 5.1 and recognizes | 61 | narrow output width. The tool also reads existing UTF-16LE logs saved with `2>` in PowerShell 5.1 and recognizes |
| 57 | the `program.exe : ` prefix on the first stderr line. | 62 | the `program.exe : ` prefix on the first stderr line. |
| 58 | 63 | ||
| 64 | The `& { ... }` block matters when the session (or a profile or script) has `$ErrorActionPreference = 'Stop'`: | ||
| 65 | Windows PowerShell 5.1 then turns the first stderr line into a terminating error, the run stops there, and the log | ||
| 66 | holds no `[d3d12-trace]` line, so it reads as a run with no D3D12 call. The block sets `Continue` for the run only | ||
| 67 | (`scripts/first_look.ps1` captures its dry run the same way). Measured on 5.1.26100 with a stand-in that prints three | ||
| 68 | trace lines to stderr and exits 37: without the block, all three with `Continue` and none with `Stop`; with it, all | ||
| 69 | three with either, `$LASTEXITCODE` 37, and the session's preference unchanged. | ||
| 70 | |||
| 59 | Linux under Wine (a cross build made with xwin, or the `runtime-windows` artifact; the backend must be Vulkan): | 71 | Linux under Wine (a cross build made with xwin, or the `runtime-windows` artifact; the backend must be Vulkan): |
| 60 | 72 | ||
| 61 | ```sh | 73 | ```sh |
| @@ -66,10 +78,17 @@ wine runtime/build/windows/gta6rt.exe --run /path/to/game_scarlett_master.exe \ | |||
| 66 | python3 -I tools/boot_trace.py /tmp/boot.jsonl --d3d12 /tmp/d3d12.log | 78 | python3 -I tools/boot_trace.py /tmp/boot.jsonl --d3d12 /tmp/d3d12.log |
| 67 | ``` | 79 | ``` |
| 68 | 80 | ||
| 81 | `runtime\build\gta6rt.exe` is where `scripts\build_runtime.ps1` (Ninja) puts it; the direct CMake path in | ||
| 82 | [runtime/README.md](../runtime/README.md) uses the multi-config Visual Studio generator, which writes | ||
| 83 | `runtime\build\RelWithDebInfo\gta6rt.exe` instead. | ||
| 84 | |||
| 69 | `--trace FILE` **refuses an existing file** (exit 2): it is created before the loader reads anything, so use a | 85 | `--trace FILE` **refuses an existing file** (exit 2): it is created before the loader reads anything, so use a |
| 70 | fresh name or delete the old one. `LEONIDA_D3D12=vulkan` selects the Vulkan-backed device, the only backend that | 86 | fresh name or delete the old one. `LEONIDA_D3D12=vulkan` selects the Vulkan-backed device, the only backend that |
| 71 | writes the `[d3d12-trace]` lines; without it the layer uses the Windows D3D12 device and the trace has nothing to | 87 | traces command lists, resources and pipelines; without it the layer uses the Windows D3D12 device, and the |
| 72 | read. Keep the traces out of the repository: they can quote whatever the game prints. | 88 | `[d3d12-trace]` lines are only what the Xbox-ABI proxy forwards (device creation, queue, fence and allocator |
| 89 | calls), which `boot_trace.py` summarizes without complaint. A run on the Vulkan device prints | ||
| 90 | `[rt] d3d12: Vulkan device: <name>`; check the log for it (a runtime built without the Vulkan headers accepts the | ||
| 91 | variable and stays on the Windows device). Keep the traces out of the repository: they can quote whatever the game prints. | ||
| 73 | 92 | ||
| 74 | Useful switches: | 93 | Useful switches: |
| 75 | 94 | ||
| @@ -90,7 +109,8 @@ Useful switches: | |||
| 90 | * `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their | 109 | * `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` when MSI Afterburner or OBS is installed; their |
| 91 | implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known | 110 | implicit layers add swapchain usage that shows up as validation errors ([testing.md](testing.md), "Known |
| 92 | problems"). | 111 | problems"). |
| 93 | * `--overlay DIR` sends the guest's writes to a private folder instead of the package. | 112 | * `--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. | ||
| 94 | 114 | ||
| 95 | ## 3. Triage order | 115 | ## 3. Triage order |
| 96 | 116 | ||
| @@ -110,8 +130,9 @@ Read the startup trace first; the first event that is not the expected one is th | |||
| 110 | the final slot for the last observed exception. The trace also includes handled exceptions, so the last | 130 | the final slot for the last observed exception. The trace also includes handled exceptions, so the last |
| 111 | observation alone does not establish what caused the run to stop. | 131 | observation alone does not establish what caused the run to stop. |
| 112 | 5. **`exit` / `error`** — a clean exit is not a correct frame; continue to the D3D12 trace. | 132 | 5. **`exit` / `error`** — a clean exit is not a correct frame; continue to the D3D12 trace. |
| 113 | 6. **D3D12 trace** — the `failed`, `unsupported`, `refused` and `partial` lines name the method. A `partial` | 133 | 6. **D3D12 trace** — the `failed`, `unsupported` and `refused` lines name the method. A `failed` |
| 114 | submission ran the supported commands from a list. The runtime's `[rt]` diagnostic names the command it left out. | 134 | `ExecuteCommandLists` submitted nothing from its lists. (`boot_trace.py` also lists a `partial` outcome, a |
| 135 | submission that ran only the supported commands; the runtime does not write it yet.) | ||
| 115 | Compare the method's position with the public SDK vtable. An unknown slot is expected until the executable names it | 136 | Compare the method's position with the public SDK vtable. An unknown slot is expected until the executable names it |
| 116 | (Q2, Q6). The `[rt]` lines in the same log carry the 24 device words, feature IDs and warnings. | 137 | (Q2, Q6). The `[rt]` lines in the same log carry the 24 device words, feature IDs and warnings. |
| 117 | The summary expects `#1` first, then one more than the last observed number. It counts each mismatch once and | 138 | The summary expects `#1` first, then one more than the last observed number. It counts each mismatch once and |
| @@ -130,8 +151,8 @@ is `null`; if neither input yields a report, stdout is empty. | |||
| 130 | 151 | ||
| 131 | ## 4. The open questions, and the trace signal for each | 152 | ## 4. The open questions, and the trace signal for each |
| 132 | 153 | ||
| 133 | The questions are in [`d3d12_vulkan.md`](d3d12_vulkan.md) §8.2; that table repeats 16, 19 and 20, and this one is | 154 | The questions are in [`d3d12_vulkan.md`](d3d12_vulkan.md) §8.2; this table takes the same 1–22 in |
| 134 | the de-duplicated 1–22. It maps each question to the event to look for; it does not answer them. | 155 | order. It maps each question to the event to look for; it does not answer them. |
| 135 | 156 | ||
| 136 | | # | Question | Signal in the first trace | | 157 | | # | Question | Signal in the first trace | |
| 137 | |---|---|---| | 158 | |---|---|---| |
| @@ -172,5 +193,6 @@ the de-duplicated 1–22. It maps each question to the event to look for; it doe | |||
| 172 | The retail executable is not in the package, so this page is untested against it; the tool and the trace formats | 193 | The retail executable is not in the package, so this page is untested against it; the tool and the trace formats |
| 173 | are tested on synthetic fixtures and on `tiny_game` (which has no D3D12 calls). The present slots (Q6) and the | 194 | are tested on synthetic fixtures and on `tiny_game` (which has no D3D12 calls). The present slots (Q6) and the |
| 174 | Xbox device parameters (Q1) remain the first things the executable itself has to name. The D3D12 trace needs the | 195 | Xbox device parameters (Q1) remain the first things the executable itself has to name. The D3D12 trace needs the |
| 175 | Vulkan backend; a build without it runs the game's calls through the PC device and records nothing. The runbook | 196 | Vulkan backend; a build without it runs the game's calls through the PC device and records only the proxy's |
| 197 | device, queue, fence and allocator calls. The runbook | ||
| 176 | does not make the game boot; it makes the first real trace readable. | 198 | does not make the game boot; it makes the first real trace readable. |