Repository navigation
startup: close the rendered session from the output window - #2344
SuperCraft3M wants to merge 1 commit into
Conversation
tedin7
left a comment
There was a problem hiding this comment.
Review of head 5633a0d3f2b75f32ffcfb7a536d502d0f05fe9f5 (Linux host; no PowerShell, no Windows).
Commands executed locally (in a worktree of the PR head):
git diff --stat origin/main...HEAD -> 6 files, +84/-10
python3 tests/docs_links_check.py -> Checked 19 Markdown files and 453 links
python3 tests/bidi_controls_check.py -> no bidirectional controls
git diff --check origin/main...HEAD -> clean
python3 tests/startup_run_ps1_check.py -> "text only: not a Windows host" (0 failed)
CI at review time: Windows and Linux jobs still pending. The PR is mergeable.
Findings: P1=0, P2=0.
Read-through:
run.ps1:-not $env:X2W_HIDE_TITLE_WINDOWtreats the string "0" as set (non-empty string is truthy), so an explicit0still opts out. The new test case with-Render -LiveConsoleandhide_env="0"covers that.--console 0matchesdebug_launch.py(opts.get("--console", "1") == "1").d3d12_present.inl:WM_CLOSEnow callsExitProcess(0)after logging. Minimize is unaffected because it goes throughWM_SYSCOMMAND. Nit: the exit skips any flush of the shader cache or logs, which the PR text already says is intended.startup_present_producer.cpp(window-close): the fixture finds the output window by class and PID, checks that the guest window is hidden, then minimize, restore andSC_CLOSE. Reaching the 5 s sleep and returning 19 means the process did not exit, so the test fails closed.startup_output_window_closeruns with the new CMake line, which linksuser32and adds thesrcinclude path.startup_run_ps1_check.py: the expectations (--console 0unless-LiveConsole, and the inherited env value) matchrun.ps1.
Nits:
- The
-Translatepath only gets the--console 0and hide default through$Render. That is correct, since-Translateneeds-Render. The test'srendering = translate or ...is a slightly looser model than the script, but it is harmless.
Not done:
- No mutation run. The launcher test needs PowerShell and the close probe needs Windows, and neither is available on this host. The claimed Win2025 results in the PR body were not re-run here.
AI-assisted; commands listed were executed locally.
R0Y00
left a comment
There was a problem hiding this comment.
The presenter is inside the shared D3D12 shim. WM_CLOSE currently calls ExitProcess in every host that creates that window, including hosts launched without run.ps1. That also runs DLL detach after stopping the other threads, which can hang if a stopped thread holds a lock needed by detach. Keep session shutdown owned by the launcher or an explicitly enabled session owner. In other hosts, closing the presenter should leave the host alive.
Please keep the existing minimize check and add both close cases: a managed source-built child whose process handle becomes signaled and whose launcher returns, and a direct shim host that stays alive on presenter close. The window visibility and live-console change can proceed independently if you want to land that first. Microsoft ExitProcess documentation
|
APPROVED. Closes rendered session from the output window. |
5633a0d to
0465ba6
Compare
Change
Closing the output window of a rendered
run.ps1session signals its debugger. The debugger owns the Windows job, terminates the child and verifies that the process handle becomes signaled before returning. Minimize keeps the session active. In a direct shim host, Close hides the output and the host remains active.The source-built presenter exercises minimize, restore and Close in both modes. The managed probe requires a debugger return and a zero child exit. The direct probe verifies that the window is hidden and the host can continue issuing presents.
Verification
Changes at
0465ba6don18f2f85c. Release, MSVC 19.44.35230, Windows 11 build 26300.9711. Hardware used an NVIDIA RTX 4070 with driver 32.0.16.2114. The D3D12 debug layer was unavailable.4 passed, 0 failed, 0 skipped. The launcher check ran on Windows PowerShell 5.1 and PowerShell 7.
AI-assisted (Codex).