From 898a2d7d9f0a66a68e3c86ce462ce6a4eb4155ac Mon Sep 17 00:00:00 2001 From: ruv Date: Sat, 23 May 2026 13:43:49 -0400 Subject: [PATCH] feat(adr-110): wire observe_csi_frame_arrival into CSI receive path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Iter 19 — without this call, iter 18's EMA fps tracking was dead code because csi_fps_samples stayed 0 forever and mesh_aligned_us_for_csi_frame always fell back to the 20 Hz constant. In udp_receiver_task's parse_esp32_frame branch, replace the bare last_frame_time assignment with NodeState::observe_csi_frame_arrival, which computes dt vs last_frame_time, feeds update_csi_fps_ema (α=1/8), bumps csi_fps_samples, and sets last_frame_time as a side effect (same value the bare assignment did). Effect: after ~5 CSI frames arrive from any node, mesh_aligned_us_for_csi_frame returns interpolated timestamps using the node's actually-observed frame rate instead of the 20 Hz default. Real bench rate was ~10 fps, so this halves the per-frame timestamp error in §A0.12-style multistatic alignment. cargo check -p wifi-densepose-sensing-server --no-default-features → green. Co-Authored-By: claude-flow --- v2/crates/wifi-densepose-sensing-server/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/v2/crates/wifi-densepose-sensing-server/src/main.rs b/v2/crates/wifi-densepose-sensing-server/src/main.rs index d0c4adab..ec8e23e6 100644 --- a/v2/crates/wifi-densepose-sensing-server/src/main.rs +++ b/v2/crates/wifi-densepose-sensing-server/src/main.rs @@ -4370,7 +4370,10 @@ async fn udp_receiver_task(state: SharedState, udp_port: u16) { let adaptive_model_clone = s.adaptive_model.clone(); let ns = s.node_states.entry(node_id).or_insert_with(NodeState::new); - ns.last_frame_time = Some(std::time::Instant::now()); + // ADR-110 iter 19 — feed the per-node fps EMA from real + // CSI arrivals. The helper sets `last_frame_time` as a + // side effect, so the previous bare assignment is gone. + ns.observe_csi_frame_arrival(std::time::Instant::now()); // ADR-084 Pass 3: cluster-Pi novelty sensor. // Score this frame's feature vector against the per-node