Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Mar 11, 2024

Enables Vulkan validation layers for macOS and linux builds, enables macOS validation for macOS builds.

Fixes flutter/flutter#144967

There may still be remaining issues with macOS validation, I need to verify I can reproduce flutter/flutter#143324 . I plan to do that separately

"//flutter/impeller/typographer/backends/stb:typographer_stb_backend",
"//flutter/testing:testing_lib",
"//flutter/third_party/txt",
"//third_party/vulkan_validation_layers",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jonahwilliams jonahwilliams changed the title testing. [Impeller] attempt to get validation errors from CI unittests. Mar 12, 2024
# TODO(https://github.com/flutter/flutter/issues/142642): Remove this.
'--gtest_filter=-*OpenGLES',
# TODO EVEN MORE
'--gtest_filter=*Metal',
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 vulkan variants crash, I think this is because they weren't running before? I'd need to double check. Either that or they are just hitting validation checks that are fatal in a way the test harness can't handle

}

TEST_P(EntityTest, RuntimeEffectSetsRightSizeWhenUniformIsStruct) {
TEST_P(EntityTest, DISABLED_RuntimeEffectSetsRightSizeWhenUniformIsStruct) {
Copy link
Member

Choose a reason for hiding this comment

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

Please add an issue for a disabled test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not disabling it here anymore, i filled one generic skip test issue


static const std::vector<std::string> kVulkanDenyValidationTests = {};
static const std::vector<std::string> kVulkanDenyValidationTests = {
"impeller_Play_GaussianBlurFilterContentsTest_" //
Copy link
Member

Choose a reason for hiding this comment

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

nit: turn off clang format so these are all on one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

::glfwDestroyWindow(reinterpret_cast<GLFWwindow*>(handle));
}

PlaygroundImplVK::PlaygroundImplVK(PlaygroundSwitches switches)
Copy link
Member

Choose a reason for hiding this comment

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

Ideally this would be a static function that returns StatusOr<std::unique_ptr<PlaygroundImplVK>> instead of short circuiting a constructor, leaving a half initialized object.

https://google.github.io/styleguide/cppguide.html#Doing_Work_in_Constructors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can just lift the check out of the constructor, since its a static method. I made this an FML_CHECK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

#endif // IMPELLER_ENABLE_VULKAN

namespace {
static const std::vector<std::string> kVulkanDenyValidationTests = {
Copy link
Member

Choose a reason for hiding this comment

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

Let's share this instead of duplicating it twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

enable_validations && HasLayer("VK_LAYER_KHRONOS_validation");
if (enable_validations && !validations_enabled_) {
FML_LOG(ERROR)
FML_LOG(FATAL)
Copy link
Member

Choose a reason for hiding this comment

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

I think the safer thing is to add a test that makes sure this doesn't get printed out. I'm concerned about sending users down this path on accident.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I'm keeping this fatal for testing.

So we have two approaches here:

  1. Keep the existing behavior but add checks that it is running as expected on CI.
  2. Make it fatal but do more work to make sure users don't fall down the path.

Copy link
Member

Choose a reason for hiding this comment

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

What I'm doing for impeller validations is that it is off by default (existing behavior) but I swap it on in the main() for the test runner and adding a test to make sure it it is on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm moving this back to error, as a follow up we need to make sure accidentally turning off validations causes a test somewhere to fail - ideally once for each shard.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return extra_env


def metal_validation_env(build_dir):
Copy link
Member

Choose a reason for hiding this comment

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

This contains both Metal and Vulkan configuration variables.

Rename this to metal_and_vulkan_validation_env?

Or have the caller create a merged dictionary from metal_validation_env and vulkan_validation_env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

tools/gn Outdated
gn_args['impeller_enable_vulkan'] = True

if args.enable_impeller_vulkan_playgrounds:
gn_args['impeller_enable_vulkan_playgrounds'] = True
Copy link
Member

Choose a reason for hiding this comment

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

Remove impeller_enable_vulkan_playgrounds from tools/gn now that it no longer exists in the GN scripts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #51341 at sha c53ff77

parser.add_argument(
'--enable-impeller-opengles',
default=False,
default=True,
Copy link
Member

Choose a reason for hiding this comment

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

Should the default value for --enable-impeller-vulkan also be switched?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets try it


# Whether the Vulkan backend is enabled.
impeller_enable_vulkan = (is_linux || is_win || is_android ||
impeller_enable_vulkan = (is_linux || is_win || is_android || is_mac ||
Copy link
Member

Choose a reason for hiding this comment

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

Why does this one have enable_unittests but the opengles one doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lets try it

parser.add_argument(
'--enable-impeller-vulkan-playgrounds',
default=False,
default=True,
Copy link
Member

Choose a reason for hiding this comment

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

The GN invocations all live in this repo, so if this flag is a no-op now, and is no longer passed in the json files, then it can be safely removed from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

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

Looks a lot better! Thanks for pushing on this!

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

lgtm!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 13, 2024
@auto-submit auto-submit bot merged commit 67e6328 into flutter:main Mar 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 13, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 13, 2024
…145106)

flutter/engine@6ceccf8...9551b49

2024-03-13 [email protected] [Impeller] fix heap selection process for YUV textures. (flutter/engine#51262)
2024-03-13 6844906[email protected] [Fuchsia] Enable sound null safety everywhere (flutter/engine#51355)
2024-03-13 [email protected] [Impeller] added missing golden test for DrawScaledTextWithPerspectiveSaveLayer (flutter/engine#51368)
2024-03-13 [email protected] Roll Skia from dc7443fa4d88 to 1ad0d0fabe7a (1 revision) (flutter/engine#51373)
2024-03-13 [email protected] Implement PlatformDispatcher.requestViewFocusChange on web.  (flutter/engine#50535)
2024-03-13 [email protected] [Impeller] attempt to get validation errors from CI unittests. (flutter/engine#51341)
2024-03-13 [email protected] Roll Dart SDK from b19e0995f317 to 18ec60df0774 (1 revision) (flutter/engine#51374)
2024-03-13 [email protected] [scenario app] make image matching fuzzier. (flutter/engine#51376)
2024-03-13 [email protected] Roll Skia from bbe453e3525d to dc7443fa4d88 (1 revision) (flutter/engine#51371)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Impeller] Vulkan playground tests aren't running on CI (with validations)

5 participants