DirectStorage: submitted cancellation, intermediate_size, and physical-page destinations #21
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!21
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/21/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?
@raylitebull on GitHub · 2026-11-21 21:57 UTC · original
raylitebull:dstorage-enhancements→main· +773 −64 · 3 files · 1 commits · merged 2026-11-21 22:53 UTCSummary
Implements three console DirectStorage (
xcrdapi.dll) enhancements incrates/xcl/src/hle/dstorage.rs:Cancellation of already-submitted requests (
CancelRequestsWithTag):{ up_to_seq, mask, value }cancellation rules in shared queue state (pruned as the worker advances).workerbeforependinginQueueInner::submit()so concurrent submissions preserve strict FIFO ordering.IDStorageStatusArrayXorDSTORAGE_ERROR_RECORD, while leaving requests enqueued afterCancelRequestsWithTagunaffected.Entry::Signalin an RAIIFenceRefsoID3D12FenceCOM references are never leaked on close or error.Multi-stage decompression /
intermediate_size:DSTORAGE_REQUEST_OPTIONSbitfield (ZlibDecompressbit 0,BcpackModebits 1..=4,SwizzleModebits 5..=20,DestinationIsPhysicalPagesbit 21,SourceTypebit 22,SourceIsPhysicalPagesbit 23).source_size < intermediate_size <= destination_size(zero-padding any trailing destination bytes), validates two-stage bounds (E_DESTINATION_SIZE), and refuses unsupported BCPack / hardware swizzle modes withE_DECOMPRESSION.Physical-page destinations and sources (
DestinationIsPhysicalPages/SourceIsPhysicalPages):MEM_WRITE_WATCH), while the non-virtual mode in the0x48-byteDSTORAGE_REQUESTtargets 64 KiB physical page arrays (DestinationPageArray+DestinationPageOffset@0x10;SourcePageArray+SourcePageOffset@0x28).PULONG_PTRpage arrays at enqueue time and exportsPHYS_PAGE_SIZE,read_physical_pages, andwrite_physical_pagesincrates/xcl/src/hle/kernelx.rs(obeyingAWAY -> PHYS_BLOCKSlock order and validating all pages before copying, including pages mapped into reserved virtual address space).Testing
crates/xcl/src/hle/dstorage.rs:cancel_pending_and_submitted_requests_by_tag,multi_stage_intermediate_size_validation_and_zlib,physical_page_destinations_and_sources.tests/testtitle/src/gpu.rs::direct_storagee2e check withDestinationIsPhysicalPages+DestinationPageOffsetandCancelRequestsWithTag.cargo build --workspace(0 new warnings) andcargo test --workspace -- --test-threads=4all passing (243 lib + 12console_dlls_e2e+ 1console_shaders+ 1e2e+ 6gpu_pso_e2e+ 3xg_oracle).@ivall on GitHub · 2026-11-21 22:53 UTC · original
Reviewed and merged, thanks – the physical-page reads / writes follow XCL's page model (a page is at its home or where it is mapped), and BCPack / hardware swizzle modes are refused instead of faked. Checked together with #21, #22 and #25 on top of current main: full workspace tests pass (277 lib tests, e2e, console_dlls_e2e, gpu_pso_e2e, rpf_e2e), no new build warnings.