Skip to content

docs(0011): record the wall-clocked hardware run — the board question… - #159

Merged
TheAngryRaven merged 1 commit into
BETAfrom
claude/5v-profiling-beta-branch-8jmgzr
Aug 26, 2026
Merged

TheAngryRaven merged 1 commit into
BETAfrom
claude/5v-profiling-beta-branch-8jmgzr

Conversation

@TheAngryRaven

Copy link
Copy Markdown
Owner

… is answered

9134 Hz, 96 us mean, 37 ms worst iteration, SLP 12.0, with a GPS lock, logging and the camera recording.

The instrument validates itself: 9134 Hz x 96 us = 87.7% of the second inside loop(), and SLP — computed by a different route — reads 12.0%. All fourteen slots sum to ~99.8.

SLP 12% also settles what the previous build could not distinguish: the CPU is not sleeping through the second, so the loop genuinely runs at ~9 kHz and the old pegged rate was the display clamp rather than the timebase bug. There was no way to know that until the window was wall-clocked.

Headroom, against the binding constraint (one iteration per 40 ms PVT frame): ~420x on the mean, 43x on the worst iteration against the 4 KB GPS ring, 108x against the watchdog. Nothing here justifies an nRF5340 on throughput, and SLP 12% caps what leaving the Arduino core could reclaim.

Also records where the 88% goes — it is polling, not work. GPS is called 9134 times a second to service a 25 Hz stream; DSP renders 3 times and early-returns ~9000; BTN is six digitalReads per iteration with nobody touching a button. Rate-limiting the polls would reclaim most of it without changing silicon.

Claude-Session: https://claude.ai/code/session_01CqENxo91S1VL3sM9PTWMf1

Summary

Type of change

  • Bug fix (no user-visible behavior change beyond the fix)
  • New feature / behavior
  • Refactor (no behavior change)
  • Tests only
  • CI / tooling / docs
  • Breaking change (track files, log format, BLE protocol, or a removed mode)

How it was verified

  • Host unit tests pass (ctest --test-dir tests/build)
  • clang-tidy clean
  • Compiles for the XIAO nRF52840 Sense
  • Tested on real hardware — describe what you exercised:

Checklist

  • CHANGELOG.md updated under [Unreleased] (if user-visible)
  • ARCHITECTURE.md / CLAUDE.md updated (if a module or interface changed)
  • New testable logic has a matching test in tests/
  • Branch is focused — refactors / behavior / tests are not mixed together

Related issues

… is answered

9134 Hz, 96 us mean, 37 ms worst iteration, SLP 12.0, with a GPS lock,
logging and the camera recording.

The instrument validates itself: 9134 Hz x 96 us = 87.7% of the second
inside loop(), and SLP — computed by a different route — reads 12.0%.
All fourteen slots sum to ~99.8.

SLP 12% also settles what the previous build could not distinguish: the
CPU is not sleeping through the second, so the loop genuinely runs at
~9 kHz and the old pegged rate was the display clamp rather than the
timebase bug. There was no way to know that until the window was
wall-clocked.

Headroom, against the binding constraint (one iteration per 40 ms PVT
frame): ~420x on the mean, 43x on the worst iteration against the 4 KB
GPS ring, 108x against the watchdog. Nothing here justifies an nRF5340
on throughput, and SLP 12% caps what leaving the Arduino core could
reclaim.

Also records where the 88% goes — it is polling, not work. GPS is called
9134 times a second to service a 25 Hz stream; DSP renders 3 times and
early-returns ~9000; BTN is six digitalReads per iteration with nobody
touching a button. Rate-limiting the polls would reclaim most of it
without changing silicon.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CqENxo91S1VL3sM9PTWMf1
@github-actions

Copy link
Copy Markdown

Coverage — host-testable units

📂 Overall coverage

Metric Coverage
Lines 🟢 1854/1881 (98.6%)
Functions 🟢 197/197 (100.0%)
Branches 🟢 1372/1516 (90.5%)

📄 File coverage

File Lines Functions Branches
BirdsEye/ble_stream.cpp 🟢 34/34 (100.0%) 🟢 8/8 (100.0%) 🟡 17/20 (85.0%)
BirdsEye/camera_fsm.cpp 🟢 238/246 (96.7%) 🟢 20/20 (100.0%) 🟡 142/160 (88.8%)
BirdsEye/course_creator.cpp 🟢 213/221 (96.4%) 🟢 21/21 (100.0%) 🟡 119/136 (87.5%)
BirdsEye/course_prune.cpp 🟢 37/37 (100.0%) 🟢 5/5 (100.0%) 🟢 47/50 (94.0%)
BirdsEye/crc32.cpp 🟢 30/30 (100.0%) 🟢 4/4 (100.0%) 🟢 24/24 (100.0%)
BirdsEye/crossing_pattern.cpp 🟢 15/15 (100.0%) 🟢 1/1 (100.0%) 🟢 12/12 (100.0%)
BirdsEye/dovex_header.cpp 🟢 106/107 (99.1%) 🟢 7/7 (100.0%) 🔴 62/88 (70.5%)
BirdsEye/filename_validator.cpp 🟢 14/14 (100.0%) 🟢 1/1 (100.0%) 🟢 30/30 (100.0%)
BirdsEye/gps_stats.cpp 🟢 25/25 (100.0%) 🟢 3/3 (100.0%) 🟢 8/8 (100.0%)
BirdsEye/gps_status_page.cpp 🟢 29/29 (100.0%) 🟢 4/4 (100.0%) 🟢 28/28 (100.0%)
BirdsEye/gps_time.cpp 🟢 45/45 (100.0%) 🟢 6/6 (100.0%) 🟢 30/32 (93.8%)
BirdsEye/gps_validation.cpp 🟢 24/24 (100.0%) 🟢 2/2 (100.0%) 🟢 66/66 (100.0%)
BirdsEye/haversine.cpp 🟢 8/8 (100.0%) 🟢 1/1 (100.0%) ⚫ 0/0 (0.0%)
BirdsEye/idle_policy.cpp 🟢 17/17 (100.0%) 🟢 2/2 (100.0%) 🟢 14/14 (100.0%)
BirdsEye/insta360_protocol.cpp 🟢 140/140 (100.0%) 🟢 16/16 (100.0%) 🟡 86/98 (87.8%)
BirdsEye/lap_format.cpp 🟢 18/18 (100.0%) 🟢 1/1 (100.0%) 🟢 9/9 (100.0%)
BirdsEye/led_animations.cpp 🟢 84/84 (100.0%) 🟢 7/7 (100.0%) 🟢 43/46 (93.5%)
BirdsEye/led_frame.cpp 🟢 21/21 (100.0%) 🟢 7/7 (100.0%) 🟢 6/6 (100.0%)
BirdsEye/led_modes.cpp 🟢 67/68 (98.5%) 🟢 6/6 (100.0%) 🟢 50/52 (96.2%)
BirdsEye/led_status.cpp 🟢 106/108 (98.1%) 🟢 11/11 (100.0%) 🟢 71/75 (94.7%)
BirdsEye/local_time.cpp 🟢 48/48 (100.0%) 🟢 6/6 (100.0%) 🟢 46/50 (92.0%)
BirdsEye/loop_profile.cpp 🟢 65/65 (100.0%) 🟢 7/7 (100.0%) 🟢 35/36 (97.2%)
BirdsEye/sat_bars.cpp 🟢 33/33 (100.0%) 🟢 2/2 (100.0%) 🟢 51/54 (94.4%)
BirdsEye/sd_access_policy.cpp 🟢 9/9 (100.0%) 🟢 3/3 (100.0%) 🟢 18/18 (100.0%)
BirdsEye/sd_format_page.cpp 🟢 25/25 (100.0%) 🟢 3/3 (100.0%) 🟢 25/26 (96.2%)
BirdsEye/sector_purple.cpp 🟢 84/85 (98.8%) 🟢 3/3 (100.0%) 🟡 57/64 (89.1%)
BirdsEye/sensoregg_protocol.cpp 🟢 44/45 (97.8%) 🟢 7/7 (100.0%) 🟢 33/34 (97.1%)
BirdsEye/setting_parse.cpp 🟢 29/30 (96.7%) 🟢 2/2 (100.0%) 🟢 38/42 (90.5%)
BirdsEye/sprint_select.cpp 🟢 25/25 (100.0%) 🟢 4/4 (100.0%) 🟢 46/48 (95.8%)
BirdsEye/tach_filter.cpp 🟢 91/91 (100.0%) 🟢 13/13 (100.0%) 🟡 72/82 (87.8%)
BirdsEye/track_json.cpp 🟢 116/120 (96.7%) 🟢 12/12 (100.0%) 🟡 67/88 (76.1%)
BirdsEye/wake_cause.cpp 🟢 14/14 (100.0%) 🟢 2/2 (100.0%) 🟢 20/20 (100.0%)

@TheAngryRaven
TheAngryRaven merged commit fcd2556 into BETA Aug 26, 2026
9 checks passed
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