Commit Graph

3 Commits

Author SHA1 Message Date
ruv ba978041ae Merge remote-tracking branch 'origin/main' into resolve-1579-conflict
# Conflicts:
#	docs/adr/README.md
2026-08-11 13:04:00 -04:00
Claude 79d1fff99a feat: implement ADR-288/289/290 — benchmark harness, wideband CSI ingest, vitals ground-truth rig
ADR-288 (wifi-densepose-train): Widar3.0 Intel-5300 .dat bfee parser
(bounded, panic-free), WidarDataset over the CsiDataset trait, deterministic
SplitProtocol (cross-subject/environment/orientation + leakage-prone random
baseline), LeakageAudit that Errs on subject/environment/recording overlap,
train-only MeanPoseBaseline, and EvidenceGrade where Measured requires an
embedded reproducer. Criterion bench for parser + split + audit.

ADR-289 (wifi-densepose-mat): FeitCSI binary record parser (layout verified
against upstream source) with dimension-vs-buffer validation and bounded
allocation, DeviceType::FeitCsi replay/stream modes, subcarrier-agnostic
frame metadata (bandwidth/band/native->pipeline mapping). Criterion bench at
1992-subcarrier frames.

ADR-290 (wifi-densepose-vitals): reference-series CSV ingest, cross-correlation
time alignment with optional drift fit, Bland-Altman/MAE/RMSE agreement with
mandatory SessionScope, and EvidenceGrade gating Measured on reference device +
coverage + reproducer. Criterion bench for hour-scale alignment.

All three crate suites green; benches compile. Numbers are SYNTHETIC (in-code
fixtures); no hardware claims.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_015TcKegTS7QqhWPC2L2SzaS
2026-08-11 00:06:39 +00:00
ruv a7f7adfabc perf(vitals,wifiscan): O(1) VecDeque sliding windows + vitals bench (ADR-157 §A1/§D1)
Replace Vec::remove(0) (O(n) per-sample buffer shift -> O(n^2) full-window
sweep) with VecDeque push_back/pop_front (O(1) eviction) in the fixed-length
sliding/ring buffers of the vital-sign and wifiscan extractors. Where the
autocorrelation / zero-crossing / Pearson loop needs a contiguous slice,
make_contiguous() is called once per extract(), matching the idiom already used
in wifiscan/pipeline/orchestrator.rs. Output is bit-identical.

Sites: anomaly.rs (rr/hr history), store.rs (readings ring; history() now takes
&mut self to hand back a contiguous slice, no external callers), wifiscan
breathing_extractor.rs (filtered history), wifiscan correlator.rs (per-BSSID
histories -> Vec<VecDeque<f32>>). (heartrate.rs/breathing.rs windows land with
the §A2/§A3 fixes in a separate commit.)

New criterion bench crates/wifi-densepose-vitals/benches/vitals_bench.rs drives
each extractor over a full-window fill. Honest MEASURED result: end-to-end win
is NULL within noise at realistic ESP32 window sizes (1500-3000) because the
per-frame DSP dominates the eviction (heartrate 42.8ms->44.4ms, breathing
7.95ms->7.86ms, overlapping CIs). In isolation the eviction collapses O(n^2)
-> O(n) (34.6x at window=3000, 3158x at window=100000); A1 lands as the correct
data structure removing a latent O(n^2), NOT a claimed hot-path speedup.

Reproduce: cargo bench -p wifi-densepose-vitals --bench vitals_bench

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-06-11 20:59:57 -04:00