Keep the title's thread_local exit callback out of the host CRT #488

Open
SmartIngenieriayDesarrollo wants to merge 2 commits from upstream-pr/488 into main
SmartIngenieriayDesarrollo commented 2026-12-01 03:02:10 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by SmartIngenieriayDesarrollo on 2026-12-01T03:02:10Z.


What

The title's CRT runs as if it were the process's exe. At start it calls _register_thread_local_exe_atexit_callback (imported from api-ms-win-crt-runtime-l1-1-0.dll) to register the destructor of its thread_locals.

The host UCRT accepts one such callback per process and calls terminate() on a second one. victory.exe registers its own callback as soon as it links any C++ code with thread_locals. The title's call is then the second one, and the start aborts with 0xC0000409 (FAST_FAIL_FATAL_APP_EXIT in ucrtbase!abort).

We hit this when we linked the Tracy client (tracing-tracy / tracy-client). The same would happen with any other C++ dependency that has thread_locals.

This PR resolves that import to our own function in modules/kernel.rs. The function:

  • keeps the first callback, and logs and ignores any later one instead of aborting;
  • queues itself once with the host CRT's atexit;
  • at exit, calls the title's callback once, as callback(NULL, DLL_PROCESS_DETACH, NULL), which is what the UCRT does in common_exit.

Builds without C++ thread_locals see no difference. The title's callback still runs at exit, now from the exit table instead of the UCRT's single slot.

Prior art

  • Other projects hit the same CRT rule:
  • I found neither before writing this. Neither is in VIctory or Vice-Tay.
  • This version keeps the callback and runs it at exit, as the UCRT would, instead of dropping it.

How it was found

cdb, breakpoint on ucrtbase!register_thread_local_exe_atexit_callback:

build calls callers result
with the tracy feature 2 victory!__scrt_common_main_seh, then the title's CRT (called from the loader) the second call aborts
without it 1 the title's CRT runs
with it, plus this change 1 victory!__scrt_common_main_seh only runs, reaches gameplay

Tests

  • On current main (0d692a31), with the one-line test fix of #487 applied (apu.rs, needed for cargo test -p victory-hle to compile): cargo test -p victory-hle --lib: 424 passed, 1 failed. The failure is xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it, which passes when run alone, 3 times out of 3, also on main without this change: it is timing-sensitive under the full parallel run.

New title_tls_exit_callback_is_kept_not_passed_to_the_host checks that:

  • the import resolves to HLE;
  • a second registration is ignored;
  • the callback runs once with DLL_PROCESS_DETACH.

Tested on: Windows 11, Ryzen 7 5700X3D, RX 7800 XT, Series S 1.0.2.1. A release build with the Tracy client linked now starts and reaches the prison cell, where it previously died at 1.5 s.

— El_Santo

AI-assisted: yes

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5578086161 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488). Originally posted by [SmartIngenieriayDesarrollo](https://github.com/SmartIngenieriayDesarrollo) on 2026-12-01T03:02:10Z. --- ## What The title's CRT runs as if it were the process's exe. At start it calls `_register_thread_local_exe_atexit_callback` (imported from `api-ms-win-crt-runtime-l1-1-0.dll`) to register the destructor of its `thread_local`s. The host UCRT accepts **one** such callback per process and calls `terminate()` on a second one. `victory.exe` registers its own callback as soon as it links any C++ code with `thread_local`s. The title's call is then the second one, and the start aborts with `0xC0000409` (`FAST_FAIL_FATAL_APP_EXIT` in `ucrtbase!abort`). We hit this when we linked the Tracy client (`tracing-tracy` / `tracy-client`). The same would happen with any other C++ dependency that has `thread_local`s. This PR resolves that import to our own function in `modules/kernel.rs`. The function: - keeps the first callback, and logs and ignores any later one instead of aborting; - queues itself once with the host CRT's `atexit`; - at exit, calls the title's callback once, as `callback(NULL, DLL_PROCESS_DETACH, NULL)`, which is what the UCRT does in `common_exit`. Builds without C++ `thread_local`s see no difference. The title's callback still runs at exit, now from the exit table instead of the UCRT's single slot. ## Prior art - Other projects hit the same CRT rule: - [ProjectLeonida/mandy#1564](https://github.com/ProjectLeonida/mandy/pull/1564) (merged) makes the game's thread-local exit callback and `at_quick_exit` handlers the runtime's own. - [xcl-dev/xcl#2500](https://github.com/xcl-dev/xcl/pull/2500) resolves the import to a no-op when it adds Tracy. - I found neither before writing this. Neither is in VIctory or Vice-Tay. - This version keeps the callback and runs it at exit, as the UCRT would, instead of dropping it. ## How it was found `cdb`, breakpoint on `ucrtbase!register_thread_local_exe_atexit_callback`: | build | calls | callers | result | |---|---|---|---| | with the `tracy` feature | 2 | `victory!__scrt_common_main_seh`, then the title's CRT (called from the loader) | the second call aborts | | without it | 1 | the title's CRT | runs | | with it, plus this change | 1 | `victory!__scrt_common_main_seh` only | runs, reaches gameplay | ## Tests - On current `main` (`0d692a31`), with the one-line test fix of #487 applied (`apu.rs`, needed for `cargo test -p victory-hle` to compile): `cargo test -p victory-hle --lib`: 424 passed, 1 failed. The failure is `xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it`, which passes when run alone, 3 times out of 3, also on `main` without this change: it is timing-sensitive under the full parallel run. New `title_tls_exit_callback_is_kept_not_passed_to_the_host` checks that: - the import resolves to HLE; - a second registration is ignored; - the callback runs once with `DLL_PROCESS_DETACH`. Tested on: Windows 11, Ryzen 7 5700X3D, RX 7800 XT, Series S 1.0.2.1. A release build with the Tracy client linked now starts and reaches the prison cell, where it previously died at 1.5 s. — El_Santo AI-assisted: yes
chatgpt-codex-connector[bot] commented 2026-12-01 03:02:19 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:02:19Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T03:11:52.258815Z dedbdb4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7299255436 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#issuecomment-7299255436). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:02:19Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"dedbdb4b92f7b97fd17426a39e550d4301b2a3c1","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-12-01T03:11:52.258815Z">2026-12-01T03:11:52.258815Z</relative-time> | `dedbdb4` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
chatgpt-codex-connector[bot] commented 2026-12-01 03:11:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:11:49Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dedbdb4b92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review:6124504320 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#pullrequestreview-6124504320). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:11:49Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `dedbdb4b92` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] commented 2026-12-01 03:11:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:11:49Z.

Code review location: docs/tests.md; line 19

@@ -0,0 +1,103 @@
+# Tests
+
+How changes to this tree are tested on the test PC the README describes, and
+what each recent session played and measured. Newest first.
+
+## How a session is run
+
+- **Build.** A diagnostics build (`cargo build --profile diag -p victory
+  --features diagnostics`), its shaders translated ahead with `victory shaders`.
+- **Launch.** `scripts\play.ps1 -Console series-s` with the RTX 4090 settings,
+  in full screen, the performance panel on. Nothing else compiles meanwhile; one
+  game runs at a time.
+- **Play.** Either by hand, through scripted pad input sent while watching a
+  capture after every move, or by a scripted route (walk, run, turn the camera,
+  step aside). Take a capture every minute and record the full verification
+  from the game window on the card's encoder.
+- **Measure.** fps and the frame's parts from the game's own once-a-second frame
+  lines in the world (lines with over 1,000 draws a frame); the game's memory,
+  the card's memory, load, power and temperature sampled every 20 s.

P1 Badge Use the required frame-level acceptance procedure

When this section is used to validate a change, the Series S launch and once-a-second summaries cannot establish the acceptance conditions in AGENTS.md: Series X, 3840×2160 with RT, a bracketed controllable-boat route, and individual frame intervals with counts above 50/30/15 ms. Filtering summaries by draw count can include cinematics and cannot reveal individual stalls or produce the required frame-based 1% low. Document the canonical per-present trace procedure and label the Series S sessions as historical, non-acceptance measurements.

AGENTS.md reference: AGENTS.md:L51-L54

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4748750719 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#discussion_r4748750719). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:11:49Z. **Code review location:** `docs/tests.md`; line 19 ~~~~diff @@ -0,0 +1,103 @@ +# Tests + +How changes to this tree are tested on the test PC the README describes, and +what each recent session played and measured. Newest first. + +## How a session is run + +- **Build.** A diagnostics build (`cargo build --profile diag -p victory + --features diagnostics`), its shaders translated ahead with `victory shaders`. +- **Launch.** `scripts\play.ps1 -Console series-s` with the RTX 4090 settings, + in full screen, the performance panel on. Nothing else compiles meanwhile; one + game runs at a time. +- **Play.** Either by hand, through scripted pad input sent while watching a + capture after every move, or by a scripted route (walk, run, turn the camera, + step aside). Take a capture every minute and record the full verification + from the game window on the card's encoder. +- **Measure.** fps and the frame's parts from the game's own once-a-second frame + lines in the world (lines with over 1,000 draws a frame); the game's memory, + the card's memory, load, power and temperature sampled every 20 s. ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Use the required frame-level acceptance procedure** When this section is used to validate a change, the Series S launch and once-a-second summaries cannot establish the acceptance conditions in `AGENTS.md`: Series X, 3840×2160 with RT, a bracketed controllable-boat route, and individual frame intervals with counts above 50/30/15 ms. Filtering summaries by draw count can include cinematics and cannot reveal individual stalls or produce the required frame-based 1% low. Document the canonical per-present trace procedure and label the Series S sessions as historical, non-acceptance measurements. AGENTS.md reference: [AGENTS.md:L51-L54](https://github.com/TaynanGT/Vice-Tay/blob/dedbdb4b92f7b97fd17426a39e550d4301b2a3c1/AGENTS.md#L51-L54) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-12-01 03:11:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:11:49Z.

Code review location: README.md; line 77

@@ -1,616 +1,243 @@
-# VIctory on NVIDIA
-
-> **Reporting a problem?** Please attach **both** logs from the run that went
-> wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address
-> bar of File Explorer for the default paths below. With `VICTORY_HOME` set,
-> look for `logs` there. `victory.exe config` shows the active `data_dir` for crash logs.
->
-> 1. **The play log**, in `%LOCALAPPDATA%\victory\logs\`: the newest
->    `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or
->    `victory-nvidia-<date>-<time>.log` (from the script launcher). The window
->    shows its path at the start, on the line `Log: ...`.
-> 2. **The crash log**: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and,
->    if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log`
->    in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`.
->
-> Also say which GPU, Windows version (10 or 11) and release you used.
->
-> Many errors already have an answer in
-> [docs/troubleshooting.md](docs/troubleshooting.md): look there first.
-
-## Frame generation: what your card supports
-
-| Your card | Frame generation | Limits |
-| --- | --- | --- |
-| GeForce RTX 40 and RTX 50 | **DLSS frame generation** | 2x on RTX 40; more than 2x (up to 6x) needs an RTX 50 |
-| GeForce RTX 20 and RTX 30 | **AMD FSR 3 frame generation**, or **DLSS multi frame generation (MFG) through the [MFG Unlocker](https://github.com/dashdogy/MFG-Unlocker) mod** (F1, MFG UNLOCKER; see [below](#mfg-unlocker)) | FSR 3: **2x at most**. MFG Unlocker: a third-party mod, not made or supported by NVIDIA or by this fork; NVIDIA itself offers DLSS frame generation only on RTX 40 and later. DLSS upscaling works on these cards either way, so the Series X profile is fine |
-| Other cards (no DLSS) | **None** | FSR 3 frame generation needs DLSS upscaling on, on both consoles |
-
-- **At every start the game tells you** which one your card runs, and why
-  not if it can't, at the top of the picture for the first 30 seconds (and
-  in the console window).
-- **F1 menu, FRAME GEN TYPE**: AUTO (DLSS where the card has it, else FSR 3),
-  DLSS, or FSR 3 (also on an RTX 40/50, if you prefer it). FRAME GENERATION
-  switches it off or on.
-- FSR 3 needs DLSS upscaling on, on both consoles (so does a Series S picture
-  other than 1280x720; with DLSS off the start says what was turned off).
-- FSR 3 needs AMD's FidelityFX DLLs (`amd_fidelityfx_loader_dx12.dll` and
-  `amd_fidelityfx_framegeneration_dx12.dll`, about 30 MB). They are AMD's and
-  not part of this program. On a card without DLSS frame generation (or with
-  FSR 3 chosen in F1) the first start of `victory.exe` asks once whether to
-  download them from AMD's own GitHub (the FidelityFX SDK);
-  `victory.exe get-fsr` does it later, and `Get-AMD-FSR.cmd` does it for the
-  script launcher. Each file is checked against the copy this fork was tested
-  with, and only loaded with AMD's valid signature. A `fidelityfx` folder next
-  to `victory.exe`, or `VICTORY_FIDELITYFX_DIR`, works too.
-
-## Quick start: how to run it
-
-**The easy way: one file, nothing to build**
-
-1. Download `victory.exe` from the
-   [latest release](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/latest).
-2. Put it into the folder of **your own dump** of the title's Xbox Series
-   build v1.0.2.1, next to `game_scarlett_master.exe`.
-3. Double-click it. Windows may say the publisher is unknown (the file is not
-   signed): "More info", then "Run anyway".
-
-Prompts follow the F1 settings only, nothing is detected: Xbox button prompts
-by default, keyboard keys when CONTROLS is KEYBOARD or MOUSE AND KEYBOARD is on.
-Animated hold prompts keep their original icons. A custom mouse-and-keyboard
-bindings file keeps the gamepad pictures.
-
-- The first start asks once whether to download NVIDIA's DLSS and frame
-  generation files (about 70 MB) from NVIDIA's own GitHub. They are NVIDIA's
-  and are not part of this program; say no and the game still runs, with its
-  own upscaling and no frame generation.
-- Settings, saves, caches, logs and NVIDIA's and AMD's files are kept under
-  `%LOCALAPPDATA%\victory`. The one exception is on Windows 10. Its own Direct3D 12
-  stops at shader model 6.5, and the game's translated shaders need 6.6. Without
-  6.6 the game shows a black screen and closes within seconds. So the first start
-  there offers to fetch Microsoft's newer Direct3D 12 runtime (the D3D12 Agility
-  SDK, `D3D12Core.dll`, about 22 MB from nuget.org). It goes into a `D3D12`
-  folder beside `victory.exe`. `victory.exe get-d3d12` does the same by hand,
-  `Get-D3D12.cmd` does it for a build of your own (into `target\release\D3D12`),
-  and `scripts\play-foxhound.ps1` (with `play-nvidia.ps1` and `PLAY_FRAMEGEN.cmd`)
-  runs it when that folder is missing and no device runs shader model 6.6.
-  The file is checked against Microsoft's signature and the tested SHA-256.
-  Windows 11 keeps using its own runtime. A `D3D12` folder that is already
-  there, for example from a repack or another guide (1.618, 1.620), is used
-  at the version of its `D3D12Core.dll`. Before v2026.11.27.6 that version
-  had to be 1.614, or Windows refused Direct3D 12 with `0x887E0003` (the
-  fix in .4 and .5 did not take effect).
-- To use another drive, set `$env:VICTORY_HOME = 'E:\VIctory Data'` in
-  PowerShell, then run `.\victory.exe config` in that window to check the cache
-  and save directories. For future launches, run `setx VICTORY_HOME "E:\VIctory Data"`
-  and open a fresh terminal from Start. Use an absolute path outside the repository.
-  VIctory creates missing directories. Existing files stay in their original location.
-  To keep using existing saves, copy the `data` folder with the game closed or
-  point `VICTORY_DATA_DIR` at the existing folder.
-- `VICTORY_CACHE_DIR` and `VICTORY_DATA_DIR` each override the corresponding
-  `[paths]` entry in `victory.toml`. Those entries take precedence over the
-  `cache` and `data` defaults under `VICTORY_HOME`. The Pareto launcher uses
-  `cache-pareto` unless `VICTORY_CACHE_DIR` is set. GPU drivers and third-party
-  SDKs manage their own internal caches separately.
-- You need Windows 10 or 11, 32 GB of RAM or more, an SSD and an NVIDIA
-  GeForce RTX card with a recent driver. This repository and its releases
-  contain no game files.
-- **The first start of each new version makes every shader first.** A new
-  `victory.exe`, with DLSS frame generation on, runs at about 14 fps on its first
-  start and normally from then on. So the first start translates and builds
-  every shader before the game's first frame, says so on the console, and then
-  plays at the usual frame rate. It takes a while, and it doesn't happen again
-  for that version (a mark is kept in `%LOCALAPPDATA%\victory\warmed`). The
-  older behaviour, play ten seconds and start the game again, is still there:
-  `--set VICTORY_WARMUP_RESTART=10`.
-- <a id="mfg-unlocker"></a>**RTX 20 and 30 cards: DLSS multi frame generation
-  (MFG) works through the [MFG Unlocker](https://github.com/dashdogy/MFG-Unlocker)
-  mod.** The fork supports loading it, but the mod is someone else's: it is not
-  made or supported by NVIDIA (whose DLSS frame generation is for RTX 40 and
-  later) or by this fork, and we have not tested it on an RTX 20 or 30
-  ourselves. It is an option, off by default: **F1, MFG UNLOCKER, ON**, then
-  restart. On, the next start
-  downloads it by itself from the mod's own GitHub release (v1.7.2, about 5 MB,
-  checked against the SHA-256 its author published) into
-  `%LOCALAPPDATA%\victory\mfg-unlocker`, and every start loads it. Nothing is
-  renamed or copied. The script launcher loads it too
-  (`scripts\play-foxhound.ps1`, and Steam through it): before, only
-  `victory play` did, so a start from the script carried the switch and no mod.
-  What it unlocks is DLSS frame generation, so **DLSS has to be on and FRAME
-  GENERATION at 2X or more**; with frame generation off, or FSR 3 picked, the
-  mod is left out rather than loaded for nothing, and the start says so.
-  Generated frames appear only in the game itself, with its window focused —
-  not on the title screen or while loading. The start's notice then reads
-  `FRAME GEN: DLSS, UNLOCKED BY A MOD`. On an RTX 20 or 30 the first start also asks once (No unless
-  you type y). `victory.exe get-mfg` downloads it by hand. The mod writes its own
-  `RTXMFG-...` logs and settings beside `victory.exe`, and Backspace opens its
-  menu. The start's notice says "UNLOCKED BY A MOD" and the log says it was
-  loaded. If the game crashes or frame generation fails, turn it off in F1 (or
-  add `VICTORY_MFG_UNLOCKER=` to `%LOCALAPPDATA%\victory\victory-settings.txt`).
-  FSR 3 frame generation (2x) is the fully supported way on those cards. A
-  `winmm.dll` copy of the mod beside `victory.exe` still works too.
-- RTX 20 and 30 cards can also run
-  [DLSS Enabler](https://www.nexusmods.com/site/mods/757) (not ours either;
-  tried on an RTX 2080 with the script launcher): frame generation from 2x to
-  6x by Streamline's count. It takes four steps of set-up and has known faults,
-  in [docs/dlss.md](docs/dlss.md#rtx-20-and-30-cards-dlss-enabler-a-mod-not-ours).
-
-**Choosing a GPU on a PC with more than one**
-
-If VIctory picks a different GPU than you intended, open PowerShell in the
-folder containing `victory.exe`. Set `VICTORY_ADAPTER` and launch from the same
-window.
+# Vice-Tay
+
+> [!NOTE]
+> **Development has resumed.** I'm back at work on Vice-Tay as of Monday, November 30.
+
+**Xbox Series compatibility on Windows, tuned on a GeForce RTX 4090.**
+
+Vice-Tay builds on [VIctory](https://github.com/Marvisak/VIctory) to run an Xbox Series title from your own files. The title's x86-64 code runs on the host CPU. The compatibility layer provides the console APIs it calls and translates its graphics work to Direct3D 12.
+
+[Quick start](#getting-started) · [Measurements](#measurements) · [Measurements on GitHub Pages](https://taynangt.github.io/Vice-Tay/)
+
+## Measurements
+
+The goal is **30 rendered FPS in the open world with correct visuals**.
+
+### Series S boat test at 4K
+
+On November 27, 2026, I repeated the same boat route with two local builds. Both used DLSS Quality (2560 × 1440 → 3840 × 2160) and AMD 2× frame generation. Each result averages about 39 seconds of telemetry.
+
+| Build | Rendered FPS | Generated FPS | Presented FPS |
+| --- | ---: | ---: | ---: |
+| 4K reference · `e9a30f4f` | 16.12 | 16.12 | 32.25 |
+| 4K experimental · `424fb3f6` | **26.72** | 26.72 | **53.44** |
+
+The experimental build reached a median of 27.80 rendered FPS across the sampled intervals. The Series S 4K option is under review in [PR #329](https://github.com/TaynanGT/Vice-Tay/pull/329).
+
+[4K settings, frame counts and percentiles](docs/measurements.md#series-s-4k-boat-test)
+
+### Earlier Series S measurements
+
+| Session | Result |
+| --- | --- |
+| **1080p GPU read-through test** | An on/off test with the boat stationary went from **22.60 to 26.38 rendered FPS** and **45.13 to 52.78 presented FPS**. |
+| **6-minute frame generation test** · `88e80129` | Medians of **22.4 rendered FPS** and **44.9 presented FPS** in a separate 1080p test with 2× frame generation. |
+| **30-minute playtest** · `bc090416` | Median of **21.1 rendered FPS** and a 17.0 FPS 1% low across the prologue, the boat section and traversal on foot. |
+
+[1080p comparison](docs/measurements.md#series-s-1080p-gpu-read-through) · [Frame generation test](docs/measurements.md#series-s-frame-generation) · [30-minute playtest](docs/measurements.md#series-s-baseline)
+
+**Test PC** · RTX 4090 (24 GB), Ryzen 9 9950X3D, 48 GiB DDR5, Windows 11 Pro x64
+
+<details>
+<summary>Full test configuration</summary>
+
+| Component | Configuration |
+| --- | --- |
+| CPU and motherboard | AMD Ryzen 9 9950X3D (16 cores, 32 threads), MSI MAG X870 TOMAHAWK WIFI (MS-7E51), BIOS 1.A93 |
+| Graphics | NVIDIA GeForce RTX 4090 (24 GB GDDR6X, driver 621.40), integrated AMD Radeon Graphics |
+| Memory | 2 × 24 GiB DDR5 at 8,000 MT/s, 43.4 GiB visible to Windows, 128 GiB page file |
+| Storage | Samsung 990 PRO 4 TB and 2 TB, Samsung 970 PRO 1 TB |
+| Display | Samsung Odyssey OLED G8 (G81SF), 3840 × 2160 at 240 Hz |
+| OS | Windows 11 Pro 26H2 x64, build 26300.10075 |
+
+</details>
+
+In the 30-minute playtest, checkpoint retries worked after the boat ran aground. The HUD, minimap, mission prompts and pause menu were usable along the route.
+
+## Getting started
+
+**Requirements.** Windows 10 or 11 x64, an AVX2-capable CPU, a Direct3D 12 GPU with Shader Model 6.6 and mesh shader support, Rust, and MSVC build tools with a Windows SDK. Rust uses the version pinned in [`rust-toolchain.toml`](rust-toolchain.toml).
+
+> [!IMPORTANT]
+> Bring your own copy of the title. Keep the executable, game data and derived cache outside this checkout. See the [asset policy](docs/asset-policy.md).
+> The runtime reports unverified game and package licences as inactive. A title that requires a verified licence may stop at startup.
+
+1. Clone the repository and copy the configuration template.
+
+   ```powershell
+   git clone https://github.com/TaynanGT/Vice-Tay.git
+   Set-Location Vice-Tay
+   Copy-Item .\victory.example.toml .\victory.toml
+   ```
+
+2. Set `game_dir` in `victory.toml` to the directory containing your title files. Build the diagnostics executable and launch the Series S profile with the path to your executable.
+
+   ```powershell
+   cargo build --locked --profile diag -p victory --features diagnostics
+   .\scripts\play.ps1 -Exe 'D:\victory-data\game\game.exe' -Console series-s

P1 Badge Use supported parameters in the quick-start command

Following this quick start fails before launching the title because scripts/play.ps1 has no Console parameter. Its own usage documents scripts\play.ps1 -Exe <path of your own copy's executable>, and its parameter block at lines 15–21 accepts only Exe, Safe, RayTracing, Build, and More; line 47 already hard-codes --console series-s. The new -Machine and upscaler examples likewise target parameters absent from this script. Update the examples to the checked-in launcher API or include the corresponding launcher implementation.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4748750725 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#discussion_r4748750725). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:11:49Z. **Code review location:** `README.md`; line 77 ~~~~diff @@ -1,616 +1,243 @@ -# VIctory on NVIDIA - -> **Reporting a problem?** Please attach **both** logs from the run that went -> wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address -> bar of File Explorer for the default paths below. With `VICTORY_HOME` set, -> look for `logs` there. `victory.exe config` shows the active `data_dir` for crash logs. -> -> 1. **The play log**, in `%LOCALAPPDATA%\victory\logs\`: the newest -> `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or -> `victory-nvidia-<date>-<time>.log` (from the script launcher). The window -> shows its path at the start, on the line `Log: ...`. -> 2. **The crash log**: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, -> if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` -> in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. -> -> Also say which GPU, Windows version (10 or 11) and release you used. -> -> Many errors already have an answer in -> [docs/troubleshooting.md](docs/troubleshooting.md): look there first. - -## Frame generation: what your card supports - -| Your card | Frame generation | Limits | -| --- | --- | --- | -| GeForce RTX 40 and RTX 50 | **DLSS frame generation** | 2x on RTX 40; more than 2x (up to 6x) needs an RTX 50 | -| GeForce RTX 20 and RTX 30 | **AMD FSR 3 frame generation**, or **DLSS multi frame generation (MFG) through the [MFG Unlocker](https://github.com/dashdogy/MFG-Unlocker) mod** (F1, MFG UNLOCKER; see [below](#mfg-unlocker)) | FSR 3: **2x at most**. MFG Unlocker: a third-party mod, not made or supported by NVIDIA or by this fork; NVIDIA itself offers DLSS frame generation only on RTX 40 and later. DLSS upscaling works on these cards either way, so the Series X profile is fine | -| Other cards (no DLSS) | **None** | FSR 3 frame generation needs DLSS upscaling on, on both consoles | - -- **At every start the game tells you** which one your card runs, and why - not if it can't, at the top of the picture for the first 30 seconds (and - in the console window). -- **F1 menu, FRAME GEN TYPE**: AUTO (DLSS where the card has it, else FSR 3), - DLSS, or FSR 3 (also on an RTX 40/50, if you prefer it). FRAME GENERATION - switches it off or on. -- FSR 3 needs DLSS upscaling on, on both consoles (so does a Series S picture - other than 1280x720; with DLSS off the start says what was turned off). -- FSR 3 needs AMD's FidelityFX DLLs (`amd_fidelityfx_loader_dx12.dll` and - `amd_fidelityfx_framegeneration_dx12.dll`, about 30 MB). They are AMD's and - not part of this program. On a card without DLSS frame generation (or with - FSR 3 chosen in F1) the first start of `victory.exe` asks once whether to - download them from AMD's own GitHub (the FidelityFX SDK); - `victory.exe get-fsr` does it later, and `Get-AMD-FSR.cmd` does it for the - script launcher. Each file is checked against the copy this fork was tested - with, and only loaded with AMD's valid signature. A `fidelityfx` folder next - to `victory.exe`, or `VICTORY_FIDELITYFX_DIR`, works too. - -## Quick start: how to run it - -**The easy way: one file, nothing to build** - -1. Download `victory.exe` from the - [latest release](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/latest). -2. Put it into the folder of **your own dump** of the title's Xbox Series - build v1.0.2.1, next to `game_scarlett_master.exe`. -3. Double-click it. Windows may say the publisher is unknown (the file is not - signed): "More info", then "Run anyway". - -Prompts follow the F1 settings only, nothing is detected: Xbox button prompts -by default, keyboard keys when CONTROLS is KEYBOARD or MOUSE AND KEYBOARD is on. -Animated hold prompts keep their original icons. A custom mouse-and-keyboard -bindings file keeps the gamepad pictures. - -- The first start asks once whether to download NVIDIA's DLSS and frame - generation files (about 70 MB) from NVIDIA's own GitHub. They are NVIDIA's - and are not part of this program; say no and the game still runs, with its - own upscaling and no frame generation. -- Settings, saves, caches, logs and NVIDIA's and AMD's files are kept under - `%LOCALAPPDATA%\victory`. The one exception is on Windows 10. Its own Direct3D 12 - stops at shader model 6.5, and the game's translated shaders need 6.6. Without - 6.6 the game shows a black screen and closes within seconds. So the first start - there offers to fetch Microsoft's newer Direct3D 12 runtime (the D3D12 Agility - SDK, `D3D12Core.dll`, about 22 MB from nuget.org). It goes into a `D3D12` - folder beside `victory.exe`. `victory.exe get-d3d12` does the same by hand, - `Get-D3D12.cmd` does it for a build of your own (into `target\release\D3D12`), - and `scripts\play-foxhound.ps1` (with `play-nvidia.ps1` and `PLAY_FRAMEGEN.cmd`) - runs it when that folder is missing and no device runs shader model 6.6. - The file is checked against Microsoft's signature and the tested SHA-256. - Windows 11 keeps using its own runtime. A `D3D12` folder that is already - there, for example from a repack or another guide (1.618, 1.620), is used - at the version of its `D3D12Core.dll`. Before v2026.11.27.6 that version - had to be 1.614, or Windows refused Direct3D 12 with `0x887E0003` (the - fix in .4 and .5 did not take effect). -- To use another drive, set `$env:VICTORY_HOME = 'E:\VIctory Data'` in - PowerShell, then run `.\victory.exe config` in that window to check the cache - and save directories. For future launches, run `setx VICTORY_HOME "E:\VIctory Data"` - and open a fresh terminal from Start. Use an absolute path outside the repository. - VIctory creates missing directories. Existing files stay in their original location. - To keep using existing saves, copy the `data` folder with the game closed or - point `VICTORY_DATA_DIR` at the existing folder. -- `VICTORY_CACHE_DIR` and `VICTORY_DATA_DIR` each override the corresponding - `[paths]` entry in `victory.toml`. Those entries take precedence over the - `cache` and `data` defaults under `VICTORY_HOME`. The Pareto launcher uses - `cache-pareto` unless `VICTORY_CACHE_DIR` is set. GPU drivers and third-party - SDKs manage their own internal caches separately. -- You need Windows 10 or 11, 32 GB of RAM or more, an SSD and an NVIDIA - GeForce RTX card with a recent driver. This repository and its releases - contain no game files. -- **The first start of each new version makes every shader first.** A new - `victory.exe`, with DLSS frame generation on, runs at about 14 fps on its first - start and normally from then on. So the first start translates and builds - every shader before the game's first frame, says so on the console, and then - plays at the usual frame rate. It takes a while, and it doesn't happen again - for that version (a mark is kept in `%LOCALAPPDATA%\victory\warmed`). The - older behaviour, play ten seconds and start the game again, is still there: - `--set VICTORY_WARMUP_RESTART=10`. -- <a id="mfg-unlocker"></a>**RTX 20 and 30 cards: DLSS multi frame generation - (MFG) works through the [MFG Unlocker](https://github.com/dashdogy/MFG-Unlocker) - mod.** The fork supports loading it, but the mod is someone else's: it is not - made or supported by NVIDIA (whose DLSS frame generation is for RTX 40 and - later) or by this fork, and we have not tested it on an RTX 20 or 30 - ourselves. It is an option, off by default: **F1, MFG UNLOCKER, ON**, then - restart. On, the next start - downloads it by itself from the mod's own GitHub release (v1.7.2, about 5 MB, - checked against the SHA-256 its author published) into - `%LOCALAPPDATA%\victory\mfg-unlocker`, and every start loads it. Nothing is - renamed or copied. The script launcher loads it too - (`scripts\play-foxhound.ps1`, and Steam through it): before, only - `victory play` did, so a start from the script carried the switch and no mod. - What it unlocks is DLSS frame generation, so **DLSS has to be on and FRAME - GENERATION at 2X or more**; with frame generation off, or FSR 3 picked, the - mod is left out rather than loaded for nothing, and the start says so. - Generated frames appear only in the game itself, with its window focused — - not on the title screen or while loading. The start's notice then reads - `FRAME GEN: DLSS, UNLOCKED BY A MOD`. On an RTX 20 or 30 the first start also asks once (No unless - you type y). `victory.exe get-mfg` downloads it by hand. The mod writes its own - `RTXMFG-...` logs and settings beside `victory.exe`, and Backspace opens its - menu. The start's notice says "UNLOCKED BY A MOD" and the log says it was - loaded. If the game crashes or frame generation fails, turn it off in F1 (or - add `VICTORY_MFG_UNLOCKER=` to `%LOCALAPPDATA%\victory\victory-settings.txt`). - FSR 3 frame generation (2x) is the fully supported way on those cards. A - `winmm.dll` copy of the mod beside `victory.exe` still works too. -- RTX 20 and 30 cards can also run - [DLSS Enabler](https://www.nexusmods.com/site/mods/757) (not ours either; - tried on an RTX 2080 with the script launcher): frame generation from 2x to - 6x by Streamline's count. It takes four steps of set-up and has known faults, - in [docs/dlss.md](docs/dlss.md#rtx-20-and-30-cards-dlss-enabler-a-mod-not-ours). - -**Choosing a GPU on a PC with more than one** - -If VIctory picks a different GPU than you intended, open PowerShell in the -folder containing `victory.exe`. Set `VICTORY_ADAPTER` and launch from the same -window. +# Vice-Tay + +> [!NOTE] +> **Development has resumed.** I'm back at work on Vice-Tay as of Monday, November 30. + +**Xbox Series compatibility on Windows, tuned on a GeForce RTX 4090.** + +Vice-Tay builds on [VIctory](https://github.com/Marvisak/VIctory) to run an Xbox Series title from your own files. The title's x86-64 code runs on the host CPU. The compatibility layer provides the console APIs it calls and translates its graphics work to Direct3D 12. + +[Quick start](#getting-started) · [Measurements](#measurements) · [Measurements on GitHub Pages](https://taynangt.github.io/Vice-Tay/) + +## Measurements + +The goal is **30 rendered FPS in the open world with correct visuals**. + +### Series S boat test at 4K + +On November 27, 2026, I repeated the same boat route with two local builds. Both used DLSS Quality (2560 × 1440 → 3840 × 2160) and AMD 2× frame generation. Each result averages about 39 seconds of telemetry. + +| Build | Rendered FPS | Generated FPS | Presented FPS | +| --- | ---: | ---: | ---: | +| 4K reference · `e9a30f4f` | 16.12 | 16.12 | 32.25 | +| 4K experimental · `424fb3f6` | **26.72** | 26.72 | **53.44** | + +The experimental build reached a median of 27.80 rendered FPS across the sampled intervals. The Series S 4K option is under review in [PR #329](https://github.com/TaynanGT/Vice-Tay/pull/329). + +[4K settings, frame counts and percentiles](docs/measurements.md#series-s-4k-boat-test) + +### Earlier Series S measurements + +| Session | Result | +| --- | --- | +| **1080p GPU read-through test** | An on/off test with the boat stationary went from **22.60 to 26.38 rendered FPS** and **45.13 to 52.78 presented FPS**. | +| **6-minute frame generation test** · `88e80129` | Medians of **22.4 rendered FPS** and **44.9 presented FPS** in a separate 1080p test with 2× frame generation. | +| **30-minute playtest** · `bc090416` | Median of **21.1 rendered FPS** and a 17.0 FPS 1% low across the prologue, the boat section and traversal on foot. | + +[1080p comparison](docs/measurements.md#series-s-1080p-gpu-read-through) · [Frame generation test](docs/measurements.md#series-s-frame-generation) · [30-minute playtest](docs/measurements.md#series-s-baseline) + +**Test PC** · RTX 4090 (24 GB), Ryzen 9 9950X3D, 48 GiB DDR5, Windows 11 Pro x64 + +<details> +<summary>Full test configuration</summary> + +| Component | Configuration | +| --- | --- | +| CPU and motherboard | AMD Ryzen 9 9950X3D (16 cores, 32 threads), MSI MAG X870 TOMAHAWK WIFI (MS-7E51), BIOS 1.A93 | +| Graphics | NVIDIA GeForce RTX 4090 (24 GB GDDR6X, driver 621.40), integrated AMD Radeon Graphics | +| Memory | 2 × 24 GiB DDR5 at 8,000 MT/s, 43.4 GiB visible to Windows, 128 GiB page file | +| Storage | Samsung 990 PRO 4 TB and 2 TB, Samsung 970 PRO 1 TB | +| Display | Samsung Odyssey OLED G8 (G81SF), 3840 × 2160 at 240 Hz | +| OS | Windows 11 Pro 26H2 x64, build 26300.10075 | + +</details> + +In the 30-minute playtest, checkpoint retries worked after the boat ran aground. The HUD, minimap, mission prompts and pause menu were usable along the route. + +## Getting started + +**Requirements.** Windows 10 or 11 x64, an AVX2-capable CPU, a Direct3D 12 GPU with Shader Model 6.6 and mesh shader support, Rust, and MSVC build tools with a Windows SDK. Rust uses the version pinned in [`rust-toolchain.toml`](rust-toolchain.toml). + +> [!IMPORTANT] +> Bring your own copy of the title. Keep the executable, game data and derived cache outside this checkout. See the [asset policy](docs/asset-policy.md). +> The runtime reports unverified game and package licences as inactive. A title that requires a verified licence may stop at startup. + +1. Clone the repository and copy the configuration template. + + ```powershell + git clone https://github.com/TaynanGT/Vice-Tay.git + Set-Location Vice-Tay + Copy-Item .\victory.example.toml .\victory.toml + ``` + +2. Set `game_dir` in `victory.toml` to the directory containing your title files. Build the diagnostics executable and launch the Series S profile with the path to your executable. + + ```powershell + cargo build --locked --profile diag -p victory --features diagnostics + .\scripts\play.ps1 -Exe 'D:\victory-data\game\game.exe' -Console series-s ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Use supported parameters in the quick-start command** Following this quick start fails before launching the title because `scripts/play.ps1` has no `Console` parameter. Its own usage documents `scripts\play.ps1 -Exe <path of your own copy's executable>`, and its parameter block at lines 15–21 accepts only `Exe`, `Safe`, `RayTracing`, `Build`, and `More`; line 47 already hard-codes `--console series-s`. The new `-Machine` and upscaler examples likewise target parameters absent from this script. Update the examples to the checked-in launcher API or include the corresponding launcher implementation. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-12-01 03:11:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:11:49Z.

Code review location: crates/victory-hle/src/modules/kernel.rs; line 427

@@ -392,6 +392,57 @@ pub extern "C" fn terminate() -> ! {
     host::abort()
 }
 
+/// The destructor of the title's `thread_local`s, registered by its CRT (0:
+/// none yet).
+static TITLE_TLS_EXIT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
+
+unsafe extern "C" {
+    #[link_name = "atexit"]
+    fn crt_atexit(f: extern "C" fn()) -> i32;
+}
+
+/// The CRT's `_register_thread_local_exe_atexit_callback`: the title's CRT
+/// thinks it is the exe and registers the destructor of its `thread_local`s.
+///
+/// The host CRT takes one such callback per process and aborts on a second
+/// one, and the exe is ours: as soon as our exe has C++ `thread_local`s of its
+/// own (Tracy's client, or any other C++ library), it registers first and the
+/// title's registration aborts the start (0xC0000409 in
+/// `ucrtbase!terminate`). So the title's callback is kept here and called at
+/// exit, from the host CRT's exit table, as the host CRT would have called it.
+pub extern "C" fn _register_thread_local_exe_atexit_callback(callback: usize) {
+    use std::sync::atomic::Ordering;
+    if callback == 0 {
+        return;
+    }
+    if TITLE_TLS_EXIT
+        .compare_exchange(0, callback, Ordering::SeqCst, Ordering::SeqCst)
+        .is_err()
+    {
+        // The host CRT would abort here; the first one is kept.
+        tracing::warn!(from = %host::callers(), "title registers a second thread_local exit callback: ignored");
+        return;
+    }
+    // SAFETY: registers a plain function with the host CRT's exit table.
+    if unsafe { crt_atexit(run_title_tls_exit) } != 0 {

P2 Badge Run title TLS destructors before ordinary exit handlers

On normal exit(), UCRT invokes the EXE TLS callback before executing its atexit table. Enqueuing the callback here instead makes every cleanup registered later run before the title's TLS destructors. For example, a function-local static initialized during gameplay can be destroyed before a title thread_local destructor that still uses it, introducing use-after-destruction or shutdown crashes even without Tracy. Preserve the pre-atexit ordering and cover it with a process-exit regression test; the current test invokes the callback runner directly and cannot detect this reversal.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4748750733 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#discussion_r4748750733). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:11:49Z. **Code review location:** `crates/victory-hle/src/modules/kernel.rs`; line 427 ~~~~diff @@ -392,6 +392,57 @@ pub extern "C" fn terminate() -> ! { host::abort() } +/// The destructor of the title's `thread_local`s, registered by its CRT (0: +/// none yet). +static TITLE_TLS_EXIT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); + +unsafe extern "C" { + #[link_name = "atexit"] + fn crt_atexit(f: extern "C" fn()) -> i32; +} + +/// The CRT's `_register_thread_local_exe_atexit_callback`: the title's CRT +/// thinks it is the exe and registers the destructor of its `thread_local`s. +/// +/// The host CRT takes one such callback per process and aborts on a second +/// one, and the exe is ours: as soon as our exe has C++ `thread_local`s of its +/// own (Tracy's client, or any other C++ library), it registers first and the +/// title's registration aborts the start (0xC0000409 in +/// `ucrtbase!terminate`). So the title's callback is kept here and called at +/// exit, from the host CRT's exit table, as the host CRT would have called it. +pub extern "C" fn _register_thread_local_exe_atexit_callback(callback: usize) { + use std::sync::atomic::Ordering; + if callback == 0 { + return; + } + if TITLE_TLS_EXIT + .compare_exchange(0, callback, Ordering::SeqCst, Ordering::SeqCst) + .is_err() + { + // The host CRT would abort here; the first one is kept. + tracing::warn!(from = %host::callers(), "title registers a second thread_local exit callback: ignored"); + return; + } + // SAFETY: registers a plain function with the host CRT's exit table. + if unsafe { crt_atexit(run_title_tls_exit) } != 0 { ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Run title TLS destructors before ordinary exit handlers** On normal `exit()`, UCRT invokes the EXE TLS callback before executing its `atexit` table. Enqueuing the callback here instead makes every cleanup registered later run before the title's TLS destructors. For example, a function-local static initialized during gameplay can be destroyed before a title `thread_local` destructor that still uses it, introducing use-after-destruction or shutdown crashes even without Tracy. Preserve the pre-`atexit` ordering and cover it with a process-exit regression test; the current test invokes the callback runner directly and cannot detect this reversal. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot] commented 2026-12-01 03:11:49 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by chatgpt-codex-connector[bot] on 2026-12-01T03:11:49Z.

Code review location: docs/replay.md; line 26

@@ -5,6 +5,39 @@ layer sends to the card, and the memory it reads) and run it again without
 the title, to see where the card's time goes and to try changes in seconds.
 Code: `crates/victory-gpu/src/replay`.
 
+## Inspect a dropped draw
+
+For one frame's operation listing, create the capture folder first. Use a
+diagnostics build and add the folder and frame number to your usual launch.
+
+```powershell
+-More @{VICTORY_CAPTURE='C:\captures\vice-tay'; VICTORY_CAPTURE_FRAMES='1000'}
+```
+
+Read `frame-1000-ops.txt` in the capture folder. A failed preparation for a
+direct draw, indexed draw or mesh dispatch includes the reason, pipeline
+recipe key and guest shader hashes when a pipeline was set. Draws that reach
+the GPU can still produce incorrect geometry, depth or materials.
+
+## Inspect the scene before frame generation
+
+With frame generation enabled, set `VICTORY_CAPTURE_SCENE_BEFORE_FRAMEGEN=1`
+and the capture folder above. List specific frames or create an empty
+`scene-next` file in that folder while the title is running. The next

P2 Badge Document a scene-capture path implemented by this runtime

This procedure never produces the promised scene-<frame>.png: a repository-wide search finds VICTORY_CAPTURE_SCENE_BEFORE_FRAMEGEN, scene-next, and scene-trace only in this new documentation. The implemented capture::poll_request consumes next-frame.request with VICTORY_CAPTURE_ON_REQUEST, while capture::save_as writes half-size frame-* images. Consequently, users following these instructions cannot obtain the claimed full-resolution pre-interpolation capture for visual comparisons. Document the supported capture behavior or include the scene-capture implementation with this how-to.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review-comment:4748750738 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/488#discussion_r4748750738). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-12-01T03:11:49Z. **Code review location:** `docs/replay.md`; line 26 ~~~~diff @@ -5,6 +5,39 @@ layer sends to the card, and the memory it reads) and run it again without the title, to see where the card's time goes and to try changes in seconds. Code: `crates/victory-gpu/src/replay`. +## Inspect a dropped draw + +For one frame's operation listing, create the capture folder first. Use a +diagnostics build and add the folder and frame number to your usual launch. + +```powershell +-More @{VICTORY_CAPTURE='C:\captures\vice-tay'; VICTORY_CAPTURE_FRAMES='1000'} +``` + +Read `frame-1000-ops.txt` in the capture folder. A failed preparation for a +direct draw, indexed draw or mesh dispatch includes the reason, pipeline +recipe key and guest shader hashes when a pipeline was set. Draws that reach +the GPU can still produce incorrect geometry, depth or materials. + +## Inspect the scene before frame generation + +With frame generation enabled, set `VICTORY_CAPTURE_SCENE_BEFORE_FRAMEGEN=1` +and the capture folder above. List specific frames or create an empty +`scene-next` file in that folder while the title is running. The next ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Document a scene-capture path implemented by this runtime** This procedure never produces the promised `scene-<frame>.png`: a repository-wide search finds `VICTORY_CAPTURE_SCENE_BEFORE_FRAMEGEN`, `scene-next`, and `scene-trace` only in this new documentation. The implemented `capture::poll_request` consumes `next-frame.request` with `VICTORY_CAPTURE_ON_REQUEST`, while `capture::save_as` writes half-size `frame-*` images. Consequently, users following these instructions cannot obtain the claimed full-resolution pre-interpolation capture for visual comparisons. Document the supported capture behavior or include the scene-capture implementation with this how-to. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/488:upstream-pr/488'
git switch 'upstream-pr/488'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/488'
git switch 'upstream-pr/488'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/488'
git switch 'upstream-pr/488'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/488'
git switch 'main'
git merge --squash 'upstream-pr/488'
git switch 'main'
git merge --ff-only 'upstream-pr/488'
git switch 'main'
git merge 'upstream-pr/488'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!488
No description provided.