Skip to content

CI: free-threaded 3.15t wasm build with pthreads (#175 step 1) - #397

Merged
b-re-w merged 1 commit into
developfrom
feat/wasm-ft-build
Nov 12, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/wasm-ft-build

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 12, 2026

Copy link
Copy Markdown
Member

Refs #175 (step 1: the build experiment). Owner approval 2026-11-13: "#175 may add the new wasm 3.15t CI build job".

What

  • .github/workflows/build-ft-wasm.yml runs on dispatch, on push to develop that touches its own paths, and on pull requests that touch them. Its dispatch inputs are python_version, emscripten_version (empty means CPython's own pin, 4.0.19 for 3.15.0) and trampoline_patch (apply or skip). It uploads one artifact and publishes no release.
  • .github/scripts/ft-wasm/build-wasm.sh is separate from python-multiplatform/scripts/wasm/build-cpython.sh. That script is pinned to 3.14.2 and Emscripten 5.0.3, and feeds the wasmJs test runtime, which this job must not touch. The build uses CPython's Platforms/emscripten driver with --disable-gil --enable-wasm-pthreads, -pthread -sPTHREAD_POOL_SIZE=8 -sMAXIMUM_MEMORY=2GB, libffi and mpdec built with -pthread, and a small asserted patch so the call trampoline falls back to CPython's JS trampoline when memory is shared.
  • Checks that fail the job:
    • Py_GIL_DISABLED in the build Python and in the host pyconfig.h;
    • atomics in libffi and mpdec;
    • shared memory in python.wasm;
    • stdlib name python3.15t;
    • smoke.py under node (GIL disabled, 4 threads join with correct results), in the build tree and again from the unpacked archive.
  • docs/platforms/free-threaded-wasm.md has a "Not verified" list. wasm-design.md gets a pointer to it.

The Emscripten pin, the flags and the patch are experiment choices (agent proposal, not confirmed). The pin is still open: CPython 3.15.0 pins 4.0.19, while our wasmJs runtime uses 5.0.3.

Expected

This has never run anywhere. The likely first hard failure is the make-host link. This PR's own workflow run is the experiment.

Not in this PR (later #175 steps)

  • Kotlin/Wasm's shared memory import.
  • The worker pool for the first Thread.start from Kotlin.
  • Function tables on every Worker for upcalls.
  • Staging this archive as the wasmJs runtime.
  • Cross-origin isolation headers and service worker.

Category: feature added (CI build experiment), documentation corrected.

…eads (#175)

Owner approval 2026-11-13. New build-ft-wasm.yml (dispatch, push on develop and pull requests on its own
paths) and .github/scripts/ft-wasm/build-wasm.sh: --disable-gil --enable-wasm-pthreads, libffi and mpdec
with -pthread, a call-trampoline patch for shared memory, then a node smoke test that starts four
threads with the GIL disabled. Artifact only; no release. docs/platforms/free-threaded-wasm.md.
@b-re-w
b-re-w merged commit d4c8f64 into develop Nov 12, 2026
1 check passed
@b-re-w
b-re-w deleted the feat/wasm-ft-build branch November 12, 2026 21:07
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