Proposal: Hardware-aware worker pool sizing and adaptive concurrency #39

Open
opened 2026-11-29 13:44:27 +00:00 by nativ69 · 1 comment
nativ69 commented 2026-11-29 13:44:27 +00:00 (Migrated from github.com)
Contributor

Imported from edsuuu/VI-BR-PORT. Originally posted by nativ69 on 2026-11-29T13:44:27Z.


Motivation

Victory currently uses fixed defaults for several worker pools, regardless of the host CPU topology and the resources required by other pools.

My performance testing suggests that reducing the number of thin translation threads can significantly improve performance, potentially by reducing CPU and memory contention.

Benchmarks

Test environment

  • CPU: AMD Ryzen 7 5800X (8C/16T)
  • GPU: RTX 4070 12GB
  • RAM: 32GB DDR4-3200
  • Branch: dev
  • Xbox Series S, 1080p, release build
  • Warm pipeline cache
  • Benchmark sequence: From the opening café scene to the point where Lucia looks out of the window in her prison cell.

Results

All tests were performed with VICTORY_PIPELINE_WORKERS=10, varying only VICTORY_THIN_THREADS.

Metric 2 threads 4 threads 6 threads 8 threads (default)
Median FPS 10.55 17.6 14.5 13.3
Prison cell median FPS 13.5 19.9 17.6 15.6
Preparing 42ms 43.3ms 55.5ms 65.2ms
Copies 15.6ms 17.1ms 21.2ms 27ms
Heap buffers 8.1ms 9ms 12.2ms 17.7ms
CPU utilization 65.2% 76.9% 86.3% 90.8%
Peak private memory 24.20 GiB 24.42 GiB 25.83 GiB 25.63 GiB

Prison cell FPS represents the median of the last three samples.

Reducing VICTORY_THIN_THREADS from 8 to 4 resulted in:

  • 32.3% higher median FPS across the benchmark sequence.
  • 27.6% higher median FPS in the prison cell.
  • Lower CPU utilization, frame preparation times and memory copy overhead.
  • Comparable draw calls and dropped draws per frame.

Note

These tests cover the same sequence with a warm pipeline cache. Results may differ during normal gameplay, particularly when entering new areas, streaming assets and compiling additional pipelines.
These benchmarks were performed on an earlier revision of the dev branch. Further testing is needed to validate the results against the latest changes and across different hardware configurations.

Proposal

Phase A: Hardware-aware defaults

Automatically configure the following parameters at startup, based on the host CPU's available physical/logical cores and topology:

  • VICTORY_THIN_THREADS
  • VICTORY_PIPELINE_WORKERS

This could initially be implemented in the launcher or startup script, while preserving explicit user overrides.

Rather than sizing each pool independently, their combined CPU requirements should be considered alongside the game engine and other Victory worker pools.

The sizing formula should be validated across different CPU configurations.

Phase B: Runtime adaptive concurrency

As a longer-term improvement, consider adjusting active worker counts at runtime based on:

  • Pipeline compilation backlog
  • Thin translation queue depth
  • CPU contention
  • GPU starvation
  • Frame preparation times
  • Memory pressure

This could allow CPU resources to be allocated differently during initial loading, steady-state gameplay and transitions into new areas.

Discussion

I'd like to hear the maintainers' and other contributors' thoughts before implementing this.

  • Would hardware-aware defaults be a reasonable first step?
  • Should worker sizing be handled by the launcher or internally by Victory?
  • Should worker pools share a coordinated CPU budget?
  • Can contributors reproduce similar results on other CPU configurations?

Additional benchmarks across different CPUs, with both cold and warm pipeline caches, would help establish sensible defaults.

<!-- greyfinch-sync:edsuuu/VI-BR-PORT:issue:6679447385 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/issues/39). Originally posted by [nativ69](https://github.com/nativ69) on 2026-11-29T13:44:27Z. --- ## Motivation Victory currently uses fixed defaults for several worker pools, regardless of the host CPU topology and the resources required by other pools. My performance testing suggests that reducing the number of thin translation threads can significantly improve performance, potentially by reducing CPU and memory contention. ## Benchmarks ### Test environment - CPU: AMD Ryzen 7 5800X (8C/16T) - GPU: RTX 4070 12GB - RAM: 32GB DDR4-3200 - Branch: `dev` - Xbox Series S, 1080p, release build - Warm pipeline cache - Benchmark sequence: From the opening café scene to the point where Lucia looks out of the window in her prison cell. ### Results All tests were performed with `VICTORY_PIPELINE_WORKERS=10`, varying only `VICTORY_THIN_THREADS`. | Metric | 2 threads | 4 threads | 6 threads | 8 threads (default) | |---|---:|---:|---:|---:| | Median FPS | 10.55 | **17.6** | 14.5 | 13.3 | | Prison cell median FPS | 13.5 | **19.9** | 17.6 | 15.6 | | Preparing | 42ms | 43.3ms | 55.5ms | 65.2ms | | Copies | 15.6ms | 17.1ms | 21.2ms | 27ms | | Heap buffers | 8.1ms | 9ms | 12.2ms | 17.7ms | | CPU utilization | 65.2% | 76.9% | 86.3% | 90.8% | | Peak private memory | 24.20 GiB | 24.42 GiB | 25.83 GiB | 25.63 GiB | Prison cell FPS represents the median of the last three samples. Reducing `VICTORY_THIN_THREADS` from 8 to 4 resulted in: - **32.3% higher median FPS** across the benchmark sequence. - **27.6% higher median FPS** in the prison cell. - Lower CPU utilization, frame preparation times and memory copy overhead. - Comparable draw calls and dropped draws per frame. > [!NOTE] > These tests cover the same sequence with a warm pipeline cache. Results may differ during normal gameplay, particularly when entering new areas, streaming assets and compiling additional pipelines. > These benchmarks were performed on an earlier revision of the `dev` branch. Further testing is needed to validate the results against the latest changes and across different hardware configurations. ## Proposal ### Phase A: Hardware-aware defaults Automatically configure the following parameters at startup, based on the host CPU's available physical/logical cores and topology: - `VICTORY_THIN_THREADS` - `VICTORY_PIPELINE_WORKERS` This could initially be implemented in the launcher or startup script, while preserving explicit user overrides. Rather than sizing each pool independently, their combined CPU requirements should be considered alongside the game engine and other Victory worker pools. The sizing formula should be validated across different CPU configurations. ### Phase B: Runtime adaptive concurrency As a longer-term improvement, consider adjusting active worker counts at runtime based on: - Pipeline compilation backlog - Thin translation queue depth - CPU contention - GPU starvation - Frame preparation times - Memory pressure This could allow CPU resources to be allocated differently during initial loading, steady-state gameplay and transitions into new areas. ## Discussion I'd like to hear the maintainers' and other contributors' thoughts before implementing this. - Would hardware-aware defaults be a reasonable first step? - Should worker sizing be handled by the launcher or internally by Victory? - Should worker pools share a coordinated CPU budget? - Can contributors reproduce similar results on other CPU configurations? Additional benchmarks across different CPUs, with both cold and warm pipeline caches, would help establish sensible defaults.
github-actions[bot] commented 2026-11-29 13:44:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from edsuuu/VI-BR-PORT. Originally posted by github-actions[bot] on 2026-11-29T13:44:35Z.


Thanks for the report. A few details will help us reproduce it.

Please add:

  • What happened, what you expected, and the steps
  • The GPU and its memory, Windows 10 or 11, and the PC's RAM
  • The launcher and engine versions (both window titles show them) and the profile (Series S or X)
  • Launcher logs from %APPDATA%\VI-BR-PORT\logs\ (open.log, shaders.log, warm.log), or the launcher's Logs panel and its Copy button
  • After a crash, also %LOCALAPPDATA%\victory\data\7952987A\crashes.log and the newest *.crash.log in that folder's temp\

Paste the text or drag the files into this issue. Thank you.


Obrigado pelo relato. Alguns detalhes ajudam a reproduzir.

Por favor, inclua:

  • O que aconteceu, o que era esperado e os passos
  • A placa de vídeo e a memória dela, Windows 10 ou 11, e a RAM do PC
  • As versões do launcher e do motor (os títulos das duas janelas mostram) e o perfil (Series S ou X)
  • Os logs do launcher em %APPDATA%\VI-BR-PORT\logs\ (open.log, shaders.log, warm.log), ou o painel Logs do launcher e o botão Copy
  • Depois de um crash, também %LOCALAPPDATA%\victory\data\7952987A\crashes.log e o *.crash.log mais novo na pasta temp\ dessa pasta

Pode colar o texto ou arrastar os arquivos nesta issue. Obrigado.

<!-- greyfinch-sync:edsuuu/VI-BR-PORT:comment:7256767156 --> Imported from [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT/issues/39#issuecomment-7256767156). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T13:44:35Z. --- Thanks for the report. A few details will help us reproduce it. Please add: - What happened, what you expected, and the steps - The GPU and its memory, Windows 10 or 11, and the PC's RAM - The launcher and engine versions (both window titles show them) and the profile (Series S or X) - Launcher logs from `%APPDATA%\VI-BR-PORT\logs\` (`open.log`, `shaders.log`, `warm.log`), or the launcher's Logs panel and its Copy button - After a crash, also `%LOCALAPPDATA%\victory\data\7952987A\crashes.log` and the newest `*.crash.log` in that folder's `temp\` Paste the text or drag the files into this issue. Thank you. --- Obrigado pelo relato. Alguns detalhes ajudam a reproduzir. Por favor, inclua: - O que aconteceu, o que era esperado e os passos - A placa de vídeo e a memória dela, Windows 10 ou 11, e a RAM do PC - As versões do launcher e do motor (os títulos das duas janelas mostram) e o perfil (Series S ou X) - Os logs do launcher em `%APPDATA%\VI-BR-PORT\logs\` (`open.log`, `shaders.log`, `warm.log`), ou o painel Logs do launcher e o botão Copy - Depois de um crash, também `%LOCALAPPDATA%\victory\data\7952987A\crashes.log` e o `*.crash.log` mais novo na pasta `temp\` dessa pasta Pode colar o texto ou arrastar os arquivos nesta issue. Obrigado. <!-- issue-logs -->
Sign in to join this conversation.
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
edsuuu/VI-BR-PORT#39
No description provided.