Skip to content

wasm pages: the browser gate (JX4): a browser without JSPI is told what it needs - #1513

Merged
transfix merged 2 commits into
masterfrom
feat/jspi-browser-gate
Nov 24, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/jspi-browser-gate

Conversation

@transfix

Copy link
Copy Markdown
Owner

Since #1409 (JX2), the browser hosts are built with -fwasm-exceptions and -sJSPI, and there is no Asyncify fallback. A browser without JSPI (Safari or iOS before 27, Chrome before 137, Firefox before 153) failed part way through the load. This is JX4's browser gate (docs/roadmap/WASM_JSPI_EXCEPTIONS.md).

What changes

  • Every host page checks that WebAssembly.Suspending and WebAssembly.promising are functions before it fetches anything of the module. Without them it shows what the browser needs in place of the load:
    • "This page needs a newer browser", then Chrome 137, Firefox 153 or Safari 27, or later (Edge 137 and other browsers built on Chrome 137 too).
    • On an iPhone or iPad, where every browser is WebKit, it asks for iOS 27 (iPadOS 27) whatever the browser. It tells one by its user agent, and an iPad's Mac user agent by its touch screen.
    • Then the browser's user agent.
  • The pages:
    • arigl-web.js, which covers arigl-web, ariglx-web and the deployed cyprty page;
    • ari-web.js, for ari.html and ari_tvision.html;
    • the gallery's demo.html.in (its ?gldiag report also gets a jspi line);
    • arigl_term.html and cyprty.html.
    • Not the JSPI bench page.
  • arigl-web and ari.html set ariadneWeb.state = 'unsupported', with the text in ariadneWeb.needs.
  • Each page carries its own copy of the check, not a shared file. The arigl-web recipe and cy-pca/cyprty's stage.sh ship a fixed list of files, so cyprty gets the gate with the arigl-web release that has it and needs no change.

Test

  • arigl_web_smoke.mjs gets four cases that delete WebAssembly.Suspending before the page's script runs:
    • arigl-web as Chrome, and as Chrome on an iPhone, which must ask for iOS 27;
    • ari.html as Chrome, and as Safari on an iPad;
    • none of them may fetch the module's .js, its .wasm or python312.zip.
  • Every other case is the normal run, through the same gate. CI runs it in the arigl-web and ariglx-web jobs.

Checked locally (phm, 2026-11-23)

  • Smoke: against arigl-web 4.0.6's module with these loaders, headless Chrome 152: all 23 cases pass (19 normal, 4 gate).
  • Inline pages: demo.html.in, arigl_term.html and cyprty.html, from source, in Chrome 152. With JSPI each starts fetching its module. Without it each shows the gate and fetches nothing.
  • WebKit: Playwright 1.65.1's WebKit is 27.2 (the WPE MiniBrowser on Linux), and it has JSPI.
    • In it, arigl-web 4.0.6 ran the docset, ari.html drew it, and the gate showed with Suspending deleted.
    • cy-pca/cyprty main (b4ec9fd), staged by its own stage.sh onto this loader, ran in two WebKit pages against a local arisrv 4.0.6. Both joined the room (the relay counted 2 present), saw each other in Users, in a camera window and as an avatar, and one got the other's voice stream through its AudioWorklet.
    • Not checked: Safari on a real iPhone.

Docs: WASM_JSPI_EXCEPTIONS.md (JX4), ARIADNE.md §9.4 (and its terminal-page bullet, which still said -sASYNCIFY), and CVCGL_WASM.md.

No C++ changes. A trial merge with #1505 (which also edits arigl-web.js and the smoke) is clean.

…at it needs

The browser builds use wasm exceptions and JSPI with no Asyncify fallback, so a
browser without JSPI failed part way through the load. Every host page now
checks for WebAssembly.Suspending and WebAssembly.promising before it fetches
anything of the module, and without them shows a page naming what it needs:
Chrome 137, Firefox 153 or Safari 27, or later; on an iPhone or iPad (every
browser there is WebKit), iOS 27. Then the browser's user agent.

- arigl-web.js (arigl-web and ariglx-web) and ari-web.js (ari.html,
  ari_tvision.html): ariadneWeb.state is "unsupported", the text in
  ariadneWeb.needs.
- The inline pages: the gallery's demo.html.in (its ?gldiag report gets a jspi
  line), arigl_term.html and cyprty.html.
- Each page carries the check itself: the arigl-web recipe and cyprty's
  stage.sh ship a fixed list of files, so cyprty gets the gate with the
  arigl-web release and needs no change.
- arigl_web_smoke.mjs: four cases with WebAssembly.Suspending deleted before
  the page's script runs (arigl-web as Chrome and on an iPhone, ari.html as
  Chrome and on an iPad); none may fetch the module.
- Docs: WASM_JSPI_EXCEPTIONS.md (JX4), ARIADNE.md section 9.4 (and the
  terminal page's loop, which is JSPI now, not Asyncify), CVCGL_WASM.md.
@transfix
transfix enabled auto-merge (squash) November 24, 2026 00:51
@transfix
transfix merged commit 05514b6 into master Nov 24, 2026
29 of 31 checks passed
@transfix
transfix deleted the feat/jspi-browser-gate branch November 24, 2026 09:32
transfix added a commit that referenced this pull request Nov 24, 2026
# Conflicts:
#	src/cvc/CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant