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

Closed
Kadamitas wants to merge 1 commit from upstream-pr/1260 into main
Kadamitas commented 2026-11-24 21:00:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kadamitas on 2026-11-24T21:00:53Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5480253147 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1260). Originally posted by [Kadamitas](https://github.com/Kadamitas) on 2026-11-24T21:00:53Z. --- Claimed in the coordination issue as: [file-backed zlib workers](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7144350290) ### 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.
Kadamitas commented 2026-11-27 18:51:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kadamitas on 2026-11-27T18:51:14Z.


Closing because current main already prepares adjacent file-backed transforms in parallel, including zlib, with a shared staging budget and FIFO publication. The original benchmark compared with serial decoding. Main covers the intended behavior through its own worker pipeline.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7225938892 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1260#issuecomment-7225938892). Originally posted by [Kadamitas](https://github.com/Kadamitas) on 2026-11-27T18:51:14Z. --- Closing because current main already prepares adjacent file-backed transforms in parallel, including zlib, with a shared staging budget and FIFO publication. The original benchmark compared with serial decoding. Main covers the intended behavior through its own worker pipeline.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1260
No description provided.