DirectStorage: zlib requests inflate with the runtime's native zlib #59
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!59
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/59/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?
@Sr-0w on GitHub · 2026-11-26 13:01 UTC · original
Sr-0w:storage/native-zlib→main· +257 −3 · 4 files · 1 commits · merged 2026-11-26 13:42 UTCWhat
DirectStorage zlib requests now inflate with the zlib-ng that the .NET runtime ships (
System.IO.Compression.Native), not with the managedZlibInflater.NativeZlibInflatercalls the runtime's own exports, the onesZLibStreamcalls:DestinationSizeand end there, with the Adler-32 checked.The exports are internal to the runtime. If they are missing, or the state fails a known stream when the queue is created, the queue falls back to
ZlibInflater.Why
On a retail game's loading screens (RX 7800 XT, game data on a SATA SSD):
I timed each request on the queue workers over the first 15 minutes of a boot (local instrumentation, not part of this PR):
Inflate speed on 256 KiB chunks, measured on the same machine:
ZlibInflaterTests
NativeZlibInflaterTestschecks that both inflaters produce the same bytes (1 B to 256 KiB). It also checks that a longer stream, a shorter one, a truncated one and one with a bad Adler-32 are refused, and that the next request still inflates after a refusal.IndirectGatherTests.Gathered_dispatch_records_are_clamped_before_the_list_runsfails on main without this change too.docs/directstorage.mdis updated.In game
A boot with this change is running now; I will add the loading time and fps before and after in a comment.
🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-26 13:42 UTC · original
merged, thanks, 3x on inflate is a big one for loading. the fallback check at queue creation is a nice touch
the red CI on this PR was main's fault, the keep-awake test left its thread holding the WARP device and later tests ran out of memory. fixed in
d07a8455on the IndirectGather test failing on your 7800 XT:
6db8e2damakes the gather prelude move its buffers to UAV and back explicitly instead of leaning on implicit promotion, which is the one driver-dependent step we found. if it still fails on main for you, could you post which assertion trips? that tells us whether no prelude ran or which records came back wrong