diff options
| author | QemmHD <290605352+QemmHD@users.noreply.github.com> | 2026-11-24 10:22:49 -0500 |
|---|---|---|
| committer | QemmHD <290605352+QemmHD@users.noreply.github.com> | 2026-11-24 10:32:26 -0500 |
| commit | ba142e7ff519bcde01a54b4ac3556539dbc53df2 (patch) | |
| tree | 3cfa6d04fd90230d464a9e6f9ca75bdb3b6d5f93 /docs | |
| parent | 119d5b920cfeddf9bb811102907b1078a7a4195c (diff) | |
docs: BL-1, main already clears the /GA index-0 stop; boot.md and the stop table say what it carries
docs/boot_leads.md sends a reader to implement BL-1 because "the retail run on main ends in the stop-4 shape".
That line comes from retail_boot_intel_host.md, measured at main 867d922f. b7a3fed28 (the loader rewrites a
/GA executable's index-0 TLS reads) landed on main after that, and 4710549af after it, so the lead as written
describes a main that no longer exists. The integration tree's #4313 is a second design for the same stop
(the runtime's own EXE gives up index 0 at process start), not a fix main is missing.
- boot.md, triage step 3: what the stop looks like, what load() does about it, the log line that counts the
rewritten reads, the switch that turns the rewrite off, and the two tests.
- retail_boot_chain.md, row 4: #4313 is what the measured tree had; main carries b7a3fed28 and 4710549af.
- boot_leads.md, BL-1: a Status entry with the same, and what is left of the lead.
Nothing was run on the retail executable for this (it needs game files), and all three places say so.
Tested at main a28927849: tests/test_docs_*.py, 47 pass; the repository-consistency set (test_cmake_*,
test_shader_stage_resume, test_runtime_paths, test_docs_*, test_make_game_*, test_check_no_game_data*,
test_run_semantic_tests), 566 pass and 5 skip. scripts/check_no_game_data.py on the three files: clean.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/boot.md | 11 | ||||
| -rw-r--r-- | docs/boot_leads.md | 9 | ||||
| -rw-r--r-- | docs/retail_boot_chain.md | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/docs/boot.md b/docs/boot.md index 7367dd91d..ec27b3146 100644 --- a/docs/boot.md +++ b/docs/boot.md | |||
| @@ -114,6 +114,17 @@ Read the startup trace first; the first event that is not the expected one is th | |||
| 114 | TLS index. The summary shows the address and phase of the last observed TLS callback | 114 | TLS index. The summary shows the address and phase of the last observed TLS callback |
| 115 | (`last_tls_callback` in JSON). The loader records it before invoking the callback, so the record gives no | 115 | (`last_tls_callback` in JSON). The loader records it before invoking the callback, so the record gives no |
| 116 | completion result. The loader's own TLS is checked by `run_tiny_game_tls`. | 116 | completion result. The loader's own TLS is checked by `run_tiny_game_tls`. |
| 117 | An access violation in CRT startup before the first D3D12 call can be the TLS index instead: code built with | ||
| 118 | `/GA` reads its thread-local data at module index 0 without `_tls_index`, and index 0 belongs to `gta6rt.exe` | ||
| 119 | (stop 4 of [retail_boot_chain.md](retail_boot_chain.md)). `load()` rewrites those reads in a mapped executable | ||
| 120 | so that they reach the image's own block, and every other mapped module with a TLS directory has an index of | ||
| 121 | its own ([`runtime/README.md`](../runtime/README.md), "PE loader"). The stderr log has one | ||
| 122 | `[rt] loader: <image>: <N> index-0 TLS reads` line for the executable; `N` 0 on an image that faults there | ||
| 123 | means its reads have a shape the rewrite does not know. `LEONIDA_TLS_GA_PATCH=0` turns the rewrite off, to | ||
| 124 | see the stop without it. `loader_tls` checks both ways with a synthetic `/GA` executable mapped beside a DLL | ||
| 125 | that has TLS of its own, on the loading thread and on a new one, and `run_tiny_game_ga_tls` runs a `/GA` | ||
| 126 | build of the stand-in game through `gta6rt --run`. Not confirmed here on the retail executable: that needs | ||
| 127 | game files. | ||
| 117 | 4. **`exception`** — code, `at`, access/address and the stack frames. The loader's vectored handler only records, | 128 | 4. **`exception`** — code, `at`, access/address and the stack frames. The loader's vectored handler only records, |
| 118 | so the process behaviour is the same with or without the trace. When the report reaches `--limit`, it reserves | 129 | so the process behaviour is the same with or without the trace. When the report reaches `--limit`, it reserves |
| 119 | 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 |
diff --git a/docs/boot_leads.md b/docs/boot_leads.md index e949c0dc1..1477b74da 100644 --- a/docs/boot_leads.md +++ b/docs/boot_leads.md | |||
| @@ -25,6 +25,15 @@ your own copy or with a synthetic test before you build on it, and record the re | |||
| 25 | keeps one TLS host slot per mapped module (`runtime/src/pe_loader.cpp`, `runtime/src/tls_host.cpp`), and the | 25 | keeps one TLS host slot per mapped module (`runtime/src/pe_loader.cpp`, `runtime/src/tls_host.cpp`), and the |
| 26 | integration tree carries a fix for stop 4 that `main` does not | 26 | integration tree carries a fix for stop 4 that `main` does not |
| 27 | ([retail_boot_chain.md](retail_boot_chain.md), row 4). | 27 | ([retail_boot_chain.md](retail_boot_chain.md), row 4). |
| 28 | - **Status:** `main` clears the synthetic case since `b7a3fed28` and `4710549af`, which the measurement quoted above | ||
| 29 | (`main` `867d922f`) predates. `load()` rewrites the executable's `mov r64, gs:[58h]` reads so that they reach a | ||
| 30 | per-thread view with the image's own block at `[0]`, and each other mapped module with a TLS directory has an index of | ||
| 31 | its own. `loader_tls` checks it with a `/GA` executable beside a DLL with TLS of its own, on the loading thread and on | ||
| 32 | a new one, and shows the stop with `LEONIDA_TLS_GA_PATCH=0`; `run_tiny_game_ga_tls` runs a `/GA` build of the stand-in | ||
| 33 | game through `gta6rt --run`. The integration tree's fix (#4313) is a second design, not a missing one: the runtime's | ||
| 34 | own EXE gives up index 0 at process start, so an index-0 read of any shape works without a rewrite. What is left of | ||
| 35 | this lead is the retail `--run` on current `main` and, if it still stops here, the read shape the rewrite does not | ||
| 36 | know. | ||
| 28 | - **Implement:** | 37 | - **Implement:** |
| 29 | 1. Find the stop-4 fix on the integration tree and compare it with `Loader::initialize_tls` on `main`. | 38 | 1. Find the stop-4 fix on the integration tree and compare it with `Loader::initialize_tls` on `main`. |
| 30 | 2. Make the executable's slot resolve at index 0 of the thread's TLS array, and give every other mapped module that | 39 | 2. Make the executable's slot resolve at index 0 of the thread's TLS array, and give every other mapped module that |
diff --git a/docs/retail_boot_chain.md b/docs/retail_boot_chain.md index fd07905be..89f320169 100644 --- a/docs/retail_boot_chain.md +++ b/docs/retail_boot_chain.md | |||
| @@ -17,7 +17,7 @@ stand-ins named below (not pull requests yet). Own 1.0.2.1 copy, Windows 11, RTX | |||
| 17 | | 1 | The first `XMemVirtualAlloc` calls: two 64 KiB reserve forms, then 2 MiB pages | #6709, #4531 | | 17 | | 1 | The first `XMemVirtualAlloc` calls: two 64 KiB reserve forms, then 2 MiB pages | #6709, #4531 | |
| 18 | | 2 | The 2 MiB reserve+commit calls carry attribute words the shim refuses, and `PAGE_GRAPHICS_*` bits (0x800..0x40000) on top of `PAGE_READWRITE` | Local: accept the attribute word, drop the graphics bits and keep the CPU protection. All seven startup allocations then succeed. #6843 measures the attribute words; no PR changes the check yet | | 18 | | 2 | The 2 MiB reserve+commit calls carry attribute words the shim refuses, and `PAGE_GRAPHICS_*` bits (0x800..0x40000) on top of `PAGE_READWRITE` | Local: accept the attribute word, drop the graphics bits and keep the CPU protection. All seven startup allocations then succeed. #6843 measures the attribute words; no PR changes the check yet | |
| 19 | | 3 | `xgameruntime.lib`'s thunk treats a missing `XErrorReport` as fatal | #6582 | | 19 | | 3 | `xgameruntime.lib`'s thunk treats a missing `XErrorReport` as fatal | #6582 | |
| 20 | | 4 | Access violation in the title's allocator: its `/GA` code reads its TLS from module index 0 | #4313 | | 20 | | 4 | Access violation in the title's allocator: its `/GA` code reads its TLS from module index 0 | #4313 in the measured tree: the runtime's own EXE gives up index 0 at process start. `main` has a different fix since `b7a3fed28` (with `4710549af` for threads that were already running): the loader rewrites the executable's index-0 reads so that they reach the image's own block ([boot.md](boot.md) §3, step 3). Checked on `main` with a synthetic `/GA` executable beside a DLL with TLS of its own (`loader_tls`) and a `/GA` build of the stand-in game under `gta6rt --run` (`run_tiny_game_ga_tls`); the retail run was not repeated for this note, it needs game files | |
| 21 | | 5 | Fatal assert when `DStorageGetFactory` returns null | #4348 | | 21 | | 5 | Fatal assert when `DStorageGetFactory` returns null | #4348 | |
| 22 | | 6 | `XMemAllocatePhysicalPages` unimplemented; the title asserts on FALSE | Local stand-in, §2 | | 22 | | 6 | `XMemAllocatePhysicalPages` unimplemented; the title asserts on FALSE | Local stand-in, §2 | |
| 23 | | 7 | `D3D12XboxCreateDevice` succeeds; device slot 26 is called with its arguments swapped | Local, §3.1 | | 23 | | 7 | `D3D12XboxCreateDevice` succeeds; device slot 26 is called with its arguments swapped | Local, §3.1 | |