Skip to content

Fix rendering of WebGL traces on latest Chrome-128 and Edge-128 browsers #7131

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

Closed
wants to merge 6 commits into from

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Aug 26, 2024

Fixes #7130.

@plotly/plotly_js
cc: @birkskyum

@@ -24,7 +24,7 @@
"gl-pointcloud2d": "^1.0.3",
"gl-scatter3d": "^1.4.1",
"gl-select-box": "^1.0.4",
"gl-shader": "4.3.1",
"gl-shader": "github:archmoj/gl-shader#0409f68f8005ef3a3f3fccb6121bc7f0a5fda8bb",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@archmoj archmoj requested a review from alexcjohnson August 27, 2024 00:00
function ensureFinite(arr) {
return arr.map(function(v) {
return (
isNaN(v) ? 0 :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this one exclude NaN values? Doesn’t that pose a risk that missing data will be filled in spuriously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't encounter that case in our tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have that case (missing data, particularly with lines but also points and surfaces) in our image tests? This is stackgl so I guess my question is scoped to the 3D trace types.

But also, this is different from what you did in parcoords, why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In stackgl jasmine tests I encountered a case with both infinity and NaN. So I had to guard against both.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still want to understand:

  • Why are there differences between the stackgl and parcoords fixes? "because only one has a test that cares about NaN" isn’t enough. Have you tried to find a way to push a NaN into the other one? Does it cause problems?
  • Is there any chance that setting NaN to zero will make missing data suddenly appear? This I would consider a VERY bad bug, so it’s worth looking into carefully. Is there any way you can find to pass in an array containing some null data mixed in with valid data, or a typed array with NaN mixed in, that results in a point appearing where there should be none? If this code is processing the x/y/z arrays for scatter3D for example, I could imagine this happening due to NaN at the beginning, middle, or end of one of the arrays; NaN in all three at once; or different length arrays; all of these coming from either plain arrays or typed arrays. We could enumerate similar sets of conditions for the other trace types, and ideally we should have these conditions in test images so we have confidence the behavior is stable over time. These wouldn't need to all be different images, the same trace can have many incomplete or totally missing data points. And perhaps we already have some of these conditions represented in our test images - if so, fantastic, just point them out to me and we'll be good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case of NaN didn't happen in the parcoords cases.
But it was present in a mesh3d case.
I start thinking perhaps NaNs could/should be avoided in one layer higher in the stackgl case.
Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@archmoj @alexcjohnson is this a must-have for our next minor release?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that several trace types seem fully broken on latest Chrome (and Edge, per plotly/plotly.py#4729, not surprising as it’s built on Chrome) I certainly think so. I don’t particularly care how the fix is done but I do want us to test thoroughly that the fix can’t generate incorrect data points on a graph

@gvwilson gvwilson added bug something broken P1 needed for current cycle labels Aug 28, 2024
@archmoj
Copy link
Contributor Author

archmoj commented Aug 28, 2024

@alexcjohnson
In respect to you comments I improved the handling of NaNs in parcoords constraintrange in 890ccfd.

In the case of stackgl these NaN conditions appear to occur for the 3D model matrix when the trace has empty arrays e.g.

Plotly.newPlot(gd, [{
    x: [],
    y: [],
    z: [],
    type: 'scatter3d'
}])

Or when they are turned off:

Plotly.newPlot(gd, [{
    visible: 'legendonly',
    x: [1],
    y: [2],
    z: [3],
    type: 'scatter3d'
}])

Whereas other applications namely ArcGIS also encountered this exact issue: https://community.esri.com/t5/arcgis-online-questions/map-error-in-new-chrome-update-128-0-6613-85/td-p/1525829
I still think this could/should be considered a Chrome regression which hopefully be fixed in future versions.

I hope this temporary fix is good enough to be included in the upcoming minor to bring back these traces.

@archmoj
Copy link
Contributor Author

archmoj commented Aug 28, 2024

Good news: I found this bug as labeled P1 on chromium.org.
See https://issues.chromium.org/issues/361823993

@archmoj
Copy link
Contributor Author

archmoj commented Aug 28, 2024

@alexcjohnson @gvwilson
With the revert updates in https://issues.chromium.org/issues/361823993 we may be able to close this PR.
But I am still not sure how they are going to update the latest stable version. Let's wait until tomorrow.

@birkskyum
Copy link
Contributor

birkskyum commented Aug 28, 2024

15 min ago - some people says things are working. Is there maybe a patch out already?

Screenshot 2024-08-28 at 21 46 58

My browser just now updated from:
128.0.6613.85
to
128.0.6613.114

@archmoj
Copy link
Contributor Author

archmoj commented Aug 28, 2024

This is now fixed by Chromium 128.0.6613.113:
https://chromium.googlesource.com/chromium/src/+/refs/tags/128.0.6613.113

I was able to update my Chrome.
Closing.

@archmoj archmoj closed this Aug 28, 2024
@archmoj archmoj deleted the parcoords-chrome-128 branch August 28, 2024 20:07
@gvwilson
Copy link
Contributor

👍

@archmoj archmoj removed this from the v2.35.0 milestone Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chrome 128 seems to have problem rendering WebGL traces including parcoords, mesh3d, surface
4 participants