[GH-ISSUE #6124] Crash: collision scan candidate budget exhausted #1986

Closed
opened 2026-11-02 15:51:08 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @kira-horizon[bot] on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6124

Version: Nightly 2026-11-01 · 4aa6854 · OS: linux (x86_64) version Pop!_OS 24.04 LTS, kernel 7.2.6-76070206-generic (copied from the report)

What I did:

  1. Made a flat world
  2. Had everything generate in at render distance 128
  3. Set my movment speed to 400 ('/attribute @s minecraft:movement_speed base set 400' any higher values work as well)
  4. Ran diagonally
    What happened: Crashed.
    What I expected: Not crash.
    Does it happen every time? Yes.
    Horizon version: Nightly 2026-11-01 · 4aa6854
    OS, CPU, GPU:
    Operating System: linux (x86_64) version Pop!_OS 24.04 LTS, kernel 7.2.6-76070206-generic
    CPU: 12x AMD Ryzen 5 9600X 6-Core Processor
    Memory: 385 MiB used by the game, 31664 MiB installed
    Render Settings: render distance 128, simulation distance 5, graphics custom, FOV 70, max FPS unlimited, VSync off, fullscreen on, GUI scale auto, smooth lighting on, clouds true, biome blend 3, mipmap levels 4
    Resource Packs: vanilla
    Graphics Adapter: NVIDIA GeForce RTX 4070 Ti (Vulkan, DiscreteGpu), driver NVIDIA 595.104.02

Reported on Discord by Triibu in #horizon-bugs · Discord thread
Tags: crash, rendering

Attachments (Discord links expire after a while; the thread keeps them)

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @kira-horizon[bot] on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6124 **Version:** Nightly 2026-11-01 · 4aa6854 · **OS:** linux (x86_64) version Pop!_OS 24.04 LTS, kernel 7.2.6-76070206-generic <sub>(copied from the report)</sub> > What I did: > 1. Made a flat world > 2. Had everything generate in at render distance 128 > 3. Set my movment speed to 400 ('/attribute `@s` minecraft:movement_speed base set 400' any higher values work as well) > 4. Ran diagonally > What happened: Crashed. > What I expected: Not crash. > Does it happen every time? Yes. > Horizon version: Nightly 2026-11-01 · 4aa6854 > OS, CPU, GPU: > Operating System: linux (x86_64) version Pop!_OS 24.04 LTS, kernel 7.2.6-76070206-generic > CPU: 12x AMD Ryzen 5 9600X 6-Core Processor > Memory: 385 MiB used by the game, 31664 MiB installed > Render Settings: render distance 128, simulation distance 5, graphics custom, FOV 70, max FPS unlimited, VSync off, fullscreen on, GUI scale auto, smooth lighting on, clouds true, biome blend 3, mipmap levels 4 > Resource Packs: vanilla > Graphics Adapter: NVIDIA GeForce RTX 4070 Ti (Vulkan, DiscreteGpu), driver NVIDIA 595.104.02 Reported on Discord by **Triibu** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1566496736040460468) Tags: crash, rendering **Attachments** (Discord links expire after a while; the thread keeps them) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496736392773672/message.txt?ex=6ae8c146&is=6ae76fc6&hm=f14fee967246f63ca5664c11788b0657f3acf7fc310fa4e730d43e0d08860775&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496736883511480/message.txt?ex=6ae8c146&is=6ae76fc6&hm=2e54a91626dbdc35de6bd2456324c16ca867d34f85b7039b6f1f7c2e7eb81a6c&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496737433096192/message.txt?ex=6ae8c146&is=6ae76fc6&hm=8f87f514fb0c2872efac2cd3f9ea1494b3e4fc69a58994abead0c47514097625&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496737999454349/message.txt?ex=6ae8c146&is=6ae76fc6&hm=14f6d971804195a7a433f55a6396a7ba674ec77b0e7874056da86522e7c8d273&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496738620088450/message.txt?ex=6ae8c146&is=6ae76fc6&hm=3ab05c0c0395678fe61afd404e382832f03505fa30ec0981bc35c4feeac86765&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496739265875978/message.txt?ex=6ae8c146&is=6ae76fc6&hm=b08a71f84647d64c1137c4f2a31f31564a10ee270989c6744859de728d478f7a&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496739861594333/message.txt?ex=6ae8c146&is=6ae76fc6&hm=95c28096f5dec5966ca6026ef6de003b5cb171f566a16321d9edec4293d85e29&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496740494811176/message.txt?ex=6ae8c147&is=6ae76fc7&hm=986ebbcc5f0c1f329a1f188fe1fe745d9a00d4f00c476e24656b60afccda178e&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496741258166362/message.txt?ex=6ae8c147&is=6ae76fc7&hm=3498524b74b8063c01ae433c34fcddc29450b9b5e58929f43b5ee93dfbaeebc2&) - [message.txt](https://cdn.discordapp.com/attachments/1566496736040460468/1566496741941977189/message.txt?ex=6ae8c147&is=6ae76fc7&hm=d4d0fc00ec7664b4ef637cd96ddefbd78b84c233a71f6e7732875ef7a8891c0e&) <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:51:08 +07:00
Author
Owner

@kira-horizon[bot] commented on GitHub (Nov 1, 2026):

Claimed by JustKrabby on Discord (GitHub: JustKarkat), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #6124).

<!-- gh-comment-id:6561688851 --> @kira-horizon[bot] commented on GitHub (Nov 1, 2026): Claimed by `JustKrabby` on Discord (GitHub: `JustKarkat`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #6124). <!-- kira:work -->
Author
Owner

@JustKarkat commented on GitHub (Nov 1, 2026):

🤖 Agent: comment by JustKarkat's AI agent, not by JustKarkat personally. Claimed; here is where the crash comes from.

The message is Horizon's own guard, not a vanilla failure. CollisionScanError::VisitBudget prints "collision scan candidate budget exhausted" (crates/horizon-world/src/block_collision_scan.rs:68) and is raised in find_next when the cursor passes the budget (:156).

Why running diagonally at movement_speed 400 reaches it. The movement scan collects shapes for the whole swept box, not a thin line: try_resolve_step_movement asks for aabb.expand_towards(movement) (crates/horizon-core/src/geometry/movement.rs:59), and the client passes candidate_budget: 1_000_000 (crates/horizon-client/src/motion.rs:1996). A move of N blocks in X and Z therefore covers about N×N cells, so the budget is hit at roughly 1000 blocks per tick diagonally. movement_speed 400 compounds — velocity keeps growing every tick — so a second of running gets there.

How it becomes a crash: Motion::collide turns the error into an io::Error (motion.rs:1994) and the game aborts with it.

Reproduction: I could not drive it through horizon-ctl on a build of main (Oct 31): the scripted move does not see the attribute (1.2 blocks in a second at speed 400) and held keys do not reach the offscreen window. The attached logs have expired, so this needs a real client session — the paths above are from the code, not from a captured backtrace.

Vanilla has no such counter: it walks the same expanded box, so the same movement is slow rather than fatal. Horizon's cap is a deliberate anti-hang guard (the same scan refuses boxes past the positive-int cursor domain with TooLarge), so the trade is a design decision rather than a one-line bug:

  1. keep the cap and turn exhaustion into a clamped movement — move what fits the scan in one tick; no crash, no clipping;
  2. scale the budget to the movement sweep so the movement path behaves like vanilla — normal play never comes near it (it only changes past ~1000 blocks/tick), and the pathological case stalls instead of exiting.

I would take (2) for the movement path only, since it removes a crash reachable from a legal command and leaves every ordinary movement identical. Say the word and I will write it with a harness-level test; the alternative is fine too if a maintainer prefers clamping.

<!-- gh-comment-id:6561695730 --> @JustKarkat commented on GitHub (Nov 1, 2026): 🤖 Agent: comment by JustKarkat's AI agent, not by JustKarkat personally. Claimed; here is where the crash comes from. **The message is Horizon's own guard, not a vanilla failure.** `CollisionScanError::VisitBudget` prints "collision scan candidate budget exhausted" (`crates/horizon-world/src/block_collision_scan.rs:68`) and is raised in `find_next` when the cursor passes the budget (`:156`). **Why running diagonally at `movement_speed 400` reaches it.** The movement scan collects shapes for the whole *swept box*, not a thin line: `try_resolve_step_movement` asks for `aabb.expand_towards(movement)` (`crates/horizon-core/src/geometry/movement.rs:59`), and the client passes `candidate_budget: 1_000_000` (`crates/horizon-client/src/motion.rs:1996`). A move of N blocks in X *and* Z therefore covers about N×N cells, so the budget is hit at roughly 1000 blocks per tick diagonally. `movement_speed 400` compounds — velocity keeps growing every tick — so a second of running gets there. **How it becomes a crash:** `Motion::collide` turns the error into an `io::Error` (`motion.rs:1994`) and the game aborts with it. **Reproduction:** I could not drive it through `horizon-ctl` on a build of main (Oct 31): the scripted `move` does not see the attribute (1.2 blocks in a second at speed 400) and held keys do not reach the offscreen window. The attached logs have expired, so this needs a real client session — the paths above are from the code, not from a captured backtrace. **Vanilla has no such counter:** it walks the same expanded box, so the same movement is slow rather than fatal. Horizon's cap is a deliberate anti-hang guard (the same scan refuses boxes past the positive-int cursor domain with `TooLarge`), so the trade is a design decision rather than a one-line bug: 1. keep the cap and turn exhaustion into a **clamped movement** — move what fits the scan in one tick; no crash, no clipping; 2. scale the budget to the **movement sweep** so the movement path behaves like vanilla — normal play never comes near it (it only changes past ~1000 blocks/tick), and the pathological case stalls instead of exiting. I would take (2) for the movement path only, since it removes a crash reachable from a legal command and leaves every ordinary movement identical. Say the word and I will write it with a harness-level test; the alternative is fine too if a maintainer prefers clamping.
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#1986
No description provided.