hle: validate DirectStorage staging buffer sizes (NEW-83) #2507

Closed
github-bot wants to merge 1 commit from gh-pr/2507/head into gh-pr/2507/base
Owner

@⁠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 merging

IDStorageFactoryX::SetStagingBufferSize accepted 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 return E_INVALIDARG and 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 f3578e3 preserves both the upstream legacy-multiply test and the accepted logarithm regression in valu_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_VIOLATION in heap_direct_texture_reads_mark_their_heap_index on 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 842b0cb completed without conflicts. The validation results above apply to the pinned merge parent f3578e3; the two later upstream commits have not been included in the executed validation.

**@⁠TheGrayOrange** on GitHub · 2026-11-25 15:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2507) `TheGrayOrange:task/new-83-dstorage-staging-submission` → `main` · +176 −0 · 1 files · 1 commits · closed without merging `IDStorageFactoryX::SetStagingBufferSize` accepted 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 return `E_INVALIDARG` and 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)](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)](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](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633)](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) ### Merge resolution and current-base validation The merge with upstream `f3578e3` preserves both the upstream legacy-multiply test and the accepted logarithm regression in `valu_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_VIOLATION` in `heap_direct_texture_reads_mark_their_heap_index` on 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 `842b0cb` completed without conflicts. The validation results above apply to the pinned merge parent `f3578e3`; the two later upstream commits have not been included in the executed validation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:45 +00:00
github-bot closed this pull request 2026-11-26 05:07:45 +00:00
Author
Owner

@⁠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_size in crates/victory-hle/src/modules/dstorage.rs serves one title, which asks for 32 MiB (as the existing doc comment says). The scheduler handles any capacity, so rejecting other sizes with an E_INVALIDARG that 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

**@⁠Marvisak** on GitHub · 2026-11-25 15:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2507#issuecomment-7167492378) <!-- victory-triage v1 head=37f57007fae3b8f6d19f12640ef811543b1e3ae8 verdict=proposed-close at=2026-11-25T15:58:45Z --> 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_size` in `crates/victory-hle/src/modules/dstorage.rs` serves one title, which asks for 32 MiB (as the existing doc comment says). The scheduler handles any capacity, so rejecting other sizes with an `E_INVALIDARG` that 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](https://claude.ai/code)_
Author
Owner

@⁠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.

**@⁠TheGrayOrange** on GitHub · 2026-11-26 02:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/2507#issuecomment-7180971503) · 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2507
No description provided.