DirectStorage: zero-pad short uncompressed requests to destination size (#1488) #1615
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by slopgobblercobbler on 2026-11-24T18:23:24Z.
Summary
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
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T19:33:20Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:46:38Z.
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!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:00:24Z.
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.Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T19:12:51Z.
AMD Windows test report for head
58fa588e247dd34f70a2edb5c35c8a08aee47679(exact head, clean detached checkout, no local changes). Base:main9e3831e1f570d3646e53ab753b19ec07eb8f1485(the merge base; the PR is not merged with currentmain).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (Windows Kit 10.0.26100.0).XCL_ADAPTERunset, so the physical GPU was used, not WARP. Own target dir, rebuilt from scratch for this head.cargo build --workspace -j 4: ok.cargo test --workspace -j 4 --no-fail-fast -- --test-threads=4 --nocapture(debug): 777 passed, 0 failed, 41 ignored over 20 test binaries. OneSKIPPEDline:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows. The newhle::dstorage::tests::uncompressed_request_with_short_source_is_zero_paddedpasses. At this head the tree has nofuzz_tests, so the known AMD fuzz failure (#2115) does not come up.scripts/smoke.ps1of each commit, release builds, title run from a local copy): base9e3831etwice, then this head, in the order base, PR, base:9e3831e, run 158fa5889e3831e, run 2The older
smoke.ps1at these commits prints the folder name astitle:; I replaced it withretail-titlein the blocks above and changed nothing else. Peak commit varies by about 1.5 GB between runs of the same commit here (base: 17520 and 16579 MB), so the 18086 MB of this head is within that spread, not a measured increase.Not tested
main(8b957bec): the suite and the smoke ran on this head and its merge base only.AI use: Claude Code (Claude Sonnet 5.5) ran the tests and drafted this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:19:26Z.
Triage (#1607) – head
58fa588Titles cannot reach the case this pads.
queue_enqueue_requestrunsRequest::checkfirst. For an uncompressed request ((false, 0)),checkreturnsE_DESTINATION_SIZEwheneverdestination_size != source_size. This was already in this PR's base and is still on main. So a short uncompressed request is refused at enqueue and never reachesexecute.The new test calls
executedirectly and skips that check. Zero-padding would also contradict the refusal the GDK documents for this request.Recommendation: close (bad: pads requests that EnqueueRequest already refuses; no change for titles).
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.