Major changes: - Organized Python v1 implementation into v1/ subdirectory - Created Rust workspace with 9 modular crates: - wifi-densepose-core: Core types, traits, errors - wifi-densepose-signal: CSI processing, phase sanitization, FFT - wifi-densepose-nn: Neural network inference (ONNX/Candle/tch) - wifi-densepose-api: Axum-based REST/WebSocket API - wifi-densepose-db: SQLx database layer - wifi-densepose-config: Configuration management - wifi-densepose-hardware: Hardware abstraction - wifi-densepose-wasm: WebAssembly bindings - wifi-densepose-cli: Command-line interface Documentation: - ADR-001: Workspace structure - ADR-002: Signal processing library selection - ADR-003: Neural network inference strategy - DDD domain model with bounded contexts Testing: - 69 tests passing across all crates - Signal processing: 45 tests - Neural networks: 21 tests - Core: 3 doc tests Performance targets: - 10x faster CSI processing (~0.5ms vs ~5ms) - 5x lower memory usage (~100MB vs ~500MB) - WASM support for browser deployment
4.4 KiB
4.4 KiB
WiFi-DensePose Rust Port - 15-Agent Swarm Configuration
Mission Statement
Port the WiFi-DensePose Python system to Rust using ruvnet/ruvector patterns, with modular crates, WASM support, and comprehensive documentation following ADR/DDD principles.
Agent Swarm Architecture
Tier 1: Orchestration (1 Agent)
- Orchestrator Agent - Coordinates all agents, manages dependencies, tracks progress
Tier 2: Architecture & Documentation (3 Agents)
- ADR Agent - Creates Architecture Decision Records for all major decisions
- DDD Agent - Designs Domain-Driven Design models and bounded contexts
- Documentation Agent - Maintains comprehensive documentation, README, API docs
Tier 3: Core Implementation (5 Agents)
- Signal Processing Agent - Ports CSI processing, phase sanitization, FFT algorithms
- Neural Network Agent - Ports DensePose head, modality translation using tch-rs/onnx
- API Agent - Implements Axum/Actix REST API and WebSocket handlers
- Database Agent - Implements SQLx PostgreSQL/SQLite with migrations
- Config Agent - Implements configuration management, environment handling
Tier 4: Platform & Integration (3 Agents)
- WASM Agent - Implements wasm-bindgen, browser compatibility, wasm-pack builds
- Hardware Agent - Ports CSI extraction, router interfaces, hardware abstraction
- Integration Agent - Integrates ruvector crates, vector search, GNN layers
Tier 5: Quality Assurance (3 Agents)
- Test Agent - Writes unit, integration, and benchmark tests
- Validation Agent - Validates against Python implementation, accuracy checks
- Optimization Agent - Profiles, benchmarks, and optimizes hot paths
Crate Workspace Structure
wifi-densepose-rs/
├── Cargo.toml # Workspace root
├── crates/
│ ├── wifi-densepose-core/ # Core types, traits, errors
│ ├── wifi-densepose-signal/ # Signal processing (CSI, phase, FFT)
│ ├── wifi-densepose-nn/ # Neural networks (DensePose, translation)
│ ├── wifi-densepose-api/ # REST/WebSocket API (Axum)
│ ├── wifi-densepose-db/ # Database layer (SQLx)
│ ├── wifi-densepose-config/ # Configuration management
│ ├── wifi-densepose-hardware/ # Hardware abstraction
│ ├── wifi-densepose-wasm/ # WASM bindings
│ └── wifi-densepose-cli/ # CLI application
├── docs/
│ ├── adr/ # Architecture Decision Records
│ ├── ddd/ # Domain-Driven Design docs
│ └── api/ # API documentation
├── benches/ # Benchmarks
└── tests/ # Integration tests
Domain Model (DDD)
Bounded Contexts
- Signal Domain - CSI data, phase processing, feature extraction
- Pose Domain - DensePose inference, keypoints, segmentation
- Streaming Domain - WebSocket, real-time updates, connection management
- Storage Domain - Persistence, caching, retrieval
- Hardware Domain - Router interfaces, device management
Core Aggregates
CsiFrame- Raw CSI data aggregateProcessedSignal- Cleaned and extracted featuresPoseEstimate- DensePose inference resultSession- Client session with historyDevice- Hardware device state
ADR Topics to Document
- ADR-001: Rust Workspace Structure
- ADR-002: Signal Processing Library Selection
- ADR-003: Neural Network Inference Strategy
- ADR-004: API Framework Selection (Axum vs Actix)
- ADR-005: Database Layer Strategy (SQLx)
- ADR-006: WASM Compilation Strategy
- ADR-007: Error Handling Approach
- ADR-008: Async Runtime Selection (Tokio)
- ADR-009: ruvector Integration Strategy
- ADR-010: Configuration Management
Phase Execution Plan
Phase 1: Foundation
- Set up Cargo workspace
- Create all crate scaffolding
- Write ADR-001 through ADR-005
- Define core traits and types
Phase 2: Core Implementation
- Port signal processing algorithms
- Implement neural network inference
- Build API layer
- Database integration
Phase 3: Platform
- WASM compilation
- Hardware abstraction
- ruvector integration
Phase 4: Quality
- Comprehensive testing
- Python validation
- Benchmarking
- Optimization
Success Metrics
- Feature parity with Python implementation
- < 10ms latency improvement over Python
- WASM bundle < 5MB
- 100% test coverage
- All ADRs documented