phetsims / projectile-motion

"Projectile Motion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
16 stars 13 forks source link

CT timeToGround is NaN #215

Closed KatieWoe closed 1 year ago

KatieWoe commented 4 years ago
projectile-motion : phet-io-fuzz : require.js : run
Query: brand=phet-io&phetioStandalone&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: timeToGround is NaN
Error: Assertion failed: timeToGround is NaN
    at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/assert/js/assert.js?bust=1575883065513:22:13)
    at Trajectory.step (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/projectile-motion/js/common/model/Trajectory.js?bust=1575883065624:237:21)
    at IntroModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/projectile-motion/js/common/model/ProjectileMotionModel.js?bust=1575883065624:305:36)
    at EventTimer.step (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/phet-core/js/EventTimer.js?bust=1575883065624:126:14)
    at IntroModel.step (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/projectile-motion/js/common/model/ProjectileMotionModel.js?bust=1575883065624:293:25)
    at https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/joist/js/Sim.js?bust=1575883065624:228:22
    at Action.execute (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/axon/js/Action.js?bust=1575883065624:230:20)
    at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/joist/js/Sim.js?bust=1575883065624:968:33)
    at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/joist/js/Sim.js?bust=1575883065624:949:14)
    at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/snapshot-1575859254751/joist/js/Sim.js?bust=1575883065624:932:14)
id: Bayes Chrome
Approximately 12/8/2019, 7:40:54 PM
projectile-motion : phet-io-tests : assert
9 out of 9 tests passed. 0 failed.

Approximately 12/8/2019, 7:40:54 PM
projectile-motion : phet-io-tests : no-assert
9 out of 9 tests passed. 0 failed.

Approximately 12/8/2019, 7:40:54 PM
zepumph commented 4 years ago

After fuzzing phet and phet-io brand standalone versions for over an hour I still haven't been able to reproduce this.

zepumph commented 4 years ago

This has occurred in 4 of the last 40 columns. And it has been on 4 out of the 4 screens, so quite likely it is a general model problem.

zepumph commented 4 years ago

I added a more verbose assert message to see if I can learn anything about the context when the error occurs. I'll look back next week.

KatieWoe commented 4 years ago
projectile-motion : phet-io-studio-fuzz : require.js : run
https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/studio/?sim=projectile-motion&phetioDebug&fuzz&postMessageToParent&postMessageOnLoad&postMessageOnError&postMessageOnBeforeUnload
Uncaught Error: Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
    at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/assert/js/assert.js?bust=1584525208455:22:13)
    at Trajectory.step (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/projectile-motion/js/common/model/Trajectory.js:245:19)
    at IntroModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/projectile-motion/js/common/model/ProjectileMotionModel.js:316:37)
    at EventTimer.step (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/phet-core/js/EventTimer.js:123:12)
    at IntroModel.step (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/projectile-motion/js/common/model/ProjectileMotionModel.js:304:23)
    at https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/joist/js/Sim.js:268:20
    at Action.execute (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/axon/js/Action.js:224:18)
    at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/joist/js/Sim.js:921:31)
    at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/joist/js/Sim.js:911:12)
    at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/joist/js/Sim.js:894:12)
id: Bayes Chrome
Approximately 3/18/2020, 12:21:53 AM
projectile-motion : phet-io-tests : assert
https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/phet-io-wrappers/phet-io-wrappers-tests.html?sim=projectile-motion&phetioDebug
9 out of 9 tests passed. 0 failed.

Approximately 3/18/2020, 12:21:53 AM
projectile-motion : phet-io-tests : no-assert
https://bayes.colorado.edu/continuous-testing/snapshot-1584512513704/phet-io-wrappers/phet-io-wrappers-tests.html?sim=projectile-motion
9 out of 9 tests passed. 0 failed.

Approximately 3/18/2020, 12:21:53 AM
KatieWoe commented 4 years ago

Seems to have reappeared

projectile-motion : phet-io-mirror-inputs-fuzz : require.js : run
https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/phet-io-wrappers/mirror-inputs/?sim=projectile-motion&phetioDebug&fuzz&postMessageToParent&postMessageOnLoad&postMessageOnError&postMessageOnBeforeUnload
Uncaught Error: Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
    at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/assert/js/assert.js:22:13)
    at Trajectory.step (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/projectile-motion/js/common/model/Trajectory.js:245:19)
    at DragModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/projectile-motion/js/common/model/ProjectileMotionModel.js:318:37)
    at EventTimer.step (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/phet-core/js/EventTimer.js:123:12)
    at DragModel.step (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/projectile-motion/js/common/model/ProjectileMotionModel.js:306:23)
    at https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/joist/js/Sim.js:271:20
    at Action.execute (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/axon/js/Action.js:224:18)
    at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/joist/js/Sim.js:924:31)
    at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/joist/js/Sim.js:914:12)
    at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/joist/js/Sim.js:897:12)
id: Bayes Chrome
Approximately 4/14/2020, 3:36:20 AM
projectile-motion : phet-io-tests : assert
https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/phet-io-wrappers/phet-io-wrappers-tests.html?sim=projectile-motion&phetioDebug
9 out of 9 tests passed. 0 failed.

Approximately 4/14/2020, 3:36:20 AM
projectile-motion : phet-io-tests : no-assert
https://bayes.colorado.edu/continuous-testing/snapshot-1586856980100/phet-io-wrappers/phet-io-wrappers-tests.html?sim=projectile-motion
9 out of 9 tests passed. 0 failed.

Approximately 4/14/2020, 3:36:20 AM
KatieWoe commented 4 years ago
projectile-motion : phet-io-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/projectile-motion/projectile-motion_en.html?continuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22phet-io-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1592539701703%22%2C%22timestamp%22%3A1592556694025%7D&brand=phet-io&phetioStandalone&ea&fuzz&memoryLimit=1000
Query: brand=phet-io&phetioStandalone&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/assert/js/assert.js:22:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/projectile-motion/js/common/model/Trajectory.js:245:19)
at VectorsModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/projectile-motion/js/common/model/ProjectileMotionModel.js:330:44)
at EventTimer.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/phet-core/js/EventTimer.js:123:12)
at VectorsModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/projectile-motion/js/common/model/ProjectileMotionModel.js:318:23)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/joist/js/Sim.js:277:20
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/axon/js/Action.js:225:18)
at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/joist/js/Sim.js:934:31)
at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/joist/js/Sim.js:924:12)
at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592539701703/joist/js/Sim.js:907:12)
id: Bayes Chrome
Snapshot from 6/18/2020, 10:08:21 PM
KatieWoe commented 4 years ago
projectile-motion : phet-io-studio-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/studio/?sim=projectile-motion&phetioDebug&fuzz&wrapperContinuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22phet-io-studio-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1592913951485%22%2C%22timestamp%22%3A1592919059546%7D
Uncaught Error: Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/assert/js/assert.js:22:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/projectile-motion/js/common/model/Trajectory.js:245:19)
at DragModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/projectile-motion/js/common/model/ProjectileMotionModel.js:330:44)
at EventTimer.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/phet-core/js/EventTimer.js:123:12)
at DragModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/projectile-motion/js/common/model/ProjectileMotionModel.js:318:23)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/joist/js/Sim.js:277:20
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/axon/js/Action.js:225:18)
at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/joist/js/Sim.js:934:31)
at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/joist/js/Sim.js:924:12)
at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1592913951485/joist/js/Sim.js:907:12)
id: Bayes Chrome
Snapshot from 6/23/2020, 6:05:51 AM
KatieWoe commented 4 years ago
projectile-motion : fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/projectile-motion/projectile-motion_en.html?continuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1602106308108%22%2C%22timestamp%22%3A1602133878116%7D&brand=phet&ea&fuzz&memoryLimit=1000
Query: brand=phet&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/assert/js/assert.js:22:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/projectile-motion/js/common/model/Trajectory.js:244:19)
at VectorsModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/projectile-motion/js/common/model/ProjectileMotionModel.js:328:44)
at EventTimer.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/phet-core/js/EventTimer.js:123:12)
at VectorsModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/projectile-motion/js/common/model/ProjectileMotionModel.js:316:23)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/joist/js/Sim.js:297:22
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/axon/js/Action.js:225:18)
at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/joist/js/Sim.js:975:31)
at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/joist/js/Sim.js:965:12)
at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1602106308108/joist/js/Sim.js:943:12)
id: Bayes Chrome
Snapshot from 10/7/2020, 3:31:48 PM
zepumph commented 3 years ago
projectile-motion : fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/projectile-motion/projectile-motion_en.html?continuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1625530209109%22%2C%22timestamp%22%3A1625561223625%7D&brand=phet&ea&fuzz&memoryLimit=1000
Query: brand=phet&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
Error: Assertion failed: timeToGround: NaN, previousPoint.velocity: Vector2(0, 0), previousPoint.acceleration: Vector2(0, 0), fromIf: true
at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/assert/js/assert.js:25:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/projectile-motion/js/common/model/Trajectory.js:258:19)
at DragModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/projectile-motion/js/common/model/ProjectileMotionModel.js:283:44)
at EventTimer.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/phet-core/js/EventTimer.js:120:12)
at DragModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/projectile-motion/js/common/model/ProjectileMotionModel.js:271:23)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/joist/js/Sim.js:304:22
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/axon/js/Action.js:227:18)
at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/joist/js/Sim.js:1108:31)
at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/joist/js/Sim.js:1098:12)
at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1625530209109/joist/js/Sim.js:1076:12)
id: Bayes Chrome
Snapshot from 7/5/2021, 8:10:09 PM

Looks like in each of these cases, the previousPoint has no accelleration or velocity. Looking through step, there is a fair bit of dividing by these, so I feel like we are downstream of the actual problem. Perhaps we need a marker at the beginning of step to handle this, or perhaps it is a bug where these values actually shouldn't be zero. Either way, I feel like I need to failure context in my dev tools to proceed, and I still have never been able to fuzz locally to reproduce this issue (I have three windows going currently).

zepumph commented 3 years ago

I had three windows open fuzzing the sim for 3 hour, and never hit this issue. Hmmm....

zepumph commented 2 years ago
projectile-motion : phet-io-fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/projectile-motion/projectile-motion_en.html?continuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22phet-io-fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1638456211472%22%2C%22timestamp%22%3A1638466810318%7D&ea&brand=phet-io&phetioStandalone&fuzz&memoryLimit=1000
Query: ea&brand=phet-io&phetioStandalone&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed:
timeToGround: NaN,
previousPoint.position: Vector2(0.017698939773176214, 0),
previousPoint.velocity: Vector2(0, 0),
previousPoint.acceleration: Vector2(0, 0),
fromIf: true,
number of dataPoints: 3

Error: Assertion failed:
timeToGround: NaN,
previousPoint.position: Vector2(0.017698939773176214, 0),
previousPoint.velocity: Vector2(0, 0),
previousPoint.acceleration: Vector2(0, 0),
fromIf: true,
number of dataPoints: 3

at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/assert/js/assert.js:25:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/projectile-motion/js/common/model/Trajectory.js:205:19)
at IntroModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/projectile-motion/js/common/model/ProjectileMotionModel.js:267:42)
at listener (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/projectile-motion/js/common/view/ProjectileMotionScreenView.js:280:19)
at TinyEmitter.emit (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/axon/js/TinyEmitter.js:69:9)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/axon/js/Emitter.js:37:24
at Emitter.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/axon/js/Action.js:195:18)
at Emitter.emit (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/axon/js/Emitter.js:62:19)
at PushButtonModel.fire (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/sun/js/buttons/PushButtonModel.js:162:23)
at CallbackTimer.fire (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638456211472/chipper/dist/js/axon/js/CallbackTimer.js:115:23)
id: Bayes Chrome
Snapshot from 12/2/2021, 7:43:31 AM
zepumph commented 2 years ago
projectile-motion : fuzz : unbuilt
https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/projectile-motion/projectile-motion_en.html?continuousTest=%7B%22test%22%3A%5B%22projectile-motion%22%2C%22fuzz%22%2C%22unbuilt%22%5D%2C%22snapshotName%22%3A%22snapshot-1638421122064%22%2C%22timestamp%22%3A1638447390968%7D&brand=phet&ea&fuzz&memoryLimit=1000
Query: brand=phet&ea&fuzz&memoryLimit=1000
Uncaught Error: Assertion failed:
timeToGround: NaN,
previousPoint.position: Vector2(0.017701127410985753, 0),
previousPoint.velocity: Vector2(0, 0),
previousPoint.acceleration: Vector2(0, 0),
fromIf: true,
number of dataPoints: 3

Error: Assertion failed:
timeToGround: NaN,
previousPoint.position: Vector2(0.017701127410985753, 0),
previousPoint.velocity: Vector2(0, 0),
previousPoint.acceleration: Vector2(0, 0),
fromIf: true,
number of dataPoints: 3

at window.assertions.assertFunction (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/assert/js/assert.js:25:13)
at Trajectory.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/projectile-motion/js/common/model/Trajectory.js:205:19)
at DragModel.stepModelElements (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/projectile-motion/js/common/model/ProjectileMotionModel.js:267:42)
at EventTimer.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/phet-core/js/EventTimer.js:116:12)
at DragModel.step (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/projectile-motion/js/common/model/ProjectileMotionModel.js:254:23)
at https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/joist/js/Sim.js:258:22
at Action.execute (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/axon/js/Action.js:195:18)
at Sim.stepSimulation (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/joist/js/Sim.js:787:31)
at Sim.stepOneFrame (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/joist/js/Sim.js:776:12)
at Sim.runAnimationLoop (https://bayes.colorado.edu/continuous-testing/ct-snapshots/1638421122064/chipper/dist/js/joist/js/Sim.js:757:12)
id: Bayes Chrome
Snapshot from 12/1/2021, 9:58:42 PM
samreid commented 2 years ago

@zepumph said:

In regards to Projectile Motion, if you are ever bored, I cannot for the life of me reproduce https://github.com/phetsims/projectile-motion/issues/215, but CT hits it really often.

So I added myself as an assignee. Can we work backwards and find out which term is leading to the NaN? Do you want to try that or should I?

zepumph commented 2 years ago

I am totally not in Projectile Motion at this time. Happy to investigate the next time that I'm in this repo.

samreid commented 2 years ago

From the errors, the problem is happening in this line:

        if ( previousPoint.acceleration.y === 0 ) {
          timeToGround = -previousPoint.position.y / previousPoint.velocity.y;
        }

We can also see from the data that previousPoint.position.y and previousPoint.velocity.y are both 0 (because 0/0 is NaN). Trajectory.js has these lines:

      // fix large drag errors by making it free fall
      if ( newVelocity.x < 0 ) {
        newVelocity.setXY( 0, 0 );
        apexExists = false;
      }
    // fix large drag errors
    if ( velocity.x < 0 ) {
      velocity.setXY( 0, 0 );
    }

After about 15 minutes, it triggered in ?screens=4&fuzz. Having it paused in the debugger didn't help, because it all cascaded from step.

samreid commented 2 years ago

The commit is very experimental and does not get to the root of the problem. Let's see what happens on CT. If that seems OK let's discuss it with @zepumph.

samreid commented 2 years ago

Since this commit, CT has not shown this problem. I'm having trouble tracking the flow of data in the sim to find the upstream cause of this problem, or it could be that this special case handling is appropriate. Maybe a good next step is to discuss with @zepumph when he has time.

matthew-blackman commented 1 year ago

This issue has not shown in CT for almost a year, closing this issue and will reopen if it appears again.