5.5 KiB
ADR 0068: An experimental Rust build on Horizon
- Status: proposed
- Date: 2026-11-01
- Builds on: ADR 0001 (patch-only repo), ADR 0036 (Fast and Compatible builds), ADR 0046 (modules)
Context
Horizon (MIT) is Minecraft: Java Edition 26.3 rewritten
in Rust and checked against the Java game by differential harnesses. A fork,
horizon-web (branch web), compiles its client
to wasm32-unknown-unknown with threads as Web Workers and draws through WebGPU. It opens
single-player worlds, joins Eagler servers and plays sound, and runs well in early tests.
Incari's two builds compile the same Java to WebAssembly two ways. Horizon shares none of that code, so it can't be a third way to compile Incari: Incari's features have to be written again for it. The aim is to ship it beside Fast and Compatible without a second project to maintain.
Decision
-
A third build, Rust, marked experimental. It's listed in
build.jsonbesidefastandcompatibleas"rust": {"page": "rust/index.html"}(format 2 still: older pages ignore it). The loading screen offers it only wherenavigator.gpugives an adapter, never recommends it, and?build=rustpicks it. Browsers without WebGPU are out of scope. -
Its own page. Picking Rust opens
rust/index.html: Horizon's page, files and service worker, untouched. Incari's worker leavesrust/alone, and its file list doesn't name Horizon's files. -
Horizon is pinned, fetched and never committed, as the game is (ADR 0001).
incari.propertiesnameshorizon.repositoryandhorizon.revision(a commit on the fork'swebbranch)../incari setupclones it intowork/horizon(a warning, not a failure, when it can't).INCARI_HORIZON_DIR=<path>builds a local checkout instead, for work on Horizon itself (its files as git sees them, copied intowork/horizon-override: horizon-mixins refuses the symlink a checkout's own web build leaves). -
One game download.
horizon-preparereads the pinned 26.3 jars, libraries and assets./incari setupand./incari assetsalready fetched (--client-jar,--libraries-dir,--assets-dir,--server-jar). The prepared resources stay inwork/horizon-resources/and are never committed or published. -
Incari's changes are Horizon native mods, in
rust/mods/<name>/: horizon-mixins bundles that use only Horizon's native hook points ("hooks": N, never a pinned commit), so they keep building as Horizon moves. A missing hook point is added to the fork, and offered upstream. A change no mod can make is committed to the fork and the pin bumped; there's no second patch system. What every mod shares (settings pages, HUD boxes by corner) is a bundle of its own,rust/mods/common, with no hooks. -
One build command.
./incari buildbuilds Rust before Fast and Compatible: horizon-mixins (pinned too) appliesrust/modsintowork/horizon-stage, then Horizon'sweb/package.pybuilds its threaded module (the fork dropped the single-threaded one) intoapp-web/build/rust/.--only rustbuilds it alone. The web folder has it inrust/; the single file doesn't (--htmlleaves it out: Horizon's offline file is a page of its own). -
Its tools are optional. It needs Rust
nightly-2026-10-14withrust-srcand thewasm32-unknown-unknowntarget,wasm-bindgen-cli0.2.129 and binaryen. Without them./incari buildskips Rust and says why; Fast and Compatible still build. -
Contracts are shared, code isn't. Java and Rust can't share modules, so both read one source:
Contract Source Version, featured servers, online URL incari.properties, turned into Rust constants at build timeAccounts, friends, cosmetics docs/online-protocol.mdSettings and profiles One file format in browser storage, so switching builds keeps them What a feature does The feature's README.md, the spec for both ports -
Tracked per feature.
features/README.mdhas a Rust column (Ported, Not yet, Won't port), andtools/ci/check-rust-status.shfails when a feature has none. -
Releases don't wait for it. When Horizon is behind (Incari on a newer game version, or a broken pin),
build.jsonmarksrustunavailable with a reason and the release goes out. Bumpinghorizon.revisionis its own pull request.
Consequences
- Every feature is written twice. Rust ports start with the PvP HUD and visual modules.
- No ViaVersion in the client: Horizon speaks only 26.3, so it joins servers whose proxy translates (Eagler servers with ViaVersion, Horizon servers). Servers that cap the version refuse it.
- Horizon's web port is experimental: its README lists page-side locks that can stop the game, no screenshots or world icons, and no online mode.
- CI runs the mods' own tests (
rust/'scargo test,clippy,fmt), not the Rust build: that needs the game's files. Whether headless Chromium (SwiftShader) can run WebGPU forbrowserCheckis unchecked. - Renderer, networking and licensing reviewers (
.github/CODEOWNERS) review the Rust build. Horizon is MIT, which GPL-3.0 Incari may include. rust/isn't a Gradle module, sogradle/module-boundaries.txtdoesn't list it; its rules are inrust/AGENTS.md.
Open questions
- Upstreaming the web port to horizon-rust/horizon, which would leave only the mods to maintain.
- Measurements: Rust against Fast on the same machine (
docs/benchmark.mdscenarios) before the loading screen describes it as faster.