feat(loader): opt-in extra title recording workers #612

Open
github-bot wants to merge 1 commit from github-bot/gh-612 into main AGit
Owner

@⁠lynxnathan on GitHub · 2026-12-05 18:15 UTC · original
lynxnathan:feat/recording-workers-opt-in → main · +3377 −7 · 18 files · 1 commits · draft

Summary

Port CNF-Larp's extra title recording workers for the exact supported executable build. VICTORY_SUBRENDER_WORKERS=6, 7, or 8 enables the patch; unset or 5 leaves the title's original five workers in place. The patch moves the title's fixed per-worker arrays, extends their setup and setter calls, and changes the worker count last. It turns off the title's async compute when extra workers are used because its context slots cannot hold both.

The setting is opt-in because more CPU threads are useful only when recording is the bottleneck. It does not change output resolution, upscaling, ray tracing, or frame generation preferences.

Validation

  • Windows MSVC cargo check --locked -j 8 -p victory passed on this branch (target and SDK environment set as in build.sh).
  • The recording_workers_remain_opt_in Windows unit test passed under Wine: unset and 5 select the original count; 6 and 8 select added workers; invalid values are rejected.
  • cargo xtask policy: 375 files OK. git diff --check passed.
  • An earlier experiment using the same worker patch, before the opt-in default and documentation edits, ran the supported executable on a Ryzen 7 5800X and RX 9070 XT. The game log reported eight workers and all 100 setter hooks installed. This is a runtime smoke check, not evidence that eight workers improve FPS.
  • Compare five and eight workers in the same world scene, with the same graphics, frame interval, and camera position. Keep this draft until the benefit and frame pacing cost are measured.

Costs and scope

With the switch unset, the title keeps five workers. Enabling it adds CPU threads and per-worker state, uses relocation and detour code at load, and disables async compute. The performance benefit is still unmeasured. This PR contains no personal profile, game files, binaries, or output artifacts. The open PR queue has no direct recording-worker change; descriptor performance PRs are independent.

Contribution checks

  • New behavior is behind a switch that is off by default.
  • The switch and its bounds are documented in the menu, README, and settings reference.
  • The diff has no unrelated cleanup.
  • The default-off behavior has a targeted test that would fail if the patch became automatic.
  • The open PR queue was checked for overlap.
  • The repository asset policy passed.
**@⁠lynxnathan** on GitHub · 2026-12-05 18:15 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/612) `lynxnathan:feat/recording-workers-opt-in` → `main` · +3377 −7 · 18 files · 1 commits · draft ## Summary Port CNF-Larp's extra title recording workers for the exact supported executable build. `VICTORY_SUBRENDER_WORKERS=6`, `7`, or `8` enables the patch; unset or `5` leaves the title's original five workers in place. The patch moves the title's fixed per-worker arrays, extends their setup and setter calls, and changes the worker count last. It turns off the title's async compute when extra workers are used because its context slots cannot hold both. The setting is opt-in because more CPU threads are useful only when recording is the bottleneck. It does not change output resolution, upscaling, ray tracing, or frame generation preferences. ## Validation - Windows MSVC `cargo check --locked -j 8 -p victory` passed on this branch (target and SDK environment set as in `build.sh`). - The `recording_workers_remain_opt_in` Windows unit test passed under Wine: unset and `5` select the original count; `6` and `8` select added workers; invalid values are rejected. - `cargo xtask policy`: 375 files OK. `git diff --check` passed. - An earlier experiment using the same worker patch, before the opt-in default and documentation edits, ran the supported executable on a Ryzen 7 5800X and RX 9070 XT. The game log reported eight workers and all 100 setter hooks installed. This is a runtime smoke check, not evidence that eight workers improve FPS. - [ ] Compare five and eight workers in the same world scene, with the same graphics, frame interval, and camera position. Keep this draft until the benefit and frame pacing cost are measured. ## Costs and scope With the switch unset, the title keeps five workers. Enabling it adds CPU threads and per-worker state, uses relocation and detour code at load, and disables async compute. The performance benefit is still unmeasured. This PR contains no personal profile, game files, binaries, or output artifacts. The open PR queue has no direct recording-worker change; descriptor performance PRs are independent. ## Contribution checks - [x] New behavior is behind a switch that is off by default. - [x] The switch and its bounds are documented in the menu, README, and settings reference. - [x] The diff has no unrelated cleanup. - [x] The default-off behavior has a targeted test that would fail if the patch became automatic. - [x] The open PR queue was checked for overlap. - [x] The repository asset policy passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 18:17:30 +00:00
Author
Owner

@⁠fsrajner on GitHub · 2026-12-05 20:06 UTC · original

A/B data point on RDNA 4. This PR was tested together with #612, #599, #553 and #608 in one build. All are opt-in, so the arms differ only by env.

Setup: RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton, proton-cachyos-slr. Series X profile, 4K output with FSR 4.1.2 Quality, hardware RT (HW_RT + LEAN_BUILDER + REUSE), frame generation off, headless gamescope. Base: main @ 49f5f9e + rt-7-reuse + #542 (+ #611/#596, switched off). The four PRs merged with no conflicts.

Method: the same intro snapshot every run, 120 s after the first A press. One warm-up run, then two rounds of all five arms, interleaved. "Long frames" are the long frame lines (≥ 50 ms). This scene is GPU-bound: the submit thread waits ~16 ms a frame on the card.

arm ms/frame 5 s windows > 40 ms worst window gpu_wait long frames
base 40 / 42 22/36 50.1 / 59.7 ms 16.0 / 16.2 ms 262 / 249
#612 SUBRENDER_WORKERS=8 40 / 40 22/36 55.2 / 55.9 ms 20.9 / 21.6 ms 233 / 220
#599 THIN_SPLIT=1 40 / 41 25/36 46.5 / 49.3 ms 17.5 / 15.9 ms 246 / 246
#553 JOIN_BARRIERS=1 40 / 40 21/36 51.5 / 52.5 ms 16.3 / 15.6 ms 242 / 239
#608 EVENT_DIRTY_SHADOWS=1 42 / 41 28/36 56.1 / 48.9 ms 17.1 / 16.7 ms 268 / 270
  • For this PR: the extra workers clearly speed up recording. gpu_wait rises by about 5 ms, so the frame becomes even more card-bound, and ≥ 50 ms frames drop about 12 %. The mean frame time stays the same here because the card is the limit. No crashes or visual problems were seen with async compute off.
**@⁠fsrajner** on GitHub · 2026-12-05 20:06 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/612#issuecomment-7444535032) A/B data point on RDNA 4. This PR was tested together with #612, #599, #553 and #608 in one build. All are opt-in, so the arms differ only by env. **Setup:** RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton, proton-cachyos-slr. Series X profile, 4K output with FSR 4.1.2 Quality, hardware RT (`HW_RT` + `LEAN_BUILDER` + `REUSE`), frame generation off, headless gamescope. Base: `main` @ `49f5f9e` + `rt-7-reuse` + #542 (+ #611/#596, switched off). The four PRs merged with no conflicts. **Method:** the same intro snapshot every run, 120 s after the first A press. One warm-up run, then two rounds of all five arms, interleaved. "Long frames" are the `long frame` lines (≥ 50 ms). This scene is GPU-bound: the submit thread waits ~16 ms a frame on the card. | arm | ms/frame | 5 s windows > 40 ms | worst window | gpu_wait | long frames | |---|---|---|---|---|---| | base | 40 / 42 | 22/36 | 50.1 / 59.7 ms | 16.0 / 16.2 ms | 262 / 249 | | #612 `SUBRENDER_WORKERS=8` | 40 / 40 | 22/36 | 55.2 / 55.9 ms | 20.9 / 21.6 ms | 233 / 220 | | #599 `THIN_SPLIT=1` | 40 / 41 | 25/36 | 46.5 / 49.3 ms | 17.5 / 15.9 ms | 246 / 246 | | #553 `JOIN_BARRIERS=1` | 40 / 40 | 21/36 | 51.5 / 52.5 ms | 16.3 / 15.6 ms | 242 / 239 | | #608 `EVENT_DIRTY_SHADOWS=1` | 42 / 41 | 28/36 | 56.1 / 48.9 ms | 17.1 / 16.7 ms | 268 / 270 | - For this PR: the extra workers clearly speed up recording. `gpu_wait` rises by about 5 ms, so the frame becomes even more card-bound, and ≥ 50 ms frames drop about 12 %. The mean frame time stays the same here because the card is the limit. No crashes or visual problems were seen with async compute off.
This pull request has changes conflicting with the target branch.
  • crates/victory-loader/src/lib.rs
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/612/head:github-bot/gh-612'
git switch 'github-bot/gh-612'

Merge

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