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

[Flutter GPU] Export symbols from engine, stub for testing on CI. #44280

Merged
merged 7 commits into from
Aug 3, 2023

Conversation

bdero
Copy link
Member

@bdero bdero commented Aug 2, 2023

Part of flutter/flutter#131346

Stubs a minimal test of the FFI utilities that dart:ui uses, but using public symbols exported from the engine library. If this goes well, I'll move the stuff from dart:ui into here and begin landing parts of the API with test coverage.

@bdero bdero self-assigned this Aug 2, 2023
@bdero bdero force-pushed the bdero/dart-gpu-symbol-export branch from aa0f2e0 to f68a7a5 Compare August 2, 2023 18:36
@bdero
Copy link
Member Author

bdero commented Aug 2, 2023

@chinmaygarde @jonahwilliams @zanderso This is a silly PR with some exported symbols to make sure implementing the full API will actually be viable through public symbol exports. I'll probably move everything over in incremental PRs if this doesn't suck.

Definitely interested in feedback around patterns for exporting these symbols as well. We're separately solving the issue of getting the flutter_gpu code into the framework through this discussion: flutter/flutter#131711

@bdero bdero force-pushed the bdero/dart-gpu-symbol-export branch from f68a7a5 to a6c5c71 Compare August 2, 2023 18:51
@jonahwilliams
Copy link
Member

I'm okay with exposing symbols as long as 1) we make a reasonable effort to ensure there won't be accidental collisions with other libraries 2) we document somewhere that these symbols do not constitute a public API

@bdero
Copy link
Member Author

bdero commented Aug 2, 2023

@jonahwilliams I plan to prefix all of the exported symbols with FlutterGpu -- does that seem sufficient to avoid collisions? We could perhaps use more specialty names that look more dangerous to rely on. For example, prepending Private. Thoughts?

WRT documenting that they shouldn't be used, do you have any suggestions about where we could best do this? I don't see any perfect entry points. In addition to warnings around the C++ and Dart code, I could add a note to the custom embedder wiki page linked here since these users are likely to discover these symbols.

Perhaps starting a new wiki page for Dart GPU in general would be a good idea.

@jonahwilliams
Copy link
Member

FlutterGPU sounds like a good idea. You could go a bit further with the naming like InternalFlutterGPU or something that makes it more apparent it is not intended to be a public API (not sure what best practices are here). Starting a wiki page sounds like a good idea too.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

Overall approach seems fine. It might make sense to sprinkle some TODOs with links to GitHub issues in places where the code is temporary. Presubmit test failures are related.

test('no crash', () async {
final int result = gpu.testProc();
expect(result, 1);

Copy link
Member

Choose a reason for hiding this comment

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

Does testProcWithCallback work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah, added it in the test.

@bdero bdero force-pushed the bdero/dart-gpu-symbol-export branch from f777228 to 0979e9c Compare August 2, 2023 22:09
@bdero
Copy link
Member Author

bdero commented Aug 2, 2023

Okay, almost there. Just need to figure out these remaining breakages.

@bdero bdero changed the title [Dart GPU] Export symbols from engine, stub for testing on CI. [Flutter GPU] Export symbols from engine, stub for testing on CI. Aug 2, 2023
@bdero bdero force-pushed the bdero/dart-gpu-symbol-export branch 2 times, most recently from 141fed9 to 3caf816 Compare August 2, 2023 23:20
@bdero
Copy link
Member Author

bdero commented Aug 2, 2023

Failures are looking unrelated. Let's give rebasing a try.

@bdero bdero force-pushed the bdero/dart-gpu-symbol-export branch from 3caf816 to 7783d6d Compare August 2, 2023 23:43
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 3, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 3, 2023
…ions) (#131880)

Manual roll requested by jacksongardner@google.com

flutter/engine@4cc0b3d...b08e141

2023-08-03 john@johnmccutchan.com Add @keep annotations to avoid dead code elimination of classes only referenced by JNI (flutter/engine#44337)
2023-08-03 skia-flutter-autoroll@skia.org Roll Skia from bd3ee535e246 to 36072a994f11 (2 revisions) (flutter/engine#44329)
2023-08-03 skia-flutter-autoroll@skia.org Roll Dart SDK from dcd09f5726b7 to e3d2b4a190aa (1 revision) (flutter/engine#44330)
2023-08-03 30870216+gaaclarke@users.noreply.github.com [Impeller] updated validation layers documentation (flutter/engine#44328)
2023-08-03 41930132+hellohuanlin@users.noreply.github.com [ios]make the screenIfViewLoaded and windowSceneIfLoaded helpers reusable (flutter/engine#44303)
2023-08-03 skia-flutter-autoroll@skia.org Roll Skia from 768050436c0a to bd3ee535e246 (2 revisions) (flutter/engine#44327)
2023-08-03 john@johnmccutchan.com Re-Re-Land Support for rendering Android Platform Views into a HardwareBuffer backed texture (flutter/engine#44326)
2023-08-03 skia-flutter-autoroll@skia.org Roll Skia from 8a377a9545b8 to 768050436c0a (1 revision) (flutter/engine#44320)
2023-08-03 bdero@google.com [Flutter GPU] Export symbols from engine, stub for testing on CI. (flutter/engine#44280)

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 jacksongardner@google.com,rmistry@google.com,zra@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…utter#44280)

Part of flutter/flutter#131346

Stubs a minimal test of the FFI utilities that `dart:ui` uses, but using
public symbols exported from the engine library. If this goes well, I'll
move the stuff from `dart:ui` into here and begin landing parts of the
API with test coverage.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants