DirectStorage: zero-pad short uncompressed requests to destination size (#1488) #1625
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!1625
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1625"
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?
@slopgobblercobbler on GitHub · 2026-11-24 18:23 UTC · original
slopgobblercobbler:fix/dstorage-uncompressed-padding→main· +73 −1 · 1 files · 1 commits · openSummary
Pads short uncompressed DirectStorage requests to destination size in
crates/xcl/src/hle/dstorage.rs(Issue #1488, findingXCL-BT-004):!r.zlib() && bc == 0), titles may specifysource_size < destination_size(r.source_size < n).srcwas allocated with lengthr.source_sizeand assigned directly topayload.r.dest_physical_pages()),&payload[..n]panicked with a slice index out-of-bounds error.std::ptr::copy_nonoverlapping(payload.as_ptr(), r.destination, n)caused a heap-buffer over-read reading past the end ofpayload.if bc == 0 && !r.zlib() && payload.len() < n { payload.resize(n, 0); }, zero-paddingpayloadto the full requested destination sizen.uncompressed_request_with_short_source_is_zero_paddedindstorage.rsasserting clean completion without panic or buffer over-read across both virtual memory and physical page destinations, verifying exact source data copying and zero-padding of remaining destination bytes.Changes
crates/xcl/src/hle/dstorage.rs:source_size < destination_size.Tested
cargo test -p xcl -- dstorage: 18 passed, 0 failed.upstream/main, GPL-2.0-only compliant, zero retail game data or keys.Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
@Anon64 on GitHub · 2026-11-24 19:33 UTC · original
Regression run for this PR: head
58fa588, based onmain9e3831e. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
9e3831e:this PR:
No device removals or crashes; 99 % of main's frames, 105 % of its peak commit.
Peak commit on this machine is mostly the pipeline preload's DXC compiles (#1035) and varies from run to run, so it says little about this PR.
Not tested: the whole suite; whether the title reaches the changed code in these 60 s.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@DavidM1911 on GitHub · 2026-11-24 20:46 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 05:00 UTC · original
PR #1625 Windows verification
Tested clean detached head
58fa588e247dd34f70a2edb5c35c8a08aee47679on STOR-WINLAB, Windows 11 Enterprise Evaluation x64 (10.0.26200, build 26200). The guest reports an AuthenticAMD processor (family 23, model 113, stepping 0, ~3.9 GHz) and an Intel Arc A770 with driver 32.0.101.9175. DXC was 1.9.2609.5. Rust was rustc 1.100.0 (0ef1bc386 2026-11-09), x86_64-pc-windows-msvc. The dev and test profiles ran with debug info and incremental compilation disabled.Tested
cargo build --workspacecompleted successfully.cargo test --workspace --no-runcompleted successfully and produced 19 test executables.cargo test -p xcl --lib hle::dstorage -- --nocapture --test-threads=1 --skip hle::dstorage::tests::error_record_has_the_failed_requests_offset_source_size_and_tagran outside the Arc mutex withXCL_ADAPTER=NONE_CPU_ONLY. 17 passed, 0 failed, 0 ignored, 0 SKIPPED markers, 732 filtered out.crates/xcl/src/hle/dstorage.rs. Its regression test verified that an uncompressed memory request preserved all 40 source bytes and wrote 48 zero bytes to fill the 88-byte destination. The log confirms execution of both the virtual-memory and mapped physical-page cases.Not tested
Execution covered the focused CPU DirectStorage tests only, with the rest of the workspace compiled. The full workspace GPU suite and retail-title smoke runs were omitted. One existing DirectStorage test was filtered out because it deletes its temporary file fixture. Retail BCPack samples were omitted.
AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1625-focused.logand published.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.