-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Test FenceWaiterVK
and fix termination bugs
#45870
[Impeller] Test FenceWaiterVK
and fix termination bugs
#45870
Conversation
…larke/engine into gaaclarke-mock-vulkan-context-builder
FenceWaiterVK
and fix termination bugsFenceWaiterVK
and fix termination bugs
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 code is tricky, it looks good to me and the additional tests are an welcome addition. You should get 2 approvals just because it's tricky threading changes.
One minor nit across the board is that auto
should only be used if if makes the code easier to read, not out of convenience as per the style guide. We violate this a lot.
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
@chinmaygarde I have 2 LGTMs, but would prefer you as a third if you're around. |
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.
Not having static thread analysis annotated synchronization utils for condition variables really hurts the reviewability of this PR. We should patch that in //impeller/base/thread.h
. Rather not have to reason about things the compiler can :/
Other than that, just nits.
@@ -377,10 +377,6 @@ void ContextVK::Setup(Settings settings) { | |||
/// | |||
auto fence_waiter = | |||
std::shared_ptr<FenceWaiterVK>(new FenceWaiterVK(device_holder)); | |||
if (!fence_waiter->IsValid()) { |
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.
An invalid fence waiter will no longer invalidate the context now. In the future, if fence waiters cannot be created reliably, the call sites of the users will have to be patched.
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.
There is no such thing as an invalid fence waiter, that is, there is no state that ever marks the fence waiter as invalid. I found it misleading that we check a boolean that is effectively constant true - let's it add it back if/when there is such a case?
…ions) (#134876) Manual roll requested by [email protected] flutter/engine@326faf1...30b7e9d 2023-09-15 [email protected] Roll Skia from 7f88bda24f7f to 0057898979a1 (1 revision) (flutter/engine#45904) 2023-09-15 [email protected] [Impeller] Test `FenceWaiterVK` and fix termination bugs (flutter/engine#45870) 2023-09-15 [email protected] Roll Dart SDK from a5ee0055cf20 to e9452310189b (1 revision) (flutter/engine#45902) 2023-09-15 [email protected] Roll Skia from 4f26f22daa4b to 7f88bda24f7f (5 revisions) (flutter/engine#45901) 2023-09-15 [email protected] [Impeller] dont cache failed render target allocations. (flutter/engine#45895) 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
…ions) (flutter#134876) Manual roll requested by [email protected] flutter/engine@326faf1...30b7e9d 2023-09-15 [email protected] Roll Skia from 7f88bda24f7f to 0057898979a1 (1 revision) (flutter/engine#45904) 2023-09-15 [email protected] [Impeller] Test `FenceWaiterVK` and fix termination bugs (flutter/engine#45870) 2023-09-15 [email protected] Roll Dart SDK from a5ee0055cf20 to e9452310189b (1 revision) (flutter/engine#45902) 2023-09-15 [email protected] Roll Skia from 4f26f22daa4b to 7f88bda24f7f (5 revisions) (flutter/engine#45901) 2023-09-15 [email protected] [Impeller] dont cache failed render target allocations. (flutter/engine#45895) 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
Fixes flutter/flutter#134751, and @jonahwilliams suspects it could be related to a number of other flaky/texture leak scenarios (flutter/flutter#133506 (comment)) that only happen sometimes (i.e. on CI but not real devices), i.e. stuff like: ```txt --- Vulkan Debug Report  ---------------------------------------- |         Severity: Error |           Type: { Validation } |         ID Name: VUID-vkDestroyBuffer-buffer-00922 |        ID Number: -464217071 |    Queue Breadcrumbs: [NONE] |  CMD Buffer Breadcrumbs: [NONE] |     Related Objects: Device [94498356231456] [ImpellerDevice] |         Trigger: Validation Error: [ VUID-vkDestroyBuffer-buffer-00922 ] Object 0: handle = 0x55f21cf47d20, name = ImpellerDevice, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xe4549c11 | Cannot call vkDestroyBuffer on VkBuffer 0xbb00000000bb[] that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyBuffer-buffer-00922) ----------------------------------------------------------------- ``` --- ~~This PR will look a bit like a mess until the last 2 PRs merge in, but locally it appears to fix fence races/segfaults that I was seeing on CI, including on Linux with validations enabled. We can test it further tomorrow.~~ EDIT: Updated.
Fixes flutter/flutter#134751, and @jonahwilliams suspects it could be related to a number of other flaky/texture leak scenarios (flutter/flutter#133506 (comment)) that only happen sometimes (i.e. on CI but not real devices), i.e. stuff like:
This PR will look a bit like a mess until the last 2 PRs merge in, but locally it appears to fix fence races/segfaults that I was seeing on CI, including on Linux with validations enabled. We can test it further tomorrow.EDIT: Updated.