DirectStorage: the error record keeps the request's offset, size and tag #1214

Merged
emirduran707 merged 1 commit from upstream-pr/1223 into main 2026-11-24 15:56:39 +00:00
emirduran707 commented 2026-11-24 13:23:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T13:23:14Z.


The record RetrieveErrorRecord returns for the first failed request left FileOffset (0x230), SourceSize (0x240) and CancellationTag (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). Its dstorage_win32.h declares, after WCHAR Filename[MAX_PATH]: UINT64 FileOffset; void* Source; UINT32 SourceSize; UINT64 CancellationTag; CHAR Name[...]. Its MarkRequestError copies them from the failed request. XCL's existing offsets (0x10, 0x18, 0x20, 0x24, 0x238, record size 0x290) fit the same layout.

queue_retrieve_error_record now 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; test error_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

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo test --workspace -- --test-threads=4 on 2e17d3d: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU tests
  • the new test without the change: FileOffset left: 0, right: 256; with it cargo test -p xcl --lib dstorage passes (15 passed)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19650 MB

this PR:

xcl-smoke v1
commit: 2e17d3dedd954f4cd487296c1919e62708f77b39
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1559 (PresentX 1559)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19698 MB

Not tested

  • A title that reads these fields from a failure; the smoke title's run is a regression check only.
  • The layout on the console itself: it follows Microsoft's Win32 implementation of the console API, not a hardware run.
  • NVIDIA and Intel GPUs.

AI use

  • Claude Code with Claude Opus 5.5: found the problem, wrote the change, the test and this description; I reviewed the diff and ran the tests and smoke runs above.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6582766572 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1223). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-24T13:23:14Z. --- The record `RetrieveErrorRecord` returns for the first failed request left `FileOffset` (0x230), `SourceSize` (0x240) and `CancellationTag` (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). Its `dstorage_win32.h` declares, after `WCHAR Filename[MAX_PATH]`: `UINT64 FileOffset; void* Source; UINT32 SourceSize; UINT64 CancellationTag; CHAR Name[...]`. Its `MarkRequestError` copies them from the failed request. XCL's existing offsets (0x10, 0x18, 0x20, 0x24, 0x238, record size 0x290) fit the same layout. `queue_retrieve_error_record` now 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; test `error_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** - AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release - `cargo test --workspace -- --test-threads=4` on 2e17d3d: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU tests - the new test without the change: `FileOffset` `left: 0`, `right: 256`; with it `cargo test -p xcl --lib dstorage` passes (15 passed) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1541 (PresentX 1541) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19650 MB ``` this PR: ``` xcl-smoke v1 commit: 2e17d3dedd954f4cd487296c1919e62708f77b39 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1559 (PresentX 1559) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19698 MB ``` **Not tested** - A title that reads these fields from a failure; the smoke title's run is a regression check only. - The layout on the console itself: it follows Microsoft's Win32 implementation of the console API, not a hardware run. - NVIDIA and Intel GPUs. **AI use** - Claude Code with Claude Opus 5.5: found the problem, wrote the change, the test and this description; I reviewed the diff and ran the tests and smoke runs above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thehollowedone commented 2026-11-24 14:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T13:26:11Z.


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 tag 0x1701234567. A second retrieval cleared the fields. A new batch then reported only its own failure at 0x200, size 7 and tag 0x29ABCDEF01.

cargo test --offline --locked -p xcl --lib hle::dstorage::tests -- --test-threads=1 passed 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.

<!-- greyfinch-sync:ivall/xcl:comment:7132826075 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1223#issuecomment-7132826075). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T13:26:11Z. --- Independent mixed-queue check on [`2e17d3d`](https://github.com/ivall/xcl/commit/2e17d3dedd954f4cd487296c1919e62708f77b39), 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 tag `0x1701234567`. A second retrieval cleared the fields. A new batch then reported only its own failure at `0x200`, size 7 and tag `0x29ABCDEF01`. `cargo test --offline --locked -p xcl --lib hle::dstorage::tests -- --test-threads=1` passed 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 commented 2026-11-24 14:06:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:47:18Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib dstorage: 15 passed, 0 failed.

Note: the full d3d12x lib filter currently aborts with 0xc0000005 on unmodified main too (pre-existing, unrelated to this PR); the PR's own tests were run by name and pass.

<!-- greyfinch-sync:ivall/xcl:comment:7133337403 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1223#issuecomment-7133337403). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T13:47:18Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - cargo test -p xcl --lib dstorage: 15 passed, 0 failed. Note: the full `d3d12x` lib filter currently aborts with 0xc0000005 on unmodified `main` too (pre-existing, unrelated to this PR); the PR's own tests were run by name and pass.
upstream-sync closed this pull request 2026-11-24 16:06:03 +00:00
DavidM1911 commented 2026-11-26 04:07:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T04:05:35Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7182286899 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1223#issuecomment-7182286899). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T04:05:35Z. --- 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
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1214
No description provided.