xcl run: end the title when its launcher is gone #3431
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3431"
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 ivall/xcl. Originally posted by vakaobr on 2026-11-29T15:41:20Z.
The host watched its launcher (the handle in
XCL_PREPARATION_PARENT) only during shader preparation and closed the handle after it. Once the title ran, nothing tied the host to the launcher: with the launcher killed, the host went on alone, nobody waited for it or read its output, andreport.jsonkeptexit_code: nulland an emptyenvironment. Part of #258.What is in it
crates/xcl/src/host.rs:host_maintakes the launcher's handle (launcher_handle), lends it to preparation, and keeps it for the run. Anxcl-launcher-watchthread waits on it; when the launcher ends it logsthe launcher (xcl run) is gone – ending the title (…), writes the final report and ends throughreal::end_title(fences signalled, GPU drained), exit code0x7C10003.crates/xcl/src/hle/d3d12x/present/preparation.rs:before_guestborrows the handle instead of reading the variable itself; it still stops preparation when the launcher goes.the_title_ends_when_the_launcher_is_gone: an event stands for the launcher's process handle; nothing happens before it is signalled, the callback runs after.Tested
x86_64-pc-windows-gnu; head87e472fonmain9dfbe3e.host::testsandpresent::preparation::tests: 7 passed, 0 failed.the launcher (xcl run) is gone – ending the title, the process ended 14 ms later with status0x7c10003, nothing left running.main9dfbe3ewith and without this PR, hanging in some runs and crashing (0xc0000005) in others; the watcher did not fire.Regression run
scripts/smoke.ps1. I am asking on #258 for a pair.Not tested
SetConsoleCtrlHandler) are not handled here; under CrossOver Ctrl-C delivers none.AI use
main, and drafted this description. I checked it before opening.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:52:16Z.
Review (head
87e472f9, diff read, not a merge-check; draft,PR descriptionred, no Windows run):host.rs~124-130) goes fromreport::write_finalandlog::flushstraight toend_title. TheXCL_RUN_SECONDSpath and the normal exit (host.rs~301-302 / ~321-322 on main) also callpso_async::shutdown_used()andshutdown_indirect_split_records(500 ms).end_titlesuspends the other threads, so the last entries ofused-pipelines.txtand the split records can be lost. The description says the exit works "likeXCL_RUN_SECONDS"; with those two calls added it would.report.json'sexit_code: nulland emptyenvironment, but only the launcher fills those in (launcher.rssummarize), so they stay null and empty after this PR. What it fixes is the orphaned host.host.rs~60-66; preparation used to close it), so every child process started later inherits it. Harmless, but clearing the inherit flag would be tidier.(N frames shown, N PresentX calls), the textsmoke.ps1looks for as the end of a run. It still reportskilled (no exit), but it's worth checking that it parses the same.watch_launcherwith an event standing in for the process; the exit sequence isn't tested. Still missing: a Windows suite run and the smoke pair. The labels (area:d3d12,area:shaders) don't fit.Fine: detection waits on the
SYNCHRONIZEhandle the launcher passes, not a PID, so PID reuse can't trigger it. A host started withoutXCL_PREPARATION_PARENTisn't watched. It's one thread blocked inWaitForSingleObjectwith no polling. The exit goes throughend_title, which drains the GPU. Thepreparation.rschange is needed now that the host owns the handle. It also letssmoke.ps1finish when it kills the launcher on timeout; #1073 and #1270 deal with the same orphan from the script side.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:54:47Z.
Triage (#1607) – head
87e472fNo open or merged PR ends the host when
xcl rungoes away. Main only uses the launcher handle (XCL_PREPARATION_PARENT) during shader preparation; #766's kill-on-close job object is in the e2e harness only.Problem:
host.rsLAUNCHER_GONE = 0x7C1_0003is the exit codeuma_driver.rsalready uses for "coherent window could not be restored" (stop_unbacked, the restore path, and its testfailed_restore_stops_before_importing_an_unbacked_window). Two different endings then share one code; please pick an unused one (0x7C1_0001/0002 are taken inhost.rstoo).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.