fix(sleep): select the stager by device family only; remove the V2 toggle - #347
Closed
tanarchytan wants to merge 1 commit into
Closed
fix(sleep): select the stager by device family only; remove the V2 toggle#347tanarchytan wants to merge 1 commit into
tanarchytan wants to merge 1 commit into
Conversation
…ggle V2 is objectively right on 5.0/MG and wrong on WHOOP 4.0 (the ryanbr#319 sparse-motion inflation), so the staging engine is already chosen by device family (ryanbr#327). The per-user "Experimental sleep staging (V2)" toggle was therefore redundant and confusing: a 4.0 owner "enabling V2" changed nothing yet looked broken (issue ryanbr#345). - Remove the toggle end to end: PuffinExperiment.experimentalSleepV2 (+ its key), the Settings UI, and the AppViewModel / WhoopBleClient threading, on both platforms. - sleepStagerV2ForFamily(family) is now the sole selector (family != WHOOP4). Behaviour is unchanged for the default: the flag already defaulted true, so 5.0/MG stays on V2 and 4.0 stays on V1. - Family-gate the self-heal restage too, resolving the healed strap's OWN family (correct for a multi-device 4.0 + 5.0/MG user) - the small follow-up ryanbr#327 noted, so an edited 4.0 night now stays on V1 as well. - Document in-code that unifying 4.0 on a motion-robust V2 needs real 4.0 raw first (ryanbr#271, ryanbr#319); no 4.0+PSG data exists, so 4.0 keeps V1. Android: :app:testFullDebugUnitTest green (family-gate + self-heal tests). Swift twin mirrored byte-identically; the app-target Swift has no CI, so it needs a Mac build to confirm compile.
|
For me on the 4.0 the sleep stages were messed up until I turned on V2. I was getting about 20 to 40 mins of deep and rem for an 8 hour period until I turned on V2 |
ryanbr
added a commit
that referenced
this pull request
Jul 13, 2026
…revert toggle (#351) Reworks #347. #327 hard-gated WHOOP 4.0 to V1 (V2 over-stages on sparse motion, #319) and #347 would have removed the toggle entirely. But a 4.0 user (kavemang, #347) reported the opposite: V1 UNDER-stages badly — ~20-40 min deep+REM for an 8 h night (should be ~150-230) — and V2 fixed it. Neither engine is validated on 4.0, so forcing either is wrong; the honest answer is a sensible default plus an escape. - Drop the #327 family gate: the selector is now just the toggle on both the normal detected-night path and the self-heal restage (already toggle-driven), so V2 is the default for EVERY strap and a user can turn it off to fall back to V1. The toggle defaulted true already, so 5/MG is unchanged; 4.0 flips to V2. - Remove the now-trivial sleepStagerV2ForFamily helper + its family-gate test. - Fix the stale Android toggle comment; the Swift blurb already read correctly. Byte-parity: both platforms resolve useSleepStagerV2 straight from the toggle. Android compile + com.noop.analytics.* tests green; app-target Swift via app-build.
DX23876
pushed a commit
to DX23876/noop
that referenced
this pull request
Jul 22, 2026
…revert toggle (ryanbr#351) Reworks ryanbr#347. ryanbr#327 hard-gated WHOOP 4.0 to V1 (V2 over-stages on sparse motion, ryanbr#319) and ryanbr#347 would have removed the toggle entirely. But a 4.0 user (kavemang, ryanbr#347) reported the opposite: V1 UNDER-stages badly — ~20-40 min deep+REM for an 8 h night (should be ~150-230) — and V2 fixed it. Neither engine is validated on 4.0, so forcing either is wrong; the honest answer is a sensible default plus an escape. - Drop the ryanbr#327 family gate: the selector is now just the toggle on both the normal detected-night path and the self-heal restage (already toggle-driven), so V2 is the default for EVERY strap and a user can turn it off to fall back to V1. The toggle defaulted true already, so 5/MG is unchanged; 4.0 flips to V2. - Remove the now-trivial sleepStagerV2ForFamily helper + its family-gate test. - Fix the stale Android toggle comment; the Swift blurb already read correctly. Byte-parity: both platforms resolve useSleepStagerV2 straight from the toggle. Android compile + com.noop.analytics.* tests green; app-target Swift via app-build.
Merged
9 tasks
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.
What
Removes the per-user "Experimental sleep staging (V2)" toggle and selects the staging engine purely by device family.
V2 is right on 5.0/MG and wrong on WHOOP 4.0 (the #319 sparse-motion inflation, fixed by #327), so the family gate already decided the engine. The toggle only added confusion — a 4.0 owner "enabling V2" changed nothing yet looked broken (issue #345).
Changes
PuffinExperiment.experimentalSleepV2(+ its key), the Settings toggle UI, and theAppViewModel/WhoopBleClientthreading, on both platforms.sleepStagerV2ForFamily(family)is now the sole selector (family != WHOOP4). Behaviour-preserving: the flag already defaultedtrue, so 5.0/MG → V2 and 4.0 → V1 are unchanged.Verification
:app:testFullDebugUnitTestgreen — the family-gateSleepV2FamilyGateTestand the self-healSleepStagerV2Testare updated and passing.IntelligenceEngine/Repository/SettingsView/PuffinExperiment) has no CI, so it needs a Mac build to confirm compile — flagged for a maintainer with Xcode.Completes the #327 self-heal follow-up; addresses the #345 confusion.