QuantEcon / QuantEcon/QuantEcon.py
WASM: Host a WASM testbed site under the QuantEcon org
@mmcky is already working on this.
Since Sep 7, 2026.
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 2.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 3
Description
Proposal: host a WASM testbed site under the QuantEcon org
Motivation
Work on #925 has surfaced two bugs in the emscripten-forge Numba build (the jitted-generator hang, #927; and a crash when saving to the persistent cache), with diagnoses, reproducers, and in one case a monkeypatch-verified fix. We should have our own place to try candidate fixes in a real browser kernel and to check that the affected quantecon functions work, both for these two issues and for whatever comes next in the campaign.
Upstream CI (fork + PR) can build a patched package and run the recipe's own tests in wasm, but only as part of a PR, and it cannot run the end-to-end check with quantecon on the xeus-python/JupyterLite stack that #925 targets. A C-level fix such as the generator alias cannot be tested by monkeypatching a live kernel at all; it needs a rebuilt package running in the browser.
Proposal
A small repo (e.g. QuantEcon/wasm-testbed) publishing a JupyterLite site to GitHub Pages whose environment can include locally patched packages. The result is our own counterpart of https://notebook.link/@anutosh491/numba-ecosystem — a URL that opens an xeus-python notebook in the browser with the smoke notebooks preloaded, nothing to install — except that we choose what goes into the environment, and every deployment corresponds to a commit.
- A fork of emscripten-forge/recipes with a branch per candidate fix to
recipes_emscripten/numba; buildnumbaforemscripten-wasm32either locally (pixi run build-emscripten-wasm32-pkg) or via a draft PR on the fork (CI uploads the built.condaas an artifact). - A GitHub Actions workflow that indexes the patched
.condainto a static conda channel withrattler-index, builds the site withjupyterlite-xeusfrom anenvironment.ymllisting that channel first, then emscripten-forge and conda-forge, and deploys to Pages. Swapping the package under test is a one-line change. - Smoke notebooks shipped with the site: the environment-check cell, the per-issue MWEs (currently the five-line generator MWE and the persistent-cache MWE), and the quantecon checks (
support_enumeration/vertex_enumerationon small games with known equilibria;simplex_gridunder a warm cache), extended as new issues appear. - Results go into #928's table. If we open upstream PRs, the browser evidence comes from here.
Implementation notes
- Make the patched package win the solve. Listing the custom channel first is not enough: at equal version the solver prefers the higher build number, and the stock package is build 1. Bump
build: numberin the patched recipe (or pin the build inenvironment.yml); otherwise the site silently uses stock numba. - The channel is only needed at build time. The browser never contacts a channel;
jupyter lite buildbakes the packages into the site. So a local directory in the CI workspace suffices (channels: - ./channel, withemscripten-wasm32/andnoarch/subdirs indexed byrattler-index fs channel/). If the xeus build's solver turns out not to accept local paths, the fallback is aquanteconchannel on prefix.dev (rattler-build upload prefix), the mechanism emscripten-forge itself uses. - Commit the
.condainto the repo (channel/emscripten-wasm32/, a few MB) rather than fetching CI artifacts, which expire and need tokens across repos. - Prove the patched build is in use. The environment-check cell should print the numba build string, and the
ctypessymbol check from #927 (numba_make_generatorresolves only under the patch) is the definitive marker.
Notes
- Patched packages must be built from the recipe so they carry the channel's pins (
llvmlite ==0.49.0,numpy 2.4.*); mixing them with stock emscripten-forge packages is then safe. - Once a fix lands upstream, the corresponding package is dropped from the channel; with an empty custom channel the site is just the #928 deployment.
- Nothing runs server-side: the site is static files on Pages.
- The site's
notebooks/?path=smoke_test.ipynbURL deep-links straight into the smoke notebook; that is the link to cite next to results in #928.
Refs: #925, #927, #928
🤖 Generated with Claude Code (Claude Fable 5.1)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.