Skip to content

Conversation

andrewgazelka
Copy link
Member

No description provided.

@andrewgazelka andrewgazelka marked this pull request as ready for review September 10, 2025 02:59
@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 02:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the codebase from nightly Rust to stable Rust 1.89.0 by removing or replacing unstable features. The changes include replacing SIMD operations with stable alternatives, removing unstable syntax like let chains and pattern matches, and updating various APIs to use stable equivalents.

  • Migrated from nightly Rust features to stable Rust 1.89.0
  • Replaced SIMD operations with stable alternatives using third-party crates
  • Updated toolchain and dependencies for stable compatibility

Reviewed Changes

Copilot reviewed 52 out of 647 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rust-toolchain.toml Changed from nightly to stable Rust 1.89.0
tools/rust-mc-bot/src/packet_utils.rs Used abs_diff method instead of manual absolute difference
events/bedwars/src/lib.rs Removed unstable feature flags
events/bedwars/src/plugin/spawn.rs Replaced is_empty() with len() == 0 for collection checks
events/bedwars/src/plugin/regeneration.rs Fixed comparison operator precedence issue
events/bedwars/src/plugin/block.rs Replaced is_empty() with len() == 0 for collection checks
crates/simd-utils/src/lib.rs Replaced SIMD operations with stable chunked processing
crates/hyperion-stats/src/lib.rs Replaced SIMD with wide crate for stable compatibility
crates/packet-channel/src/lib.rs Implemented custom SyncUnsafeCell wrapper
crates/hyperion/src/storage/buf.rs Replaced unstable slice methods with stable alternatives
crates/hyperion/src/simulation/packet.rs Added clippy allow for field name convention
crates/hyperion/src/simulation/metadata/mod.rs Removed problematic PartialOrd implementation and made function const
crates/hyperion/src/simulation/handlers.rs Replaced Try trait with Result-based error handling
crates/hyperion/src/simulation/blocks/mod.rs Updated function signature to use anyhow::Result
crates/hyperion/src/net/proxy.rs Fixed rkyv deserialization error handling
crates/hyperion/src/lib.rs Removed unstable feature flags and updated APIs
crates/hyperion/src/ingress/mod.rs Replaced array splitting with slice operations
crates/hyperion/src/common/util/mojang.rs Replaced Duration::from_mins with stable equivalent
crates/hyperion/src/common/config.rs Added clippy allow for collapsible if statement
crates/hyperion-utils/src/cached_save.rs Used std::io::Error::other instead of closure
crates/hyperion-proxy/src/cache.rs Replaced BVH with simple fallback for stable compatibility
crates/hyperion-palette/src/indirect.rs Replaced SIMD search with linear search
crates/hyperion-inventory/src/lib.rs Replaced thread_local with AtomicU8
crates/hyperion-command/src/lib.rs Removed iter_intersperse feature usage
crates/hyperion-command/src/system.rs Manually implemented string joining without intersperse
crates/hyperion-clap-macros/src/lib.rs Fixed let chain syntax for stable compatibility
crates/geometry/src/aabb.rs Added const midpoint methods
crates/bvh-region/tests/simple.rs Replaced nested if-let with let chain alternative
crates/bvh-region/src/query/ray.rs Replaced nested if-let with let chain alternative
crates/bvh-region/src/lib.rs Removed unstable feature flags
clippy.toml Added MSRV configuration for Rust 1.89.0
ci.sh Added CI script for clippy and test execution
Cargo.toml Updated dependencies and workspace configuration
Comments suppressed due to low confidence (1)

crates/hyperion-proxy/src/cache.rs:1

  • The BVH replacement with linear search over all players will have O(n) complexity instead of O(log n). For large numbers of players, this could become a bottleneck. Consider implementing a spatial partitioning solution or using a stable BVH crate.
use std::collections::HashSet;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


for (mut last_damaged, prev_health, mut health) in query {
if *health < **prev_health {
if **health < ***prev_health {
Copy link
Preview

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect operator precedence causing triple dereference. Should be *health < **prev_health to compare the current health with the previous health value.

Copilot uses AI. Check for mistakes.

Comment on lines +289 to 304
let mut has_collision = false;
let _unused = blocks.get_blocks(min, max, |pos, block| {
let pos = Vec3::new(pos.x as f32, pos.y as f32, pos.z as f32);

for aabb in block.collision_shapes() {
let aabb = Aabb::new(aabb.min().as_vec3(), aabb.max().as_vec3());
let aabb = aabb.move_by(pos);

if shrunk.collides(&aabb) {
return ControlFlow::Break(false);
has_collision = true;
return Err(anyhow::anyhow!("early exit")); // Early exit on collision
}
}

ControlFlow::Continue(())
Ok(())
});
Copy link
Preview

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using anyhow::Error for control flow is not idiomatic. Consider using a custom error type or ControlFlow enum instead of creating an error just for early termination.

Copilot uses AI. Check for mistakes.

T: Copy + PartialEq + std::fmt::Debug,
{
let mut idx = start_idx;
const CHUNK_SIZE: usize = 64;
Copy link
Preview

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hardcoded chunk size of 64 should be documented or made configurable. Consider adding a comment explaining why this specific size was chosen for optimal performance.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant