perf: copy big title copies in pieces on the kept threads (VICTORY_WIDE_COPY, off by default) #500

Merged
LooperSalty merged 3 commits from upstream-pr/500 into main 2026-11-27 14:13:00 +00:00
LooperSalty commented 2026-11-27 13:56:14 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T13:56:14Z.


What

copy_mapped moves each per-frame title copy (64-76 MB) on a single thread. With VICTORY_WIDE_COPY=1, a copy of 8 MiB or more is cut into 2 MiB pieces and run through the kept threads of shadow::wide_run. Each piece goes through copy_mapped unchanged, so the title-destination guards still apply per piece. Off by default (A/B switch), so default behaviour is unchanged.

The idea comes from fever308's parallel copy work in JMAN730/victory (b975c652). It is not ported: this is a smaller version written against our copy_mapped. THIRD_PARTY.md gets a row for JMAN730/victory, and the commit carries Co-authored-by for fever308.

Measurement

Full HD 1920x1080, Series X profile, RTX 4070 SUPER, warm cache, warm-up launch discarded, window 60-170 s, median fps derived from frame times, 3 alternating pairs:

run 1 run 2 run 3 median
off 31.9 30.8 29.8 30.8
on 37.7 33.8 34.4 34.4

+12 % median, and "on" was ahead in all 3 pairs.

1 % lows (110 samples, crude): off 2.8 / 11.9 / 4.5, on 7.7 / 8.5 / 8.1.

Measured on the maintainer's machine; spread between repeats is high, to confirm.

Test plan

  • cargo test --release -p victory-gpu piece_copy (2 passed)
  • cargo xtask policy from third_party/victory (295 files ok)
  • CI
  • Independent A/B on another machine (VICTORY_WIDE_COPY=1 vs unset)

🤖 Generated with Claude Code

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5527820910 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/500). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-27T13:56:14Z. --- ## What `copy_mapped` moves each per-frame title copy (64-76 MB) on a single thread. With `VICTORY_WIDE_COPY=1`, a copy of 8 MiB or more is cut into 2 MiB pieces and run through the kept threads of `shadow::wide_run`. Each piece goes through `copy_mapped` unchanged, so the title-destination guards still apply per piece. Off by default (A/B switch), so default behaviour is unchanged. The idea comes from fever308's parallel copy work in JMAN730/victory (`b975c652`). It is not ported: this is a smaller version written against our `copy_mapped`. `THIRD_PARTY.md` gets a row for JMAN730/victory, and the commit carries `Co-authored-by` for fever308. ## Measurement Full HD 1920x1080, Series X profile, RTX 4070 SUPER, warm cache, warm-up launch discarded, window 60-170 s, median fps derived from frame times, 3 alternating pairs: | | run 1 | run 2 | run 3 | median | | --- | --- | --- | --- | --- | | off | 31.9 | 30.8 | 29.8 | 30.8 | | on | 37.7 | 33.8 | 34.4 | 34.4 | +12 % median, and "on" was ahead in all 3 pairs. 1 % lows (110 samples, crude): off 2.8 / 11.9 / 4.5, on 7.7 / 8.5 / 8.1. Measured on the maintainer's machine; spread between repeats is high, to confirm. ## Test plan - [x] `cargo test --release -p victory-gpu piece_copy` (2 passed) - [x] `cargo xtask policy` from `third_party/victory` (295 files ok) - [ ] CI - [ ] Independent A/B on another machine (`VICTORY_WIDE_COPY=1` vs unset) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot] commented 2026-11-27 13:56:22 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T13:56:22Z.


Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-27T13:56:17.936527Z
We couldn’t complete this review. Comment @codex review to try again.
c9c9a64 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:LooperSalty/AnyXboxX:comment:7220130025 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/500#issuecomment-7220130025). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T13:56:22Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"c9c9a64255c4e111dc67ab35e98970115fb922c3","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-27T13:56:17.936527Z">2026-11-27T13:56:17.936527Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `c9c9a64` | 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-11-27 13:56:24 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T13:56:24Z.


You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7220130949 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/500#issuecomment-7220130949). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T13:56:24Z. --- You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
PeppeBeard commented 2026-11-27 16:51:46 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by PeppeBeard on 2026-11-27T16:51:46Z.


Replication datapoint for #500's A/B, different hardware class: RTX 5070 Ti (16 GB), 32 GB RAM, 16 logical CPUs, Windows 11, Series X profile, 1920x1080 windowed, warm pipeline cache, built from main at a445308.

Method note: the env var was set user-level (setx VICTORY_WIDE_COPY 1) so the switch is confirmed active for the run; the comparison session ran without it (launcher-side overrides — see UX note below). Both sessions are normal play through the open world, not a fixed replay, so scene composition varies between them; treat this as a field measurement, not a strict A/B.

Per-frame summaries are from the host meter lines (INFO victory_gpu::host: N fps, ... ms/frame (... preparing: copies X ms Y MB ...), buckets by draws/frame):

Draws/frame Switch off (median fps) Switch on (median fps)
1k-3k 24.3 19.6
3k-6k ~14.7 (all 3k+ pooled) 21.2
6k-10k (pooled above) 17.5
10k+ (peak 14,796) 8-15 observed not hit this session

Pooling all 3k+ draws: median went from 14.7 to 20 fps (+35%), and the worst 2.5-3 fps valleys during heavy streaming disappeared. Per-frame copy volume in heavy scenes was 90-140 MB; "preparing: copies" sat around 10-15 ms/frame with the switch on, versus 15-33 ms in the off session's heaviest samples. Direction agrees with the 4070 SUPER numbers in the PR description, magnitude larger here (likely because our 16-logical-CPU host benefits more from unserializing the big copies).

Two UX observations while verifying, for whatever they're worth:

  1. VICTORY_WIDE_COPY is the only A/B switch I've hit that prints no banner or meter line, so there is no way to confirm from the game log that it took effect. A one-line startup log (like the other switches have) would have saved a debugging session.
  2. The launcher's advanced-override panel validates the key but not the value (KEY=VALUE → v == "1" gate downstream). A typo'd value (e.g. a trailing character) fails silently with no warning at launch. Validating the value against the expected 0/1 or echoing the resolved environment in the launch log would catch this.

Happy to rerun a tighter fixed-route pair if that would help.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7223755874 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/500#issuecomment-7223755874). Originally posted by [PeppeBeard](https://github.com/PeppeBeard) on 2026-11-27T16:51:46Z. --- Replication datapoint for #500's A/B, different hardware class: **RTX 5070 Ti (16 GB), 32 GB RAM, 16 logical CPUs**, Windows 11, Series X profile, 1920x1080 windowed, warm pipeline cache, built from main at a445308. Method note: the env var was set user-level (`setx VICTORY_WIDE_COPY 1`) so the switch is confirmed active for the run; the comparison session ran without it (launcher-side overrides — see UX note below). Both sessions are normal play through the open world, not a fixed replay, so scene composition varies between them; treat this as a field measurement, not a strict A/B. Per-frame summaries are from the host meter lines (`INFO victory_gpu::host: N fps, ... ms/frame (... preparing: copies X ms Y MB ...)`, buckets by draws/frame): | Draws/frame | Switch off (median fps) | Switch on (median fps) | |---|---|---| | 1k-3k | 24.3 | 19.6 | | 3k-6k | ~14.7 (all 3k+ pooled) | 21.2 | | 6k-10k | (pooled above) | 17.5 | | 10k+ (peak 14,796) | 8-15 observed | not hit this session | Pooling all 3k+ draws: median went from **14.7 to ~20 fps (~+35%)**, and the worst 2.5-3 fps valleys during heavy streaming disappeared. Per-frame copy volume in heavy scenes was 90-140 MB; "preparing: copies" sat around 10-15 ms/frame with the switch on, versus 15-33 ms in the off session's heaviest samples. Direction agrees with the 4070 SUPER numbers in the PR description, magnitude larger here (likely because our 16-logical-CPU host benefits more from unserializing the big copies). Two UX observations while verifying, for whatever they're worth: 1. `VICTORY_WIDE_COPY` is the only A/B switch I've hit that prints **no banner or meter line**, so there is no way to confirm from the game log that it took effect. A one-line startup log (like the other switches have) would have saved a debugging session. 2. The launcher's advanced-override panel validates the key but not the value (`KEY=VALUE` → `v == "1"` gate downstream). A typo'd value (e.g. a trailing character) fails silently with no warning at launch. Validating the value against the expected `0/1` or echoing the resolved environment in the launch log would catch this. Happy to rerun a tighter fixed-route pair if that would help.
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
LooperSalty/AnyXboxX!500
No description provided.