startup-runtime: DirectStorage status arrays start pending, and there is no error record #1843
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#1843
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Jess-Doit on GitHub · 2026-11-24 19:23 UTC · original
Problem
The DirectStorage stand-in (
src/startup_stubs/xcrdapi.cpp) differs from the documented status-array and error-reporting behaviour in three places:New status-array slots start pending.
factory_create_status_arraysets every slot toE_PENDING, soIsComplete(i)is false andGetHResult(i)isE_PENDINGfor a slot nothing has been enqueued into. Microsoft's Win32 implementation of the console API starts every slot complete withS_OK:m_completeFlags.resize(capacity, true); m_resultCodes.resize(capacity, HRESULT_FROM_WIN32(S_OK));EnqueueStatusmarks a slot not complete.A caller that polls
IsCompletebefore it first reuses a ring slot would wait forever.No error record. Queue slot 10,
RetrieveErrorRecord(DSTORAGE_ERROR_RECORD*), is not implemented and traps. Slot 9,GetErrorEvent, returns an event that is never signaled, so a failed request leaves no record and no signal.CancelRequestsWithTagis a no-op (slot 7).Sources:
Samples/System/SimpleDirectStorageCombo/DirectStorageWin32/.DirectStorageWin32WrapperStatusArray.cpphas the initial slot state.dstorage_win32.hhas theIDStorageQueuemethod order (EnqueueRequest,EnqueueStatus,EnqueueSignal,Submit,CancelRequestsWithTag,Close,GetErrorEvent,RetrieveErrorRecord,Query) and theDSTORAGE_ERROR_RECORDlayout.IDStorageStatusArrayandDSTORAGE_ERROR_RECORD.Proposed slices
S_OKuntilEnqueueStatusmarks them pending. A source-built consumer checks a fresh array, a pending slot afterEnqueueStatusand before its turn, and the completed result. A control that restoresE_PENDINGmust fail.FailureCount, then the first failure in enqueue order, with its HRESULT, options, destination, source and request fields.Done when
Each slice lands with a source-built consumer fixture and a control that must fail, and
docs/startup-runtime.mdrecords the behaviour. No game data.AI-assisted (Claude Code).
@Jess-Doit on GitHub · 2026-11-24 19:23 UTC · original
Claiming slices 1 and 2, with Windows 10 22H2. The startup stand-ins don't need a GPU for these.
RetrieveErrorRecordand the error event: Codex, driven with Claude Code.Each slice will be a separate PR with a source-built consumer fixture and a control that must fail. Slice 3 (cancellation) is free for anyone.
AI-assisted (Claude Code, Codex).
@chunfeng11221 on GitHub · 2026-11-24 19:48 UTC · original
Taking slice 3 (\CancelRequestsWithTag) on Windows 11 x64 / MSVC 19.44 — PR up at #1869 with a source-built consumer fixture covering pre-Submit and post-Submit cancellation, bitmask/mismatch controls, and fail-first mutation checks (kept conflict-free with #1847). AI-assisted.
@R0Y00 on GitHub · 2026-11-24 19:54 UTC · original
The initial-state slice #1847 is on main at
b509a670. Release verified fresh slots report S_OK, the fence-held slot alone becomes E_PENDING, and it completes after the fence is released. I also fixed the new fixture to supply a full 40-byte queue descriptor before the final Windows and Linux checks. The error-event/error-record slice stays with the existing claim; cancellation is tracked separately in #1869.@R0Y00 on GitHub · 2026-11-24 20:39 UTC · original
Error notification and retrieval (#1873) are on main at
3ad0069d. Release verified the first failed read record, the Xbox CommandType, the reset to NONE, repeat caller-owned event signaling and the worker-start failure path. Cancellation remains in #1869 pending consistent handling of the request tag and inflate sizing.@tedin7 on GitHub · 2026-11-25 02:57 UTC · original
Taking a focused follow-up slice: distinct status HRESULTs for destination-too-small vs read-past-EOF (instead of generic E_FAIL), plus null-argument validation on OpenFile, CreateStatusArray and CreateQueue. AI-assisted.