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

Synchronize accounting for render op depths #54794

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

flar
Copy link
Contributor

@flar flar commented Aug 27, 2024

Experimental Canvas was getting depth assertion errors while trying to use the depth values supplied by DisplayList. This was mainly due to a difference in understanding as to how many depth values to allocate to a drawImageNine operation.

n case there are additional discrepancies, debugging code is added to assert the understanding of how many depth values the experimental canvas uses on each rendering operation. The depth debugging can be turned on and off with a #define

@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, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

const uint64_t old_max_;
};

#define AUTO_DEPTH_WATCHER(d) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you document, here or elsewhere how to use AUTO_DEPTH_WATCHER if I were to add a new canvas command. it just takes the required depth increment, right?

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

@@ -790,6 +790,7 @@ struct DrawImageRectOp final : DrawOpBase {
#define DEFINE_DRAW_IMAGE_NINE_OP(name, render_with_attributes) \
struct name##Op final : DrawOpBase { \
static constexpr auto kType = DisplayListOpType::k##name; \
static constexpr uint32_t kDepthInc = 9; \
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this get used somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In DisplayListBuilder::Push

@flar flar requested a review from jonahwilliams August 27, 2024 05:54
@jonahwilliams
Copy link
Contributor

Looks go to me but not to CI. Also we should turn off the depth logging for profile/release, right?

@flar
Copy link
Contributor Author

flar commented Aug 27, 2024

It looks like the test mechanism caught a number of bugs that are still in the system.

I was going to ask about the disposition of that mechanism moving forward. The asserts in the ExpCanvas are enabled for all builds. These are similar, but are far more numerous. I could make it debug only (once I fix these failures).

@jonahwilliams
Copy link
Contributor

I think it would be good to shake out the bugs now. Longer term we should probably not FML_CHECK unless we think something will cause crashes elsewhere.

@flar
Copy link
Contributor Author

flar commented Aug 27, 2024

I think it would be good to shake out the bugs now. Longer term we should probably not FML_CHECK unless we think something will cause crashes elsewhere.

I just realized that these tests are running without ExpCanvas, which means that the assertions are trying to apply to the entity system that consumes depth values differently. I think there is at least one case where the entity canvas pushes an extra entity - which doesn't matter because it isn't using the depth accounting from DL, it is using its own.

So, I'm going to push a couple of commits here to test things out:

  • One with the mechanism enabled but the exp canvas also enabled (does this have any hope of passing?) to see if it still triggers the assertions in the new mechanism - this step will be just "for our information"
  • Another with the mechanism "enabled", but the exp canvas disabled and the mechanism gated behind requiring both the mechanism enable flag and also the exp canvas enable flag - which hopefully will not have errors because the mechanism won't be used with the non-exp canvas
  • Finally, a commit with the mechanism gated by debug mode and only enabled when using exp canvas.

@jonahwilliams
Copy link
Contributor

One with the mechanism enabled but the exp canvas also enabled (does this have any hope of passing?) to see if it still triggers the assertions in the new mechanism - this step will be just "for our information"

One would hope, as this is what I'd like to opt into after this and #54604 land this week.

@flar
Copy link
Contributor Author

flar commented Aug 27, 2024

I tried running the tests locally and they took a really long time and then died anyway due to vulkan issues on my machine so I just jumped to the end state and pushed that - hopefully it will pass CI tests this time (and continue to do so when exp canvas is enabled globally).

@flar
Copy link
Contributor Author

flar commented Aug 27, 2024

Passing CI now, depth watcher now restricted to ExpCanvas + DEBUG

Copy link
Contributor

@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!

@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 27, 2024
@auto-submit auto-submit bot merged commit cfc5c1b into flutter:main Aug 27, 2024
30 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
zanderso added a commit to flutter/flutter that referenced this pull request Aug 29, 2024
…154316)

Roll Flutter Engine from 8d248aead383 to f48ecf5b49f6 (40 revisions)

flutter/engine@8d248ae...f48ecf5

2024-08-29 [email protected] [Impeller] Use multiple command
buffers for blur submission. (flutter/engine#54846)
2024-08-29 [email protected] Roll Skia from 0d8d9d2974fa to
e37b6b198016 (1 revision) (flutter/engine#54854)
2024-08-29 [email protected] Remove
`--disable-dart-dev` across `flutter/engine`. (flutter/engine#54845)
2024-08-28 [email protected] Roll Fuchsia Test Scripts from
vIJGWtHj4Rdku9Ayv... to NWpblL_DFACOx_Spi... (flutter/engine#54852)
2024-08-28 [email protected] [Impeller] fix clip culling with exp
canvas. (flutter/engine#54701)
2024-08-28 [email protected] Roll Dart SDK from
bc3dad16b2d3 to fed5ce7ea2ad (2 revisions) (flutter/engine#54851)
2024-08-28 [email protected] Roll Skia from d55406ca32e9 to
0d8d9d2974fa (4 revisions) (flutter/engine#54850)
2024-08-28 [email protected] [skwasm] Always do backdrop filter
operation even if empty. (flutter/engine#54844)
2024-08-28 [email protected]
Migrate`header_guard_check` to `package:test`. (flutter/engine#54811)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
OKGFjciA5Vd0TQks4... to ALNKvSVWQSpw1uxPy... (flutter/engine#54848)
2024-08-28 [email protected] Roll Skia from cd3d3daafe55 to
d55406ca32e9 (10 revisions) (flutter/engine#54847)
2024-08-28 [email protected] [Impeller] ensure that srcOver to
src conversion takes stroke coverage into account.
(flutter/engine#54817)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
ALNKvSVWQSpw1uxPy... to OKGFjciA5Vd0TQks4... (flutter/engine#54840)
2024-08-28 [email protected] Remove scorecards and
other bading we are no longer tracking/links are borked
(flutter/engine#54839)
2024-08-28 [email protected] Compile dart2wasm modules using the JS
runtime exported compileStreaming (flutter/engine#51488)
2024-08-28 [email protected] Roll Dart SDK from
183b9e21b706 to bc3dad16b2d3 (1 revision) (flutter/engine#54838)
2024-08-28 [email protected] Ignore generated fixture
`.dill.deps` files. (flutter/engine#54836)
2024-08-28 6844906[email protected]
[fuchsia] use the api-level from gn-sdk (flutter/engine#54740)
2024-08-28 [email protected] [Impeller] port clip stack fixes to
new canvas. (flutter/engine#54727)
2024-08-28 [email protected] [Impeller] fall back to path
rendering on thick paths. (flutter/engine#54822)
2024-08-28 [email protected] Roll Fuchsia Linux SDK from
BCqzoTS_Sz6-AaSii... to ZL8AvfXX5LFIH1LYN... (flutter/engine#54834)
2024-08-28 [email protected] Roll Skia from ca108745b1de to
cd3d3daafe55 (1 revision) (flutter/engine#54832)
2024-08-28 [email protected] Roll Dart SDK from
42ddf2278114 to 183b9e21b706 (1 revision) (flutter/engine#54830)
2024-08-28 [email protected] Roll Dart SDK from
b519f85c3076 to 42ddf2278114 (1 revision) (flutter/engine#54829)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
OKGFjciA5Vd0TQks4... to ALNKvSVWQSpw1uxPy... (flutter/engine#54827)
2024-08-28 [email protected] Roll Skia from 41cb13f65fe6 to
ca108745b1de (1 revision) (flutter/engine#54828)
2024-08-28 [email protected] Roll Skia from 259010335a55 to
41cb13f65fe6 (2 revisions) (flutter/engine#54826)
2024-08-28 [email protected] Roll Skia from 505fb55cd044 to
259010335a55 (1 revision) (flutter/engine#54823)
2024-08-28 [email protected] Roll Dart SDK from
8334290a421b to b519f85c3076 (1 revision) (flutter/engine#54821)
2024-08-28 [email protected] Roll Skia from 84e4a69da303 to
505fb55cd044 (1 revision) (flutter/engine#54819)
2024-08-27 [email protected] [Impeller] Increase host buffer
arena count to 4. (flutter/engine#54808)
2024-08-27 [email protected] Synchronize accounting for render op depths
(flutter/engine#54794)
2024-08-27 [email protected] Fix broken links
in `docs/` (flutter/engine#54815)
2024-08-27 [email protected] [Impeller] Don't override user
specification on Vulkan validation in unopt. (flutter/engine#54816)
2024-08-27 [email protected] Manual roll Dart SDK from
b81b344a194f to 8334290a421b (12 revisions) (flutter/engine#54813)
2024-08-27 [email protected] Roll Skia from 77017d30a455 to
84e4a69da303 (3 revisions) (flutter/engine#54812)
2024-08-27 [email protected] [Impeller] Clarify where to put the
metadata in the manifest. (flutter/engine#54814)
2024-08-27 [email protected] [Impeller] Use infinite swapchain
present timeouts to avoid logspam. (flutter/engine#54810)
2024-08-27 [email protected] Roll Skia from 2e1eea538014 to
77017d30a455 (2 revisions) (flutter/engine#54809)
2024-08-27 [email protected] Roll Skia from a2e2eb292492 to
2e1eea538014 (4 revisions) (flutter/engine#54806)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from BCqzoTS_Sz6- to ZL8AvfXX5LFI

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
...

---------

Co-authored-by: Zachary Anderson <[email protected]>
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#154316)

Roll Flutter Engine from 8d248aead383 to f48ecf5b49f6 (40 revisions)

flutter/engine@8d248ae...f48ecf5

2024-08-29 [email protected] [Impeller] Use multiple command
buffers for blur submission. (flutter/engine#54846)
2024-08-29 [email protected] Roll Skia from 0d8d9d2974fa to
e37b6b198016 (1 revision) (flutter/engine#54854)
2024-08-29 [email protected] Remove
`--disable-dart-dev` across `flutter/engine`. (flutter/engine#54845)
2024-08-28 [email protected] Roll Fuchsia Test Scripts from
vIJGWtHj4Rdku9Ayv... to NWpblL_DFACOx_Spi... (flutter/engine#54852)
2024-08-28 [email protected] [Impeller] fix clip culling with exp
canvas. (flutter/engine#54701)
2024-08-28 [email protected] Roll Dart SDK from
bc3dad16b2d3 to fed5ce7ea2ad (2 revisions) (flutter/engine#54851)
2024-08-28 [email protected] Roll Skia from d55406ca32e9 to
0d8d9d2974fa (4 revisions) (flutter/engine#54850)
2024-08-28 [email protected] [skwasm] Always do backdrop filter
operation even if empty. (flutter/engine#54844)
2024-08-28 [email protected]
Migrate`header_guard_check` to `package:test`. (flutter/engine#54811)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
OKGFjciA5Vd0TQks4... to ALNKvSVWQSpw1uxPy... (flutter/engine#54848)
2024-08-28 [email protected] Roll Skia from cd3d3daafe55 to
d55406ca32e9 (10 revisions) (flutter/engine#54847)
2024-08-28 [email protected] [Impeller] ensure that srcOver to
src conversion takes stroke coverage into account.
(flutter/engine#54817)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
ALNKvSVWQSpw1uxPy... to OKGFjciA5Vd0TQks4... (flutter/engine#54840)
2024-08-28 [email protected] Remove scorecards and
other bading we are no longer tracking/links are borked
(flutter/engine#54839)
2024-08-28 [email protected] Compile dart2wasm modules using the JS
runtime exported compileStreaming (flutter/engine#51488)
2024-08-28 [email protected] Roll Dart SDK from
183b9e21b706 to bc3dad16b2d3 (1 revision) (flutter/engine#54838)
2024-08-28 [email protected] Ignore generated fixture
`.dill.deps` files. (flutter/engine#54836)
2024-08-28 6844906[email protected]
[fuchsia] use the api-level from gn-sdk (flutter/engine#54740)
2024-08-28 [email protected] [Impeller] port clip stack fixes to
new canvas. (flutter/engine#54727)
2024-08-28 [email protected] [Impeller] fall back to path
rendering on thick paths. (flutter/engine#54822)
2024-08-28 [email protected] Roll Fuchsia Linux SDK from
BCqzoTS_Sz6-AaSii... to ZL8AvfXX5LFIH1LYN... (flutter/engine#54834)
2024-08-28 [email protected] Roll Skia from ca108745b1de to
cd3d3daafe55 (1 revision) (flutter/engine#54832)
2024-08-28 [email protected] Roll Dart SDK from
42ddf2278114 to 183b9e21b706 (1 revision) (flutter/engine#54830)
2024-08-28 [email protected] Roll Dart SDK from
b519f85c3076 to 42ddf2278114 (1 revision) (flutter/engine#54829)
2024-08-28 [email protected] Roll Fuchsia GN SDK from
OKGFjciA5Vd0TQks4... to ALNKvSVWQSpw1uxPy... (flutter/engine#54827)
2024-08-28 [email protected] Roll Skia from 41cb13f65fe6 to
ca108745b1de (1 revision) (flutter/engine#54828)
2024-08-28 [email protected] Roll Skia from 259010335a55 to
41cb13f65fe6 (2 revisions) (flutter/engine#54826)
2024-08-28 [email protected] Roll Skia from 505fb55cd044 to
259010335a55 (1 revision) (flutter/engine#54823)
2024-08-28 [email protected] Roll Dart SDK from
8334290a421b to b519f85c3076 (1 revision) (flutter/engine#54821)
2024-08-28 [email protected] Roll Skia from 84e4a69da303 to
505fb55cd044 (1 revision) (flutter/engine#54819)
2024-08-27 [email protected] [Impeller] Increase host buffer
arena count to 4. (flutter/engine#54808)
2024-08-27 [email protected] Synchronize accounting for render op depths
(flutter/engine#54794)
2024-08-27 [email protected] Fix broken links
in `docs/` (flutter/engine#54815)
2024-08-27 [email protected] [Impeller] Don't override user
specification on Vulkan validation in unopt. (flutter/engine#54816)
2024-08-27 [email protected] Manual roll Dart SDK from
b81b344a194f to 8334290a421b (12 revisions) (flutter/engine#54813)
2024-08-27 [email protected] Roll Skia from 77017d30a455 to
84e4a69da303 (3 revisions) (flutter/engine#54812)
2024-08-27 [email protected] [Impeller] Clarify where to put the
metadata in the manifest. (flutter/engine#54814)
2024-08-27 [email protected] [Impeller] Use infinite swapchain
present timeouts to avoid logspam. (flutter/engine#54810)
2024-08-27 [email protected] Roll Skia from 2e1eea538014 to
77017d30a455 (2 revisions) (flutter/engine#54809)
2024-08-27 [email protected] Roll Skia from a2e2eb292492 to
2e1eea538014 (4 revisions) (flutter/engine#54806)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from BCqzoTS_Sz6- to ZL8AvfXX5LFI

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
...

---------

Co-authored-by: Zachary Anderson <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants