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

Conversation

@CaseyHillers
Copy link
Contributor

@CaseyHillers CaseyHillers commented Apr 5, 2023

Reverts #40894

This is breaking Google Testing. See b/277004090

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Apr 5, 2023
@CaseyHillers CaseyHillers added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 5, 2023
@yjbanov
Copy link
Contributor

yjbanov commented Apr 5, 2023

All failures are in Firefox 72, which we do not support.

@XilaiZhang
Copy link
Contributor

just to verify, Yegor is okay with a revert right?

@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 #40937 at sha 2256882

@yjbanov
Copy link
Contributor

yjbanov commented Apr 5, 2023

The golden seems to be another Impeller flake. Let's land this.

@yjbanov yjbanov merged commit f95b1f6 into main Apr 5, 2023
@yjbanov yjbanov deleted the revert-40894-native-memory-3 branch April 5, 2023 04:49
@XilaiZhang
Copy link
Contributor

Look at Yegor -- so efficient!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 5, 2023
CaseyHillers pushed a commit to flutter/flutter that referenced this pull request Apr 5, 2023
…124200)

flutter/engine@4219c72...db23c3f

2023-04-05 [email protected] [Impeller] Snap glyph positions to screen
space pixels and map UVs correctly (flutter/engine#40912)
2023-04-05 [email protected] [macOS] Handle termination in
FlutterAppDelegate (flutter/engine#40929)
2023-04-05 [email protected] Manual roll Dart SDK from
f97b9d9b2f64 to beff36793081 (1 revision) (flutter/engine#40934)
2023-04-05 [email protected] Revert "[web] remove obsolete object
caches; simplify native object management" (flutter/engine#40937)

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://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
yjbanov added a commit that referenced this pull request Apr 5, 2023
(this is attempt 4; details below)

Remove obsolete object caches and introduce a simpler way to manage
native objects:

* Remove the unused `SynchronousSkiaObjectCache`.
* Introduce new library `native_memory.dart` that's smaller and simpler
than `skia_object_cache.dart`.
* Introduce two types of native object references:
  * `UniqueRef` a reference with a unique Dart object owner.
* `CountedRef` a ref-counted reference with multiple Dart object owners.
* All native references use GC (via `FinalizationRegistry`) as a
back-up.
* The new library removes everything related to object resurrection that
was needed only in browsers that didn't support `FinalizationRegistry`.
All browsers support it now.
* Remove the ad hoc `SkParagraph` cache that predates the introduction
of `Paragraph.dispose`.
* Rewrite `CkParagraph` in terms of `UniqueRef`.
* Rewrite `CkImage` in terms of `CountedRef`; delete `SkiaObjectBox`.

This PR does not migrate all objects from the old
`skia_object_cache.dart` to `native_memory.dart`. That would be too big
of a change. The migration can be done in multiple smaller PRs.

This also removes a few unnecessary relayouts observed in
flutter/flutter#120921, but not all of them
(more details in
flutter/flutter#120921 (comment))

## About attempt 4

More info about the revert of attempt 3 in
#40937.

In this attempt I check that the browser supports `FinalizationRegistry`
before registering the object. This will allow the code to run in older
browsers, but there will be no protection from memory leaks when the app
fails to dispose of the respective objects.

## Benchmarks

Now that this landed in flutter/flutter I have some benchmark numbers
from the devicelab. The `text_out_of_picture_bounds` benchmark dropped
by 3-4x (lower is better):

<img width="358" alt="Screenshot 2023-04-04 at 6 13 06 PM"
src="https://user-images.githubusercontent.com/211513/229956170-a5399ed3-c779-4af0-babb-ea40440f96ff.png">

The repro provided in flutter/flutter#123204
dropped from 110ms/frame to 10ms/frame.
exaby73 pushed a commit to NevercodeHQ/flutter that referenced this pull request Apr 17, 2023
…lutter#124200)

flutter/engine@4219c72...db23c3f

2023-04-05 [email protected] [Impeller] Snap glyph positions to screen
space pixels and map UVs correctly (flutter/engine#40912)
2023-04-05 [email protected] [macOS] Handle termination in
FlutterAppDelegate (flutter/engine#40929)
2023-04-05 [email protected] Manual roll Dart SDK from
f97b9d9b2f64 to beff36793081 (1 revision) (flutter/engine#40934)
2023-04-05 [email protected] Revert "[web] remove obsolete object
caches; simplify native object management" (flutter/engine#40937)

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://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
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 platform-web Code specifically for the web engine will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants