Commit graph

9 commits

Author SHA1 Message Date
rUv
a23bd2ec01 fix(server): resolve adversarial review findings C1-C5, H1-H3, H5, M1-M2
Critical fixes:
- C1: FieldModel created with n_links=1 (single_link_config) so
  feed_calibration/extract_perturbation no longer get DimensionMismatch
- C2: variance_explained now uses centered covariance trace (E[x²]-E[x]²)
  matching mode_energies normalization
- C3: MP ratio uses total_obs = frames * links for consistent threshold
  between calibration and runtime
- C4: Noise estimator filters to positive eigenvalues only, preventing
  collapse to ~0 on rank-deficient matrices (p > n)
- C5: ESP32 paths gate total_persons on presence — empty room reports 0

High fixes:
- H1: Bounding box computed from observed keypoints only (confidence > 0),
  preventing collapse from centroid-filled unobserved slots
- H2: fuse_or_fallback returns Option<usize> instead of sentinel 0,
  eliminating type ambiguity between "fusion succeeded" and "zero people"
- H3: Monotonic epoch-relative timestamps replace wall-clock/Instant mixing,
  preventing spurious TimestampMismatch on NTP steps
- H5: ndarray-linalg gated behind "eigenvalue" feature flag (default=on),
  diagonal fallback used with --no-default-features

Moderate fixes:
- M1: calibration_start guards against replacing Fresh calibration
- M2: parse_node_positions logs warning for malformed entries

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-31 18:50:00 +00:00
rUv
74e0ebbd41 feat(server): accuracy sprint 001 — Kalman tracker, multi-node fusion, eigenvalue counting
Wire three existing signal-crate components into the live sensing path:

Step 1 — Kalman Tracker (tracker_bridge.rs):
- PoseTracker from wifi-densepose-signal wired into all 5 mutable
  derive_pose_from_sensing call sites
- Stable TrackId-based person IDs replace ephemeral 0-based indices
- Greedy Mahalanobis assignment with proper lifecycle transitions
  (Tentative → Active → Lost → Terminated)
- Kalman-smoothed keypoint positions reduce frame-to-frame jitter

Step 2 — Multi-Node Fusion (multistatic_bridge.rs):
- MultistaticFuser replaces naive .sum() aggregation at both ESP32 paths
- Attention-weighted CSI fusion across nodes with cosine-similarity weights
- Fallback uses max (not sum) to avoid double-counting overlapping coverage
- Node positions configurable via --node-positions CLI arg
- Single-node passthrough preserved (min_nodes=1)

Step 3 — Eigenvalue Person Counting (field_model.rs upgrade):
- Full covariance matrix accumulation (replaces diagonal variance approx)
- True eigendecomposition via ndarray-linalg Eigh (Marcenko-Pastur threshold)
- estimate_occupancy() for runtime eigenvalue-based counting
- Calibration API: POST /calibration/start|stop, GET /calibration/status
- Graceful fallback to score_to_person_count when uncalibrated

New files: tracker_bridge.rs, multistatic_bridge.rs, field_bridge.rs
Modified: sensing-server main.rs, Cargo.toml; signal field_model.rs, Cargo.toml

Refs: .swarm/plans/accuracy-sprint-001.md

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-30 15:04:30 +00:00
ruv
e99a41434d chore: bump workspace to v0.3.0 and publish 15 crates to crates.io
- Workspace version: 0.2.0 → 0.3.0
- All internal path dependency versions updated
- ruvector-crv/gnn gated behind optional `crv` feature (removed [patch.crates-io])
- All 15 crates published to crates.io at v0.3.0

Published crates (in order):
  1. wifi-densepose-core
  2. wifi-densepose-vitals
  3. wifi-densepose-wifiscan
  4. wifi-densepose-hardware
  5. wifi-densepose-config
  6. wifi-densepose-db
  7. wifi-densepose-signal
  8. wifi-densepose-nn
  9. wifi-densepose-ruvector
  10. wifi-densepose-api
  11. wifi-densepose-train
  12. wifi-densepose-mat
  13. wifi-densepose-wasm
  14. wifi-densepose-sensing-server
  15. wifi-densepose-cli

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-02 08:39:23 -05:00
ruv
0c01157e36 feat: ADR-032a midstreamer QUIC transport + secure TDM + temporal gesture + attractor drift
Integrate midstreamer ecosystem for QUIC-secured mesh transport and
advanced signal analysis:

QUIC Transport (hardware crate):
- quic_transport.rs: SecurityMode (ManualCrypto/QuicTransport), FramedMessage
  wire format, connection management, fallback support (856 lines, 30 tests)
- secure_tdm.rs: ReplayWindow, AuthenticatedBeacon (28-byte HMAC format),
  SecureTdmCoordinator with dual-mode security (994 lines, 20 tests)
- transport_bench.rs: Criterion benchmarks (plain vs authenticated vs QUIC)

Signal Analysis (signal crate):
- temporal_gesture.rs: DTW/LCS/EditDistance gesture matching via
  midstreamer-temporal-compare, quantized feature comparison (517 lines, 13 tests)
- attractor_drift.rs: Takens' theorem phase-space embedding, Lyapunov exponent
  classification (Stable/Periodic/Chaotic) via midstreamer-attractor (573 lines, 13 tests)

ADR-032 updated with Section 6: QUIC Transport Layer (ADR-032a)
README updated with CRV signal-line section, badge 1100+, ADR count 33

Dependencies: midstreamer-quic 0.1.0, midstreamer-scheduler 0.1.0,
midstreamer-temporal-compare 0.1.0, midstreamer-attractor 0.1.0

Total: 3,136 new lines, 76 tests, 6 benchmarks

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 22:22:19 -05:00
ruv
3febf72674 chore: bump all crates to v0.2.0 for MERIDIAN release
Workspace version 0.1.0 → 0.2.0. All internal cross-crate
dependencies updated to match.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 12:14:39 -05:00
rUv
9bbe95648c
feat: ADR-024 Contrastive CSI Embedding Model — all 7 phases (#52)
Full implementation of Project AETHER — Contrastive CSI Embedding Model.

## Phases Delivered
1. ProjectionHead (64→128→128) + L2 normalization
2. CsiAugmenter (5 physically-motivated augmentations)
3. InfoNCE contrastive loss + SimCLR pretraining
4. FingerprintIndex (4 index types: env, activity, temporal, person)
5. RVF SEG_EMBED (0x0C) + CLI integration
6. Cross-modal alignment (PoseEncoder + InfoNCE)
7. Deep RuVector: MicroLoRA, EWC++, drift detection, hard-negative mining, SEG_LORA

## Stats
- 276 tests passing (191 lib + 51 bin + 16 rvf + 18 vitals)
- 3,342 additions across 8 files
- Zero unsafe/unwrap/panic/todo stubs
- ~55KB INT8 model for ESP32 edge deployment

Also fixes deprecated GitHub Actions (v3→v4) and adds feat/* branch CI triggers.

Closes #50
2026-03-01 01:44:38 -05:00
Claude
cca91bd875
feat(adr-017): Implement ruvector integrations in signal crate (partial)
Agents completed three of seven ADR-017 integration points:

1. subcarrier_selection.rs — ruvector-mincut: mincut_subcarrier_partition
   partitions subcarriers into (sensitive, insensitive) groups using
   DynamicMinCut. O(n^1.5 log n) amortized vs O(n log n) static sort.
   Includes test: mincut_partition_separates_high_low.

2. spectrogram.rs — ruvector-attn-mincut: gate_spectrogram applies
   self-attention (Q=K=V) over STFT time frames to suppress noise and
   multipath interference frames. Configurable lambda gating strength.
   Includes tests: preserves shape, finite values.

3. bvp.rs — ruvector-attention stub added (in progress by agent).

4. Cargo.toml — added ruvector-mincut, ruvector-attn-mincut,
   ruvector-temporal-tensor, ruvector-solver, ruvector-attention
   as workspace deps in wifi-densepose-signal crate.

Cargo.lock updated for new dependencies.

Remaining ADR-017 integrations (fresnel.rs, MAT crate) still in
progress via background agents.

https://claude.ai/code/session_01BSBAQJ34SLkiJy4A8SoiL4
2026-02-28 16:10:18 +00:00
Claude
3ccb301737
feat: Add comprehensive benchmarks and validation tests for Rust signal processing
- Add signal_bench.rs with Criterion benchmarks for all signal components
- Add validation_test.rs proving mathematical correctness of algorithms
- Update README.md with validated benchmark results (810x-5400x speedup)
- Fix benchmark API usage (sanitize_phase, extract methods)

Benchmark Results (4x64 CSI data):
- CSI Preprocessing: 5.19 µs (~49 Melem/s)
- Phase Sanitization: 3.84 µs (~67 Melem/s)
- Feature Extraction: 9.03 µs (~7 Melem/s)
- Motion Detection: 186 ns (~5.4 Melem/s)
- Full Pipeline: 18.47 µs (~54K fps)

Validation Tests (all passing):
- Phase unwrapping: 0.0 radians max error
- Doppler estimation: 33.33 Hz exact match
- Correlation: 1.0 for identical signals
- Phase coherence: 1.0 for coherent signals
2026-01-13 03:38:38 +00:00
Claude
6ed69a3d48
feat: Complete Rust port of WiFi-DensePose with modular crates
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
2026-01-13 03:11:16 +00:00