runtime: verify absolute archive offsets in DirectStorage batches #1316

Merged
R0Y00 merged 1 commit from upstream-pr/1323 into main 2026-11-24 08:08:46 +00:00
R0Y00 commented 2026-11-24 08:00:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:00:58Z.


Refs #1198. Adds a Windows regression that isolates an incorrect first source offset while holding file identity, zlib codec, compressed length, output size and queue constant. Uses the existing RDS5 boundary reader and startup DirectStorage consumer.

Two fixture files contain 1 and 16,384 ETPF records. Their first compressed pages start at absolute file offsets 0x8100 and 0xe8100. On both files, adding 0xe0000 selects another valid stream with the same 28-byte compressed and 4096-byte decoded size. The first two submissions are ordinary. The following two submissions use the shifted first offset, then the shifted next offset at EOF, then the correct second offset read from the directory. Each request has a separate queue status and guarded destination.

Windows 11 build 26200.9974 x64 Release, 29757986. Ten complete readbacks: four original pages matched, both wrong pages returned S_OK with exactly the alternate payload, both EOF requests returned E_FAIL and preserved the destination, and both following requests succeeded with the expected data. Running the same Windows test with local synthetic files generated by Leonida's pinned writer gave the same results. The repository test uses its own writer. The origin of an offset change in a separate caller remains open.

cmake --build --preset release --target startup_stub_xcrdapi startup_stub_consumer startup_storage_file_range
ctest --preset release --no-tests=error --output-on-failure -R '^startup_storage_(directory_batch|file_range)$'
python -B tests/resource_ranges_check.py

2/2 CTests, 20/20 range checks and the existing startup_stub_consumer.exe dstorage scenario passed. The documentation check verified 290 links.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6577302474 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1323). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T08:00:58Z. --- Refs #1198. Adds a Windows regression that isolates an incorrect first source offset while holding file identity, zlib codec, compressed length, output size and queue constant. Uses the existing RDS5 boundary reader and startup DirectStorage consumer. Two fixture files contain 1 and 16,384 ETPF records. Their first compressed pages start at absolute file offsets 0x8100 and 0xe8100. On both files, adding 0xe0000 selects another valid stream with the same 28-byte compressed and 4096-byte decoded size. The first two submissions are ordinary. The following two submissions use the shifted first offset, then the shifted next offset at EOF, then the correct second offset read from the directory. Each request has a separate queue status and guarded destination. Windows 11 build 26200.9974 x64 Release, 29757986. Ten complete readbacks: four original pages matched, both wrong pages returned S_OK with exactly the alternate payload, both EOF requests returned E_FAIL and preserved the destination, and both following requests succeeded with the expected data. Running the same Windows test with local synthetic files generated by [Leonida's pinned writer](https://github.com/ItsNotRexed/Leonida/blob/b0befb4b88d6640354940117448ea19d52507584/tests/test_ttpf_mips.py) gave the same results. The repository test uses its own writer. The origin of an offset change in a separate caller remains open. ```powershell cmake --build --preset release --target startup_stub_xcrdapi startup_stub_consumer startup_storage_file_range ctest --preset release --no-tests=error --output-on-failure -R '^startup_storage_(directory_batch|file_range)$' python -B tests/resource_ranges_check.py ``` 2/2 CTests, 20/20 range checks and the existing `startup_stub_consumer.exe dstorage` scenario passed. The documentation check verified 290 links.
tedin7 commented 2026-11-24 08:03:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T08:03:58Z.

Review: COMMENTED


Reviewed and verified PR #1323 at commit 29757986f541cbaa53fb50623bd3f9a6d06bc177 (looks good; no blockers).

Linux Checks (/tmp/rev-x2w-1323)

  • git diff --check origin/main...HEAD: passed
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 290 links)
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1095 tracked files)

Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_shim startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xmem_shim -- -j 6): 24.17s
    • Test (ctest --preset dev -R '^(startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (startup_storage_directory_batch 0.16s, startup_stubs 0.50s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_shim startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xmem_shim -- -j 6): 35.65s
    • Test (ctest --preset release -R '^(startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure): 2/2 passed (startup_storage_directory_batch 0.14s, startup_stubs 0.36s)

Notes

  • Synthetic RDS5/ETPF fixture in tests/startup_storage_directory_batch.py covers ordinary reads, shifted valid streams (full-page byte comparison), EOF rejection (0x80004005 preserving 0xa5 guard bytes), and subsequent valid reads across two files and four submissions.
  • dstorage_directory_batches() in tests/startup_stub_consumer.cpp validates stdin bounds (r.file >= 2 || !r.length || requests.size() >= 32) and closes both file handles cleanly. (Minor: IsComplete is polled on count - 1, which relies on FIFO completion ordering, and COM/module handles are left to process exit like dstorage_checks() above it; both are fine for this test.)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6035632625 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1323#pullrequestreview-6035632625). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T08:03:58Z. **Review:** COMMENTED --- Reviewed and verified PR #1323 at commit `29757986f541cbaa53fb50623bd3f9a6d06bc177` (looks good; no blockers). ### Linux Checks (`/tmp/rev-x2w-1323`) - `git diff --check origin/main...HEAD`: passed - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (16 Markdown files, 290 links) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (1095 tracked files) ### Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_shim startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xmem_shim -- -j 6`): `24.17s` - Test (`ctest --preset dev -R '^(startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure`): **2/2 passed** (`startup_storage_directory_batch` `0.16s`, `startup_stubs` `0.50s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_shim startup_stub_acphal startup_stub_chad startup_stub_consumer startup_stub_gameinput startup_stub_xapu startup_stub_xcrdapi startup_stub_xg_xs xmem_shim -- -j 6`): `35.65s` - Test (`ctest --preset release -R '^(startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure`): **2/2 passed** (`startup_storage_directory_batch` `0.14s`, `startup_stubs` `0.36s`) ### Notes - Synthetic RDS5/ETPF fixture in `tests/startup_storage_directory_batch.py` covers ordinary reads, shifted valid streams (full-page byte comparison), EOF rejection (`0x80004005` preserving `0xa5` guard bytes), and subsequent valid reads across two files and four submissions. - `dstorage_directory_batches()` in `tests/startup_stub_consumer.cpp` validates `stdin` bounds (`r.file >= 2 || !r.length || requests.size() >= 32`) and closes both file handles cleanly. (Minor: `IsComplete` is polled on `count - 1`, which relies on FIFO completion ordering, and COM/module handles are left to process exit like `dstorage_checks()` above it; both are fine for this test.)
upstream-sync closed this pull request 2026-11-24 09:04:30 +00:00
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!1316
No description provided.