DirectStorage: the error record keeps the request's offset, size and tag #1223
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!1223
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1223/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?
@emirduran707 on GitHub · 2026-11-24 13:23 UTC · original
emirduran707:dstorage-error-record-fields→main· +56 −1 · 1 files · 1 commits · merged 2026-11-24 15:56 UTCThe record
RetrieveErrorRecordreturns for the first failed request leftFileOffset(0x230),SourceSize(0x240) andCancellationTag(0x248) at zero. A title that uses the tag or the offset to find which of its requests failed got 0.The layout comes from Microsoft's Win32 implementation of the console DirectStorage API in Xbox-GDK-Samples (
Samples/System/SimpleDirectStorageCombo/DirectStorageWin32/, which uses the same interface IDs as XCL). Itsdstorage_win32.hdeclares, afterWCHAR Filename[MAX_PATH]:UINT64 FileOffset; void* Source; UINT32 SourceSize; UINT64 CancellationTag; CHAR Name[...]. ItsMarkRequestErrorcopies them from the failed request. XCL's existing offsets (0x10, 0x18, 0x20, 0x24, 0x238, record size 0x290) fit the same layout.queue_retrieve_error_recordnow also writes the request's file offset (file requests only), source size and cancellation tag. The name (0x250) is not filled: XCL's request does not keep the name pointer.What is in it
crates/xcl/src/hle/dstorage.rs: the three fields; testerror_record_has_the_failed_requests_offset_source_size_and_tag(16 bytes at 0x100 of an 8-byte file, tag 0xABCD, on a file queue).Tested
cargo test --workspace -- --test-threads=4on2e17d3d: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsFileOffsetleft: 0,right: 256; with itcargo test -p xcl --lib dstoragepasses (15 passed)Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
RetrieveErrorRecord filled the first failure's HRESULT, options, destination, destination size and file name (or memory source), and left FileOffset @0x230, SourceSize @0x240 and CancellationTag @0x248 at 0. A title that logs or retries the failed request from its record saw offset 0, size 0 and tag 0. The layout follows DSTORAGE_ERROR_RECORD in ATG's Win32 implementation of the console API (Xbox-GDK-Samples, Samples/System/ SimpleDirectStorageCombo/DirectStorageWin32/dstorage_win32.h): after `WCHAR Filename[MAX_PATH];` (0x24..0x22C) come `UINT64 FileOffset;` (0x230), `void* Source;` (0x238), `UINT32 SourceSize;` (0x240), `UINT64 CancellationTag;` (0x248) and `CHAR Name[DSTORAGE_REQUEST_MAX_NAME];` (0x250, 64 bytes), 0x290 in all, which matches ERROR_RECORD_BYTES and the offsets XCL already writes. Its MarkRequestError (DirectStorageWin32WrapperQueue.cpp) copies them from the request: m_errorRecord.FirstFailure.FileOffset = m_entries[index].request.FileOffset; m_errorRecord.FirstFailure.SourceSize = m_entries[index].request.SourceSize; m_errorRecord.FirstFailure.CancellationTag = m_entries[index].request.CancellationTag; The file offset is written for file requests only: FileOffset shares a union with Source, so for a memory request those bytes are unused or the source page offset. Name stays 0: Request does not keep the name pointer. The new test reads 16 bytes past the end of an 8-byte file with tag 0xABCD and fails without the fix (FileOffset: left 0, right 256). Co-Authored-By: Claude Opus 5.5 <[email protected]>@thehollowedone on GitHub · 2026-11-24 13:26 UTC · original
Independent mixed-queue check on
2e17d3d, Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug.I queued one valid read and two reads past the end of an eight-byte synthetic file, after canceling another queued read by its tag. The valid read copied the expected bytes and the canceled request left its destination untouched. The first record counted two failures and returned the first surviving request’s offset
0x100, size 5 and full 64-bit tag0x1701234567. A second retrieval cleared the fields. A new batch then reported only its own failure at0x200, size 7 and tag0x29ABCDEF01.cargo test --offline --locked -p xcl --lib hle::dstorage::tests -- --test-threads=1passed 16/16 with the scratch fixture. Removing only the three field writes made the same fixture fail with the failure count still correct and all three metadata fields zero. Synthetic file queues only.AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 13:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Note: the full
d3d12xlib filter currently aborts with 0xc0000005 on unmodifiedmaintoo (pre-existing, unrelated to this PR); the PR's own tests were run by name and pass.@DavidM1911 on GitHub · 2026-11-26 04:05 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin