startup: output-window close review follow-up #3344
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3344
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3342"
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?
@romn4rch on GitHub · 2026-11-28 11:21 UTC · original
romn4rch:copilot/pr-2344-review-a2cb59d5→main· +189 −12 · 9 files · 4 commits · openReplacement submission for #2344. This branch contains the existing output-window close work plus the verified review follow-up commit. The original PR remains open because its author-owned branch was not writable from this account; these PRs overlap in scope, so please keep only one submission and close/mark the other as superseded when choosing.
Validation:
startup_present_producerbuilt successfully, andstartup_output_window_close,startup_present_producer_warp, andstartup_run_ps1passed (3/3).@KelboLive on GitHub · 2026-11-28 21:22 UTC · original · approved these changes
LGTM — clean follow-up that wires output-window Close through both host modes.
The approach is consistent with existing session-close patterns in the codebase.
@KelboLive on GitHub · 2026-11-28 21:57 UTC · original · approved these changes
LGTM — clean follow-up that wires output-window Close through both host modes.
The approach is consistent with existing session-close patterns in the codebase.
@Leyukaka on GitHub · 2026-11-29 07:08 UTC · original · reviewed
Reviewed head
a2cb59d5againstmain212d4b5fby reading the diff and git objects, plusgit merge-tree. Nothing was built or run.Verdict: comment. The close handling answers the changes request on #2344, and the
prpreset now lists the affected tests, but the branch conflicts withmain.Conflict in
tools/startup/run.ps1.git merge-tree --write-tree 212d4b5f a2cb59d5exits 1 withCONFLICT (content)there.main(539c3ad5) appends@holdArgsto the same debugger line where this PR appends@windowArgs. Keeping both as@captureArgs @holdArgs @windowArgs, with both$holdArgsand$windowArgsdefinitions, matches the auto-mergedstartup_run_ps1_check.py: it appends--managed-window 1after the passed arguments, and its-SuspendOtherscases don't pass-Render. The other files auto-merge.Dropping the inherited event name is still unpinned.
debug_launch.py:221drops an inheritedX2W_SESSION_CLOSE_EVENT, but the check passes its stale name (startup_output_window_close_check.py:23) only together with--managed-window 1, anddebug_launch.py:229then overwrites the value. With line 221 removed the check still passes. A launcher run without--managed-windowand with a stale name would cover it: with the pop removed, the child takes the managed branch and exits 22 (startup_present_producer.cpp:170-172) instead of 0.What checks out:
d3d12_present.inl:39-54: Close no longer minimizes (main:39) and does not exit the process. With an event it can open and set, it returns. Otherwise it marks the output closed, stops the hider timer, shows the hidden windows again and hides the output window.present_to_windowrefuses after Close (:179), sod3d12_xs_device.cpp:7381records the frame as not shown. That is what the changes request on #2344 asked for: the launcher ends the session, and a direct host stays alive.mainasserts the old minimize-on-close behaviour (WM_CLOSE,SC_CLOSEandminimihave no match undertests/, apart from an unrelated shader check).startup_present_producer.cpp:174) and stays visible after a hider timer message (:176-180). By reading, that catches dropping the reshow call at Close. It should also catchpresent_to_windowignoring the closed flag, provided the present on the hidden window returns a success code.add_test/set_tests_properties, an include path anduser32. InCMakePresets.json, theprbuild preset gains thestartup_present_producertarget and theprtest filter gainsstartup_output_window_close,startup_present_producer_warpandstartup_run_ps1. The Windows build-and-test check passes ona2cb59d5.Minor:
return 2path atdebug_launch.py:1278is not reached with the test child.--managed-windowis missing from the usage text at the top ofdebug_launch.py;docs/startup-runtime.md:261mentions it.2ef859e5, sogit diff 44f14769 2ef859e5 -- tests/shows them.The body presents this PR as the replacement for #2344, which is still open at
44f14769(both of its commits are in this branch) and whose changes request is on5633a0d3.@JohnConnorNPC on GitHub · 2026-11-29 13:24 UTC · original
Review of head
a2cb59d5againstmainc04e0dd6. I read the diff and git objects only; nothing was built or run.This needs a rebase.
git merge-tree --write-tree origin/main a2cb59d5exits 1. Since the earlier review on212d4b5f,mainhas moved, and the branch now conflicts in three files instead of one:tools/startup/run.ps1: the same debugger line as before.mainappends@holdArgs, and this PR appends@windowArgs.tests/startup_run_ps1_check.py:75db835a("default to native shaders") changedrun_caseat the line where this PR adds the--managed-window 1expectation.mainnow hasnative_default = (native or "-Render" in switches) and not translate. Both lines are needed. Every rendered case (translate,native, or-Renderinswitches) passes-Render, so it still expects--managed-window 1.CMakePresets.json: theprtest filter.mainhas added entries to the samenameregex, so keep both sets.Checked, by reading, on the default path: without
-Render,run.ps1passes no--managed-window, anddebug_launch.pycreates no event, so a run without-Renderbehaves as before apart from the newCreateJobObject,SetInformationJobObjectandAssignProcessToJobObjectfailure exits. A direct shim host, with noX2W_SESSION_CLOSE_EVENT, now hides the output window on Close instead of minimizing it, andpresent_to_windowreturns false from then on. That change is documented indocs/startup-runtime.md.MUST
main, resolving the three conflicts above. Then re-runstartup_run_ps1, becausemain's native-default expectations and this PR's--managed-windowexpectation now meet inrun_case.SHOULD / NIT: none beyond the review of 29 November.
Held: not mergeable until rebased.
AI-assisted.
@pigalot on GitHub · 2026-11-29 13:32 UTC · original · requested changes
Reviewed
a2cb59d5. It conflicts withmain17b662a2, so I built and tested the PR head on its own (it already containsmainup to7e5c378d), not an integrated tree.I merged
maininto this branch earlier as44f14769(pushed to #2344's branch, which this PR builds on); I checked that resolution again here withgit show --remerge-diff 44f14769. It touches only the four conflicted files:present_to_windowkeepsmain's plane-surface signature with theoutput_closedcheck added, the final window capture keepsnot window_close,run.ps1passes both@captureArgsand@windowArgs, andstartup_run_ps1_check.pyexpects--managed-window 1for-Render, translate and native cases. Nothing else is in it.Blocking: conflicts with
main.git merge-tree --write-tree 17b662a2 a2cb59d5reports three files:tools/startup/run.ps1:mainappends@holdArgsto the debugger line this PR appends@windowArgsto. Both are needed:@captureArgs @holdArgs @windowArgs.tests/startup_run_ps1_check.py:main(75db835a) addednative_defaultand two more record fields next to this PR'swant.extend(["--managed-window", "1"]). Keepmain'snative_defaultline andexpectedlist, and the PR's two lines.CMakePresets.json: theprtest filter.mainaddedstartup_inline_retire_(on|control)_warp,startup_resource_retire_title_inline_warp_debug0,startup_table_lock_(control_)?warpandstartup_compute_packed_d16_x_uav_reference; keep those and add this PR's three names.I have not built those resolutions. Please merge
main(a merge, not a rebase) and I will retest the new head.What I ran at
a2cb59d5. Builtstartup_present_producerandd3d12_xs_shimindevandrelease, thenctest --test-dir out/build/<preset> --no-tests=error -j 1 --output-on-failure -R '^(startup_output_window_close|startup_present_producer_(warp|hardware)|startup_run_ps1.*)$'4/4 passed in Debug and Release
/O2, no skips.git diff --checkagainstmainis clean.Mutants (dev build,
startup_output_window_closefor the shim and launcher,startup_run_ps1forrun.ps1): 20 run, 14 killed, 5 survive, 1 equivalent.Killed:
output_closednever set;present_to_windowignoringoutput_closed; reshow step at Close dropped; minimize instead of hide.--managed-windowtest inverted; event name not passed to the child; job not terminated on Close; job exit code 1 instead of 0; close message dropped; no wait after Close.run.ps1:@windowArgsnot passed; flag set without-Render; flag value0.Survive:
debug_launch.py:221,env.pop("X2W_SESSION_CLOSE_EVENT", None)removed. This confirms Leyukaka's second point: the check only passes the stale name together with--managed-window 1, where line 229 overwrites it. A launcher run with the stale name and no--managed-windowwould pin it.debug_launch.py:1278,return 0 if child_stopped else 2replaced byreturn 0. The test child always dies with the job, so the failure path is not reached.debug_launch.py:1257,and not window_closeremoved from the final capture. Diagnostics only.d3d12_present.inl:46,if (sent) return 0;removed, andif (!sent) return 0;. In both the managed window is also hidden before the job ends it; the test cannot tell.Equivalent:
KillTimerat Close removed. Presents are refused after Close, so a later timer tick sees no shown frame and leaves the title window visible.None of the survivors blocks; the first is worth a test case while the branch is being updated anyway.
Other notes.
2ef859e5, is a merge ofmainthat also carries the follow-up changes (fixture, check, docs, preset, a comment indebug_launch.py);git show --remerge-diff 2ef859e5shows them.a2cb59d5is a clean merge.44f14769. One of the two should be closed as superseded.Environment: Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; Python 3.12.10; NVIDIA GeForce RTX 5090 driver 32.0.16.1088, debug layer enabled; inbox WARP.
CI:
Build and test on Windowspassed ona2cb59d5.This reply was AI-assisted.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.