-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should check for error code from h3Line call #40
Comments
I had a related conversation with @isaacbrodsky here: uber/h3-java#36 You are correct, I should check the output of 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. |
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.) |
Not sure. Possibilities here:
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. |
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). |
This issue should be covered by the new error handling in #139 |
Hey @nrabinowitz
So h3-node currently (ab)uses h3-js for unit testing by just confirming that the outputs of both are identical given semi-random inputs.
I've noticed intermittent failures in the
h3Line
test, and after digging through the code, I think the issue might be on the h3-js side.We can see in the declaration of the h3Line function that it returns an integer value.
And in the documentation on the implementation that the return value is an error/success status code
So the h3-node implementation of binding h3Line includes a check for that status
But the h3-js implementation of binding h3Line ignores that status
I'd normally just make a PR to fix this, but since you implemented the C version of the code and the JS bindings, I wanted to bring this up before, in case this was actually intentional?
The text was updated successfully, but these errors were encountered: