startup: count BCPack requests by format #1615

Merged
lambirou merged 1 commit from upstream-pr/1622 into main 2026-11-24 16:26:38 +00:00
lambirou commented 2026-11-24 15:13:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T15:13:15Z.


Problem

The DirectStorage stand-in currently reports a single bcpack-blank count, so a loading log cannot tell which BCPack formats a title actually asks for. That makes the BC6H decision blind: format 6 is still zero-filled, while BC1 and BC7 are decoded.

Change

  • Count BCPack requests and zero-filled outcomes per format id 1..15 in src/startup_stubs/xcrdapi.cpp.
  • Emit one x2w-dstorage BCPack summary line at process exit, for example requests formats=1:2 6:1 7:4; zero-filled formats=6:1.
  • Extend the source-built consumer fixture with a format 6 request that succeeds, leaves the destination zero-filled, and is counted, while BC1 and BC7 are not counted as blank.
  • Document the counters in docs/startup-runtime.md.

This is measurement only. It does not claim BC6H decoding; that remains a follow-up if the summary shows format 6 traffic. PR #1390 already covers BC3/BC4/BC5.

Verification

. .\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --target startup_stub_xcrdapi startup_stub_consumer startup_stub_acphal startup_stub_xapu startup_stub_gameinput
ctest --preset dev --no-tests=error -R '^startup_stubs$' -V

Result: startup_stubs 1/1 passed. Observed line:

x2w-dstorage BCPack summary: requests formats=1:2 6:1 7:4; zero-filled formats=6:1

python -B tests/docs_links_check.py checked 16 Markdown files and 348 links; git diff --check is clean.

Rebased onto origin/main (578d1e1c) on 2026-11-24; the rebased head 852ab34b rebuilt and passed the same checks.

Not tested

  • A retail title run; this change only measures the request classes the stand-in already sees.
  • AMD and Intel adapters; the counter is CPU-side and adapter-independent.

Refs #1139, #1198. No game files, dumps or XCL code are included.

Licence

MIT, as the rest of the repository. The implementation, fixture changes and documentation are original work; no XCL code, tables, game files or third-party binaries are included.

AI use: implementation, test update and verification were drafted by a Codex subagent; the orchestrator reviewed the diff and reran the targeted build and CTest above.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6585001917 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1622). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T15:13:15Z. --- ## Problem The DirectStorage stand-in currently reports a single `bcpack-blank` count, so a loading log cannot tell which BCPack formats a title actually asks for. That makes the BC6H decision blind: format 6 is still zero-filled, while BC1 and BC7 are decoded. ## Change - Count BCPack requests and zero-filled outcomes per format id 1..15 in `src/startup_stubs/xcrdapi.cpp`. - Emit one `x2w-dstorage BCPack summary` line at process exit, for example `requests formats=1:2 6:1 7:4; zero-filled formats=6:1`. - Extend the source-built consumer fixture with a format 6 request that succeeds, leaves the destination zero-filled, and is counted, while BC1 and BC7 are not counted as blank. - Document the counters in `docs/startup-runtime.md`. This is measurement only. It does not claim BC6H decoding; that remains a follow-up if the summary shows format 6 traffic. PR #1390 already covers BC3/BC4/BC5. ## Verification ```powershell . .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev --target startup_stub_xcrdapi startup_stub_consumer startup_stub_acphal startup_stub_xapu startup_stub_gameinput ctest --preset dev --no-tests=error -R '^startup_stubs$' -V ``` Result: `startup_stubs` 1/1 passed. Observed line: ```text x2w-dstorage BCPack summary: requests formats=1:2 6:1 7:4; zero-filled formats=6:1 ``` `python -B tests/docs_links_check.py` checked 16 Markdown files and 348 links; `git diff --check` is clean. Rebased onto `origin/main` (`578d1e1c`) on 2026-11-24; the rebased head `852ab34b` rebuilt and passed the same checks. ## Not tested - A retail title run; this change only measures the request classes the stand-in already sees. - AMD and Intel adapters; the counter is CPU-side and adapter-independent. Refs #1139, #1198. No game files, dumps or XCL code are included. ## Licence MIT, as the rest of the repository. The implementation, fixture changes and documentation are original work; no XCL code, tables, game files or third-party binaries are included. AI use: implementation, test update and verification were drafted by a Codex subagent; the orchestrator reviewed the diff and reran the targeted build and CTest above.
tedin7 commented 2026-11-24 16:03:22 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:27:25Z.

Review: COMMENTED


Reviewed at commit a1f24c3dd16806e4fefbf30ce083053ac6276516.

Findings

  • src/startup_stubs/xcrdapi.cpp: bcpack_requests[16] and bcpack_blank[16] are indexed by bcpack = (options >> 1) & 0xF (0..15, guarded by if (bcpack)) using InterlockedIncrement / InterlockedCompareExchange, and log_bcpack_summary is registered once via std::atexit in DStorageGetFactory.
  • tests/startup_stub_consumer.cpp and tests/startup_stub_check.py: cover an unhandled format 6 (BC6H) request alongside BC1 (format 1) and BC7 (format 7), verifying zero-filled destination output, HRESULT == 0, and the x2w-dstorage BCPack summary counts.

Verification

  • Linux repo hygiene:
    • python3 -B tests/docs_links_check.py -> passed (16 Markdown files, 348 links).
    • python3 -B tests/bidi_controls_check.py -> passed (1263 tracked files).
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): ctest --preset dev -R '^(startup_heartbeat_commit|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure -> 3/3 passed (30.29s).
    • Release /O2 (--preset release): ctest --preset release -R '^(startup_heartbeat_commit|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure -> 3/3 passed (30.27s).

No blocking issues found.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6042190141 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1622#pullrequestreview-6042190141). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T15:27:25Z. **Review:** COMMENTED --- Reviewed at commit `a1f24c3dd16806e4fefbf30ce083053ac6276516`. ### Findings - `src/startup_stubs/xcrdapi.cpp`: `bcpack_requests[16]` and `bcpack_blank[16]` are indexed by `bcpack = (options >> 1) & 0xF` (0..15, guarded by `if (bcpack)`) using `InterlockedIncrement` / `InterlockedCompareExchange`, and `log_bcpack_summary` is registered once via `std::atexit` in `DStorageGetFactory`. - `tests/startup_stub_consumer.cpp` and `tests/startup_stub_check.py`: cover an unhandled format 6 (BC6H) request alongside BC1 (format 1) and BC7 (format 7), verifying zero-filled destination output, `HRESULT == 0`, and the `x2w-dstorage BCPack summary` counts. ### Verification - Linux repo hygiene: - `python3 -B tests/docs_links_check.py` -> passed (16 Markdown files, 348 links). - `python3 -B tests/bidi_controls_check.py` -> passed (1263 tracked files). - Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP): - Debug (`--preset dev`): `ctest --preset dev -R '^(startup_heartbeat_commit|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure` -> **3/3 passed** (`30.29s`). - Release `/O2` (`--preset release`): `ctest --preset release -R '^(startup_heartbeat_commit|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure` -> **3/3 passed** (`30.27s`). No blocking issues found. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 17:01:42 +00:00
lambirou commented 2026-11-24 19:01:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T18:45:33Z.


@R0Y00 Ready for maintainer review.

Rebased onto origin/main (578d1e1c); head 852ab34b; Windows checks pass. The earlier review at a1f24c3 found no blocking issues, but that head is no longer current after the rebase.

Scope is measurement only: BCPack requests and zero-filled destinations are counted per format 1..15, and the source-built consumer sends format 6 and checks the zero-filled result. BC6H decoding is not included. No game data.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141111182 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1622#issuecomment-7141111182). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-24T18:45:33Z. --- @R0Y00 Ready for maintainer review. Rebased onto `origin/main` (`578d1e1c`); head `852ab34b`; Windows checks pass. The earlier review at `a1f24c3` found no blocking issues, but that head is no longer current after the rebase. Scope is measurement only: BCPack requests and zero-filled destinations are counted per format 1..15, and the source-built consumer sends format 6 and checks the zero-filled result. BC6H decoding is not included. No game data.
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!1615
No description provided.