startup: print raw= and completed= in the DirectStorage status lines #2809
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2817"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:19:44Z.
Part of #1198
Fixes #2816
What this unblocks: the DirectStorage status lines answer "is storage progressing?" at a glance, also for a title whose requests are all compressed (they used to read
done=0for the whole run while thousands completed).Change
src/startup_stubs/xcrdapi.cpp: newformat_request_counts()printsraw=<n> inflated=<n> failed=<n> bcpack-blank=<n> completed=<n>for both theQueue::EnqueueStatusline and the heartbeat totals line.rawis whatdone=counted (uncompressed copies only);completedisraw + inflated + bcpack-blank, so a failed request is not in it. The textinflated=%ld failed=%ldis byte-for-byte unchanged.tools/startup/live_view.py: readscompleted=from the new lines and rebuilds it fromdone=/inflated=/bcpack-blank=on older lines; the status line shows "N storage requests completed" next to the chunks count and the read-batch message says how many requests completed.docs/startup-runtime.md: documents the fields next to the heartbeat failure causes.Tests
startup_storage_failure_counts(existing stand-in check): the mixed run's counts are asserted (raw=1 inflated=1 failed=<n> bcpack-blank=0 completed=2, theinflated=N failed=Ntext unchanged), then a run with only zlib requests assertsraw=0andcompletedequal to the number of finished requests; the EnqueueStatus line carriesraw=andcompleted=and no longer saysdone=.tests/startup_live_telemetry_check.py: a new case feeds old and new EnqueueStatus and heartbeat lines through the viewer (completed 7 fromcompleted=7, 5 from an olddone=0 inflated=5line, 7 from an old heartbeat withbcpack-blank=2).Verification
Linux, run here (Stage 1; the C++ stand-in check builds with MSVC only, so it is not compiled here):
tests/startup_live_view_check.pyfails the same way on origin/main (a Windows path case), unchanged by this PR.Win2025 WARP dev+release: pending Stage-2 (
startup_storage_failure_counts,startup_storage_page_end_counts).Source: Microsoft DirectStorage documentation, DirectStorage overview (a request completes when its destination is written, whether or not it was compressed).
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T11:44:44Z.
Win2025 (build 26100) on head
0355a7745: startup_storage and startup_live regex, dev 16/16 and release 16/16 passed, including startup_storage_failure_counts (mixed-run totals and the zlib-only run: raw=0, completed equal to the finished requests), its one-bucket control, and startup_storage_page_end_counts.The earlier head
7e6774f0afailed startup_storage_failure_counts: the new mixed-run assertion ran after the existing step that adds one more failure after the heartbeat totals, so failed was 12, not 11. The assertion now expects that extra failure.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:00:42Z.
Head
1039125e1: startup_storage_failure_counts now also pins completed = raw + inflated + bcpack-blank with all four counts non-zero (format_request_counts(buf, size, 1, 2, 3, 4) == "raw=1 inflated=2 failed=3 bcpack-blank=4 completed=7"), so a total that drops the bcpack-blank term fails; the mixed run alone had no BCPack-blank request.Win2025 (build 26100), regex ^(startup_storage|startup_live): dev 16/16 and release 16/16 passed on this head (second full run). One earlier run of the same head had startup_storage_directory_batch fail once in the dev phase (the consumer process exited after Factory::CreateQueue while startup_storage_worker_start was running in parallel); the test then passed alone twice (dev+release) and in the full rerun. I did not find a cause in this change and note it here rather than hide it.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T12:11:41Z.
@MasterDomino Ready for review: head
1039125e1(Fixes #2816).Independent Stage-2 check on this exact head, Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP), Proxmox slots, dev and release
/O2:startup_storage_failure_counts(the C++ check of the new status-line counters) is among the 7 in both presets.Controls on the counters, each one change in
format_request_countsrun on Windows againststartup_storage_failure_counts, the check must fail:completedalso counting failed requests: fails.completed= raw only: fails.completed=changed back todone=: fails.completedwithout the bcpack-blank term: fails with the (1, 2, 3, 4) ->completed=7assertion added in this head (it passed before that assertion).Review result: the counters only rise for requests that wrote their destination, so
completedis raw + inflated + bcpack-blank and a failed request is not in it;inflated=N failed=Nis byte for byte what it was, andtools/startup/live_view.pyreads both the old (done=) and the new (completed=) lines.Not caused by this PR:
startup_storage_directory_batchcan fail under parallel load. Onorigin/main(7256cecf2, same regex, five runs at once on the Win2025 pool) it failed 2 of 5 times (the probe process exits non-zero attests/startup_storage_directory_batch.py:105) and passed alone and in the 7/7 runs above.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T12:11:48Z.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
We couldn’t complete this review. Comment
@codex reviewto try again.1039125ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T12:11:50Z.
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:51:41Z.
Correction to the Stage-2 note on head
1039125e1: the sentence "Not caused by this PR ... Onorigin/main(7256cecf2) it failed 2 of 5 times" is withdrawn. Those five runs applied a small patch on top of this PR's head, so they did not test main.Redo on the exact
7256cecf2tree (this head plus the full reverse diff, patch applied on Windows Server 2025, Proxmox slots, dev):startup_storage_directory_batchpassed in all five. So the earlier failure (2 of 5, probe exit non-zero attests/startup_storage_directory_batch.py:105) is not shown on main, and it is not shown to be caused by this PR either: the same test passed 7/7 on this head in the Stage-2 runs. Cause still open.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T18:31:40Z.
Review: APPROVED
Independently reviewed
1039125eintegrated overmain429f11d5(treecd23c450, clean merge).What I traced. In
src/startup_stubs/xcrdapi.cpp, a request that wrote its destination increments exactly one of three counters:requests_bcpack_blank(BCPack not decoded),requests_compressed(zlib or decoded BCPack) orrequests_done(raw copy). A failure goes only throughcount_failureintorequests_failed. So the counters are disjoint, andcompleted = raw + inflated + bcpack-blankcounts each finished request once and no failed ones.Both status lines keep the text
inflated=%ld failed=%ld, and the 128-byte buffers hold the longest possible output (about 100 characters). I also searched the tree for other readers of these lines:tools/startup/triage_run.pyreads only the heartbeat second,commit peak=and the failure-cause line, so droppingdone=does not affect it;done=,inflated=orbcpack-blank=.What I ran. I built the 12 targets behind
^(startup_storage|startup_live), includingstartup_stub_xcrdapi,startup_stub_consumerandxmem_shim, indevandrelease. Then I ranctest --test-dir out/build/<preset> --no-tests=error -j 8 --output-on-failure -R '^(startup_storage|startup_live)'three times per preset: 16/16 each time in Debug and Release
/O2, with no skips.startup_storage_directory_batchpassed in all six runs here, at-j 8.These Python checks pass:
startup_live_telemetry_check.pyandstartup_live_view_cli_check.py(OK);startup_triage_run_check.py(0 failed);docs_links_check.py(101 files, 589 links).Before and after.
main'stools/startup/live_view.py, the newtest_status_lines_old_and_new_formatfails:'7 storage requests completed' not found.else if (bcpack)instead ofelse if (zlib || bcpack), withXCRDAPI.dllrebuilt) failsstartup_storage_failure_counts. The first failure israw=2 inflated=0, expected 1 and 1, and the zlib-only run givesraw=3 inflated=0 ... expected "raw=0 inflated=3 ...".git diff --checkis clean.Non-blocking notes.
donefallback in the viewer is not tested. Every old-format line in the new test hasdone=0. If I remove"done"from the name tuple in_storage_completed,startup_live_telemetry_check.pystill passes. The code itself is right:_storage_completed("... (requests done=4 inflated=5 failed=1)")returns 9. A non-zerodone=on one old line would pin it.tests/startup_storage_failure_counts.cpp, the linechar counts[160], want_counts[160];is indented 8 spaces in a 4-space block.Neither is a reason to hold the PR.
Verdict: approve on
1039125e.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10. No GPU involved.
CI:
Build and test on Windowspasses on1039125e. There are no review threads.This reply was AI-assisted.