-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] flutter_tester --enable-impeller #46389
Conversation
bdero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just nits!
shell/testing/BUILD.gn
Outdated
| } else if (is_mac) { | ||
| libs += [ "$root_out_dir/libvk_swiftshader.dylib" ] | ||
| } else if (is_linux) { | ||
| libs += [ "$root_out_dir/libvk_swiftshader.so" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think we have these swiftshader lib names copied around in 3 or 4 places at this point (including in some source files). Not sure if there's one good place we could consolidate them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up moving this to //flutter/vulkan/swiftshader_path.h
shell/testing/tester_main.cc
Outdated
| if (res != impeller::vk::Result::eSuccess) { | ||
| VALIDATION_LOG << "Could not create surface for tester " | ||
| << impeller::vk::to_string(res); | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return -1; | |
| return EXIT_FAILURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done here and elsewhere
shell/testing/tester_main.cc
Outdated
| impeller_surface_context = impeller_context->CreateSurfaceContext(); | ||
| if (!impeller_surface_context->SetWindowSurface(std::move(surface))) { | ||
| VALIDATION_LOG << "Could not set up surface for context."; | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return -1; | |
| return EXIT_FAILURE; |
shell/testing/tester_main.cc
Outdated
| impeller_context = impeller::ContextVK::Create(std::move(context_settings)); | ||
| if (!impeller_context || !impeller_context->IsValid()) { | ||
| VALIDATION_LOG << "Could not create Vulkan context."; | ||
| return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return -1; | |
| return EXIT_FAILURE; |
| impeller_modern_shaders_vk_data, impeller_modern_shaders_vk_length), | ||
| #if IMPELLER_ENABLE_3D | ||
| std::make_shared<fml::NonOwnedMapping>( | ||
| impeller_scene_shaders_vk_data, impeller_scene_shaders_vk_length), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking care of Scene. 🙏
testing/dart/canvas_test.dart
Outdated
|
|
||
| typedef CanvasCallback = void Function(Canvas canvas); | ||
|
|
||
| bool get impellerEnabled => Platform.executableArguments.contains('--enable-impeller'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider factoring this definition out into a .dart file under testing/dart, and importing it where needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
testing/run_tests.py
Outdated
| ) | ||
| yield gather_dart_test(build_dir, dart_test_file, True, True) | ||
| yield gather_dart_test(build_dir, dart_test_file, False, True) | ||
| yield gather_dart_test(build_dir, dart_test_file, True, False, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should have been done earlier, but 4 unnamed boolean flags seems like too many. Maybe the simplest thing is just to always pass the arguments as named and always pass them all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
Many tests appear to be segfaulting. Maybe the tests that are failing under asan are a good starting point? |
Most of those were an issue where the swiftshader dylib was getting loaded and unloaded too quickly. There's still one ASAN issue I'm looking at. |
|
I'm not seeing segfaults anymore. I do see some flaky failures that seem unrelated to this patch, filed some bugs. Looks like this will be g2g now. |
…136422) flutter/engine@8bf1460...05e26c1 2023-10-11 [email protected] Run the binary size treemap script from the buildroot directory (flutter/engine#46740) 2023-10-11 [email protected] [Impeller] flutter_tester --enable-impeller (flutter/engine#46389) 2023-10-11 [email protected] Switch to Chrome For Testing instead of Chromium (flutter/engine#46683) 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
flutter#46895) Follows up on flutter#46389 That patch was too permissive in cases where a build system enables impeller but not vulkan. This change makes the build succeed in such systems.
This patch does the following: - Updates `flutter_tester` to set up an Impeller rendering context and surface if `--enable-impeller` is set to true, using the Vulkan backend with Swiftshader. - Updates `run_tests.py` to run all tests except the smoke test (that one really has no rendering impact whatsoever) with and without `--enable-impeller`. - Updates a few tests to work that were trivial: - A couple tests needed updated goldens for very minor rendering differences. Filed flutter/flutter#135684 to track using Skia gold for this instead. - Disabled SKP screenshotting if Impeller is enabled, and updated the test checking that to verify an error is thrown if an SKP is requested. - The Dart GPU based test now asserts that the gpu context is available if Impeller is enabled, and does not deadlock if run in a single threaded mode. - We were missing some trace events around `Canvas::SaveLayer` for Impeller as compared to Skia. - A couple other tests had strict checks about exception messages that are slightly different between Skia and Impeller. - I've filed bugs for other tests that may require a little more work, and skipped them for now. For FragmentProgram on Vulkan I reused an existing bug. This is part of my attempt to address flutter/flutter#135693, although @chinmaygarde and I had slightly different ideas about how to do this. The goals here are: - Run the Dart unit tests we already have with Impeller enabled. - Enable running more of the framework tests (including gold tests) with Impeller enabled. - Run all of these tests via public `dart:ui` API rather than mucking around in C++ internals in the engine.
This patch does the following:
flutter_testerto set up an Impeller rendering context and surface if--enable-impelleris set to true, using the Vulkan backend with Swiftshader.run_tests.pyto run all tests except the smoke test (that one really has no rendering impact whatsoever) with and without--enable-impeller.Canvas::SaveLayerfor Impeller as compared to Skia.impeller_enable_vulkan_playgrounds), and avoids any messy logic around whether we fallback to swiftshader or not.This is part of my attempt to address flutter/flutter#135693, although @chinmaygarde and I had slightly different ideas about how to do this.
The goals here are:
dart:uiAPI rather than mucking around in C++ internals in the engine.