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
Numerical stability regression in dartbox2d compiled to JS #4075
Comments
Added Triaged label. |
This comment was originally written by Ruper...@gmail.com The regression was introduced into dart2js between versions 8942 and 9258. |
Set owner to @floitschG. |
Tracked it down to commit 9019. |
CL uploaded: https://chromiumcodereview.appspot.com/10704229/ |
Fixed in r9695. The bug was triggered by a loop that didn't have any back-edge: http://code.google.com/p/dartbox2d/source/browse/lib/dynamics/contacts/ContactSolver.dart#374 This should be correctly handled now, but if the loop is not needed it should maybe be removed. Dart2js does not yet detect that the loop is not needed. Added Fixed label. |
This comment was originally written by domi...@google.com Thank you so much for chasing this down. You're right that the loop is not necessary, however it is a valid code construct to avoid complex nested if-statements. As it happens, I'd prefer the nested conditionals but dart2js should still be able to handle the code. Is there already an open issue for this? |
It does handle it correctly now. Just not as optimized as without the loop. |
This comment was originally written by Ruper...@gmail.com Confirmed this fixes the bug in dartbox2d. Thanks! |
This issue was originally filed by domi...@google.com
The last dart2js I tried was synced around May 25th. I synced the new version today, Jul 12th.
As of now, compiling the dartbox2d demos with dart2js exposes some obvious numerical instabilities that didn't exist previously. I've attached an example .js file as before-stable.js and after-unstable.js.
These changes make dartbox2d unusable outside of the Dart VM.
Running the same demos in Dartium shows no instability.
Attachments:
before-stable.js (460.86 KB)
after-unstable.js (745.58 KB)
The text was updated successfully, but these errors were encountered: