GithubHelp home page GithubHelp logo

Comments (5)

nrabinowitz avatar nrabinowitz commented on July 19, 2024

I had a related conversation with @isaacbrodsky here: uber/h3-java#36

You are correct, I should check the output of h3Line for completeness (I'm updating the title of this issue to reflect that). But with the current implementation of h3Line, it is (almost certainly) impossible to get a non-zero exit code here IFF you got a a value > 0 from h3LineSize. Both functions just delegate immediately to h3Distance under the hood.

So while you're right that we should check, the error condition here is (almost certainly) unreachable, and is unlikely to be the source of your bug. I think it's more likely you're running into undefined output due to whatever is behind uber/h3#184.

from h3-js.

dfellis avatar dfellis commented on July 19, 2024

Hmm... So it looks like Isaac is planning to dig into that issue, but do you have any proposal right now? Maybe I should just confirm that 90+% of the runs succeed? (That would still have very intermittent failures if the random number generator ever does more than 10% lines through pentagons.)

from h3-js.

nrabinowitz avatar nrabinowitz commented on July 19, 2024

Not sure. Possibilities here:

  • Keep your current test with a threshold, as you note, and try to drop it later
  • Implement separate property-based tests, as we do here: https://github.com/uber/h3-js/blob/master/test/h3core.spec.js#L1201 - these should work regardless of h3-js issues (though I think the failure cases might fail here too, if they're in the underlying lib)

I don't necessarily think that asserting identical output here is a big issue, since we explicitly don't guarantee stable output across versions - there are multiple "correct" answers here, so the important concern is guaranteeing the properties of the output, not necessarily the consistency of the output.

from h3-js.

dfellis avatar dfellis commented on July 19, 2024

Well, I am trying to guarantee that the major and minor version numbers for h3-node match those of h3-js so it can be a drop-in replacement (assuming no error condition reached) for anyone wanting a perf boost on Node apps.

Let me think about it a bit more. The random-but-valid input approach was nice as a kind of fuzzing, as well (which is how I found this discrepancy in the first place).

from h3-js.

nrabinowitz avatar nrabinowitz commented on July 19, 2024

This issue should be covered by the new error handling in #139

from h3-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.