hle: validate DirectStorage staging buffer sizes (NEW-83) #2507
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!2507
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2507/head"
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?
@TheGrayOrange on GitHub · 2026-11-25 15:00 UTC · original
TheGrayOrange:task/new-83-dstorage-staging-submission→main· +176 −0 · 1 files · 1 commits · closed without mergingIDStorageFactoryX::SetStagingBufferSizeaccepted arbitrary byte counts and stored them in the scheduler. The documented Xbox Series capacities are 0, 16, 20, 24, 28 and 32 MiB. This change checks the size before touching scheduler state. Unsupported values returnE_INVALIDARGand leave the configured capacity intact. Supported values, including zero, retain their existing behavior. Microsoft leaves the exact failure HRESULT unspecified, so this uses the module’s existing invalid-argument convention. [Xbox Series staging buffer](https://learn.microsoft.com/en-us/gaming/gdk/docs/features/console/storage/directstorage/directstorage-overview?view=gdk-2604#staging-buffer) · [Factory method](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/dstorage/interfaces/idstoragefactoryx/methods/idstoragefactoryx_setstagingbuffersize?view=gdk-2604)The CPU-only regression calls the existing factory interface in an isolated subprocess. It checks all six supported values, 16 unsupported values and recovery after rejection. The parent requires a completion acknowledgement after all 25 checks. The identical regression failed against the original implementation because a one-byte capacity returned success. The revised implementation passed
cargo test --locked -p victory-hle --lib dstorage.On
940d32f69b22265690a0b5a15d6ded572ba33baf, the normal workspace suite moved from 695/5/10 to 696/5/11, and the all-feature suite from 700/5/10 to 701/5/11 (passed/failed/ignored). Each adds one passing regression and one ignored helper. The same five base failures reproduced in descriptor capacity, dynamic slots, structured-buffer stride, an unbound heap-buffer read and a NaN-coordinate gather. Both warning-denied workspace Clippy configurations and asset-policy checks passed, and formatter diagnostics matched the base.Object-lifetime restrictions are outside this change. Real-console behavior and game compatibility remain unverified. Upstream CI has yet to run on this submission.
Developed with Strata/Qwen3.8FlashNext and independently verified using Codex with human supervision. [Community claim NEW-83](#1633)
Merge resolution and current-base validation
The merge with upstream
f3578e3preserves both the upstream legacy-multiply test and the accepted logarithm regression invalu_tests.rs. The grouped correction is unchanged. NVIDIA RTX 4070 Ti SUPER and WARP each passed all 260 permanent nonzero in-band inputs and returned exact positive zero at unity. The maximum measured error was 0.605534 ULP on both. All boundary, special-value and fallback results matched the prior validation. The legacy-multiply regression and SDK DXIL validation passed.Both unfiltered locked Windows configurations reproduced the same pre-existing
STATUS_ACCESS_VIOLATIONinheap_direct_texture_reads_mark_their_heap_indexon upstream and on the merge. Running the remaining cases with that single test filtered reconciled the normal baseline and merge to 862/5/10 and 863/5/10, and all features to 879/5/10 and 880/5/10 (passed/failed/ignored, plus the separately recorded inherited crash). The only added case was the passing logarithm regression. The five assertion failures, their signatures, and skip conditions matched upstream. Warning-denied Clippy and asset policy passed, and formatting diagnostics were unchanged.The upstream emitter now removes unused operations from the DXIL containers. The live logarithm and benchmark instructions and shader metadata are unchanged. Earlier numerical and sampled device evidence still applies to that arithmetic. The performance figures remain historical measurements on the earlier containers.
A subsequent merge preview against upstream
842b0cbcompleted without conflicts. The validation results above apply to the pinned merge parentf3578e3; the two later upstream commits have not been included in the executed validation.@Marvisak on GitHub · 2026-11-25 15:59 UTC · original
Automated triage for the maintainers.
Proposed for closing: this adds a guard for a case that does not occur, and it can only turn a call that works today into a failure.
set_staging_buffer_sizeincrates/victory-hle/src/modules/dstorage.rsserves one title, which asks for 32 MiB (as the existing doc comment says). The scheduler handles any capacity, so rejecting other sizes with anE_INVALIDARGthat the PR itself says is not console-verified fixes nothing the title hits. The change is 4 lines of logic and about 160 lines of test that spawns a child test process, which is more test machinery than the change needs. CI has not run on this head.This PR will be closed in 48 hours unless the author pushes a change (for example, evidence that the title passes another size and depends on the failure) or a maintainer removes the label. Thank you for the careful work all the same.
Generated by Claude Code
@TheGrayOrange on GitHub · 2026-11-26 02:37 UTC · original · edited 2026-11-26 02:39 UTC
Confirmed that the public title startup trace reports a 32 MiB staging-buffer request, consistent with the observations. Found no evidence that the current title requests an unsupported capacity or depends on its rejection.
While the change enforces the documented capacity restrictions, its practical benefit in unsubstantiated.
The investigation also reproduced staging-related head-of-line blocking under the supported 32 MiB configuration, but PR #1457 already addresses that separate issue.
Closure concurred.
Pull request closed