Repository navigation
runtime: a guest Sleep sits out host-only pipeline compiles, so the title's startup hang check survives a cold boot (RT-5 follow-up, stop 18) - #7858
Conversation
…e startup hang check) The retail title's startup hang check loops on Sleep(1000) and ends the process after 30 rounds without progress from the main thread; a round that returns more than 2 s late starts its count again. A cold driver compile of the XboxBvhBuilder compute pipelines takes 25 to 60 s on the title's thread, so a first boot ended about 31 s in. src/host_stall.h keeps a ledger of host-only stalls. The layer marks the vkCreateComputePipelines call of a compute pipeline state as one, and shims/host_stall.cpp serves Sleep for mapped images: the host's Sleep, which does not return while a stall is open and lasts as much longer as stalls overlapped it. A Sleep no stall overlaps is unchanged. host_stall_test covers the ledger and the served Sleep on synthetic threads. docs/retail_boot_chain.md section 5 has the measurement. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested
AI-assisted (Claude Code). |
|
Tested 4a51079 on NVIDIA GeForce RTX 3060 (driver 617.14), Windows 11 26H2 (26300), MSVC 19.44.35229 (v143) + Ninja, RelWithDebInfo:
AI-assisted (Claude Code). |
|
Independent timing comparison on native Windows, RTX 4080, MSVC 19.44, SDK 10.0.26100 and Vulkan SDK 1.4.363. This measures the existing pipeline-cache path; it is not a validation of this PR's Sleep implementation. The two runs used identical runtime and TLS-helper bytes, the host Sleep, the same translated catalog, and the same protected offline launcher. The sole runtime-input change was adding a prepared
The seed was produced by the existing Base: All 55 imported Winsock/WinHTTP entries remained bound to offline shims. All protected game-file metadata and all 17 PE hashes were unchanged, as were the runtime, TLS helper and cache seed. No assertions were skipped. Only aggregate measurements and API names are reported here. |
# Conflicts: # docs/README.md
|
Retail boot test (RT-5): own 1.0.2.1 copy, Windows 11, i9-12900KF, RTX 3070 (NVIDIA 617.42), MSVC 2022 RelWithDebInfo, Result: clears the startup hang check (stop 18) on NVIDIA. Without it, with this PR's stop 17 fix in (#7235): a write to address 0 at 32.4 s, the same with and without Cherry-picked AI-assisted test run. |
A cold first boot of the retail executable no longer ends at about 31 s inside the
XboxBvhBuildercompiles: with this change it survives a 56 s cold compile and goes on to the next stop (1,661 D3D12 calls, was 1,641).Claimed in the coordination issue as: new RT item (RT-5 follow-up), #7496 (comment)
Builds on no open pull request. It is next to #7516, #7535, #7360 and RT-601 (which shorten or avoid the compiles), not instead of them.
What and why
Sleep(1000)(imported fromapi-ms-win-core-synch-l1-2-0.dll), and after 30 rounds in which the main thread's progress mark did not change it writes to address 0. A round whoseSleeptook more than 2 s byQueryPerformanceCounterstarts the count again, as after a console suspend. From a static read of the loop: import names, counts and values only.D3D12XboxCreateDevice.runtime/src/host_stall.hkeeps a ledger of host-only stalls. The layer marks thevkCreateComputePipelinescall of a compute pipeline state as one (runtime/shims/d3d12_vulkan_device.cpp).runtime/shims/host_stall.cppservesSleepfor mapped images: the host'sSleep, which does not return while a stall is open and lasts as much longer as stalls overlapped it. The title's own late-round rule then starts its count again.Sleepno stall overlaps is the host's, unchanged. No pipeline is skipped and the check stays armed.SleepEx, waits with a timeout and all clocks stay the host's. Graphics pipelines and time lost outside a marked stall are not covered (docs/retail_boot_chain.md§5.3).Tested
Tested on NVIDIA RTX 4080, driver 610.88, Windows 11, i9-12900K. MSVC 2022
RelWithDebInfo, Vulkan SDK 1.4.363.0.SleepPipodi:boot-integrationatb2e606620(main1cc6e3c12with docs/retail_boot_chain.md: stops 13-17 (descriptor heap at an address, device slots 70, 127, 25) #6982's pull requests and stand-ins) plus runtime/shims: add offline ws2_32.dll Winsock2 shim for mapped EXE #6943,LEONIDA_SKIP_ASSERTS=20, the 52 builder programs translated with--wave64-emulate, this change ported for "after". Cold = one unused constant added to each module, so the driver cache missed. A second pair gave the same result; four more runs without the change ended at 32.4 to 34.1 s.WS2_32and 30WINHTTPimports to shims, none to the host.host_stall_test(new, CPU only, synthetic threads): 23 checks pass. Negative control with aSleepthat never holds: 4 of the 23 fail.ctest, 273 tests, serial, on this branch (maindde82f27e): 270 pass.d3d12_vulkan_device,d3d12_indirect_dispatch_countandd3d12_depth_resolvefail, and fail the same way on unmodifiedmainhere (the first two ata779d6411, the third atdde82f27e).tests/test_build_runtime_fallback.py: 8 pass.tests/test_docs_*.pyandscripts/check_no_game_data.py: as onmain(test_docs_cli_flags.pyandtest_docs_links.pyfail there too, on other pages).AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (Not a translator change.)🤖 Generated with Claude Code