Skip to content

DEV-1372: HIL counts an SD logging start from the unit's confirmation too - #144

Merged
JongChern merged 1 commit into
masterfrom
DEV-1372_hil_logging_start_window
Oct 30, 2026
Merged

JongChern merged 1 commit into
masterfrom
DEV-1372_hil_logging_start_window

Conversation

@JongChern

@JongChern JongChern commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The failure

The Android HIL gate on master failed midStreamSet on a Shimmer3 over Classic: about 2.3% of packets lost "away from SD logging start/stop", against a 1% limit.

That loss is the unit's, not the Android API's:

  • After a logging start, the unit pauses its stream while it opens its file. The harness already excuses that pause, as firmware behaviour, when it falls within 1 s of a logging start or stop.
  • It measured the 1 s only from when the start command was sent. The pause comes 0.35-0.71 s after the unit confirms the start, and longest and latest on the first start of a run. In the failing runs, that put its start 1.09-1.17 s after the command, just outside the window, so it was charged to the API.

Times are to the last packet before the pause, from the eight recorded Shimmer3 runs that really logged (three starts each):

Run Command to pause Confirmation to pause Packets
failing, run 1 1167 ms 699 ms 118
failing, run 2 1087 ms 707 ms 122
earlier failure 1004 ms 535 ms 62
the other 21 starts 524-964 ms 349-537 ms 28-80

The change

  • midStreamSet and inStream also mark the moment the unit confirms each logging start, so the 1 s window runs from the confirmation as well as from the command. Nothing else about the attribution changes: same window, same nearest-command rule, and loss near a battery read or anywhere else still fails.
  • The README says so.

Testing

  • Replay: I replayed the harness's attribution, as StreamAnalysis.attribute does it, on the samples and events of the eight recorded Shimmer3 midStreamSet runs that really logged.
    • As the harness is now, it reproduces the three real failures exactly (2.289%, 2.362%, 1.226%).
    • With the confirmation counted, all eight leave 0 packets lost away from the transitions, and none is charged to a battery read.
  • Build: :shimmerHilTest:compileDebugAndroidTestJavaWithJavac and :shimmerHilTest:testDebugUnitTest pass.
  • Hardware, this branch: midStreamSet on the same Shimmer3 over Classic passed. 242 packets went missing, all within the logging windows, and none elsewhere. The first-start pause was 143 packets, starting 0.71 s after the unit confirmed the start and 1.27 s after the command, so the old harness would have failed this run too.

🤖 Generated with Claude Code

… too

midStreamSet failed on a Shimmer3 over Classic with about 2.3% of
packets lost "away from SD logging start/stop". The loss was the unit's
own pause while it opens its file after a logging start. The last
packet before that pause arrives 0.35-0.71 s after the unit confirms
the start, but on the first start that is up to 1.17 s after the
command. The harness measured only from the command, with a 1 s window,
so it charged the pause to the Android API.

midStreamSet and inStream now also mark the moment the unit confirms a
start. Replaying the attribution on the eight recorded Shimmer3 runs
that really logged reproduces the three failures (2.289%, 2.362%,
1.226%), and with the confirmation counted, none of the eight has any
loss left away from the transitions. The README says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JongChern
JongChern merged commit 241aeb5 into master Oct 30, 2026
1 check passed
@JongChern
JongChern deleted the DEV-1372_hil_logging_start_window branch October 30, 2026 06:54
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