[PR #5726] [MERGED] Anticheat prediction: log what the worst tick did #6464

Closed
opened 2026-11-03 06:21:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5726
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/anticheat-prediction-detail


📝 Commits (1)

  • 6fa9bef Anticheat prediction: log what the worst tick did

📊 Changes

3 files changed (+120 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/lan/anticheat.rs (+5 -1)
📝 crates/horizon-client/src/lan/prediction.rs (+109 -0)
📝 docs/anticheat.md (+6 -0)

📄 Description

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

Part of #5725, step 1: prediction still only logs on the official server, and its lines can't tell a false positive from a cheat.

Change

Each prediction log line now ends with its worst tick as the replay played it:

  • where the client said it went, minus where the replay ended (x, y, z);
  • how far the client said it moved;
  • what the replayed body was doing: ground or air, then water, gliding, sprinting, sneaking, swimming, flying, riding.
Steve failed prediction (VL 12.4): moved up to 0.173 blocks off what its keys allow (1 tick; off +0.000 +0.173 +0.000, moved 0.281, air sprinting)

Nothing acts differently. Per-tick cost: a few booleans folded into a byte, and a 3-vector per played tick. The text is built only for a flagged tick.

Why

The live anticheat.log, 75 minutes after the 03:02Z restart: 15,512 lines.

  • Ordinary players: mostly 0.10–0.22 blocks off.
  • Cheat signatures (___kara, netlify): 1–10 blocks off.
  • Two players off by 3–9 blocks for hours: one at X 1.6 million. The lines can't say which is a glide, water, a ladder, far coordinates or a hack. This PR makes the next live hour say it, before any setback goes on.

Tests

  • lan::prediction: a_played_tick_tells_its_offset_and_state, plus a_cheats_worst_tick_is_kept_with_its_offset (a 1-block lie at tick 10 is the worst tick, with its offset and move).
  • A vanilla 26.3 client on the dedicated server with prediction on logs, e.g., (1 tick; off +0.000 +0.000 +0.039, moved 0.194, ground).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 21a12582c, 7 min 34 s)

Check Result
Scope ✅ 3 files, +120 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 511 passed (1 min 6 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 27 s)
tests: horizon-client ✅ 1639 passed (4 min 25 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 34 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 22 more

Clean-room: vanilla 26.3 only, no other project's code.

🤖 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/5726 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/anticheat-prediction-detail` --- ### 📝 Commits (1) - [`6fa9bef`](https://github.com/horizon-rust/horizon/commit/6fa9bef54f5c29d7a5a1f4ee70bf5531ebf53f29) Anticheat prediction: log what the worst tick did ### 📊 Changes **3 files changed** (+120 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/anticheat.rs` (+5 -1) 📝 `crates/horizon-client/src/lan/prediction.rs` (+109 -0) 📝 `docs/anticheat.md` (+6 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of #5725, step 1: `prediction` still only logs on the official server, and its lines can't tell a false positive from a cheat. ## Change Each `prediction` log line now ends with its worst tick as the replay played it: - where the client said it went, minus where the replay ended (x, y, z); - how far the client said it moved; - what the replayed body was doing: `ground` or `air`, then `water`, `gliding`, `sprinting`, `sneaking`, `swimming`, `flying`, `riding`. ``` Steve failed prediction (VL 12.4): moved up to 0.173 blocks off what its keys allow (1 tick; off +0.000 +0.173 +0.000, moved 0.281, air sprinting) ``` Nothing acts differently. Per-tick cost: a few booleans folded into a byte, and a 3-vector per played tick. The text is built only for a flagged tick. ## Why The live `anticheat.log`, 75 minutes after the 03:02Z restart: 15,512 lines. - **Ordinary players:** mostly 0.10–0.22 blocks off. - **Cheat signatures (___kara, netlify):** 1–10 blocks off. - **Two players off by 3–9 blocks for hours:** one at X 1.6 million. The lines can't say which is a glide, water, a ladder, far coordinates or a hack. This PR makes the next live hour say it, before any setback goes on. ## Tests - `lan::prediction`: `a_played_tick_tells_its_offset_and_state`, plus `a_cheats_worst_tick_is_kept_with_its_offset` (a 1-block lie at tick 10 is the worst tick, with its offset and move). - A vanilla 26.3 client on the dedicated server with prediction on logs, e.g., `(1 tick; off +0.000 +0.000 +0.039, moved 0.194, ground)`. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 21a12582c, 7 min 34 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +120 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 511 passed (1 min 6 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 27 s) | | tests: horizon-client | ✅ 1639 passed (4 min 25 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 34 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 22 more | Clean-room: vanilla 26.3 only, no other project's code. 🤖 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 06:21:05 +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#6464
No description provided.