RTX 5070 Ti / i9-9900K, Series X: 14 fps with the submitting thread at 65 ms; eleven switches A/B'd without a gain, three counters, two structural suggestions #267

Open
opened 2026-11-27 13:14:38 +00:00 by github-bot · 5 comments
Owner

@⁠marekpastuszczak-lang on GitHub · 2026-11-27 13:01 UTC · original

Measurements from one more NVIDIA machine, with every existing switch I could find A/B'd against the same scene, and two structural suggestions at the end. The measurements are mine; the suggestions come from reading the code and are marked as such. AI-assisted (Claude Code).

Machine and method

RTX 5070 Ti 16 GB (driver 32.0.16.1656), i9-9900K (8 cores, 16 threads), 32 GB RAM, Windows 11, game on NVMe. Build 6594538, diag, shaders translated ahead, Series X profile, windowed, the settings of play.ps1 -Machine 4070. Scripted VICTORY_KEYS only. Each run is 7 minutes; the figure is the median of the frame lines from 180 s after the world's first frame to the end, always the same scene (the prison window, about 4,700 draws a frame). Runs before the third are slower (pipelines), so the base was run four times: 13.8 to 14.1 fps.

Base

14.1 fps, 70.9 ms a frame, the card about 68% busy, 26 GB private, 11.4 GB VRAM, free RAM down to 0.3 to 0.6 GB.

From the log, per frame:

  • the submitting thread worked 64.6 ms: 17.2 refreshes (9,771 in 39 flushes, 8,654 of them known to copy nothing), 14.6 copies in the card's memory, 9.6 title bytes under flights' writes, 6.4 asking the write watch, 4.3 planning the card's steps, 3.3 copies and fills, 1.7 sending;
  • the card idle behind us 21.5 ms; the title's threads waited 24.9 ms at presents; 14.3 submissions in the line when one was added, 13.0 of 28 prepared together with the one before;
  • copies per frame: 22,339 refreshes over 17,866 MB, 9,535 MB checked, 9,463 MB of it unchanged; 249 kernel askings over 1,689 MB (5.1 ms); 11.5 ms waiting for the guards, 5.3 ms changing protections;
  • 235 hash passes and 429 compare passes on the card.

What was tried, one at a time

Change fps Note
none 14.1
VICTORY_ASK_EARLY=1 14.1
VICTORY_PORT_CONSTANTS=1 4.1 the submitting thread's preparing falls from 59 to 36 ms, but the card goes to 97% and the frame to 244 ms: it reads the heap over the bus
VICTORY_PORT_DESCRIPTORS=1 13.8 7,137 warnings a view record in the title's heap that no store told of; with ports 2+6+7 together over 4,000 in five minutes and badly wrong pictures in the cutscenes
VICTORY_PORT_CBV=1 (shaders translated again) 12.7 picture right, dropped draws 257 against 340
VICTORY_PORT_GUARD=1 14.1
VICTORY_PORT_JOURNAL=1 13.6
VICTORY_WIDE_SPIN=200 14.1 refreshes 15.8 ms, the thread as a whole no faster
VICTORY_LANE_CORE=1 14.2
VICTORY_JOIN_PARTS=32 VICTORY_JOIN_LISTS=128 13.5 still 13.0 submissions prepared together
threads 12/8/6 (the 4090 preset) no gain not the same scene, so only an indication
local patch: shadow::wide_threads() from a switch, 8 helpers 14.0 twelve helpers still running, not expected to differ

So nothing that only adds hands or moves a lock changes the frame here, and the one change that takes real work off the processor (port 1) gives it to the card over the bus.

Three counters added locally (no change of behaviour)

  • Why tables are made afresh (draw.rs, tables): of 40 million groups, 58.6% are fresh because the group holds a constant buffer view, 3.8% only because the table lies past the host heap, 37.6% are not fresh. So about 94% of the fresh tables are the 256-byte alignment of constant views.
  • Textures found changed after their upload (draw.rs, the recheck): of 52, the last kernel write told of on their pages (watch::writing) was before the upload for 45, never for 5, at or after for 2. Late DirectStorage data is not what changes them; all but six have 9 blocks shown elsewhere.
  • victory warm --used says 0 pipelines known after ordinary runs: it reads the book, and the book is written only with VICTORY_PIPELINE_BOOK=1. After one run with it: 2,470 pipelines made in 238 s (median 422 ms, p99 6.0 s, most 19.7 s). The next run was no different: the first two to three minutes in the world still ran at 1 to 4 fps with about 430 pipelines being made, and the steady state was the same 13.8 fps. Perhaps the same thing as #188.

Also: VICTORY_DLSS_4K=performance ends the process 11 s after start, during NGX's start (log on request).

Suggestions from reading the code (not measured)

  1. Refreshes are pulled by every submission, though almost none finds anything. 17.9 GB of ranges are looked at each frame for about 73 MB that changed, and 8,654 of 9,771 refreshes are known to copy nothing before they start. The work that is left is deciding that. Changes pushed once for all the submissions waiting in the line (one asking of the write watch, one pass over the changed pages, the result filed by region of memory) would take the refreshes and the asking, 23.6 ms of the 64.6, off the path of each submission. behind.rs already rests on the assumption this needs: what submitted lists read is the card's until a fence behind them.
  2. The lane as two threads in a row, cut after send::take: the card's preludes, Execute and Signal on a second thread in order, while the first goes on with the next submission's processor side. This is item 1 of "What is next" in docs/findings.md; the 21.5 ms of card idle behind the thread is what it would win here.
  3. A counter for what ends the joining at 13 of 28 (which branch of joinable / take_along). If it is the whole 174 MB heap declared as written, waves of submissions will stay short whatever else is done.

I can send any of the logs, or run a branch on this machine with the same method.

**@⁠marekpastuszczak-lang** on GitHub · 2026-11-27 13:01 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267) Measurements from one more NVIDIA machine, with every existing switch I could find A/B'd against the same scene, and two structural suggestions at the end. The measurements are mine; the suggestions come from reading the code and are marked as such. AI-assisted (Claude Code). ## Machine and method RTX 5070 Ti 16 GB (driver 32.0.16.1656), i9-9900K (8 cores, 16 threads), 32 GB RAM, Windows 11, game on NVMe. Build `6594538`, `diag`, shaders translated ahead, Series X profile, windowed, the settings of `play.ps1 -Machine 4070`. Scripted `VICTORY_KEYS` only. Each run is 7 minutes; the figure is the median of the frame lines from 180 s after the world's first frame to the end, always the same scene (the prison window, about 4,700 draws a frame). Runs before the third are slower (pipelines), so the base was run four times: 13.8 to 14.1 fps. ## Base 14.1 fps, 70.9 ms a frame, the card about 68% busy, 26 GB private, 11.4 GB VRAM, free RAM down to 0.3 to 0.6 GB. From the log, per frame: - the submitting thread worked 64.6 ms: 17.2 refreshes (9,771 in 39 flushes, 8,654 of them known to copy nothing), 14.6 copies in the card's memory, 9.6 title bytes under flights' writes, 6.4 asking the write watch, 4.3 planning the card's steps, 3.3 copies and fills, 1.7 sending; - `the card idle behind us` 21.5 ms; the title's threads waited 24.9 ms at presents; 14.3 submissions in the line when one was added, 13.0 of 28 prepared together with the one before; - `copies per frame`: 22,339 refreshes over 17,866 MB, 9,535 MB checked, 9,463 MB of it unchanged; 249 kernel askings over 1,689 MB (5.1 ms); 11.5 ms waiting for the guards, 5.3 ms changing protections; - 235 hash passes and 429 compare passes on the card. ## What was tried, one at a time | Change | fps | Note | |---|---|---| | none | 14.1 | | | `VICTORY_ASK_EARLY=1` | 14.1 | | | `VICTORY_PORT_CONSTANTS=1` | **4.1** | the submitting thread's preparing falls from 59 to 36 ms, but the card goes to 97% and the frame to 244 ms: it reads the heap over the bus | | `VICTORY_PORT_DESCRIPTORS=1` | 13.8 | 7,137 warnings `a view record in the title's heap that no store told of`; with ports 2+6+7 together over 4,000 in five minutes and badly wrong pictures in the cutscenes | | `VICTORY_PORT_CBV=1` (shaders translated again) | 12.7 | picture right, dropped draws 257 against 340 | | `VICTORY_PORT_GUARD=1` | 14.1 | | | `VICTORY_PORT_JOURNAL=1` | 13.6 | | | `VICTORY_WIDE_SPIN=200` | 14.1 | refreshes 15.8 ms, the thread as a whole no faster | | `VICTORY_LANE_CORE=1` | 14.2 | | | `VICTORY_JOIN_PARTS=32 VICTORY_JOIN_LISTS=128` | 13.5 | still 13.0 submissions prepared together | | threads 12/8/6 (the 4090 preset) | no gain | not the same scene, so only an indication | | local patch: `shadow::wide_threads()` from a switch, 8 helpers | 14.0 | twelve helpers still running, not expected to differ | So nothing that only adds hands or moves a lock changes the frame here, and the one change that takes real work off the processor (port 1) gives it to the card over the bus. ## Three counters added locally (no change of behaviour) - **Why tables are made afresh** (`draw.rs`, `tables`): of 40 million groups, 58.6% are fresh because the group holds a constant buffer view, 3.8% only because the table lies past the host heap, 37.6% are not fresh. So about 94% of the fresh tables are the 256-byte alignment of constant views. - **Textures found changed after their upload** (`draw.rs`, the recheck): of 52, the last kernel write told of on their pages (`watch::writing`) was before the upload for 45, never for 5, at or after for 2. Late DirectStorage data is not what changes them; all but six have 9 blocks shown elsewhere. - **`victory warm --used`** says `0 pipelines known` after ordinary runs: it reads the book, and the book is written only with `VICTORY_PIPELINE_BOOK=1`. After one run with it: 2,470 pipelines made in 238 s (median 422 ms, p99 6.0 s, most 19.7 s). The next run was no different: the first two to three minutes in the world still ran at 1 to 4 fps with about 430 pipelines being made, and the steady state was the same 13.8 fps. Perhaps the same thing as #188. Also: `VICTORY_DLSS_4K=performance` ends the process 11 s after start, during NGX's start (log on request). ## Suggestions from reading the code (not measured) 1. **Refreshes are pulled by every submission, though almost none finds anything.** 17.9 GB of ranges are looked at each frame for about 73 MB that changed, and 8,654 of 9,771 refreshes are known to copy nothing before they start. The work that is left is deciding that. Changes pushed once for all the submissions waiting in the line (one asking of the write watch, one pass over the changed pages, the result filed by region of memory) would take the refreshes and the asking, 23.6 ms of the 64.6, off the path of each submission. `behind.rs` already rests on the assumption this needs: what submitted lists read is the card's until a fence behind them. 2. **The lane as two threads in a row**, cut after `send::take`: the card's preludes, Execute and Signal on a second thread in order, while the first goes on with the next submission's processor side. This is item 1 of "What is next" in `docs/findings.md`; the 21.5 ms of card idle behind the thread is what it would win here. 3. **A counter for what ends the joining** at 13 of 28 (which branch of `joinable` / `take_along`). If it is the whole 174 MB heap declared as written, waves of submissions will stay short whatever else is done. I can send any of the logs, or run a branch on this machine with the same method.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:14:38 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 13:09 UTC · original · edited 2026-11-27 13:19 UTC

@⁠marekpastuszczak-lang The 8,654 no-copy refreshes and 64.6 ms on the submitting thread give us a useful baseline. I added the join-reason counter in #271 at b0ac2d8. Add -More @{VICTORY_JOIN_REASONS='1'} to a diagnostics build at cfcf180; Windows CI passed and the counter is now in main. It distinguishes waits, the join limits, a queue boundary and conflicts with earlier writes or CPU copies. The same prison-window interval will let us compare those counters to the 13 of 28 joined submissions you measured.

**@⁠TaynanGT** on GitHub · 2026-11-27 13:09 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267#issuecomment-7219124352) · edited 2026-11-27 13:19 UTC @⁠marekpastuszczak-lang The 8,654 no-copy refreshes and 64.6 ms on the submitting thread give us a useful baseline. I added the join-reason counter in [#271](https://git.gtahub.st/github/TaynanGT--Vice-Tay/pulls/271) at `b0ac2d8`. Add `-More @{VICTORY_JOIN_REASONS='1'}` to a diagnostics build at `cfcf180`; Windows CI passed and the counter is now in main. It distinguishes waits, the join limits, a queue boundary and conflicts with earlier writes or CPU copies. The same prison-window interval will let us compare those counters to the 13 of 28 joined submissions you measured.
Author
Owner

@⁠marekpastuszczak-lang on GitHub · 2026-11-27 14:10 UTC · original

Run with the counter, same machine, method and scene (the prison window, 180 s after the world's first frame to the end; third run of the build so the pipelines are there). Build 7728185, diag, shaders translated again, play.ps1 -Machine 4070 settings with VICTORY_D3D12_DRED=faults as the launcher now has it, plus VICTORY_JOIN_REASONS=1.

Frame rate: 14.1 fps median (p10 13.6, p90 14.5), 70.9 ms, about 4,680 draws: the same as 6594538 this morning.

Join stops per frame (361 lines, steady over the whole interval; the last three read the same to a tenth):

Reason per frame
value wait 4.9 to 5.0
no queued candidate 4.0
earlier write 3.0
list limit 2.0
other job 1.0
folded wait, joining disabled, fence wait, part limit, CPU copy 0.0

That is 15 stops for 28 submissions a frame, which fits the 13.0 prepared together with the one before.

Beside it, from the same interval: 13.9 submissions in the line when one was added, the submitting thread worked 66.0 ms, the title's threads waited 25.5 ms at presents; preparing: 6.4 ms asking the write watch, 9.2 title bytes under flights' writes, refreshes 15.8 ms in 40 flushes of 9,338 (7,992 known to copy nothing), 15.8 copies in the card's memory.

What I read from it, for what it is worth: CPU copies never stop a join here and the part limit is never reached, so neither the title's own copies nor VICTORY_JOIN_PARTS is what keeps the groups short (which is why raising it to 32 changed nothing this morning). A third of the stops are value waits, which no amount of joining gets past, and four a frame are an empty line: the thread catches up with the title four times a frame even though it is the slow side on average. The list limit accounts for two; VICTORY_JOIN_LISTS=128 did not move the joined count either, so those two probably turn into another reason when the limit goes.

I can run it again with other settings or on a branch, same interval.

**@⁠marekpastuszczak-lang** on GitHub · 2026-11-27 14:10 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267#issuecomment-7220430901) Run with the counter, same machine, method and scene (the prison window, 180 s after the world's first frame to the end; third run of the build so the pipelines are there). Build `7728185`, `diag`, shaders translated again, `play.ps1 -Machine 4070` settings with `VICTORY_D3D12_DRED=faults` as the launcher now has it, plus `VICTORY_JOIN_REASONS=1`. **Frame rate:** 14.1 fps median (p10 13.6, p90 14.5), 70.9 ms, about 4,680 draws: the same as `6594538` this morning. **Join stops per frame** (361 lines, steady over the whole interval; the last three read the same to a tenth): | Reason | per frame | |---|---| | value wait | 4.9 to 5.0 | | no queued candidate | 4.0 | | earlier write | 3.0 | | list limit | 2.0 | | other job | 1.0 | | folded wait, joining disabled, fence wait, part limit, CPU copy | 0.0 | That is 15 stops for 28 submissions a frame, which fits the 13.0 prepared together with the one before. Beside it, from the same interval: 13.9 submissions in the line when one was added, the submitting thread worked 66.0 ms, the title's threads waited 25.5 ms at presents; preparing: 6.4 ms asking the write watch, 9.2 title bytes under flights' writes, refreshes 15.8 ms in 40 flushes of 9,338 (7,992 known to copy nothing), 15.8 copies in the card's memory. What I read from it, for what it is worth: CPU copies never stop a join here and the part limit is never reached, so neither the title's own copies nor `VICTORY_JOIN_PARTS` is what keeps the groups short (which is why raising it to 32 changed nothing this morning). A third of the stops are value waits, which no amount of joining gets past, and four a frame are an empty line: the thread catches up with the title four times a frame even though it is the slow side on average. The list limit accounts for two; `VICTORY_JOIN_LISTS=128` did not move the joined count either, so those two probably turn into another reason when the limit goes. I can run it again with other settings or on a branch, same interval.
Author
Owner

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

@⁠marekpastuszczak-lang The counter accounts for all 15 stops, and the five value waits plus four empty-queue stops are the biggest buckets. Please rerun the same prison window on main with #286 first. Keep the warmed cache and compare send preparation, queued work and frame time. That gives us a fresh baseline for #284.

**@⁠TaynanGT** on GitHub · 2026-11-27 14:25 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267#issuecomment-7220759937) @⁠marekpastuszczak-lang The counter accounts for all 15 stops, and the five value waits plus four empty-queue stops are the biggest buckets. Please rerun the same prison window on `main` with #286 first. Keep the warmed cache and compare send preparation, queued work and frame time. That gives us a fresh baseline for #284.
Author
Owner

@⁠marekpastuszczak-lang on GitHub · 2026-11-27 18:38 UTC · original

Rerun done, with a caveat up front: I only got a warm run for d076657 (with #284). The f386fc9 baseline (with #286, without #284) never reached an empty pipeline queue in four 7-minute runs, so I am not giving a before/after for #284.

Same machine, scene and method as before (RTX 5070 Ti, i9-9900K, prison window, medians of the log lines from 180 s after the world's first frame to the end, diag, the same switches as 7728185 this morning, VICTORY_JOIN_REASONS=1).

median per frame 7728185 (this morning, warm) d076657 (warm, one run)
fps 14.1 13.6
frame 70.9 ms 73.2 ms
submitting thread worked 67.4 ms 70.1 ms
title threads waiting at presents 25.8 ms 28.8 ms
asking the write watch 6.1 6.3
title bytes under flights' writes 10.4 11.6
lists' steps (of them refreshes) 23.0 (15.9) 25.4 (17.5)
copies in the card's memory 16.5 15.5
planning the card's steps 4.6 5.9
sending the lists 1.7 1.7
nothing of ours queued on the card 18.2 ms (74% busy) 25.9 ms (65% busy)
submissions prepared with the one before 13.0 13.0
landed list recycling - 0.0 ms submitting, 9.0 ms helper

So #284 does what it says (recycling is off the submitting thread, 9 ms a frame on the helper), but on this machine the frame on d076657 is not shorter than on 7728185; the 0.5 fps difference is just above my run-to-run noise (about 0.3), from one run, and 40-odd commits apart, so I would not pin it on any one change. The join stops are unchanged (5.0 value wait, 4.0 empty queue, 3.0 earlier write, 2.0 list limit, 1.0 other job).

Something that may matter more: the pipeline queue after this update. Going from 7728185 to f386fc9 (shaders translated ahead again with victory shaders):

run build pipelines still "being made" at the end
1 f386fc9 296
2 f386fc9 197
3 f386fc9 171
4 d076657 57
5 d076657 0
6 f386fc9 again 144 (the run started at about 545)
7 d076657 0 from the start

While the queue is there the world runs at 3.5 fps with the picture badly broken (in the first run 850 to 1,000 draws a frame dropped). In run 1 the queue fell from about 585 by roughly one pipeline every 6 s for minutes, with VICTORY_PIPELINE_WORKERS=3. For comparison, the update from 6594538 to 7728185 earlier today drained in the first run. Run 6 suggests that going back to the other executable makes a good part of them again. I can send slow-pipelines.txt and the logs.

AI-assisted (Claude Code).

**@⁠marekpastuszczak-lang** on GitHub · 2026-11-27 18:38 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267#issuecomment-7225707086) Rerun done, with a caveat up front: I only got a warm run for `d076657` (with #284). The `f386fc9` baseline (with #286, without #284) never reached an empty pipeline queue in four 7-minute runs, so I am not giving a before/after for #284. Same machine, scene and method as before (RTX 5070 Ti, i9-9900K, prison window, medians of the log lines from 180 s after the world's first frame to the end, `diag`, the same switches as `7728185` this morning, `VICTORY_JOIN_REASONS=1`). | median per frame | `7728185` (this morning, warm) | `d076657` (warm, one run) | |---|---|---| | fps | 14.1 | 13.6 | | frame | 70.9 ms | 73.2 ms | | submitting thread worked | 67.4 ms | 70.1 ms | | title threads waiting at presents | 25.8 ms | 28.8 ms | | asking the write watch | 6.1 | 6.3 | | title bytes under flights' writes | 10.4 | 11.6 | | lists' steps (of them refreshes) | 23.0 (15.9) | 25.4 (17.5) | | copies in the card's memory | 16.5 | 15.5 | | planning the card's steps | 4.6 | 5.9 | | sending the lists | 1.7 | 1.7 | | nothing of ours queued on the card | 18.2 ms (74% busy) | 25.9 ms (65% busy) | | submissions prepared with the one before | 13.0 | 13.0 | | landed list recycling | - | 0.0 ms submitting, 9.0 ms helper | So #284 does what it says (recycling is off the submitting thread, 9 ms a frame on the helper), but on this machine the frame on `d076657` is not shorter than on `7728185`; the 0.5 fps difference is just above my run-to-run noise (about 0.3), from one run, and 40-odd commits apart, so I would not pin it on any one change. The join stops are unchanged (5.0 value wait, 4.0 empty queue, 3.0 earlier write, 2.0 list limit, 1.0 other job). **Something that may matter more: the pipeline queue after this update.** Going from `7728185` to `f386fc9` (shaders translated ahead again with `victory shaders`): | run | build | pipelines still "being made" at the end | |---|---|---| | 1 | `f386fc9` | 296 | | 2 | `f386fc9` | 197 | | 3 | `f386fc9` | 171 | | 4 | `d076657` | 57 | | 5 | `d076657` | 0 | | 6 | `f386fc9` again | 144 (the run started at about 545) | | 7 | `d076657` | 0 from the start | While the queue is there the world runs at 3.5 fps with the picture badly broken (in the first run 850 to 1,000 draws a frame dropped). In run 1 the queue fell from about 585 by roughly one pipeline every 6 s for minutes, with `VICTORY_PIPELINE_WORKERS=3`. For comparison, the update from `6594538` to `7728185` earlier today drained in the first run. Run 6 suggests that going back to the other executable makes a good part of them again. I can send `slow-pipelines.txt` and the logs. AI-assisted (Claude Code).
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 18:42 UTC · original

@⁠marekpastuszczak-lang The warm d076657 run confirms the reset work moved: 0.0 ms on the submit thread and 9.0 ms on the helper. The f386fc9 runs are evidence of slow pipeline preparation. If you have a summary, the pending counts and the slowest compilation times are enough to compare when an executable is reused and when it changes.

**@⁠TaynanGT** on GitHub · 2026-11-27 18:42 UTC · [original](https://github.com/TaynanGT/Vice-Tay/issues/267#issuecomment-7225780544) @⁠marekpastuszczak-lang The warm `d076657` run confirms the reset work moved: 0.0 ms on the submit thread and 9.0 ms on the helper. The `f386fc9` runs are evidence of slow pipeline preparation. If you have a summary, the pending counts and the slowest compilation times are enough to compare when an executable is reused and when it changes.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/TaynanGT--Vice-Tay#267
No description provided.