DirectStorage: fewer read workers at the start, the rest later (start-up int3 on a 16-thread Ryzen) #368

Open
github-bot wants to merge 2 commits from github-bot/gh-368 into main AGit
Owner

@⁠afutuga on GitHub · 2026-11-27 21:31 UTC · original
afutuga:dstorage-workers → main · +38 −9 · 1 files · 2 commits · open

PC: Windows 10 22H2 (19045), RTX 4060 Ti 16 GB, Ryzen 7 5700X (8 cores, 16 threads), 32 GB.
Built from source, release profile.

The problem

After a few good sessions, every start began to end about 2 seconds in, during "Game Init", with
the title's own breakpoint:

VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x22106e0

followed by the title's crash report. It was the same in every run: Series X and S, with and
without DLSS / frame generation, GPU scheduling on and off, a clean NVIDIA driver, fresh game
files, an empty data folder, empty shader / pipeline / image caches, and a freshly built
victory.exe.

What changes it

  • A diagnostics build with VICTORY_LOG=info,victory_hle::modules::dstorage=trace starts and runs
    normally (about 100,000 "request done" lines; the workers queue on the log writer).
    With victory_hle=debug only, it still stops.
  • With debug logging, the last thing before the breakpoint is always a run of dstorage: submit
    batches, right after InitializeApiImplEx2.
  • VICTORY_DSTORAGE_IO=one does not help.
  • One DirectStorage worker does: with this change and VICTORY_DSTORAGE_WORKERS=1 the release
    build starts and plays. But with one worker for the whole session things show late in play.

So it looks like a timing race between the workers' completions and the title that shows up only
when all sixteen workers run freely.

This change

  • VICTORY_DSTORAGE_WORKERS=<n> caps the DirectStorage pool at n workers at the start (at most
    one a CPU thread; the file handles stay as they are).
  • VICTORY_DSTORAGE_WORKERS_AFTER=<seconds> starts the rest of the pool that long after the first
    read, so streaming in play gets all of them back.

With VICTORY_DSTORAGE_WORKERS=1 and VICTORY_DSTORAGE_WORKERS_AFTER=60 the title starts, the
log shows the pool going to 16 at 60 s, and it plays on without stopping.

Without the switches nothing changes. It is a workaround for players who hit this; the real fix is
probably in how a request's completion is published to the title.

**@⁠afutuga** on GitHub · 2026-11-27 21:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/368) `afutuga:dstorage-workers` → `main` · +38 −9 · 1 files · 2 commits · open **PC:** Windows 10 22H2 (19045), RTX 4060 Ti 16 GB, Ryzen 7 5700X (8 cores, 16 threads), 32 GB. Built from source, release profile. ## The problem After a few good sessions, every start began to end about 2 seconds in, during "Game Init", with the title's own breakpoint: VIctory: unhandled exception 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x22106e0 followed by the title's crash report. It was the same in every run: Series X and S, with and without DLSS / frame generation, GPU scheduling on and off, a clean NVIDIA driver, fresh game files, an empty data folder, empty shader / pipeline / image caches, and a freshly built `victory.exe`. ## What changes it - A diagnostics build with `VICTORY_LOG=info,victory_hle::modules::dstorage=trace` starts and runs normally (about 100,000 "request done" lines; the workers queue on the log writer). With `victory_hle=debug` only, it still stops. - With debug logging, the last thing before the breakpoint is always a run of `dstorage: submit` batches, right after `InitializeApiImplEx2`. - `VICTORY_DSTORAGE_IO=one` does **not** help. - One DirectStorage worker does: with this change and `VICTORY_DSTORAGE_WORKERS=1` the release build starts and plays. But with one worker for the whole session things show late in play. So it looks like a timing race between the workers' completions and the title that shows up only when all sixteen workers run freely. ## This change - `VICTORY_DSTORAGE_WORKERS=<n>` caps the DirectStorage pool at n workers at the start (at most one a CPU thread; the file handles stay as they are). - `VICTORY_DSTORAGE_WORKERS_AFTER=<seconds>` starts the rest of the pool that long after the first read, so streaming in play gets all of them back. With `VICTORY_DSTORAGE_WORKERS=1` and `VICTORY_DSTORAGE_WORKERS_AFTER=60` the title starts, the log shows the pool going to 16 at 60 s, and it plays on without stopping. Without the switches nothing changes. It is a workaround for players who hit this; the real fix is probably in how a request's completion is published to the title.
On a Ryzen 7 5700X (16 threads, Windows 10) the title stopped itself with its own
breakpoint (0x80000003 at +0x22106e0) about 2 s into every start, right after a run of
DirectStorage submits. A diagnostics build tracing every finished request (which
makes the workers queue on the log writer) started normally, and so does one worker.
VICTORY_DSTORAGE_IO=one did not help.

Off by default: without the switch the pool is one worker a CPU thread, as before.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:33:46 +00:00
github-bot changed title from DirectStorage: VICTORY_DSTORAGE_WORKERS caps the read workers (start-up int3 on a 16-thread Ryzen) to DirectStorage: fewer read workers at the start, the rest later (start-up int3 on a 16-thread Ryzen) 2026-11-27 21:52:54 +00:00
With VICTORY_DSTORAGE_WORKERS=1 the start is safe, but streaming in play is left to
one worker and things show late. VICTORY_DSTORAGE_WORKERS_AFTER=<seconds> starts the
rest of the pool (one worker a CPU thread) that long after the first read. Tested on
the same PC with 1 and 60: the title started, the pool went to 16 at 60 s, no stop.

Without the switch nothing changes.
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/dstorage.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/368/head:github-bot/gh-368'
git switch 'github-bot/gh-368'

Merge

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