repin analytics for the stager pass - #269
Merged
Merged
Conversation
algo stays 76 — the stager does the same arithmetic in fewer passes and the real night stages identically.
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Contributor
PR Code Suggestions ✨No code suggestions found for the PR. |
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.
User description
analytics#49 merged, so edge was still pinned a commit behind and not getting the stager work.
kAlgoVersionholds at 76. the stager does the same arithmetic in fewer passes — one beat-gather instead of three hand-copies, the local HR window sorted once instead of twice, and a binary search instead of rescanning the night per epoch. ~950ms → ~805ms on a full real night.the one place that could have silently changed a number was sorting the HR window before
stddev, since that re-orders a float summation and feeds the wake threshold. computed before the sort now, and the real overnight capture stages identically: epochs=1068 wake=52 rem=300 nrem=716 deep=137 light=579 conf=0.5501404494382023.goldens fail in CI as always (
test/goldens/gitignored); everything else green.PR Type
Enhancement, Other
Description
Repins the
analyticssibling package inpubspec.yamlto a new commit SHA (d9362a66...).Improves sleep stager performance with faster derivation times.
Explicit callout:
kAlgoVersionwas NOT bumped (remains at 76) because the analytics output and data effects remain identical.Note: No new tests were added under
test/(expected, as user-visible behavior and output are unchanged).Diagram Walkthrough
File Walkthrough
derivation_engine.dart
Update analytics pin constant and documentationlib/compute/derivation_engine.dart
kAnalyticsPinconstant to match the newanalyticscommitSHA.
kAlgoVersionis intentionally heldat 76 because the stager arithmetic changes do not alter the final
output.
pubspec.yaml
Repin analytics dependencypubspec.yaml
analyticsdependencyreftod9362a66fbeac326d5d7d7b1fe27b28e41169a79.