DirectStorage: prepare file-backed zlib on bounded workers #1260

Open
github-bot wants to merge 1 commit from github-bot/gh-1260 into main AGit
Owner

@⁠Kadamitas on GitHub · 2026-11-24 21:00 UTC · original
Kadamitas:feat/dstorage-parallel-file-zlib → main · +358 −98 · 4 files · 1 commits · open

Claimed in the coordination issue as: file-backed zlib workers

What and why

Adds opt-in file-backed zlib preparation with a shared four-worker pool. It reuses the existing inflater and keeps queue commits, status, and overlapping destination writes in FIFO order. The bytes processed remain linear in the compressed and expanded sizes. The new queue bookkeeping is constant time per normally prepared request.

This adapts XCL #819 to Leonida’s existing C++ validation and queue model.

Tested

  • The native DirectStorage CTests passed with the option both enabled and disabled on Windows 11 x64.
  • A synthetic 128 MiB workload across 2,048 requests took 570.88 ms serially and 171.99 ms with four workers (median of three runs per mode). All 13 overlapping output regions matched byte for byte.
  • Built with MSVC and the static CRT. The installed MSVC toolset hits an unrelated timed-wait compile error with this baseline’s dynamic CRT configuration.

GPUs tested: n/a (CPU-only tests)

AI-assisted: yes

Checklist

  • Based on current main at branch creation.
  • One topic.
  • Synthetic test inputs and no game data.
**@⁠Kadamitas** on GitHub · 2026-11-24 21:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1260) `Kadamitas:feat/dstorage-parallel-file-zlib` → `main` · +358 −98 · 4 files · 1 commits · open Claimed in the coordination issue as: [file-backed zlib workers](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Adds opt-in file-backed zlib preparation with a shared four-worker pool. It reuses the existing inflater and keeps queue commits, status, and overlapping destination writes in FIFO order. The bytes processed remain linear in the compressed and expanded sizes. The new queue bookkeeping is constant time per normally prepared request. This adapts [XCL #819](https://github.com/xcl-dev/xcl/pull/819) to Leonida’s existing C++ validation and queue model. ### Tested - The native DirectStorage CTests passed with the option both enabled and disabled on Windows 11 x64. - A synthetic 128 MiB workload across 2,048 requests took 570.88 ms serially and 171.99 ms with four workers (median of three runs per mode). All 13 overlapping output regions matched byte for byte. - Built with MSVC and the static CRT. The installed MSVC toolset hits an unrelated timed-wait compile error with this baseline’s dynamic CRT configuration. GPUs tested: n/a (CPU-only tests) AI-assisted: yes ### Checklist - [x] Based on current main at branch creation. - [x] One topic. - [x] Synthetic test inputs and no game data.
Adapt the file-backed zlib pipeline from XCL #819 (1495e6df2). Keep file reads and guest-visible writes on the queue worker. Share four fixed work slots across file queues and reserve the compressed input, exact output and codec scratch against the configured staging size before starting. Release each slot after ordered retirement. Oversized, memory, physical-page, BCPack and other noneligible entries drain earlier work and run as before.

Enable with LEONIDA_DSTORAGE_PARALLEL_ZLIB=1. LEONIDA_PROFILE_STORAGE=1 reports the worker and staging high-water marks. Cover overlapping destinations, FIFO error reporting and Close in the native queue suite.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:52 +00:00
This pull request has changes conflicting with the target branch.
  • docs/directstorage.md
  • runtime/CMakeLists.txt
  • runtime/shims/dstorage.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1260/head:github-bot/gh-1260'
git switch 'github-bot/gh-1260'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1260'
git switch 'github-bot/gh-1260'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1260'
git switch 'github-bot/gh-1260'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1260'
git switch 'main'
git merge --squash 'github-bot/gh-1260'
git switch 'main'
git merge --ff-only 'github-bot/gh-1260'
git switch 'main'
git merge 'github-bot/gh-1260'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.