Closed Bug 1982594 Opened 2 months ago Closed 3 days ago

Update Firefox to utilize zstd for Translations models and WASM

Categories

(Firefox :: Translations, task)

task

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: nordzilla, Assigned: isaacbriandt10, Mentored)

References

Details

Attachments

(5 files, 2 obsolete files)

Description

In Bug 1947431 we implemented zstd for DecompressionStream and allowed it for internal use within privileged Firefox contexts.

We now have v2 Remote Settings collections that are designed to host and serve zstd compressed models and WASM.

We need to hook everything together to allow Firefox to pull from the compressed collections, and decompress the models as-needed.

Attachment #9506893 - Attachment description: WIP: Bug 1982594 - Meta changes, such as updating the version numbers and updating the schemas. r=nordzilla → WIP: Bug 1982594 - Update Translations RemoteSettings schemas r=gregtatum
Attachment #9506894 - Attachment description: WIP: Bug 1982594 - Sending the Blob from the parent process to the child process and decompressing it using DecompressionStream. r=nordzilla → WIP: Bug 1982594 - Rework TranslationsEnginePaylod IPC Transfer r=gregtatum
Attachment #9506923 - Attachment description: WIP: Bug 1982594 - Fixing tests → WIP: Bug 1982594 - Fix Translations Tests r=gregtatum

This patch modifies the RemoteSettings client's download()
method to be able to return a Blob directly, in addition to
the ArrayBuffer that it already returns.

This prevents the Translations code from having to manually
construct a Blob from the buffer, prevening a jank in the parent
process.

The build should be exactly the same, though I technically
built it from a different hash on GitHub, so we should
update that.

This patch is a condensed version of my initial WIP patch stack
for Bug 1982594 where I initially encountered this behavior.

The behavior reproduces by running the following command:

./mach test browser_translations_e2e

Rather than executing successfully, the WASM instantiation
will hang indefinitely until the test case times out.

This code is very likely to bit rot, though I hope it proves
to be useful in exploring this behavior. I haven't been able
to reproduce in a different way at the time of writing.

Comment on attachment 9512975 [details]
WIP: Bug 1982594 - (Temporary) Attempt to reproduce behavior

Revision D264662 was moved to bug 1988289. Setting attachment 9512975 [details] to obsolete.

Attachment #9512975 - Attachment is obsolete: true

This patch modifies the WASM function for instantiating
to use synchronous functions instead of WebAssembly.instantiate().

See Bug 1988289 for more information.

Attachment #9506998 - Attachment is obsolete: true
Attachment #9506893 - Attachment description: WIP: Bug 1982594 - Update Translations RemoteSettings schemas r=gregtatum → Bug 1982594 - Update Translations RemoteSettings schemas r=#translations-reviewers!
Attachment #9506894 - Attachment description: WIP: Bug 1982594 - Rework TranslationsEnginePaylod IPC Transfer r=gregtatum → Bug 1982594 - Rework TranslationsEnginePaylod IPC Transfer r=#translations-reviewers!
Attachment #9506923 - Attachment description: WIP: Bug 1982594 - Fix Translations Tests r=gregtatum → Bug 1982594 - Fix Translations Tests r=#translations-reviewers!
Attachment #9508865 - Attachment description: WIP: Bug 1982594 - Update Bergamot build hash → Bug 1982594 - Update Bergamot build hash r=#translations-reviewers!
Attachment #9513269 - Attachment description: WIP: Bug 1982594 - Patch Translations WASM Instantiation r=#translations-reviewers! → Bug 1982594 - Patch Translations WASM Instantiation r=#translations-reviewers!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: