You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated 2026-09-09.Item 1 is withdrawn — it was wrong. Network calls work in the browser; @oyamad demonstrated both call paths in xeus-python on 2026-09-06 and the reasoning is in the comment below. PR #948 was built on the old text before anyone tested it. Item 3 is moved out of this issue (no WASM rationale left, and it is entangled with the util/notebooks.py deprecation question for 0.12.0). Items 2 and 4 stand and are unchanged in substance. The 2026-08-21 revision and the original text are in the edit history.
Part of #925 (Phase 1). Documentation and error-message work — no behaviour changes on native platforms.
Items
Network utilities fail in the browser.Withdrawn 2026-09-09 — the premise was false. The original text claimed fetch_nb_dependencies and the GameTracer .gam URL loaders "perform socket-level HTTP, which does not exist in WASM", and that JS-fetch-backed shims are "kernel-specific and not guaranteed in xeus-python". Both calls in fact work in xeus-python today: urllib3 has shipped native Emscripten support since 2.2.0 and enables it automatically when sys.platform is emscripten, substituting EmscriptenHTTPConnection over XMLHttpRequest (or fetch on a worker thread for streaming), and requests sits on urllib3. emscripten-forge reached the same conclusion months ago and retired requests-wasm-polyfill as redundant (Drop requests-wasm-polyfill? emscripten-forge/recipes#782). Do not add a sys.platform == "emscripten" guard here — that condition is exactly what switches urllib3 onto its browser transport, so the guard would fire precisely when the network path is being enabled. If a friendlier error is still wanted later, the shape to aim for is wrapping a failure that actually occurs rather than refusing before trying, and it is better attempted once WASM: Host a WASM testbed site under the QuantEcon org #950 / WASM: add a WebAssembly/JupyterLite smoke-test job to CI #933 give us a browser kernel where a real failure can be observed.
probvec docstring.parallel=True (the default) silently executes serially on Emscripten. Two numba emscripten patches produce this: patch 0007 falls back from the target='parallel' ufunc target to 'cpu' (the path probvec takes), and patch 0010 (Fallback Numba parallel JIT to serial on Emscripten emscripten-forge/recipes#6293, merged 2026-08-18, shipped as numba 0.67.0 build 1) compiles @njit(parallel=True) serially and forces NUMBA_NUM_THREADS=1. A one-line note keeps the documented contract honest. This is the part of PR WASM: raise OSError for network calls on Emscripten (#931) #948 that should land — it is correct and independent of everything above.
Consider demoting requests from a hard dependency to an optional extra.Moved out of this issue and out of WASM: browser support for QuantEcon.py (Numba + JupyterLite) — tracking issue #925 on 2026-09-09.requests resolves for the browser and now demonstrably works there, so this is ordinary dependency hygiene rather than browser work. It is also entangled with the separate question of deprecating quantecon/util/notebooks.py in 0.12.0 and dropping requests altogether; if that goes ahead this item is moot. It should be tracked with that decision, not here.
Smoke tests for this issue must assert capabilities, not guards. PR #948's two Emscripten-gated tests asserted that our own sys.platform branch raises OSError — which the new code did unconditionally — so they would have passed in the browser and locked the defect in. Assert what the platform can actually do (from_url returns a 3-player game) so the test is able to disagree with us.
Note
Updated 2026-09-09. Item 1 is withdrawn — it was wrong. Network calls work in the browser; @oyamad demonstrated both call paths in xeus-python on 2026-09-06 and the reasoning is in the comment below. PR #948 was built on the old text before anyone tested it. Item 3 is moved out of this issue (no WASM rationale left, and it is entangled with the
util/notebooks.pydeprecation question for 0.12.0). Items 2 and 4 stand and are unchanged in substance. The 2026-08-21 revision and the original text are in the edit history.Part of #925 (Phase 1). Documentation and error-message work — no behaviour changes on native platforms.
Items
Network utilities fail in the browser.Withdrawn 2026-09-09 — the premise was false. The original text claimedfetch_nb_dependenciesand the GameTracer.gamURL loaders "perform socket-level HTTP, which does not exist in WASM", and that JS-fetch-backed shims are "kernel-specific and not guaranteed in xeus-python". Both calls in fact work in xeus-python today: urllib3 has shipped native Emscripten support since 2.2.0 and enables it automatically whensys.platformisemscripten, substitutingEmscriptenHTTPConnectionover XMLHttpRequest (or fetch on a worker thread for streaming), andrequestssits on urllib3. emscripten-forge reached the same conclusion months ago and retiredrequests-wasm-polyfillas redundant (Droprequests-wasm-polyfill? emscripten-forge/recipes#782). Do not add asys.platform == "emscripten"guard here — that condition is exactly what switches urllib3 onto its browser transport, so the guard would fire precisely when the network path is being enabled. If a friendlier error is still wanted later, the shape to aim for is wrapping a failure that actually occurs rather than refusing before trying, and it is better attempted once WASM: Host a WASM testbed site under the QuantEcon org #950 / WASM: add a WebAssembly/JupyterLite smoke-test job to CI #933 give us a browser kernel where a real failure can be observed.probvecdocstring.parallel=True(the default) silently executes serially on Emscripten. Two numba emscripten patches produce this: patch 0007 falls back from thetarget='parallel'ufunc target to'cpu'(the pathprobvectakes), and patch 0010 (Fallback Numba parallel JIT to serial on Emscripten emscripten-forge/recipes#6293, merged 2026-08-18, shipped as numba 0.67.0 build 1) compiles@njit(parallel=True)serially and forcesNUMBA_NUM_THREADS=1. A one-line note keeps the documented contract honest. This is the part of PR WASM: raise OSError for network calls on Emscripten (#931) #948 that should land — it is correct and independent of everything above.Consider demotingMoved out of this issue and out of WASM: browser support for QuantEcon.py (Numba + JupyterLite) — tracking issue #925 on 2026-09-09.requestsfrom a hard dependency to an optional extra.requestsresolves for the browser and now demonstrably works there, so this is ordinary dependency hygiene rather than browser work. It is also entangled with the separate question of deprecatingquantecon/util/notebooks.pyin 0.12.0 and droppingrequestsaltogether; if that goes ahead this item is moot. It should be tracked with that decision, not here.cache=Truefailure, WASM: cache=True functions that link a cache-restored callee fail with "no compiled object yet" (simplex_grid → num_compositions_jit → comb_jit) #944); single-threaded execution — all Numba parallelism is silently serialised in the browser (guvectorizetarget='parallel'via patch 0007;@njit(parallel=True)/prangeandNUMBA_NUM_THREADS=1via patch 0010); and the wasm32 limits (coordinate with WASM: audit 32-bit intp behaviour on wasm32 (overflow guards, simplex_index wrapping, dtypes) #929).Testing note
Smoke tests for this issue must assert capabilities, not guards. PR #948's two Emscripten-gated tests asserted that our own
sys.platformbranch raisesOSError— which the new code did unconditionally — so they would have passed in the browser and locked the defect in. Assert what the platform can actually do (from_urlreturns a 3-player game) so the test is able to disagree with us.Related
probvecdocstring note. Hold the rework until theutil/notebooks.pydeprecation question settlessupport_enumerationandvertex_enumerationnever return (LAPACK itself is verified working); no upstream report yet. The docs page should list both as not workingcache=Truecaller whose callee was restored from the persistent cache fails withRuntimeError: no compiled object yet; reported upstream as Numba:RuntimeError: no compiled object yetemscripten-forge/recipes#6309 (open); decision is to wait for upstreamgini_coefficientis now the O(n log n) closed form, so the browser no longer runs a serial O(n²) loopcache=Truefor@vectorize/@guvectorize, so the four eagerly compiled gufuncs recompile every sessioncomb_jit/simplex_gridboundary, 2–4 GB memory cap); documentation-only, and its second task hands the user-facing wording to this issueci/wasm/smoke_test.py— on main since PR WASM: JupyterLite environment config and browser smoke suite #938. No browser job runs it yet; that runner is WASM: add a WebAssembly/JupyterLite smoke-test job to CI #933