-
Notifications
You must be signed in to change notification settings - Fork 462
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
Math.sqrt: add a test with exact input-output expectations #4188
Conversation
8d4616d
to
46c1645
Compare
I'm not sure why esmeta is getting a stack overflow. |
@michaelficarra FWIW I just tried running the test in my local clone of esmeta pointing to the same HEAD as in the github checks here and the test passed. I restarted the test to see if it fails again. |
@ioannad That seems to have worked. It no longer gets a stack overflow, but it does fail. It opaquely fails, so I'm not sure which assertion caused the failure. Also, I'm pretty sure the test should pass. I ran the test manually in V8 and it passed there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentative approval pending the merge of the spec PR and some understanding of what's going on with esmeta
f922989
to
03af1ed
Compare
@Ms2ger Spec PR is merged. esmeta is getting a stack overflow again after rebase. 🤷♂️ |
@doehyunbaek @Zaid-maker either of you able to shed some light on esmeta's stack overflow? Otherwise I'll probably merge this anyway in the next few days |
Hi all, I'm the maintainer of ESMeta. It happens because of the limited stack size of the released executable ( |
In addition, we checked that the fixed version passed the test as follows:
|
Thanks for the swift response! I've opened #4202 to update our CI, and then we can go ahead here when that is landed. |
@Ms2ger esmeta test passes now. Should be good to go. |
I've checked Bugzilla for sqrt precision bugs, but I didn't find any. Probably because the implementation uses (*) For example a naive implementation of Goldschmidt's algorithm in JS shows ~380 mismatches, with a maximum error of 2 ULP. |
Tests for this ecma262 PR: tc39/ecma262#3345
We could additionally test chosen interesting/"edge-case" inputs, but I wouldn't know how to discover those. @anba @ptomato suggested that you may have some recommendations for these or for inputs that might have different results using known sqrt approximation strategies.
Input-output pairs were generated by the following script: