Skip to content

repin analytics for the stager pass - #269

Merged
abdulsaheel merged 1 commit into
mainfrom
chore/repin-analytics-perf
Aug 20, 2026
Merged

repin analytics for the stager pass#269
abdulsaheel merged 1 commit into
mainfrom
chore/repin-analytics-perf

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

User description

analytics#49 merged, so edge was still pinned a commit behind and not getting the stager work.

kAlgoVersion holds 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 analytics sibling package in pubspec.yaml to a new commit SHA (d9362a66...).

  • Improves sleep stager performance with faster derivation times.

  • Explicit callout: kAlgoVersion was 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

flowchart LR
  A["pubspec.yaml"] -- "updates analytics ref" --> B["New Commit SHA"]
  C["derivation_engine.dart"] -- "updates kAnalyticsPin" --> B
Loading

File Walkthrough

Relevant files
Configuration changes
derivation_engine.dart
Update analytics pin constant and documentation                   

lib/compute/derivation_engine.dart

  • Updates the kAnalyticsPin constant to match the new analytics commit
    SHA.
  • Adds documentation explaining that kAlgoVersion is intentionally held
    at 76 because the stager arithmetic changes do not alter the final
    output.
+8/-1     
Dependencies
pubspec.yaml
Repin analytics dependency                                                             

pubspec.yaml

  • Updates the analytics dependency ref to
    d9362a66fbeac326d5d7d7b1fe27b28e41169a79.
+1/-1     

algo stays 76 — the stager does the same arithmetic in fewer passes and the
real night stages identically.
@abdulsaheel
abdulsaheel merged commit cb0aa63 into main Aug 20, 2026
1 of 2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant