phetsims / collision-lab

"Collision Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

Freezing behavior when stepping back with inelastic behavior. #203

Closed KatieWoe closed 3 years ago

KatieWoe commented 3 years ago

For https://github.com/phetsims/QA/issues/599. Seen while looking at https://github.com/phetsims/collision-lab/issues/183, and it seems to be related. While on the 2D screen, I had an inelastic collision, and was stepping it back to see if behavior differed between that and moving forward. While stepping back, the screen froze and the console gave a large number of errors that seemed to keep climbing as the sim was frozen. I have been trying to reproduce, and have not had luck so far, but I will continue to try.

frozenscreen
KatieWoe commented 3 years ago

Managed to reproduce a few times on Mac 10.13 Chrome. Still not exactly sure what causes it, and recreating the starting conditions doesn't seem to work. Screen Shot 2021-01-26 at 3 37 50 PM Screen Shot 2021-01-26 at 3 35 46 PM

arouinfar commented 3 years ago

@jonathanolson at some point we disabled the step back button for elasticity =/= 0. I'd be fine with going back to that if it would resolve this issue.

jonathanolson commented 3 years ago

recreating the starting conditions doesn't seem to work.

That's probably rounding errors at work, since we're only getting the rounded values displayed visually.

jonathanolson commented 3 years ago

For debugging this, I'd probably need someone to reproduce while devtools were open (to catch it and debug).

However I'm also running into cases where it seems the numerical imprecision (https://github.com/phetsims/collision-lab/issues/183#issuecomment-771279058), so I think removing step-back for inelastic collisions here is the correct decision.

arouinfar commented 3 years ago

However I'm also running into cases where it seems the numerical imprecision (#183 (comment)), so I think removing step-back for inelastic collisions here is the correct decision.

Sounds good @jonathanolson. Let's proceed.

jonathanolson commented 3 years ago

Implemented the removal of inelastic step-back, can you verify?

arouinfar commented 3 years ago

Looks good @jonathanolson!

DevonQui commented 3 years ago

This has been fixed. In Explore 2D, if elasticity isn't 100%, the step-back button is disabled as expected. Closing