docs(directstorage): measured factory IID and SetStagingBufferSize slot (DSTORAGE-FACTORY-MEASURED) #1023
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1023"
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 ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-24T17:01:30Z.
docs/directstorage.mdnow records, as measured, what the executable asks the factory for and which slot it then calls. Claim: ubiquitarianism/leonida#14, itemDSTORAGE-FACTORY-MEASURED.What
DStorageGetFactoryimport comes fromXCRDAPI.dll, one import with one call site (RVA0x1D8E4F0, thunk0x5F3FF80, IAT slot RVA0x6793FB8), consistent withdocs/runtime_imports.md(RT-5) anddocs/audio_hal_exe_calls.md.dstorage.dllanddstorage_xs.dllare imported by nobody.0x62FC7D8/ VA0x1462FC7D8,11 9D 95 62 5F D4 84 48 A0 A3 F7 86 2E A2 43 AE—{62959D11-D45F-4884-A0A3-F7862EA243AE}read Data1 LE, Data2/Data3 LE, Data4 as stored. RDX is the out pointer at VA0x1478F5E78; the result is tested for null and then for a non-zero HRESULT before reloading the factory pointer.call [rax+0x40]withedx = 0x02000000, followed bytest eax, eax/jns.0x40 / 8 = 8, where PCdstorage.hputsSetDebugFlagsat 6 andSetStagingBufferSizeat 7, soSetStagingBufferSizeat slot 8 confirms one console-only method (SetCpuAffinity) sits alongside the sharedSetDebugFlagsat slots 6 and 7 before it (matchingruntime/shims/dstorage_xs_abi.h), and the 32 MiB value plusHRESULTsign check distinguishSetStagingBufferSizefromvoid SetDebugFlags(UINT32). Which ofSetCpuAffinityandSetDebugFlagsis 6 and which is 7 stays a guess.xcrdapi.dllmeasured; factory order medium instead of low), the id is added to the factory-id policy, and the shim consequence is written down: accept the id as the factory's declared id (besidekStatusArrayIds) rather than only learning it at boot, and keepSetStagingBufferSizeon slot 8.E_DSTORAGE_STAGING_BUFFER_LOCKEDrule expects.Why
The page listed the module as "low" on a name in a library list and the factory order as low "(
SetCpuAffinityslot is a guess)". Both are now measured from the file, so a shim that misroutes the staging call or refuses the real factory id can be caught before a boot. Nothing is executed; no game bytes are committed.Tested
python -I scripts/check_no_game_data.py docs/directstorage.md— exit 0python -I tests/test_docs_*.pyandpython -I tests/test_i18n_index.py— OKpython -m compileall -q make_game.py tools tests— exit 0python -I tools/import_call_sites.py game_scarlett_master.exe --import XCRDAPI.dll!DStorageGetFactory --json— one thunk, one call, at the RVAs quotedDocs only, no runtime or test change. GPUs tested: n/a.
AI-assisted: yes (Antigravity)
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:02:21Z.
Reviewed 16ce4126:
Docs-only PR verified against the repository: GUID byte conversion, RVA/VA pairs, 32 MiB limit, RT-5 cross-references,
check_no_game_data.py docs/directstorage.md,tools/import_call_sites.py --help, and all 13tests/test_docs_*.py/test_i18n_index.pychecks pass. Three issues to fix before merge:lea rdx, [rip+0x5B6798F] ; VA 0x14D894E78— RVA0xD894E78(227 MB) is past the end of the 184,995,840-byte image (docs/runtime_imports.mdRT-5), and the excerpt's own displacements (0x5B6798Fand0x5B6797Con themov rcxafter the call) both resolve to0x1478F5E78. Please fix it and re-verify the excerpt with Capstone.runtime/shims/dstorage_xs_abi.h:9,352-354:SetDebugFlags(UINT32)is shared with PCdstorage.h(not console-only), so PC putsSetStagingBufferSizeat slot 7 (not 6) and slot 8 confirms one console-only method (SetCpuAffinity) plusSetDebugFlagsat slots 6–7 (not two console-only methods).SetDebugFlagsalso takes oneUINT32argument; it is theHRESULTreturn check (test eax, eax) and0x02000000(32 MiB) value that identifySetStagingBufferSize.origin/mainto resolve the merge conflict indocs/directstorage.md(SetStagingBufferSizebullet).AI-assisted review.
Recommendation: Fix first
Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-25T15:49:14Z.
Thanks @PierreEbele — all three points are addressed:
lea rdx, [rip+0x5B6798F]fromVA 0x14D894E78toVA 0x1478F5E78(0x141D8E4E2 + 7 + 0x5B6798F) and re-verified the entire0x141D8E4DB–0x141D8E51Ccall-site excerpt with Capstone, includingmov [rip+0x5B67990], rax(VA 0x1478F5E80) beforecall 0x145F3FF80and bothmov rcxreloads fromVA 0x1478F5E78.dstorage_xs_abi.h): Updateddocs/directstorage.md(plus the commit message and PR description) soSetDebugFlags(UINT32)is noted as shared with PCdstorage.h(PC slot 6,SetStagingBufferSizeat PC slot 7), meaningSetStagingBufferSizeat console slot 8 confirms one console-only method (SetCpuAffinity) sits alongsideSetDebugFlagsat slots 6–7, and0x02000000(32 MiB) plus theHRESULTsign check (test eax, eax/jns) distinguishSetStagingBufferSizefromvoid SetDebugFlags(UINT32).origin/main(preserving the host-transform scratch sentence on theSetStagingBufferSizebullet) and re-rancheck_no_game_data.pyalong with alltests/test_docs_*.pyandtests/test_i18n_index.pychecks.AI-assisted: yes (Antigravity)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:23:28Z.
Red/green: Docs only: Records the measured DirectStorage factory IID and slot-8 SetStagingBufferSize call in docs/directstorage.md, matching dstorage_xs_abi.h on main.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
7daa4a4a5in GitHub Actions: no new failure. Docs checked by a separate reviewer against the code on main.AI-assisted (Claude Code, Claude Opus 5.5)