VICTORY_WIDE_THREADS and VICTORY_CAPTURE_EVERY #312

Closed
github-bot wants to merge 578 commits from github-bot/gh-312 into main AGit
Owner

@⁠wondasahnet on GitHub · 2026-11-27 15:38 UTC · original
wondasahnet:feat/wide-threads-capture-every → main · +50405 −4327 · 195 files · 578 commits · closed without merging

Two switches, one commit each. Without them nothing changes.

VICTORY_WIDE_THREADS=<n> (1 to 16)

The submitting thread shares a submission's refreshes with helper threads (shadow::wide) and waits for the last of them. How many there are is a quarter of the processors, 2 to 6: 4 on a CPU of eight cores with two threads each. The switch says how many instead.

Why one would want to: in a 25 s sampling profile of the Series S prison scene on a Ryzen 7 9800X3D (-Machine 4070, 22 to 23 fps), the parallel refreshes were 22% of the submitting thread's samples, while the threads that translate the title's lists were parked about nine tenths of the time. The frame waits for the submitting thread, and there are idle cores beside it.

Measured, RTX 5080, Ryzen 7 9800X3D, 64 GB, Series S build, prison intro, diagnostics build, -Machine 4070 with VICTORY_PORT_DESCRIPTORS=1, VICTORY_PORT_GUARD=1, VICTORY_PORT_JOURNAL=1, DLSS frame generation on (the rendered rate is given), one self-driven run each:

fps median p10
default (4 threads) 24.6 21.2
VICTORY_WIDE_THREADS=7 26.2 20.6

The second run was shorter and had camera turns the first had not, and runs of this scene differ by about 1 fps as it is. It has not been measured inside one run yet. That is why this is a switch and the default stays: other CPUs need their own numbers before the default moves.

VICTORY_CAPTURE_EVERY=<n> (1 to 64)

With VICTORY_CAPTURE_WORLD every 8th frame's picture is saved once the world is there. A picture that is wrong for a frame or two, as right after a cut, falls between two of them. The switch saves every nth instead; without it it stays every 8th. Values that do not parse leave 8; others are held to 1 to 64.

Tests

  • Run on this branch at abfa16f (base c44e2ce), Windows 11, RTX 5080, Ryzen 7 9800X3D, 64 GB:

    Command Result
    cargo check --workspace --all-targets --locked clean
    cargo test --locked -p victory-gpu --features diagnostics --lib -- capture:: shadow:: 62 passed, 0 failed, 4 ignored
    cargo build --locked --profile diag -p victory --features diagnostics (before the rebase onto c44e2ce, which was clean) builds
    git diff --check clean

    The four CI commands were run once on a local merge of this branch with five other branches of mine, on base fe8a7a2 before the rebase: both clippy commands clean, cargo test --workspace --locked passed, and cargo test --workspace --all-features --locked -- --test-threads=1 passed except modules::lifecycle::tests::direct_close_suspends_and_exits in victory-hle, a window test in a crate this branch does not touch; it passed in the default job of the same run and when run again alone. After the rebase the merge was linted again with both clippy commands: clean.

  • No new unit test: both are one environment variable read once into a OnceLock, as the switches beside them are.

  • In game: VICTORY_WIDE_THREADS=7 has been on in more than a dozen self-driven runs of the prison intro on the PC above with no error line in the logs; VICTORY_CAPTURE_EVERY=1 was used there to find single wrong frames.

Not covered

  • VICTORY_WIDE_THREADS on any other CPU, and values other than 7. On a CPU with fewer cores more helper threads may take time from the threads that translate the title's lists.
  • VICTORY_CAPTURE_EVERY=1 saves a picture for every frame; that is slow by design and not something to measure frame rates with.
  • The switches are not added to the launcher.

Since the runs above the branch was rebased onto main at 16edfec (no conflicts; cargo check -p victory-gpu --all-targets --locked clean); its tip is 223402f now.

**@⁠wondasahnet** on GitHub · 2026-11-27 15:38 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/312) `wondasahnet:feat/wide-threads-capture-every` → `main` · +50405 −4327 · 195 files · 578 commits · closed without merging Two switches, one commit each. Without them nothing changes. ## `VICTORY_WIDE_THREADS=<n>` (1 to 16) The submitting thread shares a submission's refreshes with helper threads (`shadow::wide`) and waits for the last of them. How many there are is a quarter of the processors, 2 to 6: 4 on a CPU of eight cores with two threads each. The switch says how many instead. Why one would want to: in a 25 s sampling profile of the Series S prison scene on a Ryzen 7 9800X3D (`-Machine 4070`, 22 to 23 fps), the parallel refreshes were 22% of the submitting thread's samples, while the threads that translate the title's lists were parked about nine tenths of the time. The frame waits for the submitting thread, and there are idle cores beside it. Measured, RTX 5080, Ryzen 7 9800X3D, 64 GB, Series S build, prison intro, diagnostics build, `-Machine 4070` with `VICTORY_PORT_DESCRIPTORS=1`, `VICTORY_PORT_GUARD=1`, `VICTORY_PORT_JOURNAL=1`, DLSS frame generation on (the rendered rate is given), one self-driven run each: | | fps median | p10 | |---|---:|---:| | default (4 threads) | 24.6 | 21.2 | | `VICTORY_WIDE_THREADS=7` | 26.2 | 20.6 | The second run was shorter and had camera turns the first had not, and runs of this scene differ by about 1 fps as it is. It has not been measured inside one run yet. That is why this is a switch and the default stays: other CPUs need their own numbers before the default moves. ## `VICTORY_CAPTURE_EVERY=<n>` (1 to 64) With `VICTORY_CAPTURE_WORLD` every 8th frame's picture is saved once the world is there. A picture that is wrong for a frame or two, as right after a cut, falls between two of them. The switch saves every nth instead; without it it stays every 8th. Values that do not parse leave 8; others are held to 1 to 64. ## Tests - Run on this branch at `abfa16f` (base `c44e2ce`), Windows 11, RTX 5080, Ryzen 7 9800X3D, 64 GB: | Command | Result | |---|---| | `cargo check --workspace --all-targets --locked` | clean | | `cargo test --locked -p victory-gpu --features diagnostics --lib -- capture:: shadow::` | 62 passed, 0 failed, 4 ignored | | `cargo build --locked --profile diag -p victory --features diagnostics` (before the rebase onto `c44e2ce`, which was clean) | builds | | `git diff --check` | clean | The four CI commands were run once on a local merge of this branch with five other branches of mine, on base `fe8a7a2` before the rebase: both clippy commands clean, `cargo test --workspace --locked` passed, and `cargo test --workspace --all-features --locked -- --test-threads=1` passed except `modules::lifecycle::tests::direct_close_suspends_and_exits` in `victory-hle`, a window test in a crate this branch does not touch; it passed in the default job of the same run and when run again alone. After the rebase the merge was linted again with both clippy commands: clean. - No new unit test: both are one environment variable read once into a `OnceLock`, as the switches beside them are. - In game: `VICTORY_WIDE_THREADS=7` has been on in more than a dozen self-driven runs of the prison intro on the PC above with no error line in the logs; `VICTORY_CAPTURE_EVERY=1` was used there to find single wrong frames. ## Not covered - `VICTORY_WIDE_THREADS` on any other CPU, and values other than 7. On a CPU with fewer cores more helper threads may take time from the threads that translate the title's lists. - `VICTORY_CAPTURE_EVERY=1` saves a picture for every frame; that is slow by design and not something to measure frame rates with. - The switches are not added to the launcher. --- Since the runs above the branch was rebased onto `main` at `16edfec` (no conflicts; `cargo check -p victory-gpu --all-targets --locked` clean); its tip is `223402f` now.
The threads a submission's refreshes are shared with are a quarter of the
processors, 2 to 6: 4 on eight cores of two threads each. In a profile of
the Series S prison scene there, the parallel refreshes were 22% of the
submitting thread's samples while the threads that translate the title's
lists were parked nine tenths of the time.

VICTORY_WIDE_THREADS=<n> (1 to 16) says how many; without it nothing
changes. With 7 on an RTX 5080 and a Ryzen 7 9800X3D the scene ran at
26.2 fps median, against 24.6 with the default 4 and the same other
settings. The two runs differ in length and camera path as well, and runs
of this scene differ by about 1 fps as it is: not measured inside one run
yet, so the default stays.
With VICTORY_CAPTURE_WORLD every 8th frame's picture is saved once the
world is there. A picture that is wrong for a frame or two, as right
after a cut, falls between two of them.

VICTORY_CAPTURE_EVERY=<n> (1 to 64) saves every nth instead; without it
it stays every 8th.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:43:36 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 15:54 UTC · original

@⁠wondasahnet Keep capture frequency fixed for the thread-count comparison, and use the same camera movement in both runs. The current p10 is slightly lower at seven threads. The every-frame capture setting is a good way to mark a one-frame artefact by frame number.

**@⁠TaynanGT** on GitHub · 2026-11-27 15:54 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/312#issuecomment-7222620946) @⁠wondasahnet Keep capture frequency fixed for the thread-count comparison, and use the same camera movement in both runs. The current p10 is slightly lower at seven threads. The every-frame capture setting is a good way to mark a one-frame artefact by frame number.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-28 02:03 UTC · original

KLBF #14 separates missing present counts from an actual zero. If you compare worker counts with VICTORY_CAPTURE_EVERY, I suggest first checking matching numbers of valid rendered and presented samples and logging skipped rows. That prevents changes in diagnostic sampling from appearing as an improvement in frame rate. I ran the absent-versus-zero count controls locally; worker latency is separate.

**@⁠akimfomin** on GitHub · 2026-11-28 02:03 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/312#issuecomment-7232100511) [KLBF #14](https://github.com/PastiiJay/klbf-lab/pull/14) separates missing present counts from an actual zero. If you compare worker counts with `VICTORY_CAPTURE_EVERY`, I suggest first checking matching numbers of valid rendered and presented samples and logging skipped rows. That prevents changes in diagnostic sampling from appearing as an improvement in frame rate. I ran the absent-versus-zero count controls locally; worker latency is separate.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 11:23 UTC · original

Good point about missing counts versus actual zero. I'll keep skipped rows visible and compare matched valid rendered and presented sample counts before interpreting worker-count changes as frame-rate gains.

**@⁠TaynanGT** on GitHub · 2026-11-29 11:23 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/312#issuecomment-7255085295) Good point about missing counts versus actual zero. I'll keep skipped rows visible and compare matched valid rendered and presented sample counts before interpreting worker-count changes as frame-rate gains.
github-bot closed this pull request 2026-11-30 17:14:53 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:12 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/312#issuecomment-7285876947) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.