* feat(ruvector): RaBitQ unbiased distance estimator (ADR-156 M2) Implement the real Gao & Long (SIGMOD 2024) RaBitQ contribution on top of the existing Pass-2 rotation: an unbiased estimator of the inner product / squared distance recovered from the 1-bit code plus 8 B/vec per-vector side info (residual_norm + x_dot_o), used to rerank the candidate set instead of raw Hamming. - src/estimator.rs (new): EstimatorSketch, SideInfo, EstimatorQuery, DistanceEstimator (estimate_inner_product / estimate_sq_distance / ranking_key / cosine_ranking_key), EstimatorBank (topk_estimated[_cosine], with_centroid). Zero-centroid simplification documented; paper-faithful centroid path also built. - src/rotation.rs: extract apply_padded() (full padded FHT frame the code lives in); apply() now truncates apply_padded(). No behaviour change. - lib.rs: export estimator types. Additive + backward-compatible: Pass-1 Sketch / Pass-2 SketchBank / WireSketch wire format unchanged; all external callers use Pass-1 and are unaffected. Co-Authored-By: claude-flow <ruv@ruv.net> * test(ruvector): estimator strict-K coverage harness (ADR-156 M2) Add measure_estimator (cosine rerank) + measure_estimator_euclidean to the coverage harness, on the BIT-IDENTICAL fixture / cluster centres / query stream / cosine ground truth as measure_pass1/measure_pass2 — apples-to-apples sign-Hamming vs unbiased-estimator-rerank. Regression tests: - estimator_rerank_not_worse_than_sign (>= sign-only Pass-2 on a fixed fixture) - estimator_coverage_is_deterministic - estimator_coverage_report (--nocapture prints the strict-K table) MEASURED strict-K (candidate_k=K=8): Pass-1 36.13% -> Pass-2-sign 46.39% -> estimator-cosine 49.71%. Still short of the ADR-084 90% strict bar; estimator reaches 95.12% at candidate_k=24 (vs sign 91.60%). Published negative. Co-Authored-By: claude-flow <ruv@ruv.net> * docs(ruvector): record RaBitQ estimator measured negative (ADR-156 §11, ADR-084) - sketch_bench: estimator cosine/euclid columns in the coverage table. - ADR-156 §11 (new): estimator formula + zero-centroid simplification stated honestly; strict-K coverage table; RESOLVED-NEGATIVE verdict (49.71% strict, short of 90%); pinning test names. §5 #2 + §10.5 updated. - ADR-084 'Pass 2b' (new): estimator landed + measured strict-K vs the bar. - CHANGELOG [Unreleased]: ADR-156 §11 Milestone-2 entry. Co-Authored-By: claude-flow <ruv@ruv.net> |
||
|---|---|---|
| .. | ||
| benches | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
README.md
wifi-densepose-ruvector
RuVector v2.0.4 integration layer for WiFi-DensePose — ADR-017.
This crate implements all 7 ADR-017 ruvector integration points for the signal-processing pipeline and the Multi-AP Triage (MAT) disaster-detection module.
Integration Points
| File | ruvector crate | What it does | Benefit |
|---|---|---|---|
signal/subcarrier |
ruvector-mincut | Graph min-cut partitions subcarriers into sensitive / insensitive groups based on body-motion correlation | Automatic subcarrier selection without hand-tuned thresholds |
signal/spectrogram |
ruvector-attn-mincut | Attention-guided min-cut gating suppresses noise frames, amplifies body-motion periods | Cleaner Doppler spectrogram input to DensePose head |
signal/bvp |
ruvector-attention | Scaled dot-product attention aggregates per-subcarrier STFT rows weighted by sensitivity | Robust body velocity profile even with missing subcarriers |
signal/fresnel |
ruvector-solver | Sparse regularized least-squares estimates TX-body (d1) and body-RX (d2) distances from multi-subcarrier Fresnel amplitude observations | Physics-grounded geometry without extra hardware |
mat/triangulation |
ruvector-solver | Neumann series solver linearises TDoA hyperbolic equations to estimate 2-D survivor position across multi-AP deployments | Sub-5 m accuracy from ≥3 TDoA pairs |
mat/breathing |
ruvector-temporal-tensor | Tiered quantized streaming buffer: hot ~10 frames at 8-bit, warm at 5–7-bit, cold at 3-bit | 13.4 MB raw → 3.4–6.7 MB for 56 sc × 60 s × 100 Hz |
mat/heartbeat |
ruvector-temporal-tensor | Per-frequency-bin tiered compressor for heartbeat spectrogram; band_power() extracts mean squared energy in any band |
Independent tiering per bin; no cross-bin quantization coupling |
Usage
Add to your Cargo.toml (workspace member or direct dependency):
[dependencies]
wifi-densepose-ruvector = { path = "../wifi-densepose-ruvector" }
Signal processing
use wifi_densepose_ruvector::signal::{
mincut_subcarrier_partition,
gate_spectrogram,
attention_weighted_bvp,
solve_fresnel_geometry,
};
// Partition 56 subcarriers by body-motion sensitivity.
let (sensitive, insensitive) = mincut_subcarrier_partition(&sensitivity_scores);
// Gate a 32×64 Doppler spectrogram (mild).
let gated = gate_spectrogram(&flat_spectrogram, 32, 64, 0.1);
// Aggregate 56 STFT rows into one BVP vector.
let bvp = attention_weighted_bvp(&stft_rows, &sensitivity_scores, 128);
// Solve TX-body / body-RX geometry from 5-subcarrier Fresnel observations.
if let Some((d1, d2)) = solve_fresnel_geometry(&observations, d_total) {
println!("d1={d1:.2} m, d2={d2:.2} m");
}
MAT disaster detection
use wifi_densepose_ruvector::mat::{
solve_triangulation,
CompressedBreathingBuffer,
CompressedHeartbeatSpectrogram,
};
// Localise a survivor from 4 TDoA measurements.
let pos = solve_triangulation(&tdoa_measurements, &ap_positions);
// Stream 6000 breathing frames at < 50% memory cost.
let mut buf = CompressedBreathingBuffer::new(56, zone_id);
for frame in frames {
buf.push_frame(&frame);
}
// 128-bin heartbeat spectrogram with band-power extraction.
let mut hb = CompressedHeartbeatSpectrogram::new(128);
hb.push_column(&freq_column);
let cardiac_power = hb.band_power(10, 30); // ~0.8–2.0 Hz range
Memory Reduction
Breathing buffer for 56 subcarriers × 60 s × 100 Hz:
| Tier | Bits/value | Size |
|---|---|---|
| Raw f32 | 32 | 13.4 MB |
| Hot (8-bit) | 8 | 3.4 MB |
| Mixed hot/warm/cold | 3–8 | 3.4–6.7 MB |