diff --git a/.github/scripts/ft-wasm/build-wasm.sh b/.github/scripts/ft-wasm/build-wasm.sh index 912a606a..046778ef 100755 --- a/.github/scripts/ft-wasm/build-wasm.sh +++ b/.github/scripts/ft-wasm/build-wasm.sh @@ -6,8 +6,8 @@ # Environment: # FT_WORK scratch directory (default .tmp/ft-wasm) # FT_OUT receives the archive the workflow uploads (default .tmp/ft-wasm-out) -# FT_WASM_EMSDK_VERSION Emscripten to install; empty = the version CPython itself pins -# (Platforms/emscripten/config.toml, 4.0.19 in 3.15.0) +# FT_WASM_EMSDK_VERSION Emscripten to install; empty = 5.0.3 (DEFAULT_EMSDK_VERSION below), +# not the 4.0.19 CPython 3.15.0 pins in Platforms/emscripten/config.toml # FT_WASM_TRAMPOLINE_PATCH apply (default) | skip; see patch_trampoline below # # Needs: a C toolchain for the native build Python, git, curl, node on PATH @@ -16,8 +16,8 @@ # This is a separate script, not a mode of python-multiplatform/scripts/wasm/build-cpython.sh: # that script is pinned to CPython 3.14.2 / Emscripten 5.0.3 / pyemscripten_2026_0, clones a # pinned git commit, writes into .caches/ and stages the runtime the wasmJs suite runs against. -# This job builds a different CPython (3.15.0 tarball) with a different Emscripten and must not -# touch that runtime. The flags below are the #175 investigation's proposal, not a decision. +# This job builds a different CPython (3.15.0 tarball) and must not touch that runtime. Both use +# Emscripten 5.0.3. The flags below are the #175 investigation's proposal, not a decision. set -euo pipefail here="$(cd "$(dirname "$0")" && pwd)" @@ -57,7 +57,12 @@ cd "$src" # activated environment ("Build will use EMSDK from current environment"). pinned="$(sed -n 's/^emscripten-version = "\(.*\)"$/\1/p' Platforms/emscripten/config.toml)" [ -n "$pinned" ] || die "no emscripten-version in Platforms/emscripten/config.toml" -EMSDK_VERSION="${FT_WASM_EMSDK_VERSION:-$pinned}" +# The default is 5.0.3, the version pyemscripten_2026_0 pins and build-cpython.sh uses, so PMP's +# wasm runtime and pypackpack #82's wheels share one Emscripten. Leader 2026-11-26, Decision 10 (b) b1 in the team report pmp-binder.md: "b1 approved (one Emscripten 5.0.3 for PMP wasm and pypackpack #82)". +# Evidence: build-ft-wasm run 45623531263 (5274e9e2) on 5.0.3, green: smoke OK in both layouts, +# embedding probe a to d OK. CPython's own pin is still logged, so a divergence stays visible. +DEFAULT_EMSDK_VERSION=5.0.3 +EMSDK_VERSION="${FT_WASM_EMSDK_VERSION:-$DEFAULT_EMSDK_VERSION}" log "Emscripten pinned by CPython $PY_VERSION: $pinned; using: $EMSDK_VERSION" emsdk="$FT_WORK/emsdk" if [ ! -x "$emsdk/emsdk" ]; then diff --git a/.github/workflows/build-ft-wasm.yml b/.github/workflows/build-ft-wasm.yml index 25f2f6c5..16dddcd5 100644 --- a/.github/workflows/build-ft-wasm.yml +++ b/.github/workflows/build-ft-wasm.yml @@ -6,10 +6,10 @@ name: Build free-threaded CPython for wasm # add the new wasm 3.15t CI build job"). It does not touch wasm.yml or the runtime the # wasmJs suite uses. See docs/platforms/free-threaded-wasm.md. # -# Experiment choices (agent proposal, not decisions): Emscripten defaults to the version -# CPython itself pins (Platforms/emscripten/config.toml, 4.0.19 for 3.15.0), not the 5.0.3 -# of python-multiplatform/scripts/wasm/build-cpython.sh; the compile/link flags are the -# #175 investigation's; the call trampoline is patched to fall back to its JS path under +# Emscripten defaults to 5.0.3, the version of python-multiplatform/scripts/wasm/build-cpython.sh +# and pypackpack #82 (Leader 2026-11-26, Decision 10 (b) b1 in the team report pmp-binder.md: "b1 approved (one Emscripten 5.0.3 for PMP wasm and pypackpack #82)"; evidence: run 45623531263, green on +# 5.0.3), not the 4.0.19 CPython pins in Platforms/emscripten/config.toml. Experiment choices +# (agent proposal, not decisions): the compile/link flags are the #175 investigation's; the call trampoline is patched to fall back to its JS path under # shared memory (trampoline_patch=skip runs without it). on: @@ -22,7 +22,7 @@ on: required: true type: string emscripten_version: - description: Emscripten to use (empty = the version CPython pins in Platforms/emscripten/config.toml) + description: Emscripten to use (empty = 5.0.3, the default in build-wasm.sh) default: "" required: false type: string diff --git a/docs/platforms/free-threaded-wasm.md b/docs/platforms/free-threaded-wasm.md index c1adf0ba..af63b541 100644 --- a/docs/platforms/free-threaded-wasm.md +++ b/docs/platforms/free-threaded-wasm.md @@ -29,11 +29,12 @@ driver has no install or package step for Emscripten, so the script assembles it These are agent proposals from the #175 investigation, not decisions: -- **Emscripten**: the version CPython itself pins (`emscripten-version` in - `Platforms/emscripten/config.toml`, 4.0.19 for 3.15.0), not the 5.0.3 that - `build-cpython.sh` pins for `pyemscripten_2026_0`. Which version the library should use is - open. The dispatch input `emscripten_version` overrides it, so 5.0.3 can be tried without - editing the script. +- **Emscripten**: 5.0.3, the version `build-cpython.sh` pins for `pyemscripten_2026_0`, not the + 4.0.19 CPython 3.15.0 pins in `Platforms/emscripten/config.toml`. Leader 2026-11-26, Decision 10 (b) b1 in the team report pmp-binder.md: "b1 approved (one Emscripten 5.0.3 for PMP wasm and pypackpack #82)". Evidence: + build-ft-wasm run 45623531263 (5274e9e2) on 5.0.3 was green: the smoke test passed in both layouts + (`proxy-to-pthread` and `embedded`, 200 upcalls, slots traverse 3201 / clear 1600 / dealloc 1602), + the embedding probe passed `a` to `d`, and `python.wasm` imports a shared memory (min 320, max 32768 + pages). The dispatch input `emscripten_version` still overrides it. Earlier runs used 4.0.19. - **Node**: 24, the version `config.toml` pins, passed as `--host-runner node`. - **Flags**: @@ -170,8 +171,8 @@ Kotlin-side memory import). ## Not verified -- The workflow has not run yet. Whether 3.15.0 configures, compiles and links with - `--disable-gil --enable-wasm-pthreads` on Emscripten 4.0.19 is unknown. The only real +- (Superseded: 3.15.0 now configures, compiles and links with `--disable-gil + --enable-wasm-pthreads` on Emscripten 4.0.19 and 5.0.3, see above.) Before the first run the only real evidence is upstream's free-threaded build **without** pthreads (CPython gh-158997, on `main` with Emscripten 6.0.10) and Pyodide's **GIL** build with pthreads (3.14, Emscripten 5.0.3). No project is known to have combined the two.