suunto_nautic: begin pressure = max reading (ignore transmitter dropout) - #3
Merged
Merged
Conversation
A cylinder only loses pressure during a dive, so the highest reading is the true start pressure. The parser was seeding begin from the FIRST observed reading, which on a dual-transmitter dive can be a pre-pairing dropout: a transmitter that hasn't linked yet reports a spurious low value (~9 bar) for the first minutes, then jumps to the real ~200 bar. That produced a nonsensical tank that gained pressure over the dive (9 -> 109 bar). Take the max over all readings for begin pressure instead. Validated on nandodiver's Air+Air dual-transmitter dives (issue #29/#34): the dropped transmitter's begin now recovers from 9 bar to the real 207 bar; end pressures and the other transmitter are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012VH1Magk9E9nWusjYQd4oe
This was referenced Sep 6, 2026
oyarzun
pushed a commit
to oyarzun/libdc-swift
that referenced
this pull request
Sep 12, 2026
Bump libdivecomputer to the begin-pressure fix (deepsealabs/libdivecomputer#3): a dual-transmitter dive where one transmitter hasn't paired yet reports a spurious ~9 bar for the first minutes; begin pressure now takes the max reading so it recovers to the real ~207 bar instead of showing a tank that gains pressure. Tests: the corpus cross-check now derives the expected begin as the max of each app pressure curve (matching the parser) and uses a looser begin tolerance (3 bar, vs 1.5 for end) to absorb raw-vs-app noise while still catching a dropout-latched begin. Added nandodiver's two Air+Air dual-transmitter captures (1788683271/272) to the hard-asserted set. Validates deepsealabs#34 for the transmitter-dropout case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012VH1Magk9E9nWusjYQd4oe
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.
On a dual-transmitter dive, a transmitter that hasn't paired yet reports a spurious low pressure (~9 bar) for the first minutes, then jumps to the real ~200 bar. The parser seeded begin pressure from the FIRST reading, so that tank showed a nonsensical 9 → 109 bar (a cylinder gaining pressure over the dive).
Fix: begin pressure = the highest reading seen. A cylinder only loses pressure during a dive, so the max is the true start, and an initial dropout is ignored.
Validated on @nandodiver's Air+Air dual-transmitter captures (deepsealabs/libdc-swift#29): the dropped transmitter's begin recovers from 9 bar to 207 bar; end pressures and the other transmitter are unchanged.
🤖 Generated with Claude Code