Page 1 of 1

Decompression model source code and verification/checking

Posted: Sunday 11. September 2016, 13:33
by aquarat
Good day

I have an OSTC Sport, which I am very happy with. Someone recently asked me how certain I was whether or not the decompression model implementation on the OSTC Sport is accurate and I couldn't answer.

So I was wondering, has the decompression code for the Sport ever been checked by a third party ?
Also, is the Sport's decompression model code close/identical to either of these files :
p2_deco.c (OSTC2)
or
p2_deco.c (hwOS)

Thank you

Re: Decompression model source code and verification/checking

Posted: Monday 12. September 2016, 10:22
by aquarat
In your hwos_code repository you have automated tests for gas volume consumption in "Tests", do you have tests for your deco model ?

Re: Decompression model source code and verification/checking

Posted: Wednesday 28. September 2016, 12:53
by aquarat
I would have expected that these kinds of queries would have been welcomed by HeinrichsWeikamp. They're not difficult questions to answer; "yes, yes, no" or "You need to buy an OSTC 2/3/4 to ask these kinds of questions".

I'm currently trying to simulate the decompression model (p2_deco.c) on an x86_64 machine using gcc on Linux. The only odd thing I haven't yet worked out is
[pre]
(from simulator.asm: line 117/deco_setup)
movlw LOW(.1000)
movwf int_I_pres_surface+0
movwf int_I_pres_respiration+0
movlw HIGH(.1000)
movwf int_I_pres_surface+1
movwf int_I_pres_respiration+1
[/pre]
which seems to imply int_I_pres_surface is a 16-bit float.

I'm surprised that you don't have automated tests for your decompression model code (especially when you do have tests for code which is arguably less important).

All that said, my OSTC Sport, with GF set to 30/70 roughly matches a Suunto D4i with +1 conservatism, at least on the first dive.

Thank you and apologies for being difficult.

Re: Decompression model source code and verification/checking

Posted: Wednesday 28. September 2016, 15:44
by heinrichsweikamp
Hi,

We've tested this code intensively, mostly in real life (I did ~1000 dives with this code personally + millions of dives of the 20000+ OSTC users) but also using a simulator. We haven't found a bug for a while now in this part of the firmware so I'm quite confident that it's fine for the ranges we build the computer for (120m, 40h max. dive time).

But, honestly, no complex code (Deco code is ~ 2000 lines of C) is bug free. If you find something: Let us know!

regards,
matthias

Re: Decompression model source code and verification/checking

Posted: Wednesday 28. September 2016, 18:28
by aquarat
Thank you very much Matthias --- once I figure out what the inputs (int_I_pres_surface) are I'll be able to compare it to other decompression implementations :P .

Re: Decompression model source code and verification/checking

Posted: Thursday 29. September 2016, 11:03
by heinrichsweikamp
Hi,

It's the surface pressure in mbar.

regards,
Matthias