runtime: restore the console DirectStorage shim, with the typed-error inflate it needs (RT-DSTORAGE-RESTORE, #47) #131
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!131
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/131/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?
@Mumogg on GitHub · 2026-11-24 02:24 UTC · original
Mumogg:restore-directstorage→main· +3042 −31 · 8 files · 1 commits · merged 2026-11-24 03:36 UTCClaimed in #14 as
RT-DSTORAGE-RESTORE. Addresses #47 (stop 5 ofdocs/retail_boot_chain.md).What and why
The merge that brought the mirrored pull requests into
main(6dece9231) did not take the DirectStorage shim; its message says it "needs the typed-error zlib inflate". The shim's commits (f87d05fdd,ac1843da2by mariuslozo-boop,00551ba00by Kelebek) are ancestors ofmain, but the files are not in the tree, soXCRDAPI.dll!DStorageGetFactoryis the one unimplemented import #47 reports, and a plain merge of those commits is a no-op.shims/dstorage.cpp,shims/dstorage_xs_abi.h,test/dstorage_test.cppanddocs/directstorage.mdare back, byte for byte as those commits left them. None of this code is mine.leonida::zlib_inflatetakes an optionalZlibError* why(header,data,checksum,limit), which the shim turns into itsE_DSTORAGE_ZLIB_*codes. It is the interface the shim was written against, added tomain's current table-driven inflater. A caller that passes no pointer gets the sameboolas before. This is the part I wrote.registry.cppclassesxcrdapi.dll!DStorageGetFactoryas an HRESULT import: the retail spelling #47 found missing from the policy class.scripts/build_runtime.ps1build the shim intogta6rt(with/EHafor that file under clang-cl, as before); CMake builds and registersdstorage_test.Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off.
UNIMPLEMENTED XCRDAPI.dll!DStorageGetFactorytoshim(shim=94,unimplemented=0).--runonmain+ this + #127 (under Wine the title stops earlier without #127): 0 D3D12 calls before,D3D12XboxCreateDevice okafter. The next stop is in the host at device slot 26, the first forwarded call (stop 7 of the chain document).shader_library_testunder Wine: passes, including its inflate cases (stored, fixed, dynamic, truncated, bad Adler-32, over the limit).dstorage_testunder Wine: 329 checks, 2 failures, both in the one case that holds a copy on aPAGE_GUARDpage with a vectored handler (the copy reached the guard page,a running request is pending). I have not run it on Windows and do not know whether that case passes there on this tree; CI will say. I did not change the test.Not done here
scripts/build_runtime.ps1gets the source file added but I could not run that script.AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
@moffington on GitHub · 2026-11-24 03:27 UTC · original
I reproduced both PAGE_GUARD failures at
2d7be48on Omarchy Linux x86-64 (kernel 7.2.15-1-omarchy, Wine 11.20, Clang 23.1.3 targeting x86_64-w64-mingw32). This was a diagnostic build with VirtualQuery checks in guarded_move because my MinGW-targeted build omitted the SEH handler.In the failing run, the guarded allocation landed exactly at the queue worker’s StackBase. The worker copied all 4096 bytes and cleared PAGE_GUARD, but no guard-page exception reached the vectored handler. Moving the allocation away from StackBase restored the exception, and test_stats_timing passed all 25 checks.
shader_library_test passed at both revisions, and the synthetic zlib checks passed. I’d wait for native Windows CI to pass the unmodified dstorage_test before merging.
@tib1rgitta-eng on GitHub · 2026-11-24 03:41 UTC · original
Tested on native Windows, which the description says is missing. Windows 11, AMD RX 6750 GRE 12GB (RDNA2), own 1.0.2.1 copy, network off,
main1c7f5b5106with this diff applied unmodified,runtimestage built withmake_game.py(clang-cl, Windows SDK 10.0.26100)./EHafile and the CMake andbuild_runtime.ps1additions.--dry-run: 0 unimplemented imports;XCRDAPI.dll!DStorageGetFactorylists asshim, policyhresult=0 other=0(onmainalone it is the oneUNIMPLEMENTEDentry).--run:D3D12XboxCreateDevice okas the only D3D12 call, then the host AV at device slot 26 — the same next stop you measured under Wine, atgta6rt.exe+0xf5478(callq *0xd0(%r10), read0xd0) fromexe+0x2478713.So the console spelling in
registry.cppis what clears stop 5 on Windows too. Details and an A/B table are in #47.dstorage_testI did not run.(Prepared with AI assistance.)