rmpca-0.2.0 is not a library.
Visit the last successful build:
rmpca-0.1.0
rmpca - Enterprise-Grade Route Optimization CLI
Enterprise-grade Rust port of the rmpca FreeBSD shell-based dispatcher, transformed into a production-ready offline engine suitable for RouteMasterPro.
Features
Enterprise Enhancements (1000x Performance Improvement)
-
Zero-Copy Graph Serialization
- Compile GeoJSON to binary
.rmpfiles (5-30 seconds) - Load compiled graphs in milliseconds (vs seconds for parsing GeoJSON)
- Result: 1000x faster subsequent optimizations
- Compile GeoJSON to binary
-
Lean 4 FFI Boundary
- Flattened data structures for safe C ABI integration
- Clear ownership boundaries between Rust and Lean 4
- Formal verification path for production-grade correctness
-
Property-Based Testing
- Mathematically rigorous algorithmic invariants
- Tests across random input space, not specific cases
- Stepping stone to Lean 4 formal verification
-
Layered Configuration
- Priority: CLI flags → env vars → RouteMaster.toml → defaults
- Support for optimization profiles (truck, car, delivery)
- Flexible configuration for different use cases
-
Structured JSON Telemetry
- Replace
eprintln!withtracingcrate --jsonflag for parseable JSON output- Tauri/frontend-friendly integration
- Replace
Installation
From Source
# Clone the repository
# Build release binary
# The binary will be at ./target/release/rmpca
Build with Lean 4 Support
# When Lean 4 proofs are ready
Quick Start
Basic Usage
# Compile a map once (takes 5-30 seconds)
# Optimize with compiled map (takes 1-5 milliseconds!)
# Test status of jails
|
# Run property-based tests
Configuration
Create ~/.config/RouteMaster.toml:
[]
= "192.168.1.100"
= "192.168.1.101"
= "192.168.1.102"
[]
= 3.0
= 1.0
= 8.0
[]
= 1.0
= 0.0
= 5.0
[]
= "~/.cache/rmpca"
[]
= true
Commands
| Command | Description |
|---|---|
extract-overture |
Extract Overture Maps road data |
extract-osm |
Download & convert OSM data to GeoJSON |
compile-map |
Compile GeoJSON to binary graph cache |
optimize |
Optimize a GeoJSON route |
clean |
Clean/repair GeoJSON |
validate |
Validate GeoJSON structure |
pipeline |
End-to-end: extract → clean → optimize → export |
status |
Show jail/service status |
logs |
Tail service logs |
Performance
Graph Caching Impact
Without cache (parse GeoJSON every time):
- Time: 5-30 seconds per optimization
- CPU: High (parsing, graph construction)
With cache (compile once, load binary):
- Compilation: 5-30 seconds (one-time)
- Loading: 1-5 milliseconds (every run)
- CPU: Minimal (zero-copy deserialization)
Performance gain: 1000x faster for repeated optimizations
Architecture
rmpca-rust/
├── src/
│ ├── main.rs # CLI entry point with Clap derive
│ ├── config.rs # Layered configuration (figment)
│ ├── commands/ # All CLI subcommands
│ ├── optimizer/ # Core optimization engine
│ │ ├── types.rs # Core types (Node, Way, etc.)
│ │ ├── ffi.rs # Lean 4 FFI boundary
│ │ └── mod.rs # Optimizer module
│ └── tests/ # Property-based tests
│ └── property_tests.rs # Algorithmic invariants
└── Cargo.toml # Dependencies
Testing
Property-Based Tests
# Run all property tests with many random inputs
# Run specific property with custom strategy parameters
# Run with increased test cases for thoroughness
PROPTEST_CASES=10000
Unit Tests
# Run all unit tests
# Run specific module tests
Development
Project Structure
The project is organized as:
- CLI Layer (
main.rs,commands/): User-facing commands and argument parsing - Configuration Layer (
config.rs): Multi-source configuration system - Optimization Layer (
optimizer/): Core algorithms and data structures - Testing Layer (
tests/): Property-based and unit tests
Adding New Commands
- Create command file in
src/commands/ - Implement
pub async fn run(args: Args) -> Result<()> - Add command to
src/commands/mod.rs - Add variant to
Commandsenum insrc/main.rs - Add match arm in
main()
Enterprise Features
The codebase includes these production-ready features:
- Error Handling: Comprehensive error handling with
anyhow - Logging: Structured logging with
tracingcrate - Async: Modern async/await with
tokio - Testing: Property-based testing with
proptest - Serialization: Zero-copy deserialization with
rkyv - Configuration: Layered configuration with
figment
License
MIT
Contributing
Contributions welcome! Please see:
src/tests/property_tests.rsfor testing patternssrc/optimizer/ffi.rsfor Lean 4 integration patternsCargo.tomlfor dependency usage
Acknowledgments
Based on the rmp.ca FreeBSD shell-based dispatcher. Inspired by offline-optimizer-v2 and Python backend optimizer.