-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Eagerly lose WebGL context on DrawWebGL.destroy()
#7080
Conversation
Current Playwright Test Results Summary✅ 14 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 10/03/2023 07:33:14pm UTC) Run DetailsRunning Workflow e2e-couchdb on Github Actions Commit: e2b7b83 Started: 10/03/2023 07:30:32pm UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Display Layout When multiple plots are contained in a layout, we only ask for annotations once @couchdb
Retry 1 • Initial Attempt |
2.22% (1)1 / 45 runfailed over last 7 days |
22.22% (10)10 / 45 runsflaked over last 7 days |
Current Playwright Test Results Summary
✅ 141 Passing -
Run may still be in progress, this comment will be updated as current testing workflow or job completes...
(Last updated on 10/03/2023 07:33:14pm UTC)
⚠️ Flakes
📄 functional/plugins/notebook/notebookSnapshots.e2e.spec.js • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Snapshot image tests Can drop an image onto a notebook and create a new entry
Retry 1 • Initial Attempt |
16.84% (16)16 / 95 runsfailed over last 7 days |
54.74% (52)52 / 95 runsflaked over last 7 days |
Codecov Report
@@ Coverage Diff @@
## master #7080 +/- ##
==========================================
- Coverage 59.87% 55.26% -4.61%
==========================================
Files 413 650 +237
Lines 12795 26100 +13305
Branches 0 2549 +2549
==========================================
+ Hits 7661 14425 +6764
- Misses 5134 10979 +5845
- Partials 0 696 +696
*This pull request uses carry forward flags. Click here to find out more.
... and 383 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
- Recommended by Mozilla's [WebGL best practices]-(https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#lose_contexts_eagerly).
DrawWebGL.destroy()
With this implementation, are you making the trade off that we will pay the penalty for creating the context on navigation to a complex display or map tool inspector? If there are two complex plot displays with 16 plots each, in two separate chrome tabs, are we creating and destroying the WebGL contexts Every time a user uses a different tab? |
According to the documentation this Web GL extension will simulate a loss of context. Are we sure it's actually losing the context? Does it fix the issues we were seeing? - https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_lose_context |
Yes, this does fix the issue with losing WebGL context. It looks like it's marking the context for deletion and being picked up by GC much quicker. Although it "simulates" losing context (confusing wording?), it is recommended as a best practice. |
We already pay this penalty on navigation. This change just marks the contexts for deletion so that the GC can pick it up quicker. There's no way to manually destroy a context completely in memory, it needs to be handled by the GC, according to WebGL docs (I don't have the link unfortunately).
No. I believe the contexts are actually per browser instance, so in this case there would be potentially up to 16 WebGL contexts from Open MCT, and 16 contexts that fall back to 2D. |
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.
Looks good! Nice work!
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.
Had some difficulty checking out the branch due to numbers appearing as a commit hash to git, but was able to solve that using git checkout --track origin/7074
.
Here's the behavior before, with the nasty warnings stating Too many active WebGL contexts.
:
before.mov
Here's the behavior after, with WebGL contexts properly being trashed 🚮:
Closes #7081
Describe your changes:
Eagerly lose WebGL contexts on destroy by using the
WEBGL_lose_context
extension, recommended as a WebGL best practice, in an attempt to free up WebGL contexts sooner after Plots are unmounted.All Submissions:
Author Checklist
Reviewer Checklist