Closed Bug 1675385 Opened 5 years ago Closed 5 years ago

Differences between x86-64 and arm64 mac wasm prefs prevent universal builds

Categories

(Core :: JavaScript: WebAssembly, defect, P1)

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: glandium, Assigned: lth)

References

Details

Attachments

(1 file, 2 obsolete files)

The following differences make it impossible to create universal builds with both x86-64 and arm64 support for mac:

--- /tmp/x86/Firefox Nightly.app/Contents/Resources/greprefs.js
+++ /tmp/arm64/Firefox Nightly.app/Contents/Resources/greprefs.js
@@ -463,18 +463,16 @@
 pref("javascript.options.wasm_trustedprincipals", true);
 pref("javascript.options.wasm_verbose",           false);
 pref("javascript.options.wasm_baselinejit",       true);
-//@line 1114 "$SRCDIR/modules/libpref/init/all.js"
-    pref("javascript.options.wasm_cranelift",     false);
-//@line 1116 "$SRCDIR/modules/libpref/init/all.js"
-  pref("javascript.options.wasm_ionjit",          true);
+//@line 1109 "$SRCDIR/modules/libpref/init/all.js"
+    pref("javascript.options.wasm_cranelift",     true);
+//@line 1111 "$SRCDIR/modules/libpref/init/all.js"
+  pref("javascript.options.wasm_ionjit",          false);
 //@line 1118 "$SRCDIR/modules/libpref/init/all.js"
 //@line 1120 "$SRCDIR/modules/libpref/init/all.js"
   pref("javascript.options.wasm_reftypes",        true);
   pref("javascript.options.wasm_gc",              false);
 //@line 1124 "$SRCDIR/modules/libpref/init/all.js"
   pref("javascript.options.wasm_multi_value",     true);
-//@line 1128 "$SRCDIR/modules/libpref/init/all.js"
-    pref("javascript.options.wasm_simd",            true);
 //@line 1133 "$SRCDIR/modules/libpref/init/all.js"
 pref("javascript.options.native_regexp",    true);
 pref("javascript.options.parallel_parsing", true);
Flags: needinfo?(lhansen)

Lars, Steven, pretty urgent request for an Apple Silicon blocker.
Could you please help with that? Thanks

Flags: needinfo?(sdetar)

OK, we can probably fix this by just renaming the switch as 'javascript.options.wasm_optimizing' (as we have made that change elsewhere) and making the correct interpretation internally. We will for sure want to disable cranelift on non-arm64 platforms for this to work smoothly (for now), but we want to do that anyway (bug 1674722) so no big deal.

"Pretty urgent" => "P1". I'll take a look this morning.

Severity: -- → S1
Flags: needinfo?(lhansen)
Priority: -- → P1

We'll do the work over in the other bug.

Depends on: 1674722

We want to enable cranelift on aarch64 hardware except on Windows (due
to ABI issues) and on x64 with the aarch64 simulator, but not on x64
in general (because it is immature).

Add a test case to ensure that cranelift is not enabled where we do
not expect it to be.

Assignee: nobody → lhansen
Status: NEW → ASSIGNED

This patch makes cranelift and ion exclusive of each other: enabling
cranelift on a platform will effectively disable Ion on that platform.

Specifically there's a change at the pref/switch level that does not
go terribly deep:

  • the new about:config option is javascript.options.wasm_optimizingjit,
    the old wasm_cranelift and wasm_ionjit are no more
  • new values of X in --wasm-compiler=X in the js shell are 'optimizing'
    and 'baseline+optimizing', the old values 'cranelift', 'ion',
    'baseline+ion' and 'baseline+optimizing' are no more
  • we keep the separate prefs internally in the code for ion and cranelift
    but if ENABLE_WASM_CRANELIFT is defined then we never set the ion
    pref to true, and if it is not defined then we never set the cranelift
    pref to true

The trickiest changes are win testWasm.cpp and in the JIT compiler option
processing in jsapi.cpp.

People who will suffer as a result of this are those who are working
on ports of cranelift to new platforms in Firefox. As of now we have
no such work going on.

In the longer term the exclusive-or situation can be alleviated by a
switch that lets cranelift override ion when cranelift is present and
the switch is on. Patches welcome.

Depends on D96058

Groan, wrong bug.

Comment on attachment 9186015 [details]
Bug 1675385 - Fix moz.configure setup for cranelift. r?rhunt

Revision D96058 was moved to bug 1674722. Setting attachment 9186015 [details] to obsolete.

Attachment #9186015 - Attachment is obsolete: true

Comment on attachment 9186017 [details]
Bug 1675385 - Fix prefs, switches, and selection for cranelift. r?rhunt

Revision D96059 was moved to bug 1674722. Setting attachment 9186017 [details] to obsolete.

Attachment #9186017 - Attachment is obsolete: true
Flags: needinfo?(sdetar)

Bug 1674722 still leaves us with this difference:

--- x64/Firefox Nightly.app/Contents/Resources/greprefs.js
+++ aarch64/Firefox Nightly.app/Contents/Resources/greprefs.js
@@ -472,8 +472,6 @@
   pref("javascript.options.wasm_gc",              false);
 //@line 1113 "$SRCDIR/modules/libpref/init/all.js"
   pref("javascript.options.wasm_multi_value",     true);
-//@line 1117 "$SRCDIR/modules/libpref/init/all.js"
-    pref("javascript.options.wasm_simd",            true);
 //@line 1122 "$SRCDIR/modules/libpref/init/all.js"
 pref("javascript.options.native_regexp",    true);
 pref("javascript.options.parallel_parsing", true);

Good point. That's bug 1669463. We're almost ready to land that, at which point we'll have feature parity and the difference should disappear. Going forward, we're committed to adding every new feature to every compiler at the same time.

Depends on: 1669463
No longer blocks: 1675384
Blocks: 1675740
Attachment #9186832 - Attachment description: Bug 1675385 - PoC → Bug 1675385 - Move architecture-dependent wasm prefs to static prefs.
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/9a0fb6731557 Move architecture-dependent wasm prefs to static prefs. r=lth
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: