Repository navigation
drift/05: rollingRmssd aligned — (t−w,t], per-window cleaning, no rematching - #25
Merged
Merged
Conversation
…ing (#17) The differential pilot (#24) reported three real divergences in rollingRmssd; this aligns them to one convention per divergence: - window boundary: (t - windowSec, ts] on both sides — Swift's left edge moves from > to >= (adopting the Kotlin semantics); - artifact cleaning: locally per window on both sides — Kotlin's global pre-cleaning of the whole series is removed (adopting the Swift semantics: artifact rejection belongs to the window's own local statistics); - Kotlin's value-based timestamp rematching is removed entirely — cleaning the window's raw samples directly makes it structurally unnecessary (it was the source of the extra emitted point). BEHAVIOR CHANGE, both platforms: rolling-RMSSD timeline values can shift slightly; points near the window edge or the min-beats bar can appear or disappear. In the pilot, Swift lost two 10 ms points at the window boundary; Android lost spurious extra points (117.48 ms, 141.42 ms). The nightly, non-rolling HRV computation is untouched. Proven through the harness: pilot 14 cases / 3 diffs before, 0 after; reverting the Swift boundary fix alone makes it red again (1 diff), re-applying returns it to green. No existing test pinned the old special-case values, so no test numbers were adjusted. Full suites: Swift 1429 / 2 skipped / 0 failures; Android 3977 / 0 / 6. Part of the drift-control plan in #17 (step 5). Fixes the #9 class. Co-Authored-By: Codex <noreply@openai.com> 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.
Plan step 5 of #17: the three
rollingRmssddivergences the differential pilot (#24) reported as machine diffs, aligned to one convention each. Deliberate behavior change on both platforms.The conventions
[t−w,t]vs(t−w,t](t−w,t](the plan's proposal)>→>=at the left edge)Proof through the harness (red → green → red-on-revert)
SUMMARY cases=14 diffs=3(measured independently by builder and by the integrating process).SUMMARY cases=14 diffs=0— verified end-to-end with the real Gradle Kotlin runner.diffs=1(exactlyrmssd_window_boundary); re-applying → 0.Behavior change
Rolling-RMSSD timeline values can shift slightly; points near the window edge or the min-beats bar can appear or disappear. In the pilot, Swift lost two 10 ms points at the window boundary; Android lost spurious extra points (117.48 ms, 141.42 ms — the rematching artifact). The nightly, non-rolling HRV computation is untouched.
No existing test pinned the old special-case values (verified deliberately — no test numbers were "dragged along" to match the new behavior). Full suites: Swift 1429 / 2 skipped / 0 failures; Android 3977 / 0 failed / 6 skipped.
Review
Codex review (read-only, independent): green, zero findings — line-by-line value-equality of the two rewritten implementations confirmed (window inclusion, tie-breaks, thinning stride, min-beats counting, rounding, emission order), edge samples at both window edges behave identically, no orphaned helpers left in Kotlin, production callsites degrade cleanly, doc comments mirror-equal.
Part of the drift-control plan in #17. Fixes the #9 class.
🤖 Generated with Claude Code