Hashing in light of numeric precision

Hey again,

from looking at the python implementation, the hash of an object is defined via the JSON string representation, right?

Have you encountered problems there with respect to numeric precision? I.e. the hash changes, because a floating point operation (common coordinate transform) yields a slightly different result?
Again (similar to here), this applies especially to parametric workflows and functions, where it might be interesting for me to re-run the script but only update the objects that actually changed in the output.

Again, an implementation on top of Speckle might be possible, but it would be interesting to have the very identity of objects (at least those with a geometric representation) to be stable against minimal numerical imprecisions.

Looking forward to hear what you think :slight_smile:

Have a good day, everyone and keep up the great work! Coolest tool I’ve used in AEC!

2 Likes

Heya @maxmodugen! Thanks for the kind words! We’ve actually gave this a bit of thought (see Rounding numbers in Revit Test · Issue #443 · specklesystems/speckle-sharp · GitHub for example). It’s a good shout, and we were considering adding some sort of rounding to a significant digit of values

The point is that so far, our host app’s api’s have been more or less stable when it comes to precision. I expect we’ll be able to add diffing without much of a hassle overall. Or if we don’t and it’s a PITA, you’ll look back at this conversation and say… “damn, told you so!” :smiley:

Another aspect is that Speckle should also be inclined to err on the side of “trigger happy hash changes” as we don’t want to potentially send bad data out of host apps. Again, I feel when we’ll get to do some diffing exercise (or when someone else builds an app that does that!) we might have different conversations.

I see, good point! Diffing can be added on top of the existing functionality to ensure that required level of precision-tolerance, before even creating objects or anything. Makes sense from an architectural perspective to keep this application logic out of the core layers.