[PR #795] [MERGED] Sculk: Fx hashing for the per-mob step and damage maps #2816

Closed
opened 2026-11-02 15:59:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: perf/sculk-fx-maps


📝 Commits (1)

  • 0eec25d Sculk: Fx hashing for the per-mob step and damage maps

📊 Changes

1 file changed (+6 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game/sculk.rs (+6 -4)

📄 Description

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

What

Sculk's per-mob steps and damaged maps, and the alive set rebuilt every tick, now use horizon_client::fast_hash (Fx) in place of SipHash.

Why

entity_motion_events looks up every moving mob in steps each tick. In server-thread samples with 50 walk bots, it was the largest SipHash caller with a name attached. The keys are mob ids that the server hands out, so a client can't choose colliding keys, and the fast hasher is safe. The positions of sculk blocks and the maps fed by packets keep their current hashers.

Numbers

50 walk bots, with base (main) and new run at the same time. Inclusive server-thread samples under entity_motion_events:

base new
entity_motion_events 55 57
of which hashing 20 (SipHash + Who hashing) 12 (Fx)

The cut is small, about 8 samples per minute at 50 players, and within the noise of the total. It grows with the number of mobs, and nothing changes in behaviour. The maps are only looked up and retained, never iterated in order.

How tested

  • cargo fmt --all --check: passes.
  • cargo clippy --workspace --all-targets -- -D warnings: passes.
  • cargo test -p horizon-client --bin horizon-client sculk: passes.
  • tools/parity.py --changed origin/main: 16 of 16 harnesses pass.

Needs Ludovic

Nothing.

🤖 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/795 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/sculk-fx-maps` --- ### 📝 Commits (1) - [`0eec25d`](https://github.com/horizon-rust/horizon/commit/0eec25d14b6210e74915c7950f75750a6c319d7b) Sculk: Fx hashing for the per-mob step and damage maps ### 📊 Changes **1 file changed** (+6 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/sculk.rs` (+6 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Sculk's per-mob `steps` and `damaged` maps, and the `alive` set rebuilt every tick, now use `horizon_client::fast_hash` (Fx) in place of SipHash. ## Why `entity_motion_events` looks up every moving mob in `steps` each tick. In server-thread samples with 50 walk bots, it was the largest SipHash caller with a name attached. The keys are mob ids that the server hands out, so a client can't choose colliding keys, and the fast hasher is safe. The positions of sculk blocks and the maps fed by packets keep their current hashers. ## Numbers 50 walk bots, with base (main) and new run at the same time. Inclusive server-thread samples under `entity_motion_events`: | | base | new | |---|---:|---:| | `entity_motion_events` | 55 | 57 | | of which hashing | 20 (SipHash + `Who` hashing) | 12 (Fx) | The cut is small, about 8 samples per minute at 50 players, and within the noise of the total. It grows with the number of mobs, and nothing changes in behaviour. The maps are only looked up and retained, never iterated in order. ## How tested - `cargo fmt --all --check`: passes. - `cargo clippy --workspace --all-targets -- -D warnings`: passes. - `cargo test -p horizon-client --bin horizon-client sculk`: passes. - `tools/parity.py --changed origin/main`: 16 of 16 harnesses pass. ## Needs Ludovic Nothing. 🤖 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-02 15:59:18 +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#2816
No description provided.