DirectStorage: validate request sizes before allocation #1785
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1785
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1785"
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?
@yaxis1 on GitHub · 2026-11-24 20:37 UTC · original
yaxis1:fix/dstorage-request-allocation→main· +81 −18 · 3 files · 1 commits · openSummary
E_OUTOFMEMORY.Tested
git diff --checkpassed.Not tested
(error 4551).
AI use
AI assistance was used to implement and review these changes.
@frenziedcoder on GitHub · 2026-11-24 20:55 UTC · original
NVIDIA test report for
73a6454: the description has no test run (Application Control), so here is one. Full suite green, the PR's own test passing, and a clean smoke pair (1654 vs 1654 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head73a645459971606375a9f8191771253039a49aa7, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 864 passed, 0 failed, 42 ignored; all 18hle::dstorage::testspass. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
4178e88, this PR's base; the same base run as in my report on #1747):this PR:
Not tested: the world load (where this title's DirectStorage traffic is: thousands of requests per 2 s with BCPack) on this head, so the change is not exercised on retail requests beyond the start screen; AMD; Wine.
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.
@LocranKing on GitHub · 2026-11-24 22:24 UTC · original
Independent Windows 11 + 8 GB Ampere (RTX 3060 Ti)
--releaseverification of exact head73a645459971606375a9f8191771253039a49aa7(merge-base6c89285): full suite green (including the new DirectStorage allocation test) and clean 60 s retail smoke.Tested
26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, Ampere, wave32 only), driver32.0.16.2101(621.01),rustc 1.100.0 (0ef1bc386 2026-11-09)(x86_64-pc-windows-msvc), DXC1.9.2602.17 (21d28f72),--release.cargo build --release -p xcl: exit0.cargo test --workspace --release --no-fail-fast -- --test-threads=4 --nocapture): 864 passed, 0 failed, 42 ignored. Allhle::dstorage::testsandhle::bcpack::testspass, including the newhle::dstorage::tests::zeroed_buffer_rejects_impossible_allocation. Expected hostSKIPPEDlines:2wave64 (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware),2D3D12 debug layer (test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state),1heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form).Regression run (
scripts/smoke.ps1 -Seconds 60,--release)Reference
main(4178e88; exact merge-base6c89285was not smoked separately):PR
#1785(73a6454):Not tested: exact merge-base
6c89285smoke, AMD/Intel GPUs, D3D12 debug layer, or extended world streaming past 60 s.AI use: Antigravity (
Gemini 4 Neon) built and ran the--releasetest suite and 60 s smoke locally and drafted this report from the captured outputs.@throny on GitHub · 2026-11-25 00:27 UTC · original
Two contributors checked independently and found that #1381 #1438 solves the same problem (for #1392) in a different way: #1607, group D54. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@JJAutoCompare on GitHub · 2026-11-25 03:21 UTC · original
PR #1785 - DirectStorage request-size validation
Tested commit
73a645459971606375a9f8191771253039a49aa7(clean detached checkout).Environment STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8-32, DoublePrecisionFloatShaderOps=0). DXC/DXIL 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09). Used unoptimized dev/test profiles with debug info disabled and selected the A770. The D3D12 SDK debug layer was unavailable.
Tested
cargo build --workspaceandcargo test --workspace --no-runboth succeeded outside the GPU lock.cargo test -p xcl hle::dstorage::tests -- --nocapturereported 18 passed, 0 failed, 0 ignored, with zero explicit skips. The new test verifies that an impossible buffer reservation returns E_OUTOFMEMORY. Existing tests passed for zlib output sizing, BC1 queue decoding, and error recording on a request past EOF. The PR caps source, destination and intermediate sizes at 256 MiB each and checks the file range before allocating.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the shared Arc lock. The 20 target summaries total 846 passed, 18 failed, 42 ignored (exit 101). All 18 DirectStorage tests passed again. The pass total includes 3 explicit SKIPPED lines (two no wave64, one no heap windows). Those paths provide no coverage.Failures The library had 13 compute pipeline creation failures (0x80070057, including FP64 cases) and four output mismatches (FMA overflow control, pixel sampling with implicit LOD, f16 high-half preservation, and wave64 pixel reductions). The end-to-end test title failed its RSSetDepthBiasX dynamic depth-bias check (blue pixel, expected green).
Not tested A main baseline or retail-title smoke comparison, other GPU adapters, retail sample inputs (XCL_SAMPLE_* unset), request sizes at and above the 256 MiB boundary, and real memory pressure.
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1785-suite.logand published this report.github-bot referenced this pull request2026-11-26 06:18:30 +00:00
@luckyteagirl on GitHub · 2026-11-26 10:48 UTC · original · reviewed
On
73a645459971606375a9f8191771253039a49aa7, the zlib-only path still has an infallible allocation after the new fallible buffers:zeroed_buffer(stage1_len)?allocates the intermediate size, thend.truncate(written)retains only that capacity, andd.resize(n, 0)can grow it todestination_sizewithout returningE_OUTOFMEMORY.Request::checkpermitssource_size < intermediate_size <= destination_sizeup to 256 MiB, so a small valid zlib stream with a 1 KiB intermediate size and a 256 MiB destination reaches this growth. If that reserve fails,Vec::resizecannot propagate the request error that this PR aims to provide. Could the padding path calltry_reserve_exact(n - d.len()).map_err(|_| E_OUTOFMEMORY)?beforeresize, with a focused failure-path check? I verified the path from source and the size constraints; I did not induce a real OOM.AI use: OpenAI Codex (GPT-6.2 Sol) found and checked the path; OpenAI Codex (GPT-6.2 Astra) independently verified it and wrote this review.
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.