Skip to content

feat: cpu-first real-csi inference vertical slice - #1978

Open
beastbroak30 wants to merge 1 commit into
ruvnet:mainfrom
beastbroak30:feat/cpu-first-real-csi-inference
Open

beastbroak30 wants to merge 1 commit into
ruvnet:mainfrom
beastbroak30:feat/cpu-first-real-csi-inference

Conversation

@beastbroak30

Copy link
Copy Markdown

Problem

RuView had no CPU inference path for real public CSI datasets, no dataset
preparation pipeline, and no honest profiling harness. This patch adds the
first vertical slice: dataset validation, preprocessing, CPU profiles, a
benchmark binary, and documentation — all without downloading data or training
weights.

Datasets

Dataset Source License Status
MM-Fi (primary) ybhbingo/MMFi_dataset CC-BY-NC-4.0 Manifest + loader ready; download manually
Wi-Pose (secondary) NjtechCVLab/Wi-PoseDataset Research use Manifest template only; .mat.npy conversion documented but not wired

Both datasets require manual download. Files are never committed to Git.

Implementation

New modules:

  • public_dataset.rsDatasetManifest, PreparedSplit, ProcessedSampleMeta, SplitPolicy
  • real_csi.rsRealCsiPipeline (6-stage: shape validation → NaN rejection → phase sanitization → Hampel denoising → per-pair standardization → subcarrier conversion)
  • profile.rsCpuProfile (5 variants, 2 implemented), ModelMetadata with enforced honesty separation

New binaries:

  • prepare_public_dataset — validates .npy headers, measures native width, writes dataset_manifest.json + split.json
  • cpu_inference_bench — machine-headered P50/P95/throughput reports, --compare FP32 vs INT8

Modified:

  • inference.rsInferenceOptions gains profile, precision, deterministic
  • onnx.rs — session builder honors intra-op thread count
  • dataset.rsMmFiDataset::discover_subset for subject-filtered discovery
  • wifi-densepose-signal — re-exports hampel_filter and HampelConfig

Methodology

  1. Preprocessing (real-csi-v1): fail-closed (no NaN/inf repair), documented interpolation math for 114→56 conversion, per-sample provenance.
  2. Splits: subject-disjoint by default (Fisher–Yates, seeded, self-checked). Environment/recording/cross-dataset splits documented as future requirements.
  3. Benchmarks: criterion bench for preprocessing; ONNX inference bench with warmup, multiple iterations, JSON reports.
  4. Honesty: ModelMetadata::validate() refuses to claim accuracy without real validation. All cells in the results table are "not run (no dataset locally)".

Results

No accuracy numbers claimed. All infrastructure verified:

  • Tests: 355 new (train 283, nn 97, signal 496)
  • Clippy: zero warnings in new code
  • Smoke: both bins ran successfully on Windows x86-64

Limitations

  1. No MM-Fi/Wi-Pose files downloaded here — no accuracy numbers exist.
  2. Public-dataset accuracy ≠ RuView ESP32 accuracy (different chipsets, antennas, rooms).
  3. 114→56 interpolation loses frequency resolution.
  4. MM-Fi is CC-BY-NC-4.0: no commercial deployment of MM-Fi-trained weights.
  5. x86 int8 numbers do not transfer to edge-SoC int8 latency.

Reproducing

# tests
cargo test -p wifi-densepose-train --no-default-features --lib --tests --bins
cargo test -p wifi-densepose-nn --lib --tests --bins
cargo test -p wifi-densepose-signal --no-default-features

# smoke bins
cargo run -p wifi-densepose-nn --bin cpu-inference-bench -- --profile cpu-micro-fp32 --threads 1

- dataset manifest + split provenance (MM-Fi primary, Wi-Pose template)
- real CSI preprocessing pipeline (fail-closed validation, phase
  sanitization, Hampel denoising, per-pair standardization, 114->56
  subcarrier conversion via existing interpolate_subcarriers)
- prepare_public_dataset bin (validates .npy headers, measures native
  width, writes subject-disjoint split.json + dataset_manifest.json)
- cpu-micro-fp32 / cpu-micro-int8 profiles, ModelMetadata honesty
  separation, InferenceOptions extensions, ONNX intra-op thread wiring
- cpu-inference-bench bin (smoke mode, --compare FP32 vs INT8)
- real_csi_bench criterion bench over synthetic windows
- docs/cpu-inference-real-csi.md (acquisition, licenses, math, splits,
  profiles, bench commands, limitations, ESP32 validation path)
- 355 new tests across train/nn/signal; zero clippy warnings in new
  code; smoke-tested both new bins on Windows x86-64
- no accuracy numbers claimed: no public datasets downloaded, no
  cpu-micro-* weights trained

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant