[PR #1514] [MERGED] Single player runs on its server thread by default again; --in-frame is the opt-out #3560

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

📋 Pull Request Information

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

Base: main ← Head: feat/st-default


📝 Commits (10+)

  • c86996c Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients
  • 287d7a7 Maps on a server's players: each holder's map ticks on the server and its data reaches them
  • fa4ea80 A server's player's client sets its body as in frame: look pitch, use slowdown, boots on powder snow
  • f96101c Strikes and mob effects reach a server's players: lightning, evoker fangs, poison, axolotls
  • c6ed311 Closing a menu puts a server's player's cursor stack back into their inventory
  • a4a101c Single player runs on its server thread by default again; --in-frame is the opt-out
  • 8c81cc6 Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing
  • 26a91e3 Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps
  • e307f03 Merge remote-tracking branch 'origin/fix/st-maps' into fix/st-player-body
  • d65be41 Merge remote-tracking branch 'origin/fix/st-player-body' into fix/st-hits

📊 Changes

15 files changed (+1019 additions, -192 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+59 -45)
📝 crates/horizon-client/src/game/control.rs (+1 -0)
📝 crates/horizon-client/src/game/fangs.rs (+12 -6)
📝 crates/horizon-client/src/game/fishing.rs (+241 -41)
📝 crates/horizon-client/src/game/integrated.rs (+4 -6)
📝 crates/horizon-client/src/game/lan.rs (+2 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+25 -12)
📝 crates/horizon-client/src/game/lan_mobs.rs (+21 -0)
📝 crates/horizon-client/src/game/lightning.rs (+22 -16)
📝 crates/horizon-client/src/game/maps.rs (+321 -50)
📝 crates/horizon-client/src/game/remote.rs (+1 -10)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+7 -0)
📝 docs/launcher-commands.md (+2 -2)
📝 docs/server-levels.md (+3 -4)
📝 tools/lan_e2e.py (+298 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

Single player runs on its integrated server thread by default again, as vanilla's does. --in-frame is the opt-out. --no-server-thread and HORIZON_SERVER_THREAD=0 still work, and --server-thread stays accepted. LAN guests, dedicated servers and the command harness are unchanged.

This reverts the default of #1428 (6049012b5). #1428 made the in-frame world the default while a server's players lagged behind it. The docs, the help text and the integrated.rs comment follow.

Why now

A full scripted single player session gives the same results on the server thread as in the frame. That is the condition st-default-2 set for the flip. The fixes that got it there are the open stack: #1464 → #1465 → #1466 → #1475 → #1476 → #1508 → #1509 → #1510 → #1511 → #1512 → #1513. This PR goes last.

On Mesa the server thread is also much faster (below).

Evidence

Smoke session

A scripted single player session through horizon-ctl, on a build of this branch, on the M4. It covers:

  • walk, jump, mine and pick up, place;
  • inventory, combat (a zombie), eating;
  • boats (board, paddle, dismount), minecarts (board, ride);
  • a chest (open, fill, read), a furnace;
  • a bed (sleep, skip the night);
  • chat (say, command, screen), signs (editor, text), books (open, sign);
  • a totem saving the player;
  • keep_inventory off and on;
  • fishing (cast, bite, catch);
  • a map (filled, player marker);
  • save, quit and reopen: position, inventory, placed block, the chest's contents, the map's pixels.
mode result
default (server thread) 48/48
--in-frame 48/48

Earlier runs on the server thread failed only on the script itself, never on the game:

  • horizon-ctl summon, container X Y Z ITEM and tp act on the client's copy only. The script now uses the player's /summon, /item and /tp.
  • /give reaches a server's client a tick later.
  • {x}.5 gave the wrong block for negative coordinates.

lan_e2e

In both modes, the checks this stack adds pass: wind, fishing, maps, body, strikes and cursor. boats and minecarts pass on the server thread too.

Benchmarks

--benchmark forest, offscreen, one build of this branch. The in-frame column is the old default; the server thread column is the new one. Each cell is avg / 1% low / 0.1% low FPS, two runs.

ThinkPad: Intel HD 620, Mesa 26.2.5 ANV under Xvfb, load average 2–4.

RD in-frame (before) server thread (after)
16 185.0 / 41.3 / 32.1; 184.1 / 37.6 / 30.0 651.3 / 94.8 / 20.1; 651.2 / 119.5 / 31.0
32 55.6 / 9.7 / 6.3; 55.5 / 9.4 / 7.9 454.7 / 89.8 / 45.8; 338.6 / 76.1 / 40.5

M4 Pro: Metal. The machine was shared, with load average 22–37 from other sessions and CI runners.

RD in-frame (before) server thread (after)
16 936.3 / 205.7 / 121.4; 931.7 / 192.5 / 118.9 777.9 / 510.5 / 391.6; 776.2 / 477.0 / 333.2
32 361.1 / 114.8 / 80.1; 355.0 / 109.4 / 83.2 350.4 / 274.5 / 218.6; 344.8 / 252.5 / 168.0

What the numbers show:

  • On Mesa, the server thread is 3.5× faster at RD 16 and 6–8× at RD 32.
  • On the M4, the average at RD 16 is 17% lower, but the 1% and 0.1% lows are 2.5–3× higher at both distances. The frame no longer waits for the tick.
  • The ThinkPad's 0.1% low at RD 16 is the one figure that isn't better (20–31 vs 30–32).

These are fast-profile builds, not release builds. The two modes were compared in one build.

F3

On the server thread, F3's right column reads Integrated server @ 3.1/50.0 ms, 28 tx, 1821 rx, as vanilla's does. That is the server tick's time in a fresh world on the M4.

How tested

  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib --bins: 1064 + 98 + 18 passed.
  • tools/parity.py --changed origin/main: all pass (106/106, then 30/30 after the last changes).
  • The smoke session, lan_e2e, the benchmarks and F3 as above.

Needs Ludovic

  • A review, and the merge after the stack (#1464 … #1513).
  • A release note for players: single player is on the server thread again, and --in-frame (launcher: extra game arguments) is the way back if something breaks.

🤖 Generated with Claude Code


🔄 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/1514 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/st-default` --- ### 📝 Commits (10+) - [`c86996c`](https://github.com/horizon-rust/horizon/commit/c86996c234457b08dafcae375a36ebdbe8fcadd9) Fishing on a server's players: a hook per player, ticked on the server and drawn by its clients - [`287d7a7`](https://github.com/horizon-rust/horizon/commit/287d7a7eb5e55a7936e89c9ac948f2a66aab74d1) Maps on a server's players: each holder's map ticks on the server and its data reaches them - [`fa4ea80`](https://github.com/horizon-rust/horizon/commit/fa4ea80d3253ea3a65b0663454f4a03c4e52c4b2) A server's player's client sets its body as in frame: look pitch, use slowdown, boots on powder snow - [`f96101c`](https://github.com/horizon-rust/horizon/commit/f96101cd47f35e998ac1f032f92ce7a4de82f89e) Strikes and mob effects reach a server's players: lightning, evoker fangs, poison, axolotls - [`c6ed311`](https://github.com/horizon-rust/horizon/commit/c6ed3112e7891b4d96de16cee5e16f948bbe12c7) Closing a menu puts a server's player's cursor stack back into their inventory - [`a4a101c`](https://github.com/horizon-rust/horizon/commit/a4a101ca9cf450dd715196ca5e5caed72725636f) Single player runs on its server thread by default again; --in-frame is the opt-out - [`8c81cc6`](https://github.com/horizon-rust/horizon/commit/8c81cc63f71f8f4c4c75a30f14406ed8cf3eaf88) Merge remote-tracking branch 'origin/fix/st-wind-charge' into fix/st-fishing - [`26a91e3`](https://github.com/horizon-rust/horizon/commit/26a91e3a08059af6f43af950593665774b58d1fe) Merge remote-tracking branch 'origin/fix/st-fishing' into fix/st-maps - [`e307f03`](https://github.com/horizon-rust/horizon/commit/e307f036842c53942079b1179c3feea9dcd0930e) Merge remote-tracking branch 'origin/fix/st-maps' into fix/st-player-body - [`d65be41`](https://github.com/horizon-rust/horizon/commit/d65be4183fecfd3256c204e996442bef7bc087c1) Merge remote-tracking branch 'origin/fix/st-player-body' into fix/st-hits ### 📊 Changes **15 files changed** (+1019 additions, -192 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+59 -45) 📝 `crates/horizon-client/src/game/control.rs` (+1 -0) 📝 `crates/horizon-client/src/game/fangs.rs` (+12 -6) 📝 `crates/horizon-client/src/game/fishing.rs` (+241 -41) 📝 `crates/horizon-client/src/game/integrated.rs` (+4 -6) 📝 `crates/horizon-client/src/game/lan.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+25 -12) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+21 -0) 📝 `crates/horizon-client/src/game/lightning.rs` (+22 -16) 📝 `crates/horizon-client/src/game/maps.rs` (+321 -50) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -10) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+7 -0) 📝 `docs/launcher-commands.md` (+2 -2) 📝 `docs/server-levels.md` (+3 -4) 📝 `tools/lan_e2e.py` (+298 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Single player runs on its integrated server thread by default again, as vanilla's does. `--in-frame` is the opt-out. `--no-server-thread` and `HORIZON_SERVER_THREAD=0` still work, and `--server-thread` stays accepted. LAN guests, dedicated servers and the command harness are unchanged. This reverts the default of #1428 (6049012b5). #1428 made the in-frame world the default while a server's players lagged behind it. The docs, the help text and the `integrated.rs` comment follow. ## Why now A full scripted single player session gives the same results on the server thread as in the frame. That is the condition st-default-2 set for the flip. The fixes that got it there are the open stack: #1464 → #1465 → #1466 → #1475 → #1476 → #1508 → #1509 → #1510 → #1511 → #1512 → #1513. This PR goes last. On Mesa the server thread is also much faster (below). ## Evidence ### Smoke session A scripted single player session through `horizon-ctl`, on a build of this branch, on the M4. It covers: - walk, jump, mine and pick up, place; - inventory, combat (a zombie), eating; - boats (board, paddle, dismount), minecarts (board, ride); - a chest (open, fill, read), a furnace; - a bed (sleep, skip the night); - chat (say, command, screen), signs (editor, text), books (open, sign); - a totem saving the player; - keep_inventory off and on; - fishing (cast, bite, catch); - a map (filled, player marker); - save, quit and reopen: position, inventory, placed block, the chest's contents, the map's pixels. | mode | result | |---|---| | default (server thread) | **48/48** | | `--in-frame` | **48/48** | Earlier runs on the server thread failed only on the script itself, never on the game: - `horizon-ctl summon`, `container X Y Z ITEM` and `tp` act on the client's copy only. The script now uses the player's `/summon`, `/item` and `/tp`. - `/give` reaches a server's client a tick later. - `{x}.5` gave the wrong block for negative coordinates. ### lan_e2e In both modes, the checks this stack adds pass: `wind`, `fishing`, `maps`, `body`, `strikes` and `cursor`. `boats` and `minecarts` pass on the server thread too. ### Benchmarks `--benchmark forest`, offscreen, one build of this branch. The in-frame column is the old default; the server thread column is the new one. Each cell is avg / 1% low / 0.1% low FPS, two runs. **ThinkPad**: Intel HD 620, Mesa 26.2.5 ANV under Xvfb, load average 2–4. | RD | in-frame (before) | server thread (after) | |---|---|---| | 16 | 185.0 / 41.3 / 32.1; 184.1 / 37.6 / 30.0 | **651.3 / 94.8 / 20.1; 651.2 / 119.5 / 31.0** | | 32 | 55.6 / 9.7 / 6.3; 55.5 / 9.4 / 7.9 | **454.7 / 89.8 / 45.8; 338.6 / 76.1 / 40.5** | **M4 Pro**: Metal. The machine was shared, with load average 22–37 from other sessions and CI runners. | RD | in-frame (before) | server thread (after) | |---|---|---| | 16 | 936.3 / 205.7 / 121.4; 931.7 / 192.5 / 118.9 | 777.9 / **510.5 / 391.6**; 776.2 / **477.0 / 333.2** | | 32 | 361.1 / 114.8 / 80.1; 355.0 / 109.4 / 83.2 | 350.4 / **274.5 / 218.6**; 344.8 / **252.5 / 168.0** | What the numbers show: - On Mesa, the server thread is 3.5× faster at RD 16 and 6–8× at RD 32. - On the M4, the average at RD 16 is 17% lower, but the 1% and 0.1% lows are 2.5–3× higher at both distances. The frame no longer waits for the tick. - The ThinkPad's 0.1% low at RD 16 is the one figure that isn't better (20–31 vs 30–32). These are fast-profile builds, not release builds. The two modes were compared in one build. ### F3 On the server thread, F3's right column reads `Integrated server @ 3.1/50.0 ms, 28 tx, 1821 rx`, as vanilla's does. That is the server tick's time in a fresh world on the M4. ## How tested - `cargo fmt --all -- --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib --bins`: 1064 + 98 + 18 passed. - `tools/parity.py --changed origin/main`: all pass (106/106, then 30/30 after the last changes). - The smoke session, lan_e2e, the benchmarks and F3 as above. ## Needs Ludovic - A review, and the merge after the stack (#1464 … #1513). - A release note for players: single player is on the server thread again, and `--in-frame` (launcher: extra game arguments) is the way back if something breaks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:26 +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#3560
No description provided.