Skip to content

Move day-cycle heart-rate processing off the main actor - #2804

Open
AlexSchmidt1999 wants to merge 1 commit into
ryanbr:mainfrom
AlexSchmidt1999:codex/upstream-day-cycle-performance-oct16
Open

AlexSchmidt1999 wants to merge 1 commit into
ryanbr:mainfrom
AlexSchmidt1999:codex/upstream-day-cycle-performance-oct16

Conversation

@AlexSchmidt1999

@AlexSchmidt1999 AlexSchmidt1999 commented Oct 16, 2026 •

Copy link
Copy Markdown

A foreground rescore can merge and sort a full day of heart-rate samples and calculate cycle Effort and calories on the main actor. The existing cache-miss read-and-score block now runs in a utility-priority detached task. Cache access and the result merge stay on the main actor.

The implementation matches the owner's installed 12.1 build. Owner precedence, inclusive read limits, timestamp deduplication, formulas and stored values stay the same. Android calculations are unchanged because this moves existing Apple work between executors.

The integration test uses 80,000 primary HR samples, conflicting timestamps from a second owner and out-of-range points. Effort and calorie bit patterns match the values recorded before the scheduling change for both effort methods and both sex-specific calorie paths. The test also checks cache reuse and invalidation after a new sample.

The iPhone timing report contains the anonymized measurements from the combined build.

Installed-source update, October 16

The read-and-score block and its bit-pattern integration fixture match the installed build.

Review head: 73e8272945f2. A local merge of the PRs reproduces the installed iPhone commit f88a1e12: 1,182 of 1,183 Apple product files are byte-identical; the remaining file uses the existing NoopMetrics.space3 token for the same 12-point spacing. The combined macOS build and iPhone Release build pass, including widgets and Watch components. The macOS run completes 2,352 app tests with three skipped and zero failures.

@AlexSchmidt1999

Copy link
Copy Markdown
Author

I am using NOOP 12.1.0 Release build 456 on my iPhone 17 Pro Max, and the app runs very smoothly in everyday use.

This PR is included in that combined build, together with my other Apple changes and the performance fixes from #2724 by @UtkuDenizAltiok and #2705 by @kavemang. The installed source is d67cceb5.

Both Apple builds and the local app, analytics, database and Python test suites passed for this combined build.

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.

2 participants