[RFC PATCH] Make fake profile average depth come out right

Dirk Hohndel dirk at hohndel.org
Sat Nov 2 07:27:57 UTC 2013


On Tue, 2013-10-15 at 11:36 -0700, Linus Torvalds wrote:
> 
> Ok, so this is very much a request-for-discussion rather than meant to 
> actually be applied, because it doesn't really cover all cases. If we need 
> to generate a profile for some fairly insane cases, the stupid thing just 
> gives up rather than try to search for a solution that satisfies the 
> constraints. 

No one responded. That could mean that your code is perfect, or that
people were completely disinterested in this, or they were too afraid
that you'd rip off their heads :-)

> For example, if you have a maxdepth=10m and an average depth of 9.9m, it 
> will try two different (roughly sane) dive profiles, fail to get anything 
> that matches that kind of dive and that average depth, and then just say 
> "screw it, I'll match an insane profile instead" and basically generate a 
> rectangular dive.
> 
> It does seem to handle the few cases I tried. 
> 
> Comments? Somebody should double-check my math, and I think we might want 
> to make the "default profiles" a bit saner. Right now the preferred 
> default profile simply says "ascent/descent rate of 5m/min, with two 
> levels at max_depth and 1/3rd maxdepth". 

For REASONABLE input data it seems to do the right thing. The fact that
you can make it break is much more a sign of having given completely
bogus input data...

> That profile might not work for the simple reason that maybe we did a 
> quick dive to 40m, but then came up and spent a lot of time in shallower 
> waters, so our average depth was just 10m or so. Obviously we can *not* 
> make a dive that has the two depths 40m and 13m come out to an average of 
> 10m deep.
> 
> So it has a fallback for things like that, where we try to generate a 
> profile with a faster ascent/descent rate, and a shallower second depth.
> 
> And then there's the fallback with an insane 10m/s ascent/descent rate and 
> a second depth that is basically at the surface, and if we can't generate 
> a dive profile with those parameters, either my math is wrong, or somebody 
> was playing with rockets under-water. So we just give up.

Which I think is totally reasonable.

> There's a few other heuristics too (if there is no average depth, we 
> create a random one just to make the profile look reasonable).

Random and somewhat reasonable...

> I *think* this is all perfectly fine, but I do want others to take a look. 
> It might be doing something stupid.
> 
> So I'll do:
> 
>   Conditionally-signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
> 
> so you can apply this if you agree with the math.

I was waiting for others to comment... and then forgot :-(

So, second call for comments?

/D




More information about the subsurface mailing list