Release 0.6.4 - Wall Collision Physics & CI Improvements
🎯 Major Improvements
Wall Collision Physics (Critical Fix)
- Fixed wall penetration bug where agents could pass through walls
- Corrected parametric equation sign error in collision detection
- Fixed position reference (using instead of )
- Prevented from overwriting collision results
- Result: Zero wall violations across all test cases
- Implemented elastic wall bounce physics matching RatInABox behavior
- Velocity reflection with proper parallel/perpendicular decomposition
- Speed reduction to 0.5 × speed_mean after collision
- Iterative collision handling with normal distribution noise for numerical stability
Trajectory Generation Enhancements
- Rayleigh distribution for 2D speed magnitudes
- Correct statistical distribution for 2D random walks
- CDF transformations: Rayleigh ↔ Normal for OU process updates
- Significant improvement in RatInABox parity metrics
- Added measured rotational velocity tracking
- Distinction between dynamical and measured angular velocities
- Proper angle difference normalization to [-π, π]
Performance Improvements
Trajectory similarity improvements across test cases:
- case2_walls: 36% improvement (0.041 → 0.026)
- case4_thigmotaxis: 35% improvement (0.024 → 0.016)
- case5_periodic: Perfect match (0.0 → 0.0)
- case8_hole: 28% improvement (0.657 → 0.472)
🔧 CI/CD Improvements
GitHub Actions Updates
- Updated macOS Intel runner:
macos-13→macos-15-intel- macos-13 retired by GitHub in December 2025
- Using official recommended replacement for Intel builds
- Fixed Windows CI test failure
- Handle zero-time computation in speedup calculations
- Prevent ZeroDivisionError in performance tests
Code Quality
- Translated all Chinese comments to English
- Fixed Rust formatting (cargo fmt compliance)
- Enhanced inline documentation with physics explanations
📦 Distribution
Pre-built wheels available for:
- Linux: x86_64, aarch64
- macOS: x86_64 (Intel), arm64 (Apple Silicon)
- Windows: x86_64
- Python versions: 3.11, 3.12, 3.13
🔬 Technical Details
New Dependencies
statrs = 0.16- Statistical distributions (Rayleigh, Normal CDF/inverse CDF)
Algorithm Changes
- Rayleigh-to-Normal transformation for velocity updates
- Wall bounce reflection using vector decomposition
- Collision detection with parametric line segment intersection
- Numerical stability via 1e-9 scale normal noise
📚 Documentation
- Comprehensive inline comments explaining physics principles
- Detailed algorithm descriptions in geometry utilities
- Updated build and test instructions
🙏 Acknowledgments
Thanks to the RatInABox project for the reference implementation and algorithm design.
Full Changelog: v0.6.3...v0.6.4