Enable SharedArrayBuffer by default on Nightly
Categories
(Core :: DOM: Core & HTML, task, P2)
Tracking
()
People
(Reporter: annevk, Assigned: tt)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Once we implement the logic needed for bug 1562663, we could ship SharedArrayBuffer by default, even if we don't yet ship COOP/COEP which would allow using it in a threaded/high-resolution timer fashion.
This might be useful for determining the level of breakage with this overall approach.
To restate, the plan is that we have SharedArrayBuffer available at all times, but you cannot postMessage() it without imposing restrictions on yourself (COOP and COEP). Without postMessage() support SharedArrayBuffer is as powerful as ArrayBuffer.
This plan has been coordinated with various standards bodies (e.g., TC39 at https://github.com/tc39/ecma262/issues/1435) and no concerns have been raised thus far over quite a significant period of time.
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
So we need a better error message for postMessage()
failures due to usage of SharedArrayBuffer and Webassembly.Module.
Suggestion:
The {X} object cannot be serialized The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers will enable this in the future.
(This will also help those that raised and commented in bug 1586217.)
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
(In reply to Anne (:annevk) from comment #1)
So we need a better error message for
postMessage()
failures due to usage of SharedArrayBuffer and Webassembly.Module.Suggestion:
The {X} object cannot be serialized The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers will enable this in the future.
(This will also help those that raised and commented in bug 1586217.)
Just to confirm, I assume that we want to return this error message while returning DOM_DATA_CLONE_ERROR [1]. Is that correct?
I ask that because I found Bug 1587007 and I assume Lars will improve error message for [2].
[1] https://searchfox.org/mozilla-central/rev/7cc0f0e89cb40e43bf5c96906f13d44705401042/dom/base/StructuredCloneHolder.cpp#264
[2] https://searchfox.org/mozilla-central/rev/7cc0f0e89cb40e43bf5c96906f13d44705401042/js/src/vm/StructuredClone.cpp#1251-1252
Reporter | ||
Comment 3•5 years ago
|
||
The exception that's thrown from postMessage()
due to the COOP/COEP bit not being set should have the above proposal as its message. https://groups.google.com/d/msg/mozilla.dev.platform/9cRww2hlScY/XsgsjtbfBAAJ has instructions for which API to use.
Bug 1587007 seems like a duplicate of this bug, but perhaps we should fix it there to keep this bug purely for landing the preference flip.
Comment 4•5 years ago
|
||
Yeah, this bug is pretty meta, let's fix error messages on bug 1587007.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
This patch does:
- Rename CanShareMemory to IsCrossOriginIsolated
- Only check COOP and COEP on the serializing side
- Check if the caller AgentClusterId is same as target on the deserializng side
Note that this patch assumes that it's safe to not throw for the case that the
target window is navigated to another origin but in the same agent cluster while
the MessageEvent is in-flight.
Assignee | ||
Comment 7•5 years ago
|
||
Depends on D50198
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #8)
try for P1 + P2 https://treeherder.mozilla.org/#/jobs?repo=try&revision=e6e3c1d1fb59ac8bd85fa3781197a56097b7a338
After addressing comment for P1
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1142ed55fa11692093c3becfb03577399ab4143e
Assignee | ||
Comment 11•5 years ago
•
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #10)
(In reply to Tom Tung [:tt, :ttung] from comment #8)
try for P1 + P2 https://treeherder.mozilla.org/#/jobs?repo=try&revision=e6e3c1d1fb59ac8bd85fa3781197a56097b7a338
After addressing comment for P1
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1142ed55fa11692093c3becfb03577399ab4143e
It seems the change for checking remoteType makes wpt test on Android fails. I'm checking more info on try.
Try without the remoteType check: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c3aed6ef80556e14c00ac8c79ac653067351b01
Try with the check and printing some log: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f25ca34f9ca59c69cdd15bd03c3fb6b3b74433ba
If it's related to, then I will probably extract the code for checking remote type out to another patch and land the part without it.
Assignee | ||
Comment 12•5 years ago
|
||
Depends on D50444
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #11)
It seems the change for checking remoteType makes wpt test on Android fails. I'm checking more info on try.
Try without the remoteType check: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c3aed6ef80556e14c00ac8c79ac653067351b01
Try with the check and printing some log: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f25ca34f9ca59c69cdd15bd03c3fb6b3b74433ba
Nika, the try result shows that it hit the assertion for checking remoteType on try in IsCrossOriginIsloated()
. I'm not really familiar with the behavior remoteType
and contentChild
on Android (Gecko view). So, I'm printing more information to understanding what's going on, but maybe you have some idea of that?
Assignee | ||
Comment 15•5 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #14)
Nika, the try result shows that it hit the assertion for checking remoteType on try in
IsCrossOriginIsloated()
. I'm not really familiar with the behaviorremoteType
andcontentChild
on Android (Gecko view). So, I'm printing more information to understanding what's going on, but maybe you have some idea of that?
It seems that Fenix is not mulit e10s (one content process) so this is expected to fail on Andriod. I will disable to test on Andriod.
Assignee | ||
Comment 16•5 years ago
•
|
||
Comment 17•5 years ago
|
||
bugherder |
Assignee | ||
Comment 18•5 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #9)
try for P1+P2+P3 https://treeherder.mozilla.org/#/jobs?repo=try&revision=011ae94860c6943ee4665acc0d6528fb8c33ca5b
The remaining work is to expect some tests pass in this try
Comment 19•5 years ago
|
||
Assignee | ||
Comment 20•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cdb0bb08ce22351a7f11a3fba67e8ea798ee579
I still need to update some tests in SM.
Comment 21•5 years ago
|
||
bugherder |
Comment 22•5 years ago
|
||
bugherder landing |
Assignee | ||
Comment 23•5 years ago
|
||
(In reply to Tom Tung [:tt, :ttung] from comment #20)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=cdb0bb08ce22351a7f11a3fba67e8ea798ee579
I still need to update some tests in SM.
Remaining wpt tests is webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html and encoding/streams/decode-utf8.any.sharedworker.html
Assignee | ||
Comment 24•5 years ago
|
||
try https://treeherder.mozilla.org/#/jobs?repo=try&revision=f4adfabb2b37c8b17fe53c15f0c20493202d7c47
Note: there should still have jit tests failures, but I assume fixing them are easier (because I can just disable a whole test rather than like wpt test I need to disable sub-test one by one)
Assignee | ||
Comment 25•5 years ago
|
||
Somehow failure jit tests can pass without any modification on my Mac. So this try is to verify if I don't need to make any further change on these jit tests. If they are still failing, then I will update a patch with disabling all of them.
Assignee | ||
Comment 26•5 years ago
•
|
||
One more try for wpt tests https://treeherder.mozilla.org/#/jobs?repo=try&revision=8b8ee1cdbd0dc0858d9bff4924d5dc14fbbb94f3
Updated•5 years ago
|
Assignee | ||
Comment 27•5 years ago
|
||
After enabling the perf for SAB by default on Nightly, some jsreftests fail.
And they all have log like:
tests/test262/shell.js:492: Error: Agents not available item 1
It seems that there are some issues on test262 shell, so the plan of this patch
is to disable these tests and open another follow-up ticket to re-enable them.
So that we could check the impact of enable the perf for SAB without enabling
the functionality of being postMessage'ed on Nightly users.
Depends on D48838
Assignee | ||
Comment 28•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 29•5 years ago
|
||
Depends on D53966
Updated•5 years ago
|
Assignee | ||
Comment 30•5 years ago
•
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 31•5 years ago
|
||
Comment 32•5 years ago
|
||
Comment 33•5 years ago
|
||
bugherder |
Assignee | ||
Updated•5 years ago
|
Comment 34•4 years ago
|
||
See https://github.com/mdn/sprints/issues/2219 for docs
Description
•