Launcher: the profile ask's bound comes, and an install holds no window #480

Closed
github-bot wants to merge 1 commit from github-bot/gh-480 into main AGit
Owner

@⁠erdemcisse on GitHub · 2026-12-02 15:53 UTC · original
erdemcisse:launcher-profile-answer → main · +55 −11 · 1 files · 1 commits · closed without merging

The title profile row asks victory.exe title-profile status, and Load title profile asks title-profile install. AskVictory bounded that ask -- but the bound could not come:

p.ErrorDataReceived += delegate { };
p.Start();
p.BeginErrorReadLine();
string output = p.StandardOutput.ReadToEnd();   // returns at the end of the output: the process is gone
if (!p.WaitForExit(60000)) return "victory.exe did not answer";

ReadToEnd returns when the pipe closes, and the pipe closes when the process has gone, so the wait after it is always true. A victory.exe that stalls -- a game folder on a network share, an install whose folder does not answer -- leaves the row at "checking..." for good. The comments above both call sites say the work is slow (it hashes the game's executable, "100 MB and more"), which is why it is worth bounding at all.

Measured with a stand-in that says nothing and stays five seconds, the two spellings of the method side by side, bound 1000 ms:

the stand-in before after
says nothing, stays 5 s 5032 ms -- the bound did not come -- "victory.exe gave no answer" 1011 ms, "victory.exe did not answer"
answers loaded C:\games 28 ms, "loaded" 30 ms, "loaded"
says nothing, ends 29 ms, "gave no answer" 28 ms, "gave no answer"
a note on its error pipe, ends well 525 ms, "gave no answer" 529 ms, "gave no answer"
its reason on the error pipe, exits 2 533 ms, "gave no answer" 524 ms, "no executable in that folder"

What changed

  • Both pipes are read as they come (BeginOutputReadLine / BeginErrorReadLine) into lists under a lock.
  • The bound is a bound: at it the process is ended (EndProcess, the call the rest of the launcher uses) and the answer is "victory.exe did not answer".
  • The answer is still the first non-empty line of its output. When it failed without answering, the first non-empty line of its error is the answer instead of "gave no answer". title-profile writes its notes (its log) to that pipe too, so this is gated on a non-zero exit: a run that ended well says nothing new.
  • An install is asked for on a thread of its own with the row showing "installing...", as the check already was -- it hashes and copies files, and it used to do both on the window's thread, which cannot be interrupted.

Not changed

The strings the row and the button show, the 60-second bound itself, and CheckProfile (already off the UI thread).

Tested here

scripts/build-launcher.ps1 builds the patched file with the csc this PC has (C# 5), and the launcher starts. The table above is a scratch harness.exe holding both spellings of the method and a stand-in victory.exe (sleep, optional lines on either pipe, optional failing exit); each row is one run. The real binary answers this game folder in 171 ms with not-loaded, unchanged by this patch.

**@⁠erdemcisse** on GitHub · 2026-12-02 15:53 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/480) `erdemcisse:launcher-profile-answer` → `main` · +55 −11 · 1 files · 1 commits · closed without merging The title profile row asks `victory.exe title-profile status`, and **Load title profile** asks `title-profile install`. `AskVictory` bounded that ask -- but the bound could not come: ```csharp p.ErrorDataReceived += delegate { }; p.Start(); p.BeginErrorReadLine(); string output = p.StandardOutput.ReadToEnd(); // returns at the end of the output: the process is gone if (!p.WaitForExit(60000)) return "victory.exe did not answer"; ``` `ReadToEnd` returns when the pipe closes, and the pipe closes when the process has gone, so the wait after it is always true. A `victory.exe` that stalls -- a game folder on a network share, an install whose folder does not answer -- leaves the row at "checking..." for good. The comments above both call sites say the work is slow (it hashes the game's executable, "100 MB and more"), which is why it is worth bounding at all. Measured with a stand-in that says nothing and stays five seconds, the two spellings of the method side by side, bound 1000 ms: | the stand-in | before | after | |---|---|---| | says nothing, stays 5 s | **5032 ms** -- the bound did not come -- "victory.exe gave no answer" | 1011 ms, "victory.exe did not answer" | | answers `loaded C:\games` | 28 ms, "loaded" | 30 ms, "loaded" | | says nothing, ends | 29 ms, "gave no answer" | 28 ms, "gave no answer" | | a note on its error pipe, ends well | 525 ms, "gave no answer" | 529 ms, "gave no answer" | | its reason on the error pipe, exits 2 | 533 ms, "gave no answer" | 524 ms, "no executable in that folder" | ### What changed * Both pipes are read as they come (`BeginOutputReadLine` / `BeginErrorReadLine`) into lists under a lock. * The bound is a bound: at it the process is ended (`EndProcess`, the call the rest of the launcher uses) and the answer is "victory.exe did not answer". * The answer is still the first non-empty line of its output. When it **failed without answering**, the first non-empty line of its error is the answer instead of "gave no answer". `title-profile` writes its notes (its log) to that pipe too, so this is gated on a non-zero exit: a run that ended well says nothing new. * An install is asked for on a thread of its own with the row showing "installing...", as the check already was -- it hashes and copies files, and it used to do both on the window's thread, which cannot be interrupted. ### Not changed The strings the row and the button show, the 60-second bound itself, and `CheckProfile` (already off the UI thread). ### Tested here `scripts/build-launcher.ps1` builds the patched file with the csc this PC has (C# 5), and the launcher starts. The table above is a scratch `harness.exe` holding both spellings of the method and a stand-in `victory.exe` (sleep, optional lines on either pipe, optional failing exit); each row is one run. The real binary answers this game folder in 171 ms with `not-loaded`, unchanged by this patch.
AskVictory read victory.exe's output to its end before waiting, so the
60-second bound after it could never come: a victory.exe that stalled
(a game on a network share, or one waiting on a profile's folder) left
the title profile row at "checking..." for good, and "Load title
profile" held the window for as long as the install took.

Both pipes are read as they come now, the bound is a real one (the
process is ended at it), and an install is asked for on a thread of its
own, as the check already was. An answer is still the first line of its
output; when it failed without answering, the first line of its error
is the answer instead of "gave no answer" -- its notes go there too, so
a run that ended well still says nothing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:54:28 +00:00
Author
Owner

@⁠erdemcisse on GitHub · 2026-12-02 16:05 UTC · original

CI is red here in a test of a crate this change does not touch: descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync panicked at crates/victory-gpu/src/descriptor.rs:2736 (assert!(host.made(5))), 619 passed, 1 failed, in run 46920076425.

It is order-dependent, not this commit: sync_heaps() walks every heap registered, so a round of another test can take this heap's changed page for itself and then make no slot from it. The same file names that for cleared_before_made (crates/victory-gpu/src/descriptor.rs:2785-2787) and retries there; this test did not. With a second thread calling sync_heaps() it misses slot 5 in 2 or 3 of 200 rounds, and a round or two later makes it, so nothing is lost.

#481 makes this test try again in the same way cleared_before_made does.

The whole workspace passes here on this commit: release build, cargo test --workspace --locked, both clippy passes with -D warnings, and cargo xtask policy.

**@⁠erdemcisse** on GitHub · 2026-12-02 16:05 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/480#issuecomment-7351430110) CI is red here in a test of a crate this change does not touch: `descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync` panicked at `crates/victory-gpu/src/descriptor.rs:2736` (`assert!(host.made(5))`), 619 passed, 1 failed, in run [46920076425](https://github.com/readmet3xt-lab/foxhound/actions/runs/46920076425/job/143598763443). It is order-dependent, not this commit: `sync_heaps()` walks every heap registered, so a round of another test can take this heap's changed page for itself and then make no slot from it. The same file names that for `cleared_before_made` (`crates/victory-gpu/src/descriptor.rs:2785-2787`) and retries there; this test did not. With a second thread calling `sync_heaps()` it misses slot 5 in 2 or 3 of 200 rounds, and a round or two later makes it, so nothing is lost. #481 makes this test try again in the same way `cleared_before_made` does. The whole workspace passes here on this commit: release build, `cargo test --workspace --locked`, both clippy passes with `-D warnings`, and `cargo xtask policy`.
github-bot force-pushed github-bot/gh-480 from 00d75806f3 to 0cfa62cae5 2026-12-02 16:32:15 +00:00 Compare
github-bot closed this pull request 2026-12-03 15:14:50 +00:00
Author
Owner

@⁠erdemcisse on GitHub · 2026-12-03 15:14 UTC · original

Closing: superseded by 74941fc and a22cdef on main. AskVictory now reads both pipes as they come, ends victory.exe at the 60-second bound, and the install runs off the window's thread, which is what this PR did. Rebasing would add nothing.

**@⁠erdemcisse** on GitHub · 2026-12-03 15:14 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/480#issuecomment-7382808469) Closing: superseded by 74941fc and a22cdef on main. `AskVictory` now reads both pipes as they come, ends victory.exe at the 60-second bound, and the install runs off the window's thread, which is what this PR did. Rebasing would add nothing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.