HLE: fail DirectStorage startup when no worker can start #3207
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3207
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3207"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@yumaste on GitHub · 2026-11-26 12:46 UTC · original
yumaste:fix/dstorage-worker-startup→main· +53 −39 · 1 files · 2 commits · openProblem
If every DirectStorage worker thread fails to start, the scheduler is still published. Queue creation then succeeds, but there is no worker to run submitted requests. Reads remain pending and a caller waiting for completion or queue capacity can hang.
Change
Publish the scheduler only after at least one worker starts. If none start, queue creation and staging configuration report
E_OUTOFMEMORY. A partial worker pool still services queues. The process still attempts initialization once. The title stops at startup when staging setup fails, as noted at the call site. It now sees the error there instead of hanging while waiting for I/O.Validation
cargo test --locked -p victory-hle -- --test-threads=1: 153 unit tests and 2 integration tests passed on Windows.cargo clippy --locked -p victory-hle --all-targets --all-features -- -D warningsandcargo xtask policypassed.Coordination claim. Synthetic test data only. AI-assisted (Codex).
@cloph-dsp on GitHub · 2026-11-26 13:03 UTC · original
Independent local verification of head
7088627on Windows 11, Rust 1.100.0/MSVC:cargo test --locked -p victory-hle --lib -- modules::dstorage::tests::a_scheduler_requires_at_least_one_worker --exact— 1 passed, 0 failed.git diff --check origin/main HEAD— clean.Used a worktree-local
CARGO_TARGET_DIR. The scheduler test uses synthetic spawn closures; no D3D12 device or game assets were used. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only).@AurumCarlos on GitHub · 2026-11-26 13:05 UTC · original · reviewed
Looks good to me. The doc comment on
scheduler()already promised "Noneif not even one worker could start", and onmainthe code never did that: the scheduler was published beforeSTARTEDran, whatever the spawn count. This makes the code match the comment. I checked it againstmain:create_queuealready mapsNonetoE_OUTOFMEMORY, so with no workers a title now fails at queue creation instead of hanging on its first read.close_lane,queueandsubmitall need a queue that already exists, so they can't hitNonein practice.get_or_init: the workers start while theOnceLockis still initialising. That's safe becausework→executenever callsscheduler(), so no worker can block on the cell it's being started from. Onmainthis was guaranteed by the separateOnce; now it relies on that call graph, so a short comment onstart("workers must not callscheduler()") would keep it from breaking quietly later.Arcinstead of&'static: needed now that the workers start before the scheduler is in the static. The failure path drops it cleanly, and a partial pool keeps its own clones. 👍set_staging_buffer_size: returningE_OUTOFMEMORYthere means Grand Theft Auto VI stops at startup (per the comment above it) instead of hanging later. A clear failure is better here. It might be worth one line in the PR description that this is the visible effect for that title.The test exercises
startwith injected spawns, which covers the decision itself. TheE_OUTOFMEMORYpaths stay untested becausescheduler()is a process-wideOnceLock, which is fair.@yumaste on GitHub · 2026-11-26 13:12 UTC · original
Thanks.
09dadafdocuments why workers receive the scheduler directly and must not callscheduler()while theOnceLockis initializing. I also added the startup behavior to the PR description. The synthetic scheduler test still passes.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.