Machine learning to let go
Merge Info
Issues
Resolves
Related
Merging
Target Branches
-
tor-browser
-!fixups
totor-browser
-specific commits, new features, security backports -
base-browser
andmullvad-browser
-!fixups
tobase-browser
-specific commits, new features to be shared withmullvad-browser
, and security backports- All base-browser commits.
Target Channels
-
Alpha: esr140-15.0 -
Stable: esr128-14.5 -
Legacy: esr115-13.5
Backporting
Timeline
-
No Backport (preferred): patchset for the next major stable -
Immediate: patchset needed as soon as possible (fixes CVEs, 0-days, etc) -
Next Minor Stable Release: patchset that needs to be verified in nightly before backport -
Eventually: patchset that needs to be verified in alpha before backport
(Optional) Justification
-
Security update: patchset contains a security fix (be sure to select the correct item in Timeline) -
Censorship event: patchset enables censorship circumvention -
Critical bug-fix: patchset fixes a bug in core-functionality -
Consistency: patchset which would make development easier if it were in both the alpha and release branches; developer tools, build system changes, etc -
Sponsor required: patchset required for sponsor -
Localization: typos and other localization changes that should be also in the release branch -
Other: please explain
Upstream
-
Patchset is a candidate for uplift to Firefox -
Patchset is a backport from Firefox - Bugzilla link:
- Upstream commit:
Issue Tracking
-
Link resolved issues with appropriate Release Prep issue for changelog generation
Review
Request Reviewer
-
Request review from an applications developer depending on modified system: -
NOTE: if the MR modifies multiple areas, please
/request_review
all the relevant reviewers - accessibility : henry
- android : clairehurst, dan
- build system : boklm
- ci/cd: brizental, henry
- extensions : ma1
- firefox internals (XUL/JS/XPCOM) : jwilde, ma1
- fonts : pierov
- frontend (implementation) : henry
- frontend (review) : donuts, morgan
- localization : henry, pierov
- macOS : clairehurst, dan
- nightly builds : boklm
- rebases/release-prep : brizental, clairehurst, dan, ma1, pierov, morgan
- security : jwilde, ma1
- signing : boklm, morgan
- updater : pierov
- windows : jwilde, morgan
- misc/other : pierov, morgan
-
NOTE: if the MR modifies multiple areas, please
Change Description
We switch off browser.ml.enabled
, which disables MLEngine
, which seems to be the backend for many, but not all, ml features.
We use preferences to switch off the following ML features:
- Auto fill. Was only an experiment in 140, but has since been dropped upstream. Disabled by
browser.ml.enable
. - PDF auto fill of alt text. Disabled by
pdfjs.enableAltText
andpdfjs.enableGuessAltText
. - Search suggests. Disabled by
browser.urlbar.quicksuggest.mlEnabled
(I think) andbrowser.ml.enable
. - Smart tab grouping. Disabled by
browser.tabs.groups.smart.enabled
andbrowser.tabs.groups.smart.userEnabled
. - Semantic history search. Disabled by
browser.ml.enable
andplaces.semanticHistory.featureGate
. - Link preview. Disabled by
browser.ml.linkPreview.enabled
. - Chat sidebar. Disabled by
browser.ml.chat.enable
. - Exposure of ML engines for extensions. Disabled by
extensions.ml.enabled
andbrowser.ml.enable
.
These preferences were also locked as well, since they can not work in the browser, and some would throw errors if the user tried to turn them on.
We also remove the "ml" and "genai" components entirely to remove the code that should be unused but is unaudited. We also exclude some further modules that are no longer viable without the "ml" or "genai" components.
And we tidy up a few places to either:
- Remove the import of these missing files, and replace or comment out their consumers.
- Or add a comment explaining why we think the missing file should never be loaded in practice due to our preferences.
We also lock down the translations
component. I considered removing the entire component, but
- The
cld2
part is an established component. Needs a separate discussion. -
TranslationsParent.sys.mjs
has many callers, including from geckoview. I could have gone through and removed the desktop callers, but the android stuff is much more complicated. Could be done in the future if we think it is worth it.
Instead, we just target the engine parts that should be unused.
In addition, about:translations
and about:inference
are excluded. Technically about:inference
is only in Firefox Nightly right now, but I wanted to future-proof its exclusion in case upstream is planning on bringing it to a non-Nightly release.
Finally, added a migration to clear all the locked preferences, so they do not linger in the user's profile.
Note on data clean up
By removing the files we are also removing the parts that control the stored ML data. As far as I could tell, all engines require fetching a wasm from remote settings, which will fail in Tor Browser. So I can't imagine many 15.0 alpha users have accumulated much engine data.
In contrast, the translations engine was already available in 14.0, but also needs to fetch a wasm with remote settings. So downloading languages, etc, would have failed even if the user switched browser.translations.enable
in about:config
.
Given this, I did not try and figure out how to clean out old ML data from the user's profile directory. But if someone can demonstrate lingering data, we can maybe try and do something about it.
Note on commit and comments
I placed a lot of tor-browser#44045
references in the comments. Even though I created a new commit "BB 44045: Disable ML features.", I imagine that we may have to make other issue-specific adjustments as part of this commit in the future, so I want to make it clear which parts came from the original issue, rather than future additions.
How Tested
No console errors in the following scenarios:
- Browser startup.
- New window.
- Opening
about:preferences
. - Opening
about:addons
. - Grouping tabs.
- Adding an image to a pdf.
- Searching history.
- Searching suggestions turned on in settings.
- Opening sidebar.
- Opening context menu.
Also checked that preferences in the locked preferences that appear in the user profile's prefs.js
are cleared on migration.