runtime: verify absolute archive offsets in DirectStorage batches #1323

Manually merged
github merged 1 commit from gh-pr/1323/head into gh-pr/1323/base 2026-11-26 22:58:07 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 08:00 UTC · original
R0Y00:codex/dstorage-directory-offsets → main · +182 −0 · 4 files · 1 commits · merged 2026-11-24 08:08 UTC

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.

**@⁠R0Y00** on GitHub · 2026-11-24 08:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1323) `R0Y00:codex/dstorage-directory-offsets` → `main` · +182 −0 · 4 files · 1 commits · merged 2026-11-24 08:08 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:58:06 +00:00
github manually merged commit 29757986f5 into gh-pr/1323/base 2026-11-26 22:58:07 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 08:03 UTC · original · reviewed

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.)
**@⁠tedin7** on GitHub · 2026-11-24 08:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1323#pullrequestreview-6035632625) · **reviewed** 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.)
This discussion has been locked. Commenting is limited to contributors.
No description provided.