Repository navigation
Per-manufacturer audit: which CCR parsers set dc_gasmix_t.usage reliably (follow-up to #1747/#1752) #1801
Description
Summary
#1752 uses dc_gasmix_t.usage (DC_USAGE_OXYGEN/DC_USAGE_DILUENT) to identify diluent
and oxygen-supply cylinders on a sensorless CCR import, falling back to a relative
O2/He ranking only for gases with no reported usage. That change was verified against a
single parser (shearwater_predator_parser.c). Every other CCR-capable parser in the
vendored libdivecomputer fork needs the same verification before the sensorless CCR
role logic can be trusted for them.
What "reliably" means here
For a parser to be trustworthy for #1752's role inference, it needs to, for a CCR dive:
- Set
gasmix->usage = DC_USAGE_DILUENTon every gas mix the diver configured as a
diluent, andDC_USAGE_OXYGENon the oxygen-supply mix, whenever a tank/transmitter
record does not already carrydc_tank_t.usagefor that mix. - Never set
DC_USAGE_DILUENT/DC_USAGE_OXYGENon an open-circuit/bailout gas. - Report
DC_DIVEMODE_CCR(viaDC_FIELD_DIVEMODE) for the dives this applies to, since
feat(dive-computer): rank sensorless CCR bailout gases against each other #1752's bailout ranking only activates on that mode.
A parser that reports CCR dives but never sets diluent/oxygen usage (see McLean Extreme
below) will have every one of its gases -- including the real diluent -- routed through
the bailout ranking instead, silently producing wrong roles.
Known starting point (from grepping the vendored source, not yet dive-tested)
| Parser | Sets DC_USAGE_DILUENT/OXYGEN? |
CCR dive mode reported? | Status |
|---|---|---|---|
shearwater_predator_parser.c |
Yes | Yes | Verified in #1752 |
halcyon_symbios_parser.c |
Yes | Unverified | Needs audit |
divesoft_freedom_parser.c |
Yes | Unverified | Needs audit |
hw_ostc_parser.c |
Yes | Unverified | Needs audit (OSTC has both OC and CCR variants -- check whether usage is set only on the CCR-capable ones) |
suunto_eonsteel_parser.c |
Yes | Unverified | Needs audit (EON Steel Black has a CCR mode) |
mclean_extreme_parser.c |
No -- hardcoded DC_USAGE_NONE |
Yes (DC_DIVEMODE_CCR) |
Known gap: a CCR-only computer whose diluent will be misrouted into the bailout ranking |
| All other parsers | No | Mostly OC-only or gauge | Out of scope unless they turn out to report CCR dives |
Poseidon and rEvo are not supported by libdivecomputer at all (no parser exists for
either brand in this fork), so they are out of scope for this audit regardless of how
common they are among CCR divers.
Proposed approach
- For each parser with CCR dive-mode support (start from the "Sets usage" and "gap"
rows above, then re-scanDC_FIELD_DIVEMODE/DC_DIVEMODE_CCRacrosssrc/in case
a CCR-capable parser was missed), read the source to determine exactly when
gasmix->usageis set toDC_USAGE_DILUENT/DC_USAGE_OXYGEN, and whether that
coverage is unconditional or depends on a tank/transmitter record already being
present (which would make feat(dive-computer): rank sensorless CCR bailout gases against each other #1752's fallback unreachable for the wrong reason, rather
than genuinely correct). - Where real sample data exists (test fixtures under
packages/libdivecomputer_plugin/android/src/androidTest/assets/,
packages/libdivecomputer_plugin/test/native/, or a diver-contributed download),
confirm the finding against an actual parsed dive rather than source reading alone. - Record the result per parser (reliable / unreliable / needs a fix) in a table, similar
to the one above but verified. - For McLean Extreme specifically: decide whether to patch the parser (in
submersion-app/libdivecomputer) to setDC_USAGE_DILUENT/OXYGENthe way Shearwater
does, or to special-case it in_inferSensorlessRolessome other way. - For any other parser found unreliable: same decision -- patch the fork, or exclude it
from the CCR-specific ranking (i.e. keep it on the original single-threshold heuristic)
until it can be fixed.
Out of scope
- Poseidon, rEvo, and any other brand
libdivecomputerdoes not parse at all. - Re-litigating the Sensorless import: derive CCR bailout gas roles relative to each other (bottom/deco/stage) instead of a fixed O2 threshold #1747/feat(dive-computer): rank sensorless CCR bailout gases against each other #1752 role rules themselves (bailout/deco/stage thresholds) --
this issue is about which computers the existing rules can trust, not about changing
the rules. - SCR-specific role logic, tracked separately (mentioned as an open question in Sensorless import: derive CCR bailout gas roles relative to each other (bottom/deco/stage) instead of a fixed O2 threshold #1747).
References
- Sensorless import: derive CCR bailout gas roles relative to each other (bottom/deco/stage) instead of a fixed O2 threshold #1747 (closed) -- original design discussion, including this audit as a noted gap.
- feat(dive-computer): rank sensorless CCR bailout gases against each other #1752 (merged) -- the sensorless CCR role logic this audit verifies coverage for.
lib/features/dive_computer/data/services/parsed_tank_resolver.dart--
_inferSensorlessRoles(), the function whose correctness depends on this.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity