Reuse completed state preludes in an opt-in pool #211

Manually merged
github merged 2 commits from github-bot/gh-211 into main 2026-11-27 11:56:30 +00:00 AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-27 10:12 UTC · original
TaynanGT:fix/reuse-state-preludes-93 → main · +140 −31 · 3 files · 2 commits · merged 2026-11-27 11:42 UTC

Use VICTORY_PRELUDE_POOL=1 to reuse the allocator and command list for lazy state preludes. Return each pair after the owning list's previous submissions have finished and its native reset succeeds. Keep a fixed cap of 128 idle pairs so sustained host memory pressure does not force new pairs every batch.

On the RX 6900 XT in #93, the isolated pool got through world load with the same driver, Series S save, relay settings and 720p output. The previous cap of 16 under pressure went from 810 to 5,848 total creations over about one minute after the host-list count settled. The fixed cap of 128 on d2e271d stayed at 155 creations for 67 seconds under persistent host memory pressure. The run ended by hand after about a minute and a half in the world. The gameplay paths differ, so the reported frame rates are observations from each run.

Windows default and diagnostics test suites and Clippy passed. The pool test checks that a pair stays unavailable to another list until the owner returns it. Adapted from kyokyotosh's prelude pool. Refs #93 and #138.

**@⁠TaynanGT** on GitHub · 2026-11-27 10:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/211) `TaynanGT:fix/reuse-state-preludes-93` → `main` · +140 −31 · 3 files · 2 commits · merged 2026-11-27 11:42 UTC Use `VICTORY_PRELUDE_POOL=1` to reuse the allocator and command list for lazy state preludes. Return each pair after the owning list's previous submissions have finished and its native reset succeeds. Keep a fixed cap of 128 idle pairs so sustained host memory pressure does not force new pairs every batch. On the RX 6900 XT in #93, the isolated pool got through world load with the same driver, Series S save, relay settings and 720p output. The previous cap of 16 under pressure went from 810 to 5,848 total creations over about one minute after the host-list count settled. The fixed cap of 128 on `d2e271d` stayed at 155 creations for 67 seconds under persistent host memory pressure. The run ended by hand after about a minute and a half in the world. The gameplay paths differ, so the reported frame rates are observations from each run. Windows default and diagnostics test suites and Clippy passed. The pool test checks that a pair stays unavailable to another list until the owner returns it. Adapted from [kyokyotosh's prelude pool](https://github.com/kyokyotosh/VIctory-6700XT/commit/63a773e4420bb7454e10052bd554467e01a07a69). Refs #93 and #138.
Recycle lazy prelude resources after the owning command list can safely reset and cap the idle pool under memory pressure.

Co-authored-by: kyokyotosh <[email protected]>
Use a fixed cap for idle state preludes. Sustained host RAM pressure otherwise made the RX 6900 XT run discard and recreate command allocators throughout the world.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 10:40:07 +00:00
github manually merged commit 57f3103537 into main 2026-11-27 11:56:30 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 11:43 UTC · original · edited 2026-11-27 11:44 UTC

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-11-27T11:43:39.750240Z d2e271d Draft marked ready
🔒 Security Review ✅ Completed 2026-11-27T11:44:57.967974Z d2e271d Draft marked ready
ℹ️ 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 11:43 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/211#issuecomment-7217393448) · edited 2026-11-27 11:44 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"d2e271d612117beebbfb1f5af4478f2f675cecc3","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":"d2e271d612117beebbfb1f5af4478f2f675cecc3","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"d2e271d612117beebbfb1f5af4478f2f675cecc3","mergeGateEnabled":false,"pullRequestNumber":211,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <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-11-27T11:43:39.750240Z">2026-11-27T11:43:39.750240Z</relative-time> | `d2e271d` | Draft marked ready | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-27T11:44:57.967974Z">2026-11-27T11:44:57.967974Z</relative-time> | `d2e271d` | Draft marked ready | <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>
Author
Owner

@⁠timorjay on GitHub · 2026-11-27 12:44 UTC · original

I ran the prelude pool off and on in the same Windows Sandbox on a GeForce RTX 5090 D v2 (driver 617.42), Ryzen 7 9800X3D, 32 GB host RAM. Both runs used the same diagnostics binary (a51fb9d plus this PR at d2e271d), same Series S starting save, same shader-cache snapshot, and a fresh host pipeline cache per run. The local settings included VICTORY_RELAY=2, VICTORY_TEXTURE_POOL=0, VICTORY_MAP_THREADS=1 and VICTORY_TEXTURE_STAGE_MS=12. Only VICTORY_PRELUDE_POOL changed between these two launches.

At the last frame report Pool off Pool on
Host command lists created 1,066 1,076
State preludes created 831 186

Both runs got through the office and displayed the city cashier tutorial. On both, holding LT changed the prompt from holding LT to aiming at the cashier. Both subsequently lost the device with 0x887A0020 in relay mode 2. The log showed one submission in flight (25 lists off, 7 on). The two routes spent different amounts of time in the prison. These are endpoint counts, and I would not infer a frame-rate gain from them. Reuse is observable on NVIDIA even though it did not resolve this later failure here.

I repeated the pool-on run with VICTORY_RELAY=0, keeping the other rendering settings, starting save and shader-cache seed the same. This time the player could walk, turn, aim, intimidate the cashier and pick up the cash. The subsequent police and family scenes rendered until the preset 30-minute observation limit. I found no 0x887A0020 in that run. The interactive interval from the first aim input to the cash pickup was 7 min 33 s. The game's 85 frame reports during that interval had a median of 7.4 rendered FPS and a tenth percentile of 6.5. Lighting remained overexposed and faces were missing in close-ups. This is one successful run in mode 0. The captures establish a difference in progression on this machine, but do not identify the underlying driver or runtime fault.

**@⁠timorjay** on GitHub · 2026-11-27 12:44 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/211#issuecomment-7218626007) I ran the prelude pool off and on in the same Windows Sandbox on a GeForce RTX 5090 D v2 (driver 617.42), Ryzen 7 9800X3D, 32 GB host RAM. Both runs used the same diagnostics binary (`a51fb9d` plus this PR at `d2e271d`), same Series S starting save, same shader-cache snapshot, and a fresh host pipeline cache per run. The local settings included `VICTORY_RELAY=2`, `VICTORY_TEXTURE_POOL=0`, `VICTORY_MAP_THREADS=1` and `VICTORY_TEXTURE_STAGE_MS=12`. Only `VICTORY_PRELUDE_POOL` changed between these two launches. | At the last frame report | Pool off | Pool on | | --- | ---: | ---: | | Host command lists created | 1,066 | 1,076 | | State preludes created | 831 | 186 | Both runs got through the office and displayed the city cashier tutorial. On both, holding LT changed the prompt from holding LT to aiming at the cashier. Both subsequently lost the device with `0x887A0020` in relay mode 2. The log showed one submission in flight (25 lists off, 7 on). The two routes spent different amounts of time in the prison. These are endpoint counts, and I would not infer a frame-rate gain from them. Reuse is observable on NVIDIA even though it did not resolve this later failure here. I repeated the pool-on run with `VICTORY_RELAY=0`, keeping the other rendering settings, starting save and shader-cache seed the same. This time the player could walk, turn, aim, intimidate the cashier and pick up the cash. The subsequent police and family scenes rendered until the preset 30-minute observation limit. I found no `0x887A0020` in that run. The interactive interval from the first aim input to the cash pickup was 7 min 33 s. The game's 85 frame reports during that interval had a median of 7.4 rendered FPS and a tenth percentile of 6.5. Lighting remained overexposed and faces were missing in close-ups. This is one successful run in mode 0. The captures establish a difference in progression on this machine, but do not identify the underlying driver or runtime fault.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 12:47 UTC · original

@⁠timorjay The 831 to 186 prelude count shows reuse on this NVIDIA setup. Both relay-2 runs still lost the device, while the relay-0 run progressed through the cashier scene. I’ll record the reuse result independently of stability and keep the pool optional while we have one successful relay-0 observation.

**@⁠TaynanGT** on GitHub · 2026-11-27 12:47 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/211#issuecomment-7218675323) @⁠timorjay The 831 to 186 prelude count shows reuse on this NVIDIA setup. Both relay-2 runs still lost the device, while the relay-0 run progressed through the cashier scene. I’ll record the reuse result independently of stability and keep the pool optional while we have one successful relay-0 observation.
This discussion has been locked. Commenting is limited to contributors.
No description provided.