Let DirectStorage fill spare staging space across queues #885

Open
Lkxex wants to merge 1 commit from upstream-pr/886 into main
Lkxex commented 2026-11-25 11:47:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Lkxex on 2026-11-25T11:47:33Z.


Problem

DirectStorage admission currently picks a queue head before checking staging capacity. If the selected read needs more staging than is free, the workers wait even while another queue has a read that fits. This can serialize independent streaming requests behind a large read.

Change

Allow one already-accounted, fitting read from another queue to use the available staging budget. Reserve the next eligible admission for the blocked read to prevent a stream of small requests from continually taking its capacity. Queue-local FIFO, completion status ordering, and the existing oversized-request rule stay in place. The fallback uses the same staging accounting as ordinary dispatch.

The synthetic regression starts with 60 of 100 staging units in use. An 80-unit request is next, and a separate queue has a 20-unit request. Before the change the idle worker cannot take it. After the change it can run that request while the 80-unit read waits. A second 20-unit request cannot bypass the same blocked read.

Validation

  • The synthetic scheduler regression fails on the base commit and passes with the change.
  • cargo test --locked -p victory-hle and git diff --check.
  • No game data used. In-world asset latency and frame time were not measured. The single bypass may temporarily delay the blocked read if the smaller read is still in flight when staging is released.

AI-assisted change.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6603770902 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/886). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T11:47:33Z. --- ### Problem DirectStorage admission currently picks a queue head before checking staging capacity. If the selected read needs more staging than is free, the workers wait even while another queue has a read that fits. This can serialize independent streaming requests behind a large read. ### Change Allow one already-accounted, fitting read from another queue to use the available staging budget. Reserve the next eligible admission for the blocked read to prevent a stream of small requests from continually taking its capacity. Queue-local FIFO, completion status ordering, and the existing oversized-request rule stay in place. The fallback uses the same staging accounting as ordinary dispatch. The synthetic regression starts with 60 of 100 staging units in use. An 80-unit request is next, and a separate queue has a 20-unit request. Before the change the idle worker cannot take it. After the change it can run that request while the 80-unit read waits. A second 20-unit request cannot bypass the same blocked read. ### Validation - The synthetic scheduler regression fails on the base commit and passes with the change. - `cargo test --locked -p victory-hle` and `git diff --check`. - No game data used. In-world asset latency and frame time were not measured. The single bypass may temporarily delay the blocked read if the smaller read is still in flight when staging is released. AI-assisted change.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/886:upstream-pr/886'
git switch 'upstream-pr/886'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/886'
git switch 'upstream-pr/886'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/886'
git switch 'upstream-pr/886'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/886'
git switch 'main'
git merge --squash 'upstream-pr/886'
git switch 'main'
git merge --ff-only 'upstream-pr/886'
git switch 'main'
git merge 'upstream-pr/886'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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
fxceless/victory-fork!885
No description provided.