DirectStorage: report queue read failures #624
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/624"
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 Marvisak/VIctory. Originally posted by broccolize on 2026-11-24T05:48:53Z.
Implement
GetErrorEventandRetrieveErrorRecordfor DirectStorage queues. Each queue signals its own error event and gives callers a handle they can close independently. Retrieval returns the first failed read in enqueue order and the failure count since the previous retrieval, then clears the record and resets the event.Synthetic Windows tests cover two failed reads, a successful read, out-of-order worker completion, and a status entry submitted after error retrieval. All 15 DirectStorage tests passed with and without diagnostics.
The Windows GNU workspace run passed 265 tests with four ignored. It excluded
loads_binds_and_calls_probebecause of a toolchain failure reproducible onmain. Asset-policy checks passed.Related to #577, which touches file lifetime in the same worker path. AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T05:59:25Z.
Review: APPROVED
Tested on Windows 11 with Rust 1.98.1 (x86_64-pc-windows-msvc).
o_dll_planting passed cleanly.
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:15:59Z.
Review: APPROVED
Tested
8632869on Windows 11, RTX 5070, MSVC:cargo test -p victory-hle89 passed, including the 15 DirectStorage tests (two new error-record ones). Clippy's 1 warning is the existingfield_reassign_with_defaultat xmem.rs:747.publish_before). So the first record is the first failed read in enqueue order, even when workers finish out of order, which is whatRetrieveErrorRecorddocuments.GetErrorEventhands out a duplicated handle, so a title that closes its copy can't close the queue's event.takeresets the event together with clearing the record.ReadFailure::newcopiesrequest.namewhen the read fails, on the worker thread. That relies on the title keeping the name valid until the request completes, which is the documentedDSTORAGE_REQUEST::Namecontract, so it's fine. A one-line comment there would help the next reader.Lane::newfailing onCreateEventWnow failsCreateQueuewith the HRESULT instead of panicking later. Good.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T12:19:31Z.
Independent verification & code review on Windows 11 x64 MSVC (merged onto
mainffe310e):Checks Run
cargo xtask policy: PASS (155 files ok)cargo clippy -p victory-hle --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-hle --locked -- dstorage: PASS (15/15tests, includingqueue_reports_and_retrieves_read_errorsanderror_event_reports_failures_in_enqueue_order_without_status_entries)Review Findings
The ABI layout assertions for
ErrorRecord(0x290) andReadFailure, enqueue-orderedpublish_beforedeferral, caller-owned duplicated event handles, andout.is_null()guards look very clean.One safety edge case to tighten before merge:
ReadFailure::newdereferencesrequest.sourceasInstance<File>on unsupported-option failures (crates/victory-hle/src/modules/dstorage/errors.rs:92-102):execute()rejects unsupported option bits withE_NOTIMPLbefore touchingrequest.source(dstorage.rs:843) — including bit 23 (physical-pages source, documented atdstorage.rs:691), whererequest.sourcepoints to a page-number array rather than anInstance<File>COM object.work()immediately callsReadFailure::new(&job.request, hr)on thatErr(E_NOTIMPL), andReadFailure::newchecks onlyrequest.options & MEMORY_SOURCE != 0, a bit-23 request enters theelsebranch and castsrequest.sourceto&Instance<File>to copyfile.state.filename(Box<[u16]>), which is UB / an access violation on a non-Filepointer.request.sourceasInstance<File>when no unsupported option bits are set (or at minimum when bit 23 is clear) in addition torequest.options & MEMORY_SOURCE == 0.QueueErrors::newcreates an auto-reset event (bManualReset = 0), whiletake()also callsResetEvent. If a title pollsWaitForSingleObject(event, 0)more than once before callingRetrieveErrorRecord(or duplicates the handle across watchers), auto-reset consumes the signal on the first wait; a manual-reset event (bManualReset = 1) stays signaled untilRetrieveErrorRecordresets it (if matching the Win32 DirectStorage contract is preferred).AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:22Z.
Automated triage for the maintainers. Closing because it breaks a repository rule (see
docs/asset-policy.mdand the project rules): nothing taken from the console SDK or the game, no weakening of the asset policy, and the title stays offline.If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Imported from Marvisak/VIctory. Originally posted by broccolize on 2026-11-25T03:43:53Z.
Thanks for reviewing. The diff is limited to two Rust source files for DirectStorage error reporting and synthetic tests. I checked the ABI locally against Microsoft's public documentation and public Xbox compatibility sample. The verification probe was kept local.
Could you point me to the file or line that triggered the policy closure so I can address it?
Pull request closed