[GH-ISSUE #5530] Launcher: build native mods with blaze for fast rebuilds #1718

Open
opened 2026-11-02 15:49:10 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @reservedbytes on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5530

A native mod build runs cargo build --locked on horizon-client, which takes minutes (7 to 12 for a first build, about 3 for a rebuild, in docs/native-mods.md), longer on slower machines
blaze (https://ix.dev/blaze/, indexable-inc/blaze) is a cargo-compatible build (blaze build, test, run) that rebuilds an edit in milliseconds

What's needed

  • the launcher's native build going through blaze where it's supported, cargo otherwise
  • blaze installed and kept up to date by the launcher like its Rust toolchain, with its version pinned
  • the toolchain: blaze ships its own pinned nightly, while the launcher builds with a pinned stable Rust, and the build has to stay --locked and reproducible
  • platforms: its docs say live edits work on macOS Apple silicon today, with Linux x86-64 and Windows x86-64 in its next release
Originally created by @reservedbytes on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5530 A native mod build runs `cargo build --locked` on horizon-client, which takes minutes (7 to 12 for a first build, about 3 for a rebuild, in docs/native-mods.md), longer on slower machines blaze (https://ix.dev/blaze/, indexable-inc/blaze) is a cargo-compatible build (`blaze build`, `test`, `run`) that rebuilds an edit in milliseconds What's needed - the launcher's native build going through blaze where it's supported, cargo otherwise - blaze installed and kept up to date by the launcher like its Rust toolchain, with its version pinned - the toolchain: blaze ships its own pinned nightly, while the launcher builds with a pinned stable Rust, and the build has to stay `--locked` and reproducible - platforms: its docs say live edits work on macOS Apple silicon today, with Linux x86-64 and Windows x86-64 in its next release
Author
Owner

@arismoko commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6549835685 --> @arismoko commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Author
Owner

@levzzz5154 commented on GitHub (Oct 31, 2026):

good luck!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

<!-- gh-comment-id:6549841195 --> @levzzz5154 commented on GitHub (Oct 31, 2026): good luck!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Author
Owner

@arismoko commented on GitHub (Nov 1, 2026):

🤖 Agent: I tested Blaze v0.20261030.1 with horizon-machine-sample on Linux x86-64. It builds the patched game, but there are trade-offs before making it the default.

On one machine, with eight logical CPUs and --profile fast, a cold Cargo build took 219.649 seconds and a cold Blaze build took 420.601 seconds. After a one-line hook edit, Cargo took 41.400 seconds and Blaze took 6.901 seconds. For an update across 23 Horizon commits, Cargo took 144.405 seconds and Blaze took 87.219 seconds with warm targets and daemon. These are single runs, not medians. Blaze live editing is not available on Linux in this release; these are rebuild timings.

Blaze uses its own pinned nightly instead of the launcher's pinned stable toolchain. It accepts --locked, but our stale-lockfile test showed it did not enforce it. A Cargo metadata --locked check before the build can enforce the lockfile. Blaze also needs its daemon and cache paths isolated under launcher data, and an explicit daemon stop. The cold build used about 2.2 GiB there, including a 708 MiB toolchain and a 1.4 GiB store. Blaze has no Windows release, so Windows always uses Cargo.

I am preparing an opt-in launcher integration, with Cargo remaining the default and used as a fallback when Blaze is unavailable or fails. The launcher will pin and verify the Blaze release. The end-to-end test route is https://github.com/arismoko/horizon-machine-sample; I used it for the measurements and will test the launcher path in game before opening the PR.

<!-- gh-comment-id:6551080748 --> @arismoko commented on GitHub (Nov 1, 2026): 🤖 Agent: I tested Blaze `v0.20261030.1` with horizon-machine-sample on Linux x86-64. It builds the patched game, but there are trade-offs before making it the default. On one machine, with eight logical CPUs and `--profile fast`, a cold Cargo build took 219.649 seconds and a cold Blaze build took 420.601 seconds. After a one-line hook edit, Cargo took 41.400 seconds and Blaze took 6.901 seconds. For an update across 23 Horizon commits, Cargo took 144.405 seconds and Blaze took 87.219 seconds with warm targets and daemon. These are single runs, not medians. Blaze live editing is not available on Linux in this release; these are rebuild timings. Blaze uses its own pinned nightly instead of the launcher's pinned stable toolchain. It accepts `--locked`, but our stale-lockfile test showed it did not enforce it. A Cargo `metadata --locked` check before the build can enforce the lockfile. Blaze also needs its daemon and cache paths isolated under launcher data, and an explicit daemon stop. The cold build used about 2.2 GiB there, including a 708 MiB toolchain and a 1.4 GiB store. Blaze has no Windows release, so Windows always uses Cargo. I am preparing an opt-in launcher integration, with Cargo remaining the default and used as a fallback when Blaze is unavailable or fails. The launcher will pin and verify the Blaze release. The end-to-end test route is https://github.com/arismoko/horizon-machine-sample; I used it for the measurements and will test the launcher path in game before opening the PR.
Author
Owner

@arismoko commented on GitHub (Nov 1, 2026):

🤖 Agent: I tested a launcher integration with horizon-machine-sample on Linux x86-64 using Blaze v0.20261030.1. The same-machine hook-edit measurements were single runs: Cargo took 58.1 seconds; Blaze with a cold daemon took 74.9 seconds; and Blaze with a warm daemon took 8.5 seconds.

The warm result has a significant memory cost. After a separate build, the daemon and worker held 13,426,552 KiB (about 12.8 GiB) of anonymous resident memory after 5 seconds and 9,781,384 KiB (about 9.3 GiB) after 5 minutes. Their proportional set sizes were 13,526,626 KiB and 9,868,899 KiB, respectively. The worker PID changed between snapshots. Blaze documents a 30-minute idle shutdown. Stopping its daemon after each build avoids that idle cost, but did not beat Cargo in this test.

I am stopping the integration rather than retaining that memory silently. The reference branch preserves the work for anyone who wants to continue it. Blaze still looks promising for interactive mod development if its idle memory use falls or its daemon lifetime becomes configurable. The end-to-end test route was https://github.com/arismoko/horizon-machine-sample. I used it through the launcher and ran the resulting game on the server thread.

<!-- gh-comment-id:6551991452 --> @arismoko commented on GitHub (Nov 1, 2026): 🤖 Agent: I tested a launcher integration with horizon-machine-sample on Linux x86-64 using Blaze `v0.20261030.1`. The same-machine hook-edit measurements were single runs: Cargo took 58.1 seconds; Blaze with a cold daemon took 74.9 seconds; and Blaze with a warm daemon took 8.5 seconds. The warm result has a significant memory cost. After a separate build, the daemon and worker held 13,426,552 KiB (about 12.8 GiB) of anonymous resident memory after 5 seconds and 9,781,384 KiB (about 9.3 GiB) after 5 minutes. Their proportional set sizes were 13,526,626 KiB and 9,868,899 KiB, respectively. The worker PID changed between snapshots. Blaze documents a 30-minute idle shutdown. Stopping its daemon after each build avoids that idle cost, but did not beat Cargo in this test. I am stopping the integration rather than retaining that memory silently. The [reference branch](https://github.com/arismoko/horizon/tree/experiment/blaze-native-builder) preserves the work for anyone who wants to continue it. Blaze still looks promising for interactive mod development if its idle memory use falls or its daemon lifetime becomes configurable. The end-to-end test route was https://github.com/arismoko/horizon-machine-sample. I used it through the launcher and ran the resulting game on the server thread.
Author
Owner

@arismoko commented on GitHub (Nov 1, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6551993152 --> @arismoko commented on GitHub (Nov 1, 2026): 🤖 Agent: /unclaim
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#1718
No description provided.