Skip to content
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

Gecko 102 に向けての調査、検討 #103

Open
dynamis opened this issue Mar 14, 2022 · 3 comments
Open

Gecko 102 に向けての調査、検討 #103

dynamis opened this issue Mar 14, 2022 · 3 comments
Assignees
Labels
gecko102 Gecko 102 で再現する問題

Comments

@dynamis
Copy link
Contributor

dynamis commented Mar 14, 2022

Wayland 環境での改善について

Wayland での Fx93-96 での改善についてはこちらに詳しい:
https://mastransky.wordpress.com/2021/10/01/firefox-wayland-development-in-2021/

image

I swear, no more crashes on Wayland!

Fx94 で Linux のグラフィックスバックエンドが GLX から EGL に変更:
https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/

これによるメリット:

  • Improved WebGL performance. Thanks to DMABUF zero-copy buffer sharing, WebGL can be done both sandboxed and without round-trip to system ram. WebGL is not only used in obvious places such as games, but also in more subtle ways, e.g. on Google Maps.
  • Reduced power consumption. With partial damage we don’t need to redraw the whole window any more if only a small part of the content changed. Common examples here are small animations on websites or when loading tabs.
  • Less bugs. EGL is more modern, much better suited for complex hardware accelerated desktop applications and used on more platforms, compared to GLX.
  • Hardware video decoding by default is another crucial step closer – in fact for most users it should now be only one preference away (but beware, it still has a couple of bugs).

Wayland の正式サポートについて

Fedora, Ubuntu 21.04 の Wayland サポート&彼らのビルドで Firefox も Wayland 使うようになる事を受けて、Firefox 98 から Wayland が動いてればそちらを使うようデフォルトを切り替えた:
https://bugzilla.mozilla.org/show_bug.cgi?id=1749174

これで Mozilla としてようやく (Xorg) ではなく Wayland をメインとしてサポートしていくことになったと理解できそう。

Mozilla がビルドするリリース版 (Stable) ビルドで Wayland バックエンドサポートを有効化するのはまだだがこちらの bug が 1 月末に立てられてたので PIP 周りとか問題視されてる所が解決し次第、進みそう。

ちなみに Wayland を Nightly で (=試験的に) サポートし始めたのはこちらの 2019 年の bug から

Wayland Port 全体のメタバグも参考に。

Releasenotes

リリースノートと気になるポイント:

e10s について

e10s on Wayland とかどうなってるのかと思って確認し直した。

ユーザ向けのデスクトップビルドでは Fx68 の時点で e10s 無効化は prefs から出来なくなっており (環境変数 MOZ_FORCE_DISABLE_E10S=1 を必要としており) e10s 無効化はサポート外扱いになっている (カスタムビルドなどでは無効化できる):
https://bugzilla.mozilla.org/show_bug.cgi?id=1548941

とはいえ Fx 68 時点で e10s on wayland が安定する形になっていたかというとそうではない

その後 e10s on wayland を正式サポートする/しないというアナウンス/bug は見当たらず扱いが不明確なところがあるが

  • e10s はリリース版/ユーザ向け版ではデフォルトオン、設定で無効化できなくされている
  • Fedora/Ubuntu の動きに合わせて Wayland を正式サポートとする

というのを踏まえると、Wayland では従来 e10s 有効無効にかかわらず Mozilla の正式サポート外であったが、e10s 有効の場合の Wayland だけ正式サポートになると言えるかも知れない。

@dynamis dynamis self-assigned this Mar 14, 2022
@dynamis dynamis added the gecko102 Gecko 102 で再現する問題 label Sep 5, 2022
@dynamis
Copy link
Contributor Author

dynamis commented Sep 5, 2022

Fx94 で Linux のグラフィックスバックエンドが GLX から EGL に変更:
https://mozillagfx.wordpress.com/2021/10/30/switching-the-linux-graphics-stack-from-glx-to-egl/

サポート環境は Nvidia などなのだが、RZ/G2 でも普通に gfx.x11-egl.force-enabled 設定を true にすることで有効化でき、ちょっと触った印象としては問題無さそうであったので、安定性検証を行ってどちらでリリースするかの検討が必要。

As of Firefox 94, users using Mesa driver >= 21 will get it by default. Users of the proprietary Nvidia driver will need to wait a little bit longer as the currently released drivers lack an important extension. However, most likely we’ll be able to enable EGL on the 470 series onwards. DMABUF support (and thus better WebGL performance) requires GBM support and will be limited to the 495 series onwards.

という説明を見る印象では GBMサポートができれば DMABUF ゼロコピーバッファシェアも使えるかもしれない点も要確認

Linux で EGL を有効化してパフォーマンスの違いを確認した結果の記事
https://linuxreviews.org/HOWTO_Make_Mozilla_Firefox_Blazing_Fast_On_Linux

@dynamis
Copy link
Contributor Author

dynamis commented Sep 16, 2022

Firefox 95 にて Wasm (+WASI) を利用して外部ライブラリを (プロセス分離ではなく Wasm 化による) サンドボックスで実行する RLBox という機能が入っている。

https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/
https://github.com/PLSysSec/rlbox

RLBox Library Sandboxing 周りのビルドオプションはこの辺りで扱われており、WASI を必要としている。
https://searchfox.org/mozilla-esr102/source/toolkit/moz.configure#2360

Gecko 102 時点で対象としているライブラリは Graphite, Hunspell, Ogg, Expat, Woff2
https://searchfox.org/mozilla-esr102/source/toolkit/moz.configure#2364

こちらを有効化してビルドするには WASI に依存するため、WASI 周りのツールチェインも揃っていなければ有効化してビルドすることは出来ない。

ERROR: Cannot find a wasi sysroot. Please give its location with --with-wasi-sysroot. Or build with --without-wasm-sandboxed-libraries.

のような上記 moz.configure で定義されたビルドエラーに従って --without-wasm-sandboxed-libraries を付けてビルドすることで RLBox 無効化ビルドになるはず。解決できるのが望ましいが当面の制約事項となっても仕方ない想定。

@dynamis
Copy link
Contributor Author

dynamis commented Sep 27, 2022

個別の設定・安定性の確認と検討については個別の issue で対応していくものとした:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gecko102 Gecko 102 で再現する問題
Projects
None yet
Development

No branches or pull requests

1 participant