[PR #5209] [MERGED] Anticheat prediction: a burst keeps the setback point before its lie #6140

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

📋 Pull Request Information

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

Base: main ← Head: fix/5132-burst-setback


📝 Commits (1)

  • 5317143 Anticheat prediction: a burst keeps the setback point before its lie

📊 Changes

1 file changed (+59 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/lan/prediction.rs (+59 -2)

📄 Description

🤖 Opened by iseaprojects's AI agent (OpenCode, DeepSeek V4.1 Flash), not by iseaprojects personally.

What and why

Fixes #5132.

When the server's tick lags the client's, several client ticks arrive at once and one catch_up replays them in order. Replay::play moves the replay to the position each tick claimed, so a tick that lands farther than the tolerance is counted and the replay goes on from the spot the client claimed. The next tick then agreed from there and set agreed to it, so guest_replay read a setback point already at the cheated position: the violation was counted and the setback did nothing.

play_to now stops moving the agreed point once a tick of that catch-up has counted. A sustained speed or fly hack is unchanged (every tick stays off the tolerance); only a one-tick lie followed by honest ticks in the same catch-up is affected.

The regression test a_burst_keeps_the_setback_before_its_lie, next to a_cheat_counts_from_where_it_started, plays 20 honest ticks, then tick 20 claiming +3.0 and tick 21 honest from there in a single catch-up: the lie counts once and the setback point stays at tick 19's position. It fails on main (agreed at the cheated spot) and passes with this change.

Kind

  • extra: Horizon-only, off by default

Vanilla reference

Horizon-only: the anticheat is not in vanilla, so there is no vanilla class to follow and no harness. The unit tests in crates/horizon-client/src/lan/prediction.rs cover it.

Other projects' code

none

Self-check

**pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-NACG3BC, against origin/main at 125875b84, 6 min 8 s)

| Check | Result |
| --- | --- |
| Scope | ✅ 1 files, +59 −2 |
| Cargo.lock | ✅ unchanged |
| Public tree | ✅ |
| Python tests | ❌ 495 run, FAILED (errors=1, skipped=2) (58 s) |
| rustfmt | ✅ (8 s) |
| clippy | ✅ (1 s) |
| tests: horizon-client | ✅ 1339 passed (4 min 57 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses |
| Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) |

cargo test -p horizon-client --lib lan::prediction passes (11 tests, the new one included; it fails on main).

The one red row is local to this Windows machine and is not this change: Python tests is #5201, which I filed from this run. pr_ready sets PYTHONUTF8=1, and tools/perf_bench.py decodes cmd /C ver (its output is in the console's OEM code page) as UTF-8, so stdout is None and the test errors. CI runs the Python tests on ubuntu-latest and does not hit it.


🔄 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/5209 **Author:** [@iseaprojects](https://github.com/iseaprojects) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/5132-burst-setback` --- ### 📝 Commits (1) - [`5317143`](https://github.com/horizon-rust/horizon/commit/53171431d00b8f55149877a1e5c110d2e664acde) Anticheat prediction: a burst keeps the setback point before its lie ### 📊 Changes **1 file changed** (+59 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/prediction.rs` (+59 -2) </details> ### 📄 Description > 🤖 Opened by iseaprojects's AI agent (OpenCode, DeepSeek V4.1 Flash), not by iseaprojects personally. ## What and why Fixes #5132. When the server's tick lags the client's, several client ticks arrive at once and one `catch_up` replays them in order. `Replay::play` moves the replay to the position each tick claimed, so a tick that lands farther than the tolerance is counted and the replay goes on from the spot the client claimed. The next tick then agreed from there and set `agreed` to it, so `guest_replay` read a setback point already at the cheated position: the violation was counted and the setback did nothing. `play_to` now stops moving the agreed point once a tick of that catch-up has counted. A sustained speed or fly hack is unchanged (every tick stays off the tolerance); only a one-tick lie followed by honest ticks in the same catch-up is affected. The regression test `a_burst_keeps_the_setback_before_its_lie`, next to `a_cheat_counts_from_where_it_started`, plays 20 honest ticks, then tick 20 claiming +3.0 and tick 21 honest from there in a single catch-up: the lie counts once and the setback point stays at tick 19's position. It fails on main (`agreed` at the cheated spot) and passes with this change. ## Kind - [x] extra: Horizon-only, off by default ## Vanilla reference Horizon-only: the anticheat is not in vanilla, so there is no vanilla class to follow and no harness. The unit tests in `crates/horizon-client/src/lan/prediction.rs` cover it. ## Other projects' code none ## Self-check ```text **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-NACG3BC, against origin/main at 125875b84, 6 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +59 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 495 run, FAILED (errors=1, skipped=2) (58 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 s) | | tests: horizon-client | ✅ 1339 passed (4 min 57 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ``` `cargo test -p horizon-client --lib lan::prediction` passes (11 tests, the new one included; it fails on main). The one red row is local to this Windows machine and is not this change: **Python tests** is #5201, which I filed from this run. `pr_ready` sets `PYTHONUTF8=1`, and `tools/perf_bench.py` decodes `cmd /C ver` (its output is in the console's OEM code page) as UTF-8, so `stdout` is `None` and the test errors. CI runs the Python tests on `ubuntu-latest` and does not hit it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:14:34 +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#6140
No description provided.