Skip to content

Fix globe render test baseline generation under macOS - #12090

Merged
avpeery merged 26 commits into
mainfrom
avpeery/render-test-macos
Aug 2, 2022
Merged

avpeery merged 26 commits into
mainfrom
avpeery/render-test-macos

Conversation

@avpeery

@avpeery avpeery commented Jul 15, 2022 •

Copy link
Copy Markdown
Contributor

Fixes gl-js team issue #462.

Previously we forced our render tests to disable angle with the chrome flag --use-gl=desktop introduced by #10389. The result of disabling angle while running render tests locally has caused globe render tests to fail on MacOS.

The new implementation continues running tests on circleCI as it was previously, but separates setting the chrome flags for circleCI from local yarn test-render runs. If you want to run how it is in circleCI (i.e. with the --use-gl=desktop flag) you can set CI=true in the CLI as so CI=true yarn test-render. Not forcing the local environment to disable ANGLE with --use-gl=desktop will allow more render testing across different environments.

This change also allows an option to change the ANGLE graphics backend locally. Some devices (e.g. M1 macs) seem to run the render tests with significantly less failures when forcing the ANGLE backend to be set to OpenGL. To configure the ANGLE backend, you can set the --use-angle input value to USE_ANGLE in CLI like so:
USE_ANGLE=gl yarn test-render

Have ruled out map.loaded() returning true early being the cause for the failing tests. The globe projection behavior when map.loaded() returns true is the same as other map projections.

Launch Checklist

  • briefly describe the changes in this PR
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'

@avpeery avpeery added the skip changelog Used for PRs that do not need a changelog entry label Jul 15, 2022
@avpeery avpeery linked an issue Jul 15, 2022 that may be closed by this pull request
@avpeery
avpeery marked this pull request as ready for review July 18, 2022 18:40
@SnailBones

Copy link
Copy Markdown
Contributor

Ruled out map.loaded() returning true early being the cause for the failing tests. The globe projection behavior when map.loaded() returns true is the same as other map projections.

Does this mean that we can close #11419? Or is this still an issue in other contexts?

Comment thread test/integration/testem/testem.js Outdated
"browser_args": {
"Chrome": {
"ci": [ "--disable-backgrounding-occluded-windows", "--ignore-gpu-blocklist", "--use-gl=desktop" ]
"ci": [ "--disable-backgrounding-occluded-windows", "--ignore-gpu-blocklist", "--use-angle=gl"]

@karimnaaji karimnaaji Jul 19, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking at Chromium specs, there seem to be a few different variants possible, refer here. I note: vulkan, swiftshader (only for debugging), gles, metal. There's more documentation about it here.

I imagine two areas of investigation useful for potential improvements and increased coverage:

  • On Mac, if it happens that chrome on end user machines mostly default to --use-angle=metal, we could default to that on development machine and differentiate when developers (us) run the render test vs when circle CI runs the render test, so that we'd at least have coverage of both gl and metal. You can check what is currently in use here by going to chrome://gpu/. That might be something we can address now.
  • It might be worth researching whether we should cover different Angle backend variants that are used by end-user machine, e.g. running different CI builds with each of these variants, similar to the render-test-csp and render-test-prod that we have here. This might be something to address separately.

We could document some of these findings on https://github.com/mapbox/gl-js-team/issues/480 or any other issue.

(cc @ansis as using this flag could be a way to detect potential misbehavior between Angle backends)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @karimnaaji! In order to allow covering different ANGLE backends, an option to allow setting the --use-angle chrome flag locally when running render tests locally has been enabled. By default, running the render tests locally will not set any chrome flags. I did not add any CI builds to run different configurations, but it could be something added in the future if it feels helpful.

I don't think Macs default to metal for the render tests for the most part, so my assumption is possibly incorrect on metal causing render test differences. I ran chrome://gpu/ on my computer (intel Mac) and Metal is shown as "disabled". I also had @stepankuzmin (with M1 mac) check chrome://gpu/ and metal appears as disabled as well. However, @stepankuzmin seemed to have less failures with forcing ANGLE to use OpenGL with using the chrome flag --use-angle=gl, so I'm not entirely sure of the cause there but allowing to pass the use-angle flag options locally could be helpful and to also test out different graphics backends as well.

@avpeery

avpeery commented Jul 19, 2022 •

Copy link
Copy Markdown
Contributor Author

Ruled out map.loaded() returning true early being the cause for the failing tests. The globe projection behavior when map.loaded() returns true is the same as other map projections.

Does this mean that we can close #11419? Or is this still an issue in other contexts?

It's not an issue related to the failing render tests but is still an issue specifically with satellite styles and all projections. I shared a screen recording of map.loaded() returning true before all rendering has completed with mercator in the other issue.
#11419 (comment)

@avpeery
avpeery marked this pull request as draft July 19, 2022 19:29

@SnailBones SnailBones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can confirm that this branch fixes docs image generation on my Intel chip Mac! 🎉

@avpeery
avpeery marked this pull request as ready for review July 27, 2022 21:15
Comment thread test/integration/README.md Resolved
@karimnaaji

karimnaaji commented Aug 1, 2022 •

Copy link
Copy Markdown
Contributor

Locally I consistently get this failed render test (unless using USE_ANGLE=gl yarn run test-render tests=globe), but otherwise the generation and test is fixed on my macOS machine.

Screen Shot 2022-08-01 at 1 43 24 PM

@karimnaaji karimnaaji left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@stepankuzmin stepankuzmin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍

Comment thread .circleci/config.yml Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Used for PRs that do not need a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

map.loaded() may return true too early when used with Globe View

4 participants