Repository navigation
doc(oura): correct §6.5 SpO2 overshoot stats - measured on collision-lossy data - #1465
Merged
Merged
Conversation
…lossy data The ~51%/no-reconciliation numbers were from the pre-ryanbr#1070 corpus, where 12 of every 13 samples were dropped non-randomly (survivor always the record's first value). Re-measured on three clean post-fix nights (95-97% of 1Hz, n=93,700): 20.4% over 100, and offset -0.32 + clamp[85,100] nearly reproduces Cloud truth (median exact). Also adds a first same-night paired comparison against the same wearer's WHOOP export, which lands on the same correction independently (MAE 0.49 vs 0.50) - still not enough to ship (n=3 nights), but the doc's prior "no correction reconciles it" framing no longer holds as stated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KZe4bEwsx5FpRtKCpXD1F3
DX23876
added a commit
to DX23876/noop
that referenced
this pull request
Aug 20, 2026
An upstream sync adds every upstream commit to the job's base..head range, and four of them carry AI co-author trailers (ryanbr#869, ryanbr#1465, ryanbr#1467, ryanbr#1390 — all by third-party contributors). The job therefore failed on the v10.5.0 merge for messages that are not this fork's to rewrite: clearing them would change their shas, drop their signatures and destroy the ancestry the next sync merges against. Skip any commit whose author email is not the fork identity, which is the scope the job's own comment already claimed ("inherited from upstream, where they are ryanbr's to keep"). A commit authored as DX23876 is audited exactly as before — verified on the v10.5.0 merge range: 129 upstream commits skipped, the merge commit audited clean, and the same range still fails when the filter is pointed at one of the flagged authors.
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 this fixes
OURA_PROTOCOL.md§6.5 states the decoded0x6FSpO2 stream reads ~51% of samples over 100%, andthat no offset/clamp pair reconciles it against Oura Cloud ground truth ("choosing an offset would
fabricate a calibration"). That corpus (9,076 records / 117,816 samples, 2026-07-30→08-02) was measured
before the #1070 fix landed — at the time,
spo2Sample's primary key(deviceId, ts)collided on12 of every 13 samples per record, and the survivor was always the record's first value, not a
random subsample. The stats in §6.5 are a real measurement, but of a non-randomly-selected 7.7% of the
true stream, not the stream itself.
What the correction adds
Two new subsections, §6.5.0.1 and §6.5.0.2, using a real capture from one wearer's own staging DB
(
oura-2H3B2405003655) that happens to straddle the #1070 fix:(n=93,700). Overshoot rate is 20.4%, not ~51%. Re-fitting the offset-to-Cloud-truth on this clean
data narrows the mean/median disagreement from a ~2pt gap to 0.45pt, and
offset −0.32 + clamp[85,100]reproduces the Cloud reference almost exactly (mean 97.64 vs 97.59 target, median exactmatch). Also notes an unrelated, not-yet-root-caused contamination: ~10% of this device's all-time
spo2Samplerows carry values in the0x77DC-channel's documented magnitude range (up to+11.7M), which the
unit=="raw"guard is supposed to exclude — none of it falls inside the three cleannights, but it's flagged for a follow-up check.
(
physiological_cycles.csv, cycle-start times within ~2 min of the three Oura sessions). The§6.5.0.1 offset (fit to the unrelated 922-night Cloud aggregate) scores MAE 0.49 against this
real paired WHOOP truth — matching a same-night best-fit offset (MAE 0.50) fit directly to these 3
WHOOP nights. Two corrections from non-overlapping references converge on the same accuracy.
What this does NOT change
The doc's conclusion is still do not ship a correction — n=3 nights, the fit is still to an
aggregate/short paired sample rather than a validated multi-night calibration, and the documented
7.6–52% night-to-night swing in overshoot rate means a flat offset has a real accuracy floor even in the
best case (±0.6–0.75pt per-night residuals on the same-night best fit). This PR only corrects the
evidence the "no correction reconciles it" claim rested on — it does not promote SpO2 to
spo2Pctortouch any code path.
Verification
Doc-only change. No
swift test/ Gradle impact. The underlying numbers are reproducible fromworklog/BOARD.md's 2026-08-19 evening entries (not part of this PR — private repo) against the samedevice's
spo2Sample/sleepSessiontables and the wearer's own WHOOP CSV export.