runtime: report peak commit and physical-page sections in the startup heartbeat #1263

Merged
triggered02 merged 2 commits from upstream-pr/1270 into main 2026-11-24 06:40:34 +00:00
triggered02 commented 2026-11-24 06:22:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:22:23Z.


What changed

Issue #1199 item 1: make startup runs comparable by memory spent. The DirectStorage stand-in's 10 s heartbeat now reports this process's peak and current commit charge and the number of live 64 KiB physical-page sections, and reports again when either memory value changes even while the request counters are static (so a stalled load still shows what it holds).

  • src/xmem_mapped_pages.cpp / src/xmem_shim.def: experimental x2w_xmem_page_stats export returning the number of live sections (memory.backings.size()). A section exists from a page's first use (a mapping or a page-token write) until its grant is released.
  • src/startup_stubs/xcrdapi.cpp: memory_sample() reads PeakPagefileUsage/PagefileUsage via GetProcessMemoryInfo and the section count through GetProcAddress on the already-loaded xmem.dll, and the heartbeat line gains
    ; commit peak=<MiB> current=<MiB>, live physical-page sections=<n>.
    The line keeps its previous fields; a missing reading prints unknown.
  • CMakeLists.txt: link psapi for the stand-in; register the two new CTest cases.
  • docs/startup-runtime.md: short "Startup memory accounting" section.
  • tests/xmem_page_stats_check.py, tests/startup_heartbeat_check.py: source-built checks.

No allocator, SEC_RESERVE or mapping behaviour changed; this is read-only accounting and does not overlap denn0x's experiments or PR #1264. src/startup_stubs/d3d12_xs_device.cpp is untouched (the DirectStorage heartbeat is the one extended).

Verification (release preset)

Before the change, both checks fail for the right reason:

$ python -B tests/xmem_page_stats_check.py out/build/release/xmem.dll
AttributeError: function 'x2w_xmem_page_stats' not found

$ python -B tests/startup_heartbeat_check.py out/build/release/xmem.dll out/build/release/XCRDAPI.dll
x2w-dstorage heartbeat 10 s: requests done=0 inflated=0 failed=0 bcpack-blank=0; page tokens 0 at enqueue=0, still 0 at run=0
AssertionError: no heartbeat line with commit peak and physical-page sections

After the change:

test 37: xmem_page_stats
37: live physical-page sections: grant=0 mapped=2 unmapped=2 released=0; page-token write created and released 1
37: Passed  0.11 sec

test 38: startup_heartbeat_commit
38: x2w-dstorage heartbeat 10 s: requests done=0 inflated=0 failed=0 bcpack-blank=0; page tokens 0 at enqueue=0, still 0 at run=0; commit peak=9 MiB current=9 MiB, live physical-page sections=2
38: heartbeat at 10 s: commit peak=9 MiB current=9 MiB, live physical-page sections=2
38: Passed  10.18 sec

The heartbeat check maps two synthetic pages, starts the real heartbeat through DStorageGetFactory, waits for the first 10 s report, asserts the reported section count is 2, and checks the reported peak against GetProcessMemoryInfo in the same process.

Neighbouring tests, all passing:

ctest --preset release --no-tests=error -R '^(xmem_shim_mapped_pages|era_physical_(controls|lifetime)|xmem_commit_protection)$'
100% tests passed, 0 tests failed out of 4

ctest --preset release --no-tests=error -R '^(xmem_shim_(exports|physical_pages|allocation|default_allocation|tools_memory|transfer_memory|query)|startup_stubs)$'
100% tests passed, 0 tests failed out of 7

Not verified

No run of the title image was made (none is needed for this slice): the actual peak-commit reduction / stall comparison on a real startup run, and the section count it reports, are for a follow-up run by someone with the package. The heartbeat also starts only when the title calls DStorageGetFactory, so its extra fields appear from the DirectStorage phase onward.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6575968366 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:22:23Z. --- ## What changed Issue #1199 item 1: make startup runs comparable by memory spent. The DirectStorage stand-in's 10 s heartbeat now reports this process's peak and current commit charge and the number of live 64 KiB physical-page sections, and reports again when either memory value changes even while the request counters are static (so a stalled load still shows what it holds). - `src/xmem_mapped_pages.cpp` / `src/xmem_shim.def`: experimental `x2w_xmem_page_stats` export returning the number of live sections (`memory.backings.size()`). A section exists from a page's first use (a mapping or a page-token write) until its grant is released. - `src/startup_stubs/xcrdapi.cpp`: `memory_sample()` reads `PeakPagefileUsage`/`PagefileUsage` via `GetProcessMemoryInfo` and the section count through `GetProcAddress` on the already-loaded `xmem.dll`, and the heartbeat line gains `; commit peak=<MiB> current=<MiB>, live physical-page sections=<n>`. The line keeps its previous fields; a missing reading prints `unknown`. - `CMakeLists.txt`: link `psapi` for the stand-in; register the two new CTest cases. - `docs/startup-runtime.md`: short "Startup memory accounting" section. - `tests/xmem_page_stats_check.py`, `tests/startup_heartbeat_check.py`: source-built checks. No allocator, `SEC_RESERVE` or mapping behaviour changed; this is read-only accounting and does not overlap denn0x's experiments or PR #1264. `src/startup_stubs/d3d12_xs_device.cpp` is untouched (the DirectStorage heartbeat is the one extended). ## Verification (release preset) Before the change, both checks fail for the right reason: ``` $ python -B tests/xmem_page_stats_check.py out/build/release/xmem.dll AttributeError: function 'x2w_xmem_page_stats' not found $ python -B tests/startup_heartbeat_check.py out/build/release/xmem.dll out/build/release/XCRDAPI.dll x2w-dstorage heartbeat 10 s: requests done=0 inflated=0 failed=0 bcpack-blank=0; page tokens 0 at enqueue=0, still 0 at run=0 AssertionError: no heartbeat line with commit peak and physical-page sections ``` After the change: ``` test 37: xmem_page_stats 37: live physical-page sections: grant=0 mapped=2 unmapped=2 released=0; page-token write created and released 1 37: Passed 0.11 sec test 38: startup_heartbeat_commit 38: x2w-dstorage heartbeat 10 s: requests done=0 inflated=0 failed=0 bcpack-blank=0; page tokens 0 at enqueue=0, still 0 at run=0; commit peak=9 MiB current=9 MiB, live physical-page sections=2 38: heartbeat at 10 s: commit peak=9 MiB current=9 MiB, live physical-page sections=2 38: Passed 10.18 sec ``` The heartbeat check maps two synthetic pages, starts the real heartbeat through `DStorageGetFactory`, waits for the first 10 s report, asserts the reported section count is 2, and checks the reported peak against `GetProcessMemoryInfo` in the same process. Neighbouring tests, all passing: ``` ctest --preset release --no-tests=error -R '^(xmem_shim_mapped_pages|era_physical_(controls|lifetime)|xmem_commit_protection)$' 100% tests passed, 0 tests failed out of 4 ctest --preset release --no-tests=error -R '^(xmem_shim_(exports|physical_pages|allocation|default_allocation|tools_memory|transfer_memory|query)|startup_stubs)$' 100% tests passed, 0 tests failed out of 7 ``` ## Not verified No run of the title image was made (none is needed for this slice): the actual peak-commit reduction / stall comparison on a real startup run, and the section count it reports, are for a follow-up run by someone with the package. The heartbeat also starts only when the title calls `DStorageGetFactory`, so its extra fields appear from the DirectStorage phase onward.
upstream-sync closed this pull request 2026-11-24 06:47:27 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:25:31Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46812c8ed3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6034641930 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#pullrequestreview-6034641930). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:25:31Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `46812c8ed3` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 06:47:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T06:32:08Z.

Review: COMMENTED


Dual-platform review at commit 46812c8ed3161aad20ccb92b530d0b77145b10f0:

Verification

  • Linux:
    • git diff --check origin/main...HEAD: passed
    • python -B tests/docs_links_check.py: passed (16 Markdown files, 284 links)
    • python -B tests/bidi_controls_check.py: passed (1067 files)
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target xmem_shim startup_stub_xcrdapi startup_stub_consumer -- -j 6 + ctest --preset dev -R '^(xmem_page_stats|startup_heartbeat_commit|xmem_shim_mapped_pages|xmem_shim_physical_pages|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure -> 5/5 passed (10.27s: xmem_shim_mapped_pages, xmem_page_stats, startup_stubs, xmem_shim_physical_pages, startup_heartbeat_commit)
    • Release /O2 (--preset release): cmake --build --preset release --target xmem_shim startup_stub_xcrdapi startup_stub_consumer -- -j 6 + ctest --preset release -R '^(xmem_page_stats|startup_heartbeat_commit|xmem_shim_mapped_pages|xmem_shim_physical_pages|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure -> 5/5 passed (10.21s)

Code Notes

  • x2w_xmem_page_stats in src/xmem_mapped_pages.cpp safely guards against a null output pointer and reads memory.backings.size() under memory.mutex.
  • memory_sample() in src/startup_stubs/xcrdapi.cpp caches GetProcAddress(GetModuleHandleW(L"xmem.dll"), "x2w_xmem_page_stats") in a function-local static const — this works whenever xmem.dll is loaded before the first heartbeat tick, and gracefully falls back to unknown otherwise.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6034703127 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#pullrequestreview-6034703127). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T06:32:08Z. **Review:** COMMENTED --- Dual-platform review at commit `46812c8ed3161aad20ccb92b530d0b77145b10f0`: ### Verification - **Linux**: - `git diff --check origin/main...HEAD`: passed - `python -B tests/docs_links_check.py`: passed (16 Markdown files, 284 links) - `python -B tests/bidi_controls_check.py`: passed (1067 files) - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `cmake --build --preset dev --target xmem_shim startup_stub_xcrdapi startup_stub_consumer -- -j 6` + `ctest --preset dev -R '^(xmem_page_stats|startup_heartbeat_commit|xmem_shim_mapped_pages|xmem_shim_physical_pages|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure` -> **5/5 passed** (`10.27s`: `xmem_shim_mapped_pages`, `xmem_page_stats`, `startup_stubs`, `xmem_shim_physical_pages`, `startup_heartbeat_commit`) - **Release `/O2` (`--preset release`)**: `cmake --build --preset release --target xmem_shim startup_stub_xcrdapi startup_stub_consumer -- -j 6` + `ctest --preset release -R '^(xmem_page_stats|startup_heartbeat_commit|xmem_shim_mapped_pages|xmem_shim_physical_pages|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure` -> **5/5 passed** (`10.21s`) ### Code Notes - `x2w_xmem_page_stats` in `src/xmem_mapped_pages.cpp` safely guards against a null output pointer and reads `memory.backings.size()` under `memory.mutex`. - `memory_sample()` in `src/startup_stubs/xcrdapi.cpp` caches `GetProcAddress(GetModuleHandleW(L"xmem.dll"), "x2w_xmem_page_stats")` in a function-local `static const` — this works whenever `xmem.dll` is loaded before the first heartbeat tick, and gracefully falls back to `unknown` otherwise.
chatgpt-codex-connector[bot commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:22:37Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T06:25:33.421827Z 46812c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7123869089 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#issuecomment-7123869089). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:22:37Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"46812c8ed3161aad20ccb92b530d0b77145b10f0","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T06:25:33.421827Z">2026-11-24T06:25:33.421827Z</relative-time> | `46812c8` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
triggered02 commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:31:54Z.


Rebased onto current main (7a691883, was 12 commits behind) — this also retriggers CI, because the last Linux job died inside actions/checkout with git ... exit code 128 before any step of the job ran (GitHub network error, not this change). I cannot rerun that job from the fork side (Must have admin rights to Repository), so a fresh push was the way to get a clean run; sorry for the extra notification.

Re-verified after the rebase on the release preset:

live physical-page sections: grant=0 mapped=2 unmapped=2 released=0; page-token write created and released 1
x2w-dstorage heartbeat 10 s: ... commit peak=9 MiB current=9 MiB, live physical-page sections=2
1/2 Test #37: xmem_page_stats .......... Passed 0.14 sec
2/2 Test #38: startup_heartbeat_commit . Passed 10.18 sec

I also checked the two new cases fail on a pre-change build for the right reasons (missing x2w_xmem_page_stats export; heartbeat line without the new fields), so they are not passing vacuously.

One honest limit, unchanged: the numbers above come from the source-built checks, not a title run, so this adds the observability the issue asks for (item 1) without yet providing the before/after peak-commit comparison — that needs a run and is what item 2 will be measured with.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124029236 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#issuecomment-7124029236). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:31:54Z. --- Rebased onto current `main` (`7a691883`, was 12 commits behind) — this also retriggers CI, because the last Linux job died inside `actions/checkout` with `git ... exit code 128` before any step of the job ran (GitHub network error, not this change). I cannot rerun that job from the fork side (`Must have admin rights to Repository`), so a fresh push was the way to get a clean run; sorry for the extra notification. Re-verified after the rebase on the `release` preset: ``` live physical-page sections: grant=0 mapped=2 unmapped=2 released=0; page-token write created and released 1 x2w-dstorage heartbeat 10 s: ... commit peak=9 MiB current=9 MiB, live physical-page sections=2 1/2 Test #37: xmem_page_stats .......... Passed 0.14 sec 2/2 Test #38: startup_heartbeat_commit . Passed 10.18 sec ``` I also checked the two new cases fail on a pre-change build for the right reasons (missing `x2w_xmem_page_stats` export; heartbeat line without the new fields), so they are not passing vacuously. One honest limit, unchanged: the numbers above come from the source-built checks, not a title run, so this adds the observability the issue asks for (item 1) without yet providing the before/after peak-commit comparison — that needs a run and is what item 2 will be measured with.
triggered02 commented 2026-11-24 06:50:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T06:34:38Z.


First real-run numbers from this branch (the item 1 value this PR adds), run of the title to a 120 s timeout:

heartbeat 10 s: commit peak=5482 MiB current=5290 MiB, live physical-page sections=102736
heartbeat 60 s: commit peak=7739 MiB current=7739 MiB, live physical-page sections=102736

So it reports 102,736 live physical-page sections (~6.4 GiB at 64 KiB each) against ~7.7 GiB of peak commit, with the section count flat from 10 s on while commit keeps rising. That is exactly the comparison item 2 needs, and it is the first time these numbers are available at all — the fields appear once DStorageGetFactory has run, which is the case in a title run.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124075606 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#issuecomment-7124075606). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T06:34:38Z. --- First real-run numbers from this branch (the item 1 value this PR adds), run of the title to a 120 s timeout: ``` heartbeat 10 s: commit peak=5482 MiB current=5290 MiB, live physical-page sections=102736 heartbeat 60 s: commit peak=7739 MiB current=7739 MiB, live physical-page sections=102736 ``` So it reports 102,736 live physical-page sections (~6.4 GiB at 64 KiB each) against ~7.7 GiB of peak commit, with the section count flat from 10 s on while commit keeps rising. That is exactly the comparison item 2 needs, and it is the first time these numbers are available at all — the fields appear once `DStorageGetFactory` has run, which is the case in a title run.
R0Y00 commented 2026-11-24 06:50:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T06:37:52Z.


I pushed a focused follow-up at 22709a63. The heartbeat now samples the currently loaded page provider while holding a module reference, and a change in current commit can trigger a report on its own. The source-built check observed unknown sections at 10 s, two after loading the provider at 20 s, then current commit falling from 25 to 9 MiB at the same 25 MiB peak. That check, the page-section lifetime test and the mapped-pages regression all passed in Release. The allocator and worker failure work in #1199 remain separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7124130608 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#issuecomment-7124130608). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T06:37:52Z. --- I pushed a focused follow-up at `22709a63`. The heartbeat now samples the currently loaded page provider while holding a module reference, and a change in current commit can trigger a report on its own. The source-built check observed unknown sections at 10 s, two after loading the provider at 20 s, then current commit falling from 25 to 9 MiB at the same 25 MiB peak. That check, the page-section lifetime test and the mapped-pages regression all passed in Release. The allocator and worker failure work in #1199 remain separate.
chatgpt-codex-connector[bot commented 2026-11-24 06:50:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T06:25:31Z.

Code review location: src/startup_stubs/xcrdapi.cpp; line 823

@@ -778,18 +808,40 @@ extern "C" long __stdcall DStorageGetFactory(const GUID* riid, void** out)
     log("x2w-dstorage DStorageGetFactory riid=%s", id);
     if (!out) return E_POINTER;
     // Heartbeat: the request counters every 10 s, so a run shows whether loading still progresses
-    // after the per-call logs have gone quiet.
+    // after the per-call logs have gone quiet. Peak commit and the live physical-page sections show
+    // what the run spends (#1199), including while requests are stalled.
     static HANDLE heartbeat = CreateThread(nullptr, 0, [](void*) -> DWORD {
         LONG last = -1;
+        ULONGLONG last_peak_mib = 0, last_sections = 0;
         for (int second = 10;; second += 10) {
             Sleep(10000);
             const LONG total = requests_done + requests_compressed + requests_failed;
             const LONG total2 = total + requests_bcpack_blank;
-            if (total2 != last)
+            const MemorySample sample = memory_sample();
+            const ULONGLONG peak_mib = sample.peak_commit >> 20;
+            const ULONGLONG sections = sample.sections_known ? sample.sections : 0;
+            if (total2 != last || peak_mib != last_peak_mib || sections != last_sections) {

P2 Badge Track current commit when deciding to emit the heartbeat

If current commit changes by at least 1 MiB while request counts and the physical-section count stay fixed, but current commit remains below an already reached peak, this condition emits no new line. The reported current= value therefore stays stale; include the current MiB value in the change check.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4676283684 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1270#discussion_r4676283684). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T06:25:31Z. **Code review location:** `src/startup_stubs/xcrdapi.cpp`; line 823 ~~~~diff @@ -778,18 +808,40 @@ extern "C" long __stdcall DStorageGetFactory(const GUID* riid, void** out) log("x2w-dstorage DStorageGetFactory riid=%s", id); if (!out) return E_POINTER; // Heartbeat: the request counters every 10 s, so a run shows whether loading still progresses - // after the per-call logs have gone quiet. + // after the per-call logs have gone quiet. Peak commit and the live physical-page sections show + // what the run spends (#1199), including while requests are stalled. static HANDLE heartbeat = CreateThread(nullptr, 0, [](void*) -> DWORD { LONG last = -1; + ULONGLONG last_peak_mib = 0, last_sections = 0; for (int second = 10;; second += 10) { Sleep(10000); const LONG total = requests_done + requests_compressed + requests_failed; const LONG total2 = total + requests_bcpack_blank; - if (total2 != last) + const MemorySample sample = memory_sample(); + const ULONGLONG peak_mib = sample.peak_commit >> 20; + const ULONGLONG sections = sample.sections_known ? sample.sections : 0; + if (total2 != last || peak_mib != last_peak_mib || sections != last_sections) { ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Track current commit when deciding to emit the heartbeat** If current commit changes by at least 1 MiB while request counts and the physical-section count stay fixed, but current commit remains below an already reached peak, this condition emits no new line. The reported `current=` value therefore stays stale; include the current MiB value in the change check. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
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!1263
No description provided.