[PR #1575] [MERGED] fix(launcher): defer hardware probes and hide Windows consoles #3601

Closed
opened 2026-11-03 04:10:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1575
Author: @RobertTGreat
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-startup-windows


📝 Commits (2)

  • 1be8a4c fix(launcher): defer hardware probes and hide Windows consoles
  • ac43cde launcher, server: one hidden-command helper per crate, server children keep its terminal

📊 Changes

27 files changed (+566 additions, -61 deletions)

View changed files

📝 crates/horizon-bench/src/hardware.rs (+1 -8)
📝 crates/horizon-bench/src/lib.rs (+7 -1)
📝 crates/horizon-prepare/src/java.rs (+19 -4)
📝 crates/horizon-server/src/engine.rs (+4 -2)
📝 crates/horizon-server/src/main.rs (+1 -0)
➕ crates/horizon-server/src/process.rs (+20 -0)
📝 crates/horizon-server/src/service.rs (+2 -2)
📝 crates/horizon-server/src/update.rs (+3 -4)
📝 crates/horizon-telemetry/src/system.rs (+13 -5)
📝 launcher/README.md (+8 -3)
📝 launcher/src/agents.rs (+2 -2)
📝 launcher/src/agents_page.rs (+1 -1)
📝 launcher/src/backend.rs (+5 -10)
📝 launcher/src/cli_tools.rs (+1 -1)
➕ launcher/src/console.rs (+48 -0)
📝 launcher/src/game_tools.rs (+2 -2)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+7 -0)
📝 launcher/src/perf.rs (+89 -4)
➕ launcher/src/process.rs (+21 -0)

...and 7 more files

📄 Description

🤖 Opened by Robert's AI agent (OpenAI Codex / GPT-6.1 Sol), not by Robert himself.

What and why

On Windows the launcher waited for nine hardware-report commands (seven PowerShell/CIM queries and two cmd calls) before drawing its first frame. These shared benchmark/telemetry probes bypassed the launcher's hidden-command helper and flashed terminals. The launcher executable and several other background commands also created console windows.

  • Start performance tracking with basic platform fields and collect machine details on a worker after the first frame. Merge the details without losing recorded startup/frame metrics.
  • Hide Windows console windows at the actual subprocess sources, including shared report probes, resource preparation and hosted-server helpers. Keep stdout/stderr capture, stdin, exit status and MCP pipes.
  • Build the desktop launcher with the Windows GUI subsystem; CLI invocations attach to the parent terminal while retaining redirected handles.

The shared crates are included because they start the commands responsible for the flashes. No new dependencies. The independent window/layout PR is #1574. Open launcher PRs/issues were checked; #1499 is a separate deletion freeze. Related benchmark context: #1346 (this PR covers launcher startup).

Local observation on one Windows development machine: earlier saved first-frame measurements were 3,652–6,834 ms; a subsequent run with real hardware probes measured 323 ms. These are local observations, not repeated cold-start benchmark results.

Vanilla reference

Horizon-only launcher, resource preparation and background process management. Gameplay rules and Mojang data are outside this change.

Self-check

pr_ready (tools/pr_ready.py on DESKTOP-KI5NGSR, against origin/main at 7fca3c2f9, 3 min 46 s)

Check Result
Scope ⚠️ 27 files, +570 −50; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (14 s)
clippy ❌ failed (29 s)
tests: horizon-bench, horizon-prepare, horizon-server, horizon-telemetry ❌ 73 passed, 1 failed (39 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅
launcher clippy ❌ failed (56 s)
launcher tests ✅ 111 passed (1 min 20 s)
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Additional validation on this independent branch:

  • cargo test --manifest-path launcher/Cargo.toml --locked: 146 tests passed, with the existing optional tests left at their defaults.
  • cargo test --manifest-path launcher/Cargo.toml --locked --test startup -- --ignored: passed on an interactive Windows desktop. Instrumented slow PowerShell probes start after the first frame and all report invisible console windows; both shared output helpers are exercised. Rust resolves cmd.exe from the system directory, so the test instruments PowerShell.
  • New process tests cover the executable subsystem, stdout/stderr, stdin, failure status, preparer log files, redirected CLI output and MCP transport. Unit tests cover nonblocking report initialization and asynchronous metadata merging.
  • Shared horizon-bench/horizon-telemetry tests and strict Clippy passed during development.

Known baseline failures recorded by pr_ready on Windows: existing strict Clippy diagnostics in horizon-world; existing unused Unix-link helpers in launcher/src/mojang.rs; and service::tests::units_run_the_supervisor, which expects Unix separators in a launchd path when running on Windows. The affected production path-generation code is unchanged. Vanilla harnesses need maintainer CI data. The full desktop test is opt-in for CI environments without a desktop/GPU; it was explicitly run here.

Why existing tests missed this: child stream tests did not start the full GPUI window or exercise hardware probes in the shared dependencies. The new startup test covers that path in addition to the hardware-free initialization unit test.

🤖 Generated with OpenAI Codex (GPT-6.1 Sol).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1575 **Author:** [@RobertTGreat](https://github.com/RobertTGreat) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-startup-windows` --- ### 📝 Commits (2) - [`1be8a4c`](https://github.com/horizon-rust/horizon/commit/1be8a4caeaed1bd48a8feb8f249bbe6c90042583) fix(launcher): defer hardware probes and hide Windows consoles - [`ac43cde`](https://github.com/horizon-rust/horizon/commit/ac43cdea703eefac7a64e1452a6475ea47b47cf0) launcher, server: one hidden-command helper per crate, server children keep its terminal ### 📊 Changes **27 files changed** (+566 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bench/src/hardware.rs` (+1 -8) 📝 `crates/horizon-bench/src/lib.rs` (+7 -1) 📝 `crates/horizon-prepare/src/java.rs` (+19 -4) 📝 `crates/horizon-server/src/engine.rs` (+4 -2) 📝 `crates/horizon-server/src/main.rs` (+1 -0) ➕ `crates/horizon-server/src/process.rs` (+20 -0) 📝 `crates/horizon-server/src/service.rs` (+2 -2) 📝 `crates/horizon-server/src/update.rs` (+3 -4) 📝 `crates/horizon-telemetry/src/system.rs` (+13 -5) 📝 `launcher/README.md` (+8 -3) 📝 `launcher/src/agents.rs` (+2 -2) 📝 `launcher/src/agents_page.rs` (+1 -1) 📝 `launcher/src/backend.rs` (+5 -10) 📝 `launcher/src/cli_tools.rs` (+1 -1) ➕ `launcher/src/console.rs` (+48 -0) 📝 `launcher/src/game_tools.rs` (+2 -2) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+7 -0) 📝 `launcher/src/perf.rs` (+89 -4) ➕ `launcher/src/process.rs` (+21 -0) _...and 7 more files_ </details> ### 📄 Description > 🤖 Opened by Robert's AI agent (OpenAI Codex / GPT-6.1 Sol), not by Robert himself. ## What and why On Windows the launcher waited for nine hardware-report commands (seven PowerShell/CIM queries and two cmd calls) before drawing its first frame. These shared benchmark/telemetry probes bypassed the launcher's hidden-command helper and flashed terminals. The launcher executable and several other background commands also created console windows. - Start performance tracking with basic platform fields and collect machine details on a worker after the first frame. Merge the details without losing recorded startup/frame metrics. - Hide Windows console windows at the actual subprocess sources, including shared report probes, resource preparation and hosted-server helpers. Keep stdout/stderr capture, stdin, exit status and MCP pipes. - Build the desktop launcher with the Windows GUI subsystem; CLI invocations attach to the parent terminal while retaining redirected handles. The shared crates are included because they start the commands responsible for the flashes. No new dependencies. The independent window/layout PR is #1574. Open launcher PRs/issues were checked; #1499 is a separate deletion freeze. Related benchmark context: #1346 (this PR covers launcher startup). Local observation on one Windows development machine: earlier saved first-frame measurements were 3,652–6,834 ms; a subsequent run with real hardware probes measured 323 ms. These are local observations, not repeated cold-start benchmark results. ## Vanilla reference Horizon-only launcher, resource preparation and background process management. Gameplay rules and Mojang data are outside this change. ## Self-check **pr_ready** (`tools/pr_ready.py` on DESKTOP-KI5NGSR, against origin/main at 7fca3c2f9, 3 min 46 s) | Check | Result | | --- | --- | | Scope | ⚠️ 27 files, +570 −50; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (14 s) | | clippy | ❌ failed (29 s) | | tests: horizon-bench, horizon-prepare, horizon-server, horizon-telemetry | ❌ 73 passed, 1 failed (39 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ | | launcher clippy | ❌ failed (56 s) | | launcher tests | ✅ 111 passed (1 min 20 s) | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Additional validation on this independent branch: - `cargo test --manifest-path launcher/Cargo.toml --locked`: 146 tests passed, with the existing optional tests left at their defaults. - `cargo test --manifest-path launcher/Cargo.toml --locked --test startup -- --ignored`: passed on an interactive Windows desktop. Instrumented slow PowerShell probes start after the first frame and all report invisible console windows; both shared output helpers are exercised. Rust resolves cmd.exe from the system directory, so the test instruments PowerShell. - New process tests cover the executable subsystem, stdout/stderr, stdin, failure status, preparer log files, redirected CLI output and MCP transport. Unit tests cover nonblocking report initialization and asynchronous metadata merging. - Shared `horizon-bench`/`horizon-telemetry` tests and strict Clippy passed during development. Known baseline failures recorded by `pr_ready` on Windows: existing strict Clippy diagnostics in `horizon-world`; existing unused Unix-link helpers in `launcher/src/mojang.rs`; and `service::tests::units_run_the_supervisor`, which expects Unix separators in a launchd path when running on Windows. The affected production path-generation code is unchanged. Vanilla harnesses need maintainer CI data. The full desktop test is opt-in for CI environments without a desktop/GPU; it was explicitly run here. Why existing tests missed this: child stream tests did not start the full GPUI window or exercise hardware probes in the shared dependencies. The new startup test covers that path in addition to the hardware-free initialization unit test. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/) (GPT-6.1 Sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:44 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3601
No description provided.