Desk instruments: healthy-frame RF window (RS-11.6) + tile-age telemetry closes RS-6.1 - #95
Merged
Merged
Conversation
…telemetry (RS-6.1)
Two desk-work items ahead of the antenna swap:
- image_rx_daemon: windowed HEALTHY-population RSSI/SNR, summarized in
the 10 s stats block as "rx_rf: n rssi[min/med/max] snr[min/med/max]"
and reset per window. Until now only corrupt packets carried visible
RF numbers (crc_dump) — the good-frame SNR margin was unmeasurable,
flagged as the missing instrument in the RS-11.5 closure. Tomorrow's
antenna legs get both distributions.
- web_ui: RS-6.1 aggregate tile-age telemetry on
lifetrac/v25/status/tile_age every stale-scan tick: {n_tiles, missing,
p50/p95/max age, stale count}. Audit found the rest of RS-6.1 had
landed with F10 (per-tile age_ms on /ws/state; diag-gated
staleness_overlay.js renders it) — this adds the archivable aggregate
the K-phase exit tests score against; published even when quiet since
a healthy link's p95 age IS the sweep-rotation measurement.
9 new tests (RF window semantics; age summary percentiles, missing-tile
accounting, pre-keyframe None). Suite 1109/2446.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds host-side instrumentation to better quantify RF link quality during healthy frame reception and to make per-tile staleness telemetry archivable for K-phase exit scoring.
Changes:
- Accumulate per-fragment RSSI/SNR for healthy RX frames and log min/median/max each 10s stats window.
- Publish an aggregate per-tile age summary (
lifetrac/v25/status/tile_age) every stale-scan tick, including percentiles and missing-tile accounting. - Add unit tests covering RF window accumulation/None-handling and tile-age summary behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| LifeTrac-v25/DESIGN-CONTROLLER/TODO.md | Marks RS-6.1 as completed and documents the end-to-end staleness visibility + new aggregate metric. |
| LifeTrac-v25/DESIGN-CONTROLLER/base_station/web_ui.py | Adds MQTT-published aggregate tile-age telemetry and a pure summarizer helper. |
| LifeTrac-v25/DESIGN-CONTROLLER/base_station/tests/test_tile_stale.py | Adds tests validating tile-age summary percentiles, missing-tile handling, and pre-keyframe behavior. |
| LifeTrac-v25/DESIGN-CONTROLLER/base_station/tests/test_rx_rf_stats.py | Adds tests for healthy-frame RF window accumulation and None-handling. |
| LifeTrac-v25/DESIGN-CONTROLLER/base_station/image_rx_daemon.py | Records healthy-frame RF samples and emits windowed RF distribution logs in the stats worker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1609
to
+1620
| rf_rssi = getattr(self, "_rf_rssi", None) | ||
| if rf_rssi: | ||
| rf_snr = self._rf_snr | ||
| r = sorted(rf_rssi) | ||
| s = sorted(rf_snr) if rf_snr else [0.0] | ||
| LOG.info( | ||
| "rx_rf: n=%d rssi[min/med/max]=%d/%d/%d " | ||
| "snr[min/med/max]=%.1f/%.1f/%.1f", | ||
| len(r), r[0], r[len(r) // 2], r[-1], | ||
| s[0], s[len(s) // 2], s[-1]) | ||
| self._rf_rssi = [] | ||
| self._rf_snr = [] |
…samples Copilot's catch, valid on both points: an SNR-only window (pre-F8 frames can yield None on either axis independently) never triggered the summary — so _rf_snr grew unbounded across windows — and an RSSI-only window logged a fabricated 0.0 SNR from the placeholder. The stats block now gates on EITHER list, reports per-axis counts, formats a missing axis as "None", and always resets both. New test pins the single-axis accumulation. Suite 1110/2446. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two host-side items done at the desk ahead of tomorrow's antenna swap — no bench time used, and the first one directly instruments the swap session.
Healthy-frame RSSI/SNR window (the RS-11.5 closure's missing instrument)
image_rx_daemonnow accumulates per-fragment RSSI/SNR from every good RX_FRAME and logs a windowed summary in the 10 s stats block:Until now only corrupt packets carried visible RF numbers (via
crc_dump), so the healthy population's SNR margin was unmeasurable — exactly the gap flagged in the RS-11.5 close-out. Tomorrow's antenna re-baseline (RS-11.6) gets both distributions from the same run.RS-6.1 closed: per-tile staleness visible end to end
The audit found most of RS-6.1 had already landed with F10: per-tile
age_msrides/ws/stateto the operator browser (server-authoritative, per IMAGE_PIPELINE §6.1), and the diag-gatedstaleness_overlay.jsrenders the age veil. The genuinely missing piece was the archivable aggregate for K-phase exit scoring, now published every stale-scan tick onlifetrac/v25/status/tile_age:{"ts_ms":…,"n_tiles":96,"missing":0,"p50_ms":4900,"p95_ms":9200,"max_ms":9600,"stale":0,"stale_after_ms":30000}Published even when nothing is stale — a healthy link's p95 age is the sweep-rotation measurement the K1/K2 exit tests need. Residual noted in the TODO: the overlay's 1 s/5 s thresholds predate the sweep-rotation insight; tune when K1 sets a real staleness SLA.
Tests
9 new (RF-window accumulation/None-handling via the established stub-binding pattern; age-summary percentiles, missing-tile accounting, pre-keyframe None). Full suite: 1109 passed / 2446 subtests.
🤖 Generated with Claude Code