Commit Graph
52 Commits
Author SHA1 Message Date
Malte UblandClaude Opus 5.5 604e471bc8 Merge the macOS island fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:42 -07:00
Malte UblandClaude Opus 5.5 1ec20be530 Merge the macOS island fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:42 -07:00
Malte UblandClaude Opus 5.5 ae7d4ebf0d Merge the macOS island fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:41 -07:00
Malte UblandClaude Opus 5.5 704e6b4992 Merge the macOS island fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:41 -07:00
Malte UblandClaude Opus 5.5 bfbbd349a3 Merge the macOS island fixes, and make nested entries' contexts the same way
A nested entry below the mark makes its context with ni_make_context,
so macOS clears only the top slice of the range instead of the whole of
Node's stack below the mark on every nested call (17 ms per call, and
the cross-heap GC test ran past its timeout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:40 -07:00
Malte UblandClaude Opus 5.5 50385349d3 Merge the macOS island fixes of ni/13-libnode-packs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:39 -07:00
Malte UblandClaude Opus 5.5 5f3e97998d Merge the macOS island fixes of ni/1-libnode-loader
The libnode-linux action becomes .github/actions/libnode, which serves
the Linux x64 and macOS lanes: the libnode-packs cache for the runner's
platform, else the development pack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:39 -07:00
Malte UblandClaude Opus 5.5 df869f28b0 Run Node islands on macOS, and test them in the macOS CI lanes
macOS binds libnode's own calls to v8::base::Stack inside libnode, so the
bridge's definitions cannot give V8 Node's stack as they do on Linux; V8
took the main thread's stack start and its conservative scan faulted in
the gap above Node's stack. While Node starts on its stack, the main
thread's pthread record now names that stack, which V8 reads once and
keeps.

macOS's makecontext clears the whole stack it is given, so it gets only
the top slice of Node's stack (no 64 MiB pass per context).

CI: dev-pack.json pins mirrored darwin-arm64 and darwin-x64 libnode
builds of the pinned Node 24.22.0 from the libnode-packs workflow, the
dev-pack action serves either platform, and the macOS lanes provision it,
so island tests fail rather than skip on macOS CI. The arm64 LLVM job
runs the island harness; the Intel job runs it and the island corpus.
bridge-smoke loads the .dylib bridge on macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 12:50:38 -07:00
Malte Ubl b3e29df342 Merge remote-tracking branch 'origin/ni/13-libnode-packs' into HEAD
# Conflicts:
#	packages/cli/src/bootstrap.ts
#	packages/compiler/src/node-islands/libnode.ts
#	packages/libnode-common/smoke/smoke.c
2026-10-26 11:18:28 -07:00
Malte Ubl ae66edf566 Merge remote-tracking branch 'origin/ni/3-hosted-loop' into HEAD
# Conflicts:
#	packages/cli/src/bootstrap.ts
#	packages/compiler/src/diagnostics/diagnostic.ts
#	packages/compiler/src/node-islands/libnode.ts
2026-10-26 11:17:30 -07:00
Chris Tate 89f8b39e5b Merge base branch and fix 2026-10-25 07:08:45 -05:00
Chris Tate 6157fa93ab Merge base branch and fix 2026-10-25 07:02:48 -05:00
Chris Tate 0f7fd1bdb6 Merge base and fix 2026-10-25 02:27:42 -05:00
Chris Tate 0b4301bc3e Merge base and fix 2026-10-25 02:21:39 -05:00
Chris Tate f3750ef976 Merge base and fix 2026-10-25 02:16:24 -05:00
Chris Tate e6790def72 Merge main 2026-10-24 20:06:31 -05:00
Chris Tate d60cdcc843 Merge the base branch 2026-10-24 16:49:25 -05:00
Chris Tate f0448238f1 Keep libnode pack manifest paths inside the bundle 2026-10-23 14:06:42 -05:00
Chris Tate 1562d08609 Merge the loader branch, key the build by the libnode pack, and pick musl packs 2026-10-23 13:09:08 -05:00
Chris Tate c0e24cdb3f Embed island modules, bound V8's stack scan in-thread, and keep Node's environment out 2026-10-23 12:52:57 -05:00
Chris Tate fe452bdb03 Merge main and harden the Node island loader 2026-10-23 11:04:36 -05:00
Malte Ubl e4a660c15a Merge remote-tracking branch 'origin/ni/i5-shared-modules' into HEAD 2026-10-23 06:43:11 -07:00
Malte UblandClaude Opus 5.5 ec5f77f508 Give the libnode smoke dispatcher the sharedPush entry the bridge requires
ABI 7 takes sharedPush from the bootstrap's dispatcher as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:43:02 -07:00
Malte Ubl 6bd7ecd789 Merge remote-tracking branch 'origin/ni/i4-deferred' into HEAD 2026-10-23 06:42:12 -07:00
Malte Ubl 9df17b1c85 Merge remote-tracking branch 'origin/ni/i2-handles' into HEAD 2026-10-23 06:41:13 -07:00
Malte UblandClaude Opus 5.5 f42fc643de Give the libnode smoke dispatcher the load entry the bridge requires
ABI 5 takes a load function from the bootstrap's dispatcher; without it
the smoke program's start fails with an incomplete dispatcher.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:40:57 -07:00
Malte Ubl 0a965bb87a Merge remote-tracking branch 'origin/ni/i5-shared-modules' into HEAD 2026-10-23 06:34:31 -07:00
Malte Ubl 4bbbf3e079 Merge remote-tracking branch 'origin/ni/i4-deferred' into HEAD 2026-10-23 06:33:28 -07:00
Malte Ubl 4596a4fa28 Merge remote-tracking branch 'origin/ni/i2-handles' into HEAD
# Conflicts:
#	packages/compiler/src/backend/native/executable.ts
#	packages/runtime-pack-common/runtime-pack-matrix.mjs
2026-10-23 06:32:23 -07:00
Malte UblandClaude Opus 5.5 b653f4fd08 Merge origin/ni/i1-stack-bound into ni/i2-handles
Main's FinalizationRegistry took handle tag 72, so the Node island
handle moves to 73. Island handles keep their instanceof path in the
new scr_bytes_instanceof_at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:31:43 -07:00
Malte Ubl 1e70c2a844 Merge remote-tracking branch 'origin/ni/islands-base' into HEAD 2026-10-23 06:29:55 -07:00
Malte UblandClaude Opus 5.5 a0ae4ddad0 Drive the libnode smoke test through the hosted-loop bridge ABI
The libnode packs' smoke program (#1684) still used the pump/alive/
backend_fd entries that the hosted loop (#1696) replaced, so every
Build libnode pack job failed to compile it. It now provides the full
host table and dispatcher and runs Node's event loop once after starting
the asynchronous calls, as the runtime does at the end of a program.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:00:38 -07:00
Malte Ubl 267eb7444e Merge remote-tracking branch 'origin/ni/i5-shared-modules' into HEAD
# Conflicts:
#	packages/compiler/src/backend/llvm/lib-shared.ts
#	packages/compiler/src/ir/builtin-signatures.ts
2026-10-22 20:19:46 -07:00
Malte Ubl b66a1104fe Merge remote-tracking branch 'origin/ni/i4-deferred' into HEAD
# Conflicts:
#	packages/compiler/src/backend/llvm/lib-shared.ts
#	packages/compiler/src/ir/builtin-effects.ts
#	packages/compiler/src/ir/builtin-signatures.ts
#	packages/libnode-common/bridge/scr_node_bridge.cc
2026-10-22 20:19:15 -07:00
Malte UblandClaude Opus 5.5 a8285c756b Clone native data in islands and copy island arrays of plain values
structuredClone in an island of a value holding native records, class
instances or objects (interceptor objects V8's serializer cannot clone)
clones a plain copy of that data, as Node clones the objects themselves.
An island array of primitives or strings (or arrays of those) returned
directly or through a promise crosses as a copy, which the checked cast
then meets, instead of failing the cast as an object handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 20:18:17 -07:00
Malte UblandClaude Opus 5.5 0f41b7bc67 Island handle operations, native subclasses of island classes, arrays and collections by reference (NI-5b/5c/5d)
Node islands stack, part 6 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:54 -07:00
Malte UblandClaude Opus 5.5 5fa44d9243 Share modules between a program and its Node islands through loader hooks (NI-6)
Node islands stack, part 5 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:53 -07:00
Malte UblandClaude Opus 5.5 a1b6fda11c Run npm packages in Node islands: object handles and compiler routing (NI-4)
Node islands stack, part 2 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:52 -07:00
Malte UblandClaude Opus 5.5 106eccd4fd Pass native closures, promises and objects into Node islands by reference (NI-5)
Node islands stack, part 3 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:52 -07:00
Malte UblandClaude Opus 5.5 993486e4a4 Bound V8's stack scan by Node's own stack in Node islands
Node islands stack, part 1 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:51 -07:00
Malte Ubl 7851907c0e Merge ni/13-libnode-packs (#1684) into the Node islands base 2026-10-22 14:45:29 -07:00
Malte UblandClaude Opus 5.5 73ab5b8d7f Run the libnode smoke test only on built packs; stamp the packs 0.4.2
CI's island lanes fall back to the development pack (dev-pack.json: Node
24.22.1, no package.json) until the libnode-packs cache exists, so the
smoke test, which verifies a @scriptc/libnode-<platform> package against
the 24.22.0 pin, failed there. It now runs only when SCRIPTC_LIBNODE names
a package directory. The pack package versions follow the 0.4.2 release
(scripts/sync-versions.mjs), which pin.test.ts checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:23:02 -07:00
Malte Ubl 43cd8dea21 Merge ni/1-libnode-loader into ni/13-libnode-packs 2026-10-21 20:12:41 -07:00
Malte Ubl b9ab8cfa0d Merge ni/1-libnode-loader into ni/3-hosted-loop 2026-10-21 20:12:33 -07:00
Malte UblandClaude Opus 5.5 e7f3b205c3 Fetch the CI dev libnode from scriptc's mirror first
The prerelease libnode-dev-24.22.1 mirrors the dockfries v24.22.1 libnode,
Node's v24.22.1 headers and Node's license byte for byte, as CI-only inputs
(not a scriptc release). dev-pack.json lists the mirror first and the
original locations after it; fetch-dev-pack.mjs takes the first source
whose bytes match the pinned sha256 and logs which one it used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:53:28 -07:00
Malte UblandClaude Opus 5.5 27b27fd5a8 Pass the stack limit of bridge ABI 2 in the libnode smoke test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00
Malte UblandClaude Opus 5.5 75aa8509f6 Assemble libnode packs with NI-1's build-pack.mjs and run island tests in CI
Stack the libnode packs on the in-process loader (#1685) and use its
pack assembler and manifest format instead of a second one:
build-pack.mjs keeps its CLI and fields (schema, nodeVersion,
moduleVersion, bridgeAbi, platform, arch, files), adds the libnode and
bridge names, strips and (on macOS) re-signs the bridge and links it with
-z defs, and exports buildPack(), which the platform packs call with their
package, target and build inputs as extra manifest fields.

libnodeRecord falls back to the installed @scriptc/libnode-<platform>
pack, found from the entry's directory and then next to the compiler,
when neither --libnode nor SCRIPTC_LIBNODE names one.

The Linux test lanes restore the libnode build that the libnode-packs
workflow cached, assemble the linux-x64 pack from it in seconds
(build.mjs --from-cache never builds Node) and export SCRIPTC_LIBNODE, so
the Node island corpus and harness tests run instead of skipping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00
Malte UblandClaude Opus 5.5 e9c6b68c07 Build prebuilt libnode packs for Node islands
Add the @scriptc/libnode-<platform> packs (linux-x64-gnu, linux-arm64-gnu,
darwin-arm64, darwin-x64): the pinned Node.js 24.22.0 built as a stripped
shared library with full ICU and its startup snapshot, the scriptc bridge
compiled against that release's headers, Node's LICENSE and a manifest
with the Node version, NODE_MODULE_VERSION, bridge ABI and file hashes.

packages/libnode-common holds the pin, the build (fetch and verify the
source tarball, configure --shared, build only the libnode target, strip,
stage with headers in a cache keyed by release, flags, platform and
toolchain; the bridge rebuilds in seconds against the cached headers),
a verifier, and a smoke test: a C program that loads a pack the way the
runtime does, starts Node from the snapshot and evaluates expressions
synchronously, asynchronously and throwing.

The libnode-packs workflow builds the packs on native runners, Linux in
the manylinux_2_28 images for a glibc 2.28 floor, caches each libnode
build, smoke-tests and uploads every pack. It never runs in the ordinary
build or test path. The compiler gains the pack lookup (SCRIPTC_LIBNODE,
then the installed package), validation, the nodeIslands.libnode
placements and the license notices for the Node island loader to use.

The bridge source and its C ABI header are the NI-1 bridge agent's,
included here so the packs build; the packs stay private until the
in-process island runtime ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 17:52:22 -07:00
Malte UblandClaude Opus 5.5 eaefbdf44f Host the runtime's event loop on Node's libuv once Node loads (NI-3)
Scope-B milestone NI-3. When a program loads Node in-process, its pending
ticks, promise jobs, timers and immediates move onto Node's queues in
order (timers keep their deadlines relative to the moment Node began
loading; the work of a phase the switch interrupted finishes first) and
every later one is scheduled there, so the jobs of both sides interleave
as in Node. The runtime's I/O hooks are watched from Node's loop, and its
liveness is re-read before each poll phase, after each check phase and
after every microtask checkpoint. Node's loop runs on Node's stack, and
V8's limit follows whichever stack an entry comes from.

Island signal and exit listeners join the runtime's registries at their
position, so the runtime keeps owning every signal disposition; Node's own
'exit' emission is left to the runtime's exit sequence, and the exit code
island code leaves in process.exitCode becomes the program's. Bridge ABI 3.

Ordering programs (tests/corpus-node-islands-order, harness
node-island-order.test.ts), corpus programs 6804-6811 and the
node-island-process harness pin the behavior against Node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 13:31:51 -07:00
Malte UblandClaude Opus 5.5 50a34224b9 Pin the CI dev libnode to dockfries v24.22.1
The community build's v24.22.0 asset was withdrawn when Node 24.22.1
shipped, so every Linux test shard failed to fetch it (HTTP 404). Pin the
v24.22.1 build and Node's 24.22.1 headers by sha256 instead; the island
tests pass with it in the plain and sanitized lanes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 13:31:32 -07:00