-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conformance report for reference #307
Comments
Thanks a lot! I'll have a look! |
Actually, this library did very well. |
I know. We spent some time in the past to improve the results - but in the end this meant storing whether or not a |
@miloyip This benchmark states that it is testing conformance to the JSON standard, and then tests things that are not part of the standard. It should be made clear that the roundtrip test is not in fact testing conformance to the standard, but contains arbitrary tests where "pass" vs "fail" has no relation to standard conformance, so as not to mislead users. Probably the easiest way would be to move the roundtrip tests out of the conformance section to a separate section. |
As summary: The failing tests are roundtrip24-roundtrip27. These tests have been discussed in miloyip/nativejson-benchmark#33 and #187. @twelsby wrote a great summary on this topic. I shall add the conformance report to the test reports for reference. I am not sure how to cope with this topic in the future. #302 shows there is still work to do on the parser side. However, achieving 100% "conformance" on this arbitrary benchmark set should not be the main goal for the library. What do you think? |
@miloyip pointed out in # 33 that using 17 digits of output rather than 15 would fix at least a couple of the issues. I didn't see that message before. |
We currently use
While we can ignore roundtrip30 and roundtrip31 (I just added them to have the code run on all existing roundtrip files), the other errors |
Looks like we should be using
http://en.cppreference.com/w/cpp/types/numeric_limits/max_digits10 As this is 17 for double, we'd then get and need to look at the rest of those failures above. |
I think it's not so easy, because now the following (previously succeeding) roundtrip tests are failing:
|
Yeah, I didn't say it would be easy. :) |
1.2345 is between 1.23449999999999993072208326339 and 1.23450000000000015276668818842, and is closer to the former, so that's the more accurate representation. It rounds down because the 3 after the nines is the dropped character. For the other, it's between 2.2250738585072000752518306399 and 2.22507385850719963116262078984. http://www.binaryconvert.com/result_double.html?hexadecimal=4001CCF385EBC89C |
@gregmarr Actually Roundtrip tests are needed to test the correctness of stringify function. The other tests can only test the parsing function. The problem is that, there are no single "correct" way of stringifying some values, especially the numerical format. I will try to move some more controversial ones as additional/optional checks, and not to be counted in the overall score. |
@miloyip Yes, some form of stringify testing is needed. As long as you can exclude the optional parts of it, and make the test so that it only tests the parts that are absolutely necessary, then that's true. The e vs E and presence or absence of + are the most notable parts. I previously thought that some of the tests were being too precise, but thanks to your explanation that I missed before, I see that there were some tests that were in fact valid failures. |
https://github.com/miloyip/nativejson-benchmark/blob/master/sample/conformance_Nlohmann%20(C%2B%2B11).md
The text was updated successfully, but these errors were encountered: