[PR #5041] [MERGED] Anticheat prediction (d): e2e with a real client on a jittery connection, step/spider/jesus tests #6024

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • 807a818 Anticheat prediction (d): e2e with a real client on a jittery connection, step/spider/jesus tests

📊 Changes

2 files changed (+259 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/lan/prediction.rs (+74 -0)
📝 tools/anticheat_e2e.py (+185 -2)

📄 Description

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

Movement prediction (d), after the check (c) #5012: an end-to-end test with a real client on a bad connection, and unit tests for the step, spider and jesus cheats. Tests and tools only: nothing changes for players or servers.

tools/anticheat_e2e.py --check prediction

A dedicated server with [anticheat] on (the prediction at its defaults; timer and ground off, so this is about the prediction alone), survival, peaceful. A real Horizon client, driven by horizon-ctl, connects through Jitter: a relay that holds every packet 20–120 ms, in order, both ways. The client:

  • walks, sprint-jumps, turns, strafes, sneaks backwards, with Speed III and Jump Boost given then cleared;
  • sprint-jumps over packed ice, sprints on soul sand, swims across a pool, launches itself with a riptide trident;
  • walks into two cows summoned in front of it, which are then killed; has a stone set in front of it (it walks into it before it hears of it) and jumps at it; has the floor removed from under it, then filled back;
  • flies in creative (double jump), then back to survival;
  • glides with an elytra from 60 blocks up, boosted by a firework;
  • boards a boat on a pool, paddles, sneaks out and sprints off it.

The check fails if the client is flagged even once. Then a horizon-bots walker joins: it moves by its own rules and sends no keys, so it must be flagged at least 3 times and sent back. The anticheat log is copied to out/prediction-anticheat.log.

Results on this branch (main with #5012): the honest client was never flagged in 3 runs out of 3 (and 8 out of 8 while #5012 was being finished), and the bot was flagged 13 times, sent back 12 times and kicked. off, timer and ground pass too.

Unit tests (lan::prediction, real 26.3 data)

A client walks 40 ticks into something, its moves changed by a cheat; the tick the cheat starts counts, and nothing before it does:

  • a_step_is_caught: up onto a full block without a jump (a walk steps up 0.6 at most);
  • a_spider_is_caught: up a wall, 0.2 blocks a tick, with no ladder or vine;
  • a_jesus_is_caught: on water as on the ground.

Speed, fly and anti-knockback were already covered by (b1)/(b2)/(c).

Not covered yet

A vanilla Java client: this test drives a Horizon client. The replay is vanilla's movement code, so a vanilla client should replay the same way, but that is still to be shown before the official server turns on setbacks for everyone.

Cost

None: no game code changes (MSPT unchanged).

pr_ready

Check Result
Scope ✅ 2 files, +259 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (1 min 9 s)
rustfmt ✅ (4 s)
clippy ✅ (1 min 5 s)
tests: horizon-client ✅ 1340 passed (3 min 44 s)
doc tests ✅ 0 passed (1 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 ➖ 7 affected, to run in CI (--quick): dedicated_server, lan_integration, lunge_motion, mace, pearl_wind_charge, server_entities, server_knockback
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Clean-room: the cheats are reproduced from public descriptions of what they do (black box); 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/5041 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/anticheat-prediction-e2e` --- ### 📝 Commits (1) - [`807a818`](https://github.com/horizon-rust/horizon/commit/807a818395f30a04786462d9d263aa5501d24024) Anticheat prediction (d): e2e with a real client on a jittery connection, step/spider/jesus tests ### 📊 Changes **2 files changed** (+259 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/prediction.rs` (+74 -0) 📝 `tools/anticheat_e2e.py` (+185 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Movement prediction (d), after the check (c) #5012: an end-to-end test with a **real client on a bad connection**, and unit tests for the step, spider and jesus cheats. Tests and tools only: nothing changes for players or servers. ## `tools/anticheat_e2e.py --check prediction` A dedicated server with `[anticheat]` on (the prediction at its defaults; timer and ground off, so this is about the prediction alone), survival, peaceful. A real Horizon client, driven by `horizon-ctl`, connects through `Jitter`: a relay that holds every packet 20–120 ms, in order, both ways. The client: - walks, sprint-jumps, turns, strafes, sneaks backwards, with Speed III and Jump Boost given then cleared; - sprint-jumps over packed ice, sprints on soul sand, swims across a pool, launches itself with a riptide trident; - walks into two cows summoned in front of it, which are then killed; has a stone set in front of it (it walks into it before it hears of it) and jumps at it; has the floor removed from under it, then filled back; - flies in creative (double jump), then back to survival; - glides with an elytra from 60 blocks up, boosted by a firework; - boards a boat on a pool, paddles, sneaks out and sprints off it. The check fails if the client is flagged even once. Then a horizon-bots walker joins: it moves by its own rules and sends no keys, so it must be flagged at least 3 times and sent back. The anticheat log is copied to `out/prediction-anticheat.log`. Results on this branch (main with #5012): the honest client was **never flagged in 3 runs out of 3** (and 8 out of 8 while #5012 was being finished), and the bot was flagged 13 times, sent back 12 times and kicked. `off`, `timer` and `ground` pass too. ## Unit tests (`lan::prediction`, real 26.3 data) A client walks 40 ticks into something, its moves changed by a cheat; the tick the cheat starts counts, and nothing before it does: - `a_step_is_caught`: up onto a full block without a jump (a walk steps up 0.6 at most); - `a_spider_is_caught`: up a wall, 0.2 blocks a tick, with no ladder or vine; - `a_jesus_is_caught`: on water as on the ground. Speed, fly and anti-knockback were already covered by (b1)/(b2)/(c). ## Not covered yet A **vanilla Java client**: this test drives a Horizon client. The replay is vanilla's movement code, so a vanilla client should replay the same way, but that is still to be shown before the official server turns on setbacks for everyone. ## Cost None: no game code changes (MSPT unchanged). ## pr_ready | Check | Result | | --- | --- | | Scope | ✅ 2 files, +259 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (1 min 9 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 5 s) | | tests: horizon-client | ✅ 1340 passed (3 min 44 s) | | doc tests | ✅ 0 passed (1 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 | ➖ 7 affected, to run in CI (--quick): dedicated_server, lan_integration, lunge_motion, mace, pearl_wind_charge, server_entities, server_knockback | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Clean-room: the cheats are reproduced from public descriptions of what they do (black box); 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 05:16:41 +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#6024
No description provided.