Complete RFC 1950 custom decompression jobs on a DirectStorage file queue #1128

Manually merged
github merged 2 commits from gh-pr/1128/head into gh-pr/1128/base 2026-11-26 22:43:51 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 01:34 UTC · original
R0Y00:codex/dstorage-rfc1950 → main · +246 −0 · 5 files · 2 commits · merged 2026-11-24 02:59 UTC

Refs #870. This follows the factory/staging fixture in #963 with a real Windows file queue. A source-built file request selects custom format zero, the worker consumes one RFC 1950 stream, and SetRequestResults returns the codec HRESULT with the original request ID. The destination is published only on exact input and output lengths and a valid zlib checksum.

Verified six Release cases on Windows build 26200 with Microsoft.Direct3D.DirectStorage 1.3.0 and statically linked zlib 1.3.1. Success consumed 116 bytes and produced the expected 768 bytes. Truncation, a bad checksum, trailing input and destination sizes one byte above and below the expected size all returned 0x8007000d in the codec and the DirectStorage status slot. Guards and failed destinations stayed intact. The event stayed pending before completion and a second dequeue returned S_FALSE.

cmake --build --preset release --target dstorage_rfc1950_check
ctest --preset release --no-tests=error -R '^dstorage_rfc1950_' -V

The experiment is opt-in through DSTORAGE_SDK_ROOT; the docs include the configure command and dependency versions. Only source is included.

**@⁠R0Y00** on GitHub · 2026-11-24 01:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1128) `R0Y00:codex/dstorage-rfc1950` → `main` · +246 −0 · 5 files · 2 commits · merged 2026-11-24 02:59 UTC Refs #870. This follows the factory/staging fixture in #963 with a real Windows file queue. A source-built file request selects custom format zero, the worker consumes one RFC 1950 stream, and `SetRequestResults` returns the codec HRESULT with the original request ID. The destination is published only on exact input and output lengths and a valid zlib checksum. Verified six Release cases on Windows build 26200 with Microsoft.Direct3D.DirectStorage 1.3.0 and statically linked zlib 1.3.1. Success consumed 116 bytes and produced the expected 768 bytes. Truncation, a bad checksum, trailing input and destination sizes one byte above and below the expected size all returned `0x8007000d` in the codec and the DirectStorage status slot. Guards and failed destinations stayed intact. The event stayed pending before completion and a second dequeue returned `S_FALSE`. ``` cmake --build --preset release --target dstorage_rfc1950_check ctest --preset release --no-tests=error -R '^dstorage_rfc1950_' -V ``` The experiment is opt-in through `DSTORAGE_SDK_ROOT`; the docs include the configure command and dependency versions. Only source is included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:43:50 +00:00
github manually merged commit 3ebaaddbf1 into gh-pr/1128/base 2026-11-26 22:43:51 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 01:38 UTC · original · edited 2026-11-24 02:00 UTC

The queue test already checks that completion stays pending after Submit while the custom worker still owns the request. Please add the distinct check immediately before manual Submit, after enqueueing the request, status and event: no codec request available, no completion event, and the destination sentinels untouched. Keep the existing post-Submit check. This will make the two ordering guarantees independently observable.

I independently ran all six Windows Release cases on 92f3377f with DirectStorage 1.3.0 and zlib 1.3.1. They also passed with the additional pre-Submit event and destination checks in my independent local fixture. The original six cover the successful readback and the five malformed-input or output-length cases.

**@⁠R0Y00** on GitHub · 2026-11-24 01:38 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1128#issuecomment-7119297869) · edited 2026-11-24 02:00 UTC The queue test already checks that completion stays pending after Submit while the custom worker still owns the request. Please add the distinct check immediately before manual Submit, after enqueueing the request, status and event: no codec request available, no completion event, and the destination sentinels untouched. Keep the existing post-Submit check. This will make the two ordering guarantees independently observable. I independently ran all six Windows Release cases on 92f3377f with DirectStorage 1.3.0 and zlib 1.3.1. They also passed with the additional pre-Submit event and destination checks in my independent local fixture. The original six cover the successful readback and the five malformed-input or output-length cases.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 02:24 UTC · original

I pushed the pre-Submit control as 3ebaaddb. The Release run with the real DirectStorage custom queue still passed all six scenarios with the optional SDK and zlib configured. The new assertion checks both events and the entire destination sentinel before manual Submit. The existing assertion still checks that completion is pending while the worker owns the request.

**@⁠R0Y00** on GitHub · 2026-11-24 02:24 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1128#issuecomment-7120109362) I pushed the pre-Submit control as 3ebaaddb. The Release run with the real DirectStorage custom queue still passed all six scenarios with the optional SDK and zlib configured. The new assertion checks both events and the entire destination sentinel before manual Submit. The existing assertion still checks that completion is pending while the worker owns the request.
Author
Owner

@⁠Holastor on GitHub · 2026-11-24 01:44 UTC · original · approved these changes

Independent Windows 11 Release and Dev run and review.

Environment

  • OS: Windows 11 Pro x64 (build 26100.3037)
  • Compiler: Visual Studio 2026 Developer PowerShell v18.11.4 (MSVC 19.51.36263.0)
  • CMake / Ninja: CMake 4.3.1, Ninja 1.13.0
  • DirectStorage: Microsoft.Direct3D.DirectStorage 1.3.0 NuGet package (out/dstorage-sdk)
  • zlib: 1.3.1 static x64 build (out/zlib-install)
  • Tested Commit: 92f3377f (92f3377f491805ee583b0e593e183204c1e5f7b2)

Configure & Test Commands

Release Preset:

cmake --preset release "-DDSTORAGE_SDK_ROOT=$PWD/out/dstorage-sdk" "-DZLIB_ROOT=$PWD/out/zlib-install" "-DZLIB_LIBRARY_RELEASE=$PWD/out/zlib-install/lib/zlibstatic.lib"
cmake --build --preset release --target dstorage_rfc1950_check
ctest --preset release --no-tests=error -R '^dstorage_rfc1950_' -V

Observed Statuses & Readbacks:

test 1
    Start 1: dstorage_rfc1950_success
1: consumed=116/116 produced=768/768 codec=0x00000000 completion=0x00000000
1/6 Test #1: dstorage_rfc1950_success .........   Passed    0.02 sec

test 2
    Start 2: dstorage_rfc1950_truncated
2: consumed=115/115 produced=768/768 codec=0x8007000d completion=0x8007000d
2/6 Test #2: dstorage_rfc1950_truncated .......   Passed    0.02 sec

test 3
    Start 3: dstorage_rfc1950_checksum
3: consumed=116/116 produced=768/768 codec=0x8007000d completion=0x8007000d
3/6 Test #3: dstorage_rfc1950_checksum ........   Passed    0.02 sec

test 4
    Start 4: dstorage_rfc1950_trailing
4: consumed=116/117 produced=768/768 codec=0x8007000d completion=0x8007000d
4/6 Test #4: dstorage_rfc1950_trailing ........   Passed    0.02 sec

test 5
    Start 5: dstorage_rfc1950_oversize
5: consumed=116/116 produced=768/769 codec=0x8007000d completion=0x8007000d
5/6 Test #5: dstorage_rfc1950_oversize ........   Passed    0.02 sec

test 6
    Start 6: dstorage_rfc1950_undersize
6: consumed=111/116 produced=767/767 codec=0x8007000d completion=0x8007000d
6/6 Test #6: dstorage_rfc1950_undersize .......   Passed    0.02 sec

100% tests passed, 0 tests failed out of 6 (Total Test time: 0.13 sec)

Dev Preset Verification:

cmake --preset dev "-DDSTORAGE_SDK_ROOT=$PWD/out/dstorage-sdk" "-DZLIB_ROOT=$PWD/out/zlib-install" "-DZLIB_LIBRARY_DEBUG=$PWD/out/zlib-install/lib/zlibstatic.lib" "-DZLIB_LIBRARY_RELEASE=$PWD/out/zlib-install/lib/zlibstatic.lib"
cmake --build --preset dev --target dstorage_rfc1950_check
ctest --preset dev --no-tests=error -R '^dstorage_rfc1950_' -V

All 6/6 tests passed identically (0.13 sec).

Linters & Documentation:

./out/pe-env/Scripts/python.exe -B tests/docs_links_check.py
# Self-test passed. Checked 15 Markdown files and 252 links.

./out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py
# Self-test passed. Checked 940 tracked source, script and build/CI files: no bidirectional controls.

Invariant Checks Summary

  • Exact file-to-memory bytes: Positive case consumed 116 bytes from file offset and produced exactly 768 uncompressed bytes.
  • Destination stability & guards: Sentinel bytes (0xca) before and after the destination buffer remained intact. On each of the 5 error scenarios (truncated, checksum, trailing, oversize, undersize), the destination buffer was not overwritten and the codec returned 0x8007000d (ERROR_INVALID_DATA).
  • Pending completion before submit/service: WaitForSingleObject(event, 0) == WAIT_TIMEOUT and status->IsComplete(0) == FALSE were verified before custom queue servicing.
  • Queue drains: Second complete_one() dequeue returns S_FALSE with no pending requests.
  • Status/event consistency: Codec result and DirectStorage status slot agreed on 0x00000000 for success and 0x8007000d for all error cases.

Everything reproduces cleanly.

**@⁠Holastor** on GitHub · 2026-11-24 01:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1128#pullrequestreview-6032377897) · **approved these changes** Independent Windows 11 Release and Dev run and review. ### Environment - **OS:** Windows 11 Pro x64 (build 26100.3037) - **Compiler:** Visual Studio 2026 Developer PowerShell v18.11.4 (MSVC 19.51.36263.0) - **CMake / Ninja:** CMake 4.3.1, Ninja 1.13.0 - **DirectStorage:** Microsoft.Direct3D.DirectStorage 1.3.0 NuGet package (`out/dstorage-sdk`) - **zlib:** 1.3.1 static x64 build (`out/zlib-install`) - **Tested Commit:** `92f3377f` (`92f3377f491805ee583b0e593e183204c1e5f7b2`) ### Configure & Test Commands **Release Preset:** ```powershell cmake --preset release "-DDSTORAGE_SDK_ROOT=$PWD/out/dstorage-sdk" "-DZLIB_ROOT=$PWD/out/zlib-install" "-DZLIB_LIBRARY_RELEASE=$PWD/out/zlib-install/lib/zlibstatic.lib" cmake --build --preset release --target dstorage_rfc1950_check ctest --preset release --no-tests=error -R '^dstorage_rfc1950_' -V ``` **Observed Statuses & Readbacks:** ```text test 1 Start 1: dstorage_rfc1950_success 1: consumed=116/116 produced=768/768 codec=0x00000000 completion=0x00000000 1/6 Test #1: dstorage_rfc1950_success ......... Passed 0.02 sec test 2 Start 2: dstorage_rfc1950_truncated 2: consumed=115/115 produced=768/768 codec=0x8007000d completion=0x8007000d 2/6 Test #2: dstorage_rfc1950_truncated ....... Passed 0.02 sec test 3 Start 3: dstorage_rfc1950_checksum 3: consumed=116/116 produced=768/768 codec=0x8007000d completion=0x8007000d 3/6 Test #3: dstorage_rfc1950_checksum ........ Passed 0.02 sec test 4 Start 4: dstorage_rfc1950_trailing 4: consumed=116/117 produced=768/768 codec=0x8007000d completion=0x8007000d 4/6 Test #4: dstorage_rfc1950_trailing ........ Passed 0.02 sec test 5 Start 5: dstorage_rfc1950_oversize 5: consumed=116/116 produced=768/769 codec=0x8007000d completion=0x8007000d 5/6 Test #5: dstorage_rfc1950_oversize ........ Passed 0.02 sec test 6 Start 6: dstorage_rfc1950_undersize 6: consumed=111/116 produced=767/767 codec=0x8007000d completion=0x8007000d 6/6 Test #6: dstorage_rfc1950_undersize ....... Passed 0.02 sec 100% tests passed, 0 tests failed out of 6 (Total Test time: 0.13 sec) ``` **Dev Preset Verification:** ```powershell cmake --preset dev "-DDSTORAGE_SDK_ROOT=$PWD/out/dstorage-sdk" "-DZLIB_ROOT=$PWD/out/zlib-install" "-DZLIB_LIBRARY_DEBUG=$PWD/out/zlib-install/lib/zlibstatic.lib" "-DZLIB_LIBRARY_RELEASE=$PWD/out/zlib-install/lib/zlibstatic.lib" cmake --build --preset dev --target dstorage_rfc1950_check ctest --preset dev --no-tests=error -R '^dstorage_rfc1950_' -V ``` All 6/6 tests passed identically (0.13 sec). **Linters & Documentation:** ```powershell ./out/pe-env/Scripts/python.exe -B tests/docs_links_check.py # Self-test passed. Checked 15 Markdown files and 252 links. ./out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py # Self-test passed. Checked 940 tracked source, script and build/CI files: no bidirectional controls. ``` ### Invariant Checks Summary - **Exact file-to-memory bytes:** Positive case consumed 116 bytes from file offset and produced exactly 768 uncompressed bytes. - **Destination stability & guards:** Sentinel bytes (`0xca`) before and after the destination buffer remained intact. On each of the 5 error scenarios (`truncated`, `checksum`, `trailing`, `oversize`, `undersize`), the destination buffer was not overwritten and the codec returned `0x8007000d` (`ERROR_INVALID_DATA`). - **Pending completion before submit/service:** `WaitForSingleObject(event, 0) == WAIT_TIMEOUT` and `status->IsComplete(0) == FALSE` were verified before custom queue servicing. - **Queue drains:** Second `complete_one()` dequeue returns `S_FALSE` with no pending requests. - **Status/event consistency:** Codec result and DirectStorage status slot agreed on `0x00000000` for success and `0x8007000d` for all error cases. Everything reproduces cleanly.
This discussion has been locked. Commenting is limited to contributors.
No description provided.