page: the function JIT is off by default again for Wine's loader

f6e6c7ef turned ?fjit on by default for W3 programs. fjit serves every cold
tier-1 miss with no hotness gate, so start-up pays for translating code that
runs once: Undertale's first frame comes at 28.6 s with ?fjit=1 and 16.4 s
with ?fjit=0 (worldmachine, units-ut3, 200 s runs), for 18.2 vs 17.9 fps
over the last 119 s. Holding the JIT until the first present (fix/fjit-startup
ef963f7b) did not help: the first present is Wine's, at 9.2 s, and the first
frame still came at 28.7 s. On edger units-ut2 the gate measured 27.0 fps
without and 27.1 with, so the 23.1 vs 30.0 that motivated the default no
longer shows.

Kept from f6e6c7ef: ?fjit=0 means off (no more Number('0') || 1), and the
JIT's cost line. ?fjit=1 still turns it on; it becomes the default again
once it waits for a block to be hot.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_ea9f71488b6e448da93d6c2dabf4879c
This commit is contained in:
velzieandClaude Opus 5.5 committed 2026-10-12 08:58:09 -04:00
1 parent f3689d12cd
commit 211ed107b9
1 file changed
+6 -8
+6 -8
View File
@@ -116,15 +116,13 @@ async function main() {
// `?mem64=1`: a 64-bit guest memory (the wasm64 shim; docs/mem64.md step 6).
if (q.get('mem64') === '1') globalThis.GEX_MEM64 = 1;
// `?fjit=1`: the function JIT (gexc run --fjit's browser half, fjit.rs);
// `?fjit=2` traces it, `?fjit=0` turns it off. On by default for Wine's
// own loader (W3, `exe=.../lib/wine/<arch>-unix/wine`): code no
// function-tier unit holds otherwise runs on tier-1 behind the units'
// fallback, and Undertale drops from its 30 fps cap to ~15 in some
// scenes (worldmachine, units-ut2: 23.1 fps over 120 s without, a flat
// 30.0 with).
// `?fjit=2` traces it, `?fjit=0` turns it off. Off by default: it serves
// every cold tier-1 miss, which doubles a W3 program's start-up (Undertale's
// first frame 28.6 s with `?fjit=1`, 16.4 s without; worldmachine,
// units-ut3) for about 3% of steady fps there (18.2 vs 17.9). It comes back
// as the default once it waits for a block to be hot.
const fjitQ = q.get('fjit');
const w3Loader = /\/lib\/wine\/[^/]+-unix\/wine$/.test(q.get('exe') || '');
if (fjitQ !== null ? fjitQ !== '0' : w3Loader) globalThis.GEX_FJIT = Number(fjitQ) || 1;
if (fjitQ !== null && fjitQ !== '0') globalThis.GEX_FJIT = Number(fjitQ) || 1;
// `?wasmdlls=soname=path,...`: shared objects replaced by wasm64 providers (cgen/libprov.rs).
if (q.get('wasmdlls')) globalThis.GEX_WASM_DLLS = q.get('wasmdlls');
// `?elfunits=name,...`: shared objects that get function-tier units (with `?cgen=1`).