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

Merged
R0Y00 merged 2 commits from upstream-pr/1128 into main 2026-11-24 02:59:04 +00:00
R0Y00 commented 2026-11-24 01:34:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T01:34:53Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572590857 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1128). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T01:34:53Z. --- 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.
Holastor commented 2026-11-24 01:44:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-24T01:44:15Z.

Review: APPROVED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6032377897 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1128#pullrequestreview-6032377897). Originally posted by [Holastor](https://github.com/Holastor) on 2026-11-24T01:44:15Z. **Review:** APPROVED --- 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.
upstream-sync closed this pull request 2026-11-24 06:46:28 +00:00
R0Y00 commented 2026-11-24 06:50:06 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T01:38:12Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119297869 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1128#issuecomment-7119297869). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T01:38:12Z. --- 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 commented 2026-11-24 06:50:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T02:24:30Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120109362 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1128#issuecomment-7120109362). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:24:30Z. --- 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.
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
R0Y00/Xbox2Windows!1121
No description provided.