phetsims / neuron

"Neuron" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

iOS 9 Potential Chart flashes #93

Closed orejolaphet closed 8 years ago

orejolaphet commented 9 years ago

On iOS 9 the Potential Chart does not draw any plot and the grid lines of the plot flash between blue and red while simulation is playing.

unnamed

Troubleshooting information (do not edit): Name: ‪Neuron‬ URL: http://www.colorado.edu/physics/phet/dev/html/neuron/1.0.0-dev.13/neuron_en.html Version: 1.0.0-dev.13 2015-10-09 19:02:48 UTC Features missing: fullscreen User Agent: Mozilla/5.0 (iPad; CPU OS 9_0 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A344 Safari/601.1 Language: en-us Window: 1024x671 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 IMGSGX543-124.1) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.00) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 8 uniform: 128 Texture: size: 4096 imageUnits: 8 (vertex: 8, combined: 8) Max viewport: 4096x4096 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"11bc6a6d","branch":"master"},"axon":{"sha":"47eaa1de","branch":"master"},"babel":{"sha":"931afbf1","branch":"master"},"brand":{"sha":"8a756e53","branch":"master"},"chipper":{"sha":"d93dfe7e","branch":"master"},"dot":{"sha":"09f891ac","branch":"master"},"griddle":{"sha":"bf88bc01","branch":"master"},"joist":{"sha":"3fbd99f9","branch":"master"},"kite":{"sha":"81ce58ca","branch":"master"},"neuron":{"sha":"1d73e47d","branch":"master"},"phet-core":{"sha":"f6348fba","branch":"master"},"phetcommon":{"sha":"0e4754fe","branch":"master"},"scenery":{"sha":"8c246268","branch":"master"},"scenery-phet":{"sha":"4cf23e85","branch":"master"},"sherpa":{"sha":"1759eade","branch":"master"},"sun":{"sha":"b66398a5","branch":"master"}}

jbphet commented 8 years ago

This appears to be device and OS-version specific. It does not occur on my test iPad 2 running 8.3, it does not occur on the iPad mini named "Euler" running iOS 9.2, but it does occur on the iPad named "Tycho" currently also running iOS 9.2.

jbphet commented 8 years ago

Using the iPad 2 named "Tycho" as my test device, the issue goes away if I disable WebGL using the webgl=false query parameter.

jbphet commented 8 years ago

This appears to have gone away. I was only able to duplicate it on v1.0.0-dev.13 (http://www.colorado.edu/physics/phet/dev/html/neuron/1.0.0-dev.13/neuron_en.html), and a number of things have changed since then both in the sim and in the supporting libraries. I tried bisecting, but even when I have the same dependencies as the v1.0.0-dev.13 version, I can't seem to duplicate the issue on the RequireJS or built versions. Weird. I did a release candidate and tested it on Tycho, and the problem does not manifest. It's nice that the issue has disappeared, but it's a bit disconcerting too. I'll leave this issue open through the release process to remind us to keep an eye out for it.

bryo5363 commented 8 years ago

This same behavior is observed on Microsoft Edge 25.10586.0.0

jbphet commented 8 years ago

I can duplicate on Win10+Edge on my Dell laptop. Unlike with the iOS problem, the flashing does not go away if WebGL is disabled with the webgl=false flag.

jbphet commented 8 years ago

The flashing goes away if I comment out the code that draws the data line on the canvas in DataLineCanvasNode. This isn't a solution, since the data line is needed, it's just an informative experiment.

jbphet commented 8 years ago

This issue was ultimately due to some code that tries to minimize the time needed to update the data line on the chart. This code attempted to recognize when it could simply tack a small segment onto the data line rather than redrawing the entire line. This leads to problems in cases where adjacent layers of the scene graph are also rendering in canvas, because it was making an implicit assumption that no one else was using the context between repaints. There were several ways that this could have been addressed, but I decided to make some measurements on an iPad and see how much this optimization was gaining us. I tested on an iPad 2, model A1395 running iOS 9.2, PhET name "Witten", and after running 3 trials with this optimization and three without, the frames per second measurement was actually 0.1 FPS better without the optimization. I don't think this number is statistically significant, I just think it means that the attempted optimization isn't buying us much if anything. Therefore, I've opted to remove it, which simplifies the code and solves the flashing chart issue on Edge and probably assures that the issue won't occur again on iOS.

jbphet commented 8 years ago

Assigning to @ariel-phet so that he or someone on the QA team can verify that this is fixed on v1.0.0-rc.2 (http://www.colorado.edu/physics/phet/dev/html/neuron/1.0.0-rc.2/neuron_en.html).

ariel-phet commented 8 years ago

Made checklist item for https://github.com/phetsims/tasks/issues/485

phet-steele commented 8 years ago

@jbphet this isn't happening anymore in later versions of iOS 9.