phetsims/collision-lab

Freezing behavior when stepping back with inelastic behavior.

Closed this issue · 8 comments

For phetsims/qa#599. Seen while looking at #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

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

@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.

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.

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 (#183 (comment)), so I think removing step-back for inelastic collisions here is the correct decision.

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.

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

Looks good @jonathanolson!

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