diff --git a/crates/coop-daemon/tests/resource_benchmark.rs b/crates/coop-daemon/tests/resource_benchmark.rs index fd16dc7..3e03f04 100644 --- a/crates/coop-daemon/tests/resource_benchmark.rs +++ b/crates/coop-daemon/tests/resource_benchmark.rs @@ -395,10 +395,11 @@ fn locate_prepared_app(workspace: &Path, extension: &str) -> PathBuf { /// 3.4 s, 500 time out. /// Execution mode under measurement. /// -/// `in_process` runs every app in the daemon address space — maximum density, -/// and the arm that Perry's process-global runtime state currently limits to -/// one JS heap. `worker` gives each deployment its own process, which sidesteps -/// that entirely. +/// `in_process` runs every app in the daemon address space — maximum density. +/// Until perry#8546 (class registries made per application image, #8893) it +/// was limited to one working JS heap: every image but the last-initialised +/// dispatched into the wrong code. `worker` gives each deployment its own +/// process, which never had that problem. /// /// The comparison decides whether the in-process model is worth a large change /// to Perry: a `.dylib`'s text pages are already shared across processes by the diff --git a/perry-main.lock b/perry-main.lock index e7ce6e0..8b64cf1 100644 --- a/perry-main.lock +++ b/perry-main.lock @@ -1,2 +1,2 @@ version = "0.5.1519" -commit = "41e8479a56814306650c4ae33e9cfe55a997ba50" +commit = "504013308057061f67f83fc03c0441c6d1cfae5f" diff --git a/scripts/build-perry-libraries.sh b/scripts/build-perry-libraries.sh index e43f297..497ead0 100755 --- a/scripts/build-perry-libraries.sh +++ b/scripts/build-perry-libraries.sh @@ -82,6 +82,36 @@ sha256_file() { } (cd "$perry_root" && cargo build --profile perry-dev -p perry) + +# Ext wrappers. A deployment that imports `http`, `net`, `events`, `zlib`, ... +# links a per-module static wrapper (`libperry_ext_.a`) INTO its +# application image. The daemon compiles with --no-auto-optimize and a scrubbed +# environment, so the compiler cannot build a missing wrapper on demand: its +# own cargo invocation would link through Coop's `cc` shim (which rejects +# anything that is not an application link), and a wrapper built in a separate +# invocation carries a different tokio compilation than the stdlib archive, a +# pair the link refuses. The only place the daemon's compiler looks without an +# environment is `/release/`, so build the wrappers there, +# in ONE cargo invocation with the static archives (that is what makes them +# coherent) and with the stdlib pump features the wrappers need. +# +# On a developer machine a stale `~/.local/lib/libperry_ext_*.a` from an old +# `perry` install silently satisfies the lookup instead; this step makes the +# build stop depending on that accident. +ext_wrappers="${COOP_PERRY_EXT_WRAPPERS:-http net events lru-cache zlib streams fetch ws uuid}" +ext_pumps="${COOP_PERRY_EXT_PUMPS:-external-http-server-pump external-http-client-pump external-net-pump external-ws-pump external-zlib-pump}" +ext_args=(-p perry-runtime-static -p perry-stdlib-static) +for w in $ext_wrappers; do ext_args+=(-p "perry-ext-$w"); done +ext_features="" +for f in $ext_pumps; do ext_features="${ext_features:+$ext_features,}perry-stdlib/$f"; done +(cd "$perry_root" && cargo build --release "${ext_args[@]}" --features "$ext_features") +for w in $ext_wrappers; do + archive="$perry_root/target/release/libperry_ext_${w//-/_}.a" + if [[ ! -f "$archive" ]]; then + echo "ext wrapper build did not produce $archive" >&2 + exit 1 + fi +done compiler_build="$perry_root/target/perry-dev/perry" compiler_sha256="$(sha256_file "$compiler_build")" diff --git a/scripts/prepare-next-benchmark.sh b/scripts/prepare-next-benchmark.sh index 63f87b7..6e03b73 100755 --- a/scripts/prepare-next-benchmark.sh +++ b/scripts/prepare-next-benchmark.sh @@ -22,12 +22,16 @@ compile_timeout_seconds="${COOP_NEXT_COMPILE_TIMEOUT:-1800}" # Outer limit derives from the inner one so the script can never kill a # compile the daemon was still entitled to finish. timeout_seconds="${COOP_NEXT_PREPARE_TIMEOUT:-$(( compile_timeout_seconds + 900 ))}" -# Compile peak for this fixture is well above 6 GB and has never been measured -# to completion under a cap -- every run so far died AT the limit, so each +# Compile peak for this fixture: with TailCallElim bounded (perry#8894) the +# parallel emit phase peaks at ~6.3 GB (measured on macOS and Linux), so the +# previous 6 GB cap killed every run a few minutes in. 12 GB fits that with +# headroom on any host this script is meant for; GitHub's 7.75 GB runners never +# run this fixture (the Linux proof gates it behind `next_fixture`). The +# earlier note stands as history: before #8894 every run died AT the limit, so each # reported figure was the cap and not the peak. Raise this on a host with real # memory; the default is a floor that keeps a constrained runner from swapping # itself to death, not a statement about what the compile needs. -max_rss_mb="${COOP_NEXT_MAX_RSS_MB:-6144}" +max_rss_mb="${COOP_NEXT_MAX_RSS_MB:-12288}" case "$(uname -s)" in Darwin) extension="dylib" ;;