Integrate the pending renderer and compatibility fixes #120

Open
github-bot wants to merge 15 commits from github-bot/gh-120 into main AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-27 02:57 UTC · original
TaynanGT:batch/series-s-pending-0ef → main · +1530 −48 · 19 files · 15 commits · draft

This batch brings the six pending changes onto the current main revision and preserves their original commits.

  • Combine the opt-in RAM throttle and laptop preset from #96 and #100. The preset's documented switches now have their implementation.
  • Combine the optional texture readback pool from #92 with the device-removal diagnostics from #118.
  • Include the opt-in reflection correction from #99 and the opt-in D3D12 Agility SDK build from #102.

Both local Clippy configurations and the Windows workspace tests passed, including the documented-switch and repository-policy checks. A Windows 10 retest of #84 is still needed.

**@⁠TaynanGT** on GitHub · 2026-11-27 02:57 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120) `TaynanGT:batch/series-s-pending-0ef` → `main` · +1530 −48 · 19 files · 15 commits · draft This batch brings the six pending changes onto the current main revision and preserves their original commits. - Combine the opt-in RAM throttle and laptop preset from #96 and #100. The preset's documented switches now have their implementation. - Combine the optional texture readback pool from #92 with the device-removal diagnostics from #118. - Include the opt-in reflection correction from #99 and the opt-in D3D12 Agility SDK build from #102. Both local Clippy configurations and the Windows workspace tests passed, including the documented-switch and repository-policy checks. A Windows 10 retest of #84 is still needed.
Keep each readback exclusive until its recording is reset or retired. Add a per-device bounded idle pool and separate allocation, reuse and landing telemetry.

(cherry picked from commit 67028e2193051340edcd3e06e960e673a58af1b5)
The submission relay must not retire flights on the D3D12 removed-device sentinel while readback buffers can be reused. Follow the fence check in fxceless/victory-fork@d036cea8.
On a 16 GB PC physical RAM runs out while the world streams in: the
memory the layer shares with the card goes from under 1 GB to 4-5 GB in
about 20 s, faster than Windows writes other pages out, and free RAM
falls to nothing. These settings, all off by default, slow that down:

- VICTORY_RAM_FLOOR_MB: a new buffer in the PC's memory (upload or
  shared with the card) waits while less than the floor would be left
  free, VICTORY_RAM_WAIT_MS at most (250 by default), and all threads
  together at most VICTORY_RAM_WAIT_SHARE_MS of every second (600, at
  most 1000). It only slows the making; it never refuses.
- VICTORY_RAM_FRAME_WAIT_MS: under the floor a submission also waits at
  its start, up to that long and at most half of the time, so the
  title's own streaming slows too (well inside its 30 s watchdog).
- VICTORY_WINDOWS_BAR_PERCENT: the share of the card's budget up to
  which windows outside buffers go to the card's memory
  (VICTORY_WINDOWS_BAR_MB), 50 to 95; 80 by default, as before.

The memory line reports what the throttle did and the windows on the
card; while it holds things back it reports every 5 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With the ray-tracing structure builder off, the stand-in for the indirect
light (VICTORY_AMBIENT) can now also hold the image the reflections'
resolve programs write: right after such a program each texel is held to
no more than a multiple of the stand-in's light around it, hue kept.

Off by default. It acts only when all of these hold:
- VICTORY_AMBIENT_REFLECT=<multiple> (a positive number; unset, 0 or off:
  the title's own reflections);
- VICTORY_AMBIENT_REFLECT_IN=<text>[,<text>]: text in the names of the
  programs that resolve the reflections (given at run time, so the
  reflections' programs are not named in the code; these texts are looked
  for after the other roles' names);
- the stand-in on (VICTORY_AMBIENT set) and the builder not running. With
  VICTORY_AMBIENT_RT the stand-in also runs while the builder does; the
  hold does not.

The hold's pass is compiled only when both switches are set, and a
failure to make it leaves the rest of the stand-in running. The hook
after indirect dispatches runs only for the reflections' resolve, so the
other roles are unchanged.

Ported from Serph91P's avatarmanz/VIctory-7900XTX#314 (commit 6c7e3a87,
GPL-3.0-or-later): the HOLD pass, the Reflect role and the hook after indirect
dispatches. That the reflections can be held to the ambient light, and the
switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437). Left out of
the port: the replay's --reflect and the docs.

Tests: ambient::tests::settings (the two switches' parsing),
roles_by_name (Reflect only by the given texts; none without them),
the_hold_compiles (the HOLD pass compiles with the system's compiler).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adapt the executable exports from Calvix2k in avatarmanz/VIctory-7900XTX#165 (c0c19d280d76a24c77ed45fa5bda5c924ace0466). Require an explicit build setting and diagnose a missing local runtime before initializing Direct3D.
The share of a second the throttle may wait (VICTORY_RAM_WAIT_SHARE_MS)
was a second and its spent milliseconds in two atomics: a thread moving to
a new second reset the spent time and could erase a charge another thread
had just made. They are one word now (the second above 20 bits, the
milliseconds below), charged with fetch_update; a thread that read the
clock before another moved the word on is charged to the word's own
second, so the word never goes back and no charge is lost. A test runs
eight threads over two seconds, half of them asking for the earlier
second after the turn: each second gives exactly its share.

VICTORY_RAM_KEEP_ALIVE=1 (off by default): while the throttle holds a
buffer or a submission back, it sets the title's heartbeat flag as the
title's own tick function does, so a world load it slows doesn't meet
the title's 30 s watchdog. Only in its own waits (bounded by
VICTORY_RAM_WAIT_MS and VICTORY_RAM_FRAME_WAIT_MS): a hang anywhere
else still ends the title. victory_loader::heartbeat checks the 1.0.2.1
tick function first (+0x2214a90: mov byte [rip+disp32], 1; ret) and takes
the flag's address from it; another build is left alone, said so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After an ExecuteIndirect with a count buffer the record count is read on
the card and may be 0, and a Dispatch may ask for no groups. The resolve
then writes nothing, and a hold recorded after it would rewrite what the
image held before. In both cases the hold is no longer recorded. The first
time each happens while `ambient::after` would record a hold (the image's
view is not checked), an INFO line says so:
"reflections not held after a counted indirect dispatch" and
"reflections not held after a dispatch of no groups".

To show which ways the title dispatches the resolves, they are counted
by how they were dispatched: holds after a Dispatch and after an
ExecuteIndirect without a count buffer; counted and empty resolves left
alone (counted only while `ambient::after` would record a hold; the
image's view is not checked). The counts are logged at INFO at the first
noted resolve 100 or more frames after the first noted one, then at most
once every 1000 frames
("reflections' resolves: held after a direct dispatch, held after an
indirect one without a count, not held after a counted one or a direct
one of no groups", with frames, direct, indirect, counted and empty).

Nothing changes while the hold is off (VICTORY_AMBIENT_REFLECT or
VICTORY_AMBIENT_REFLECT_IN unset): no program has the reflections' role
(Role::Reflect), so neither
the new branches nor the counts are reached.

Not covered: an ExecuteIndirect without a count buffer whose records ask
for no groups; the hold still follows it.

Test: ambient::tests::counts_by_dispatch_are_due_after_the_first_note_then_every_so_often.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts\play.ps1 -Machine laptop (asked for explicitly; -Machine auto is
unchanged): on top of the NVIDIA settings it sets what makes the Series S
world load fit in 16 GB: game files past the file cache, title buffers
used in place, 64 KiB windows with tails, up to 3 GB of windows in the
card's memory, small card copies of buffers, levels on demand, a 1080p
output drawn at half size by the title's own upscaler, and the RAM
throttle's settings (#96; without it they do nothing). They stay under
-Safe. The title's watchdog stays on; docs/laptop-16gb.md says when to add
VICTORY_RAM_KEEP_ALIVE=1 (#96).

VICTORY_WORKING_SET_MB (new, victory-loader working_set): a hard ceiling
on the game's working set, set by the game before the title runs, so
Windows trims the game's own pages instead of the rest of the PC's. The
preset sets it to the RAM less 11.6 GB, at least 3 GB (4,500 on 16 GB).

Measured on an RTX 3050 6 GB laptop with 16 GB (docs/laptop-16gb.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:04:06 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 02:58 UTC · original · edited 2026-11-27 03:01 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-27T03:00:09.868915Z be3fddf PR opened
🔒 Security Review ✅ Completed 2026-11-27T03:01:58.756601Z be3fddf 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.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 02:58 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#issuecomment-7208588305) · edited 2026-11-27 03:01 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"be3fddf7ff5fb6b24ac20113ae8d94ebaacdeb12","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":"be3fddf7ff5fb6b24ac20113ae8d94ebaacdeb12","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"be3fddf7ff5fb6b24ac20113ae8d94ebaacdeb12","mergeGateEnabled":false,"pullRequestNumber":120,"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-27T03:00:09.868915Z">2026-11-27T03:00:09.868915Z</relative-time> | `be3fddf` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-27T03:01:58.756601Z">2026-11-27T03:01:58.756601Z</relative-time> | `be3fddf` | 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>
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 02:59 UTC · original · edited 2026-11-27 03:03 UTC

I moved this batch back to draft. The head be3fddf7 includes the older fc74f10 change that writes the title’s heartbeat. #96 has since removed that code in d5c5d61. The current #100 still references the removed option, has an unchecked MiB-to-bytes conversion, and needs a low-RAM load retest with the watchdog active. Please leave both out of this batch.

The review also found a remaining issue in #99. The clamp can zero an uncounted indirect dispatch, so the reflection pass needs to check the actual clamped group counts before writing the image. The readback and Agility SDK changes can be evaluated independently on a fresh main.

**@⁠TaynanGT** on GitHub · 2026-11-27 02:59 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#issuecomment-7208611649) · edited 2026-11-27 03:03 UTC I moved this batch back to draft. The head `be3fddf7` includes the older `fc74f10` change that writes the title’s heartbeat. #96 has since removed that code in `d5c5d61`. The current #100 still references the removed option, has an unchecked MiB-to-bytes conversion, and needs a low-RAM load retest with the watchdog active. Please leave both out of this batch. The review also found a remaining issue in #99. The clamp can zero an uncounted indirect dispatch, so the reflection pass needs to check the actual clamped group counts before writing the image. The readback and Agility SDK changes can be evaluated independently on a fresh `main`.
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 03:00 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be3fddf7ff

ℹ️ 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".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 03:00 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#pullrequestreview-6082904327) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `be3fddf7ff` <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>
@ -4655,0 +4698,4 @@
note_reflect(Dispatched::Counted);
}
} else if self.after_dispatch(list, p) == Some(Role::Reflect) {
note_reflect(Dispatched::Indirect);
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-27 03:00 UTC · original

P2 Badge Skip the reflection hold for empty indirect dispatches

With the reflection correction enabled, an uncounted indirect dispatch can still execute zero groups: its argument dimensions can be zero, and the clamps in indirect.rs and indirect/batch.rs also zero dispatches that exceed their limits or available work budget. This branch nevertheless calls after_dispatch, which launches the hold over the entire reflection image, modifying earlier contents even though the resolve wrote nothing—the same corruption the new direct-dispatch and counted-dispatch guards explicitly avoid. Gate the hold on the effective GPU-side arguments, or skip uncounted indirect resolves when nonempty execution cannot be established.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-27 03:00 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#discussion_r4715252546) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Skip the reflection hold for empty indirect dispatches** With the reflection correction enabled, an uncounted indirect dispatch can still execute zero groups: its argument dimensions can be zero, and the clamps in `indirect.rs` and `indirect/batch.rs` also zero dispatches that exceed their limits or available work budget. This branch nevertheless calls `after_dispatch`, which launches the hold over the entire reflection image, modifying earlier contents even though the resolve wrote nothing—the same corruption the new direct-dispatch and counted-dispatch guards explicitly avoid. Gate the hold on the effective GPU-side arguments, or skip uncounted indirect resolves when nonempty execution cannot be established. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 03:14 UTC · original

The empty indirect-dispatch fix is now in draft #127. The WARP test exercises the actual GPU clamp and confirms that the reflection texture stays unchanged when a dispatch has zero groups. The draft still needs a matched gameplay and timing run on the RTX 5070 Ti.

**@⁠TaynanGT** on GitHub · 2026-11-27 03:14 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#issuecomment-7208818588) The empty indirect-dispatch fix is now in draft #127. The WARP test exercises the actual GPU clamp and confirms that the reflection texture stays unchanged when a dispatch has zero groups. The draft still needs a matched gameplay and timing run on the RTX 5070 Ti.
Author
Owner

@⁠nidscode on GitHub · 2026-11-27 03:41 UTC · original

Updates for the two held from this batch:

  • #96 is at d5c5d61: the throttle and the race fix only, without the heartbeat code.
  • #100 is at 4c9a0a8: independent of #96 (no throttle settings in the preset, no throttle or keep-alive switches in its doc), with the checked MiB conversion. With the watchdog active, 2 of 2 low-RAM loads passed on main + #100 alone (details in #100).
  • The heartbeat is now its own PR, #126, stacked on #96, with the range, lifetime and concurrency checks. One caveat for #96: with the watchdog on, its throttle ended all 6 loads I tried on this title without #126.
**@⁠nidscode** on GitHub · 2026-11-27 03:41 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#issuecomment-7209199057) Updates for the two held from this batch: - **#96** is at `d5c5d61`: the throttle and the race fix only, without the heartbeat code. - **#100** is at `4c9a0a8`: independent of #96 (no throttle settings in the preset, no throttle or keep-alive switches in its doc), with the checked MiB conversion. With the watchdog active, 2 of 2 low-RAM loads passed on `main` + #100 alone (details in #100). - **The heartbeat** is now its own PR, **#126**, stacked on #96, with the range, lifetime and concurrency checks. One caveat for #96: with the watchdog on, its throttle ended all 6 loads I tried on this title without #126.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 04:07 UTC · original

Thanks for separating the measurements, @⁠nidscode. The two successful guarded loads on #100 are now evidence for the standalone laptop preset, and its Windows CI passed. Your 0-of-6 result for the throttle alone gives us a separate case for #96 and #126. This is easier to follow in the focused PRs, alongside the reflection work in #127 and the readback and Agility changes already in #130.

**@⁠TaynanGT** on GitHub · 2026-11-27 04:07 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/120#issuecomment-7209543901) Thanks for separating the measurements, @⁠nidscode. The two successful guarded loads on #100 are now evidence for the standalone laptop preset, and its Windows CI passed. Your 0-of-6 result for the throttle alone gives us a separate case for #96 and #126. This is easier to follow in the focused PRs, alongside the reflection work in #127 and the readback and Agility changes already in #130.
This pull request has changes conflicting with the target branch.
  • README.md
  • apps/victory/src/run.rs
  • crates/victory-gpu/src/ambient.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-loader/src/working_set.rs
  • docs/laptop-16gb.md
  • scripts/play.ps1
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/120/head:github-bot/gh-120'
git switch 'github-bot/gh-120'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-120'
git switch 'github-bot/gh-120'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-120'
git switch 'github-bot/gh-120'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-120'
git switch 'main'
git merge --squash 'github-bot/gh-120'
git switch 'main'
git merge --ff-only 'github-bot/gh-120'
git switch 'main'
git merge 'github-bot/gh-120'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.