Commit Graph
4080 Commits
Author SHA1 Message Date
Malte Ubl 02e499f434 Merge remote-tracking branch 'origin/ni/i7-routing' into HEAD
# Conflicts:
#	packages/libnode-common/bridge/scr_node_bridge.cc
2026-10-22 20:26:01 -07:00
Malte Ubl 5695f91291 Merge remote-tracking branch 'origin/ni/i6-subclasses' into HEAD 2026-10-22 20:25:37 -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 Ubl 05f7696eed Merge remote-tracking branch 'origin/ni/i3-exports' into HEAD 2026-10-22 20:18:50 -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 Ubl 63269b8009 Merge ni/i7-routing into ni/i8-exit 2026-10-22 19:56:48 -07:00
Malte UblandClaude Opus 5.5 47f44c3dfd npm harness: cases that stay native under the fence rule keep their deferred-refusal expectations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:38:49 -07:00
Malte UblandClaude Opus 5.5 45c8c292af Native plain objects inherit Object.prototype directly in Node islands
A plain object a program passes into an island is an object-template
instance, which inherits from its implicit constructor's prototype object;
island code that checks for plain objects (jose's isObject:
Object.getPrototypeOf(o) === Object.prototype) rejected it. The instance now
inherits Object.prototype directly. Corpus 6826 checks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:15:49 -07:00
Malte UblandClaude Opus 5.5 3b2d5f2022 Node islands: give a nested entry its own scheduling state
A call into Node from an async fiber runs in a context of its own on Node's
stack while the calling fiber stays suspended in it, but runtime code that
Node called back there still ran as that fiber: scr_current named it, and
a fiber resumed from there saved its resumer in scr_loop_ctx and, under
ASan, its fake stack in the calling fiber's slot. The calling fiber's next
park then returned to a context that no longer existed, or under ASan
resumed with a fake stack the nested context had destroyed
(6870-node-island-server-fibers in dev mode, sanitized: SEGV in
nh_keep_done). The nested entry now runs host callbacks as the loop's code
does (no current fiber, the main exception cell and ALS slot) and puts the
calling fiber's state and the loop context back when it returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:13:46 -07:00
Malte UblandClaude Opus 5.5 b388156593 Make packages islands only for fences that surely fire; keep jose and run-node native without pins
A gap fence inside a function body may never run, so it no longer makes its
package a Node island under --node-islands=auto: only fences in top-level
module code and fences that need the JavaScript runtime do. The package's
island class still decides after a failed build. Typed packages like jose
stay native (DECISIONS.md, 2026-10-21), so the corpus pins of jose and
run-node are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:08:34 -07:00
Malte UblandClaude Opus 5.5 55a69232b7 Exit cleanly with Node loaded and keep nested entries on Node's stack (NI-7c, NI-3b)
Node islands stack, part 8 of 11 (scriptc-perf/results/islands-prs/PLAN.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:49:55 -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 0dcf0e95d3 Route more packages and values through Node islands (NI-4c–4g)
Node islands stack, part 7 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 2f8e8b2b92 Defer evaluating Node island modules until the program uses them (NI-7)
Node islands stack, part 4 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 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 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 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 56abb3d77a Merge ni-2-node-island-report (#1691) into the Node islands base 2026-10-22 14:45:33 -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 Ubl 5cb2329780 Merge remote-tracking branch 'origin/main' into ni-2-node-island-report 2026-10-22 14:31:26 -07:00
Malte UblandClaude Opus 5.5 1d94942bf9 Treat three timing-dependent island ordering programs as races
g01 (twenty fs.stat round trips against a 2 ms timer), p10 (two 0 ms
timers armed on either side of an island call) and s06 (fs callbacks and
timers pending when Node loads) each failed one CI run in a different
lane: their order depends on how long the island call or the I/O takes,
which differs between the sides and grows under ASan. Their native runs
now have to produce the lines of one of Node's outputs, like the other
race programs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:31:17 -07:00
Chris Tate 48a08dce8e Store arrays of ProgramLifetime instances in 4-byte slots on Linux (#1847) 2026-10-22 16:29:42 -05:00
Chris Tate d2408a09ad Match Node for reduce accumulators and callback arguments.length (#1828) 2026-10-22 16:27:50 -05:00
Chris Tate f45d8ba6dd Version while loops over typed arrays on their counters' bounds (#1841) 2026-10-22 16:27:30 -05:00
Chris Tate 7ef356137f Read the union payload inline when comparing it with a number or boolean (#1839) 2026-10-22 16:26:44 -05:00
Chris Tate e74bd658fd Inline Map retains and Map.size in release builds (#1862) 2026-10-22 16:24:56 -05: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
Chris Tate 41af221ed1 Version functions on number parameters that bound their loops (#1853) 2026-10-22 16:21:01 -05:00
Malte Ubl fb0d7a99a8 Merge remote-tracking branch 'origin/ni/1-libnode-loader' into ni/13-libnode-packs 2026-10-22 14:17:35 -07:00
Malte Ubl 694d34bb44 Merge remote-tracking branch 'origin/ni/1-libnode-loader' into ni/3-hosted-loop 2026-10-22 14:17:32 -07:00
Malte Ubl 13b00dd78b Merge remote-tracking branch 'origin/main' into ni/1-libnode-loader
# Conflicts:
#	packages/compiler/src/frontend/lowering/lower-modules.ts
#	tests/harness/differential.test.ts
#	tests/harness/linux-differential.test.ts
#	tests/harness/llvm-differential.test.ts
#	tests/harness/windows-differential.test.ts
2026-10-22 14:10:07 -07:00
Chris Tate 4d049fbb8c Merge pull request #1850 from vercel-labs/ctate/prepare-v0-4-37aaa7
Prepare v0.4.2 release
v0.4.2
2026-10-22 15:09:47 -05:00
Chris Tate f7ef188d96 Give the sanitized bootstrap seed job swap (#1864) 2026-10-22 14:34:41 -05:00
Chris Tate 5aae5531e0 Give the sanitized bootstrap seed job swap
The sanitized seed compiles the compiler's 700 MB LLVM module with one clang
process under AddressSanitizer. The compile peaks near 14 GB while the Node
process that emitted the module still holds about 6 GB, which exceeds the
runner's 16 GB of memory. The job now enlarges swap to 24 GB before it builds
the seed, as the sanitized emitter job does.
2026-10-22 14:30:37 -05:00
Chris Tate 83b2b34b6e Inline Map retains and Map.size in release builds
Release builds no longer import runtime bitcode, so program code called scr_map_retain_v for every Map read out of a container and scr_map_size for every size read. A Map retain now uses the emitted increment helper, as string retains do, and Map.size reads the live count through an internal helper.
2026-10-22 14:19:04 -05:00
Chris Tate d83c676705 Store compact values of string-key maps in 4-byte slots on Linux 2026-10-22 14:08:00 -05:00
Chris Tate 27bc23b3c2 Include the refreshed optimization profile in v0.4.2 2026-10-22 13:24:44 -05:00
Chris Tate 8d4ee22009 Refresh the native compiler's optimization profile (#1858) 2026-10-22 13:23:05 -05:00
Chris Tate e39ddf3d00 Refresh the native compiler's optimization profile 2026-10-22 13:18:04 -05:00
Chris Tate b4a3bace60 Read compact array slots in dense loop fast copies, and their flag only on 64-bit targets 2026-10-22 13:08:42 -05:00
Chris Tate 6681b9407e Version functions on number parameters that bound their loops
A number parameter that every call site proves an int32 reaches the
function's i32 entry. One that some caller passes as an unproven number,
such as a value read from a worker message or parsed from text, kept its
double, so every loop it bounds compared an integer counter with a double
limit and the values derived from it stayed doubles.

When such a parameter bounds a numeric loop (arithmetic, element and
field reads and writes, Math calls, no allocation or other calls), the
function now gets a copy of its body. Its own body first tests
each such parameter for an int32 that is not -0 and, when all pass, calls
the copy with `p | 0`, the same double. The copy's only caller proves
those parameters int32s, so it gets the i32 entry and integer loops.
Other values run the body as before.

Only plain synchronous functions of at most 2048 IR nodes are versioned:
not class members or generated helpers, not capturing, not the entry,
not dynamic-tier, not calling themselves, and at most 16 per module. A
function holding the only call site of another function is kept whole
unless that callee only computes a number or boolean from scalar reads:
a second call site can stop LLVM from inlining the callee and leave the
records it builds in memory. Library builds and modules that observe
call stacks are left as they are.
2026-10-22 11:46:21 -05:00
Chris Tate 9aaebbab25 Prepare v0.4.2 release 2026-10-22 11:14:27 -05:00
Chris Tate 5266cb7cbe Check with tsc-ts 0.0.7 and batch contextual types and signatures (#1844) 2026-10-22 10:50:12 -05:00
Chris Tate eef3471159 Stop asking batch methods the checker server answers as unknown
tsgo has no getContextualTypes or getResolvedSignatures. Each prefetch
asked for them anyway, and a failed chunk was split and retried down to
single nodes, so a tsgo build paid about two failed requests per
prefetched node. The checker facade now remembers a batch method the
server answers with "unknown API method" and asks those queries node by
node from then on.
2026-10-22 10:46:38 -05:00
Chris Tate 4d7de03054 Store arrays of ProgramLifetime instances in 4-byte slots on Linux 2026-10-22 10:46:16 -05:00
Chris Tate b774307a4d Merge main 2026-10-22 10:46:00 -05:00
Chris Tate 5bbf2c97b8 Encode posted records from their fields, and queue a message in one block (#1824) 2026-10-22 10:25:40 -05:00
Chris Tate 08081ca1a2 Encode each field of a posted record completely before the next
A typed record encoded from its field hooks queued a plain-object field on
the visit stack and went on to the next field, so getters on later fields
ran before the properties of earlier ones were read. Node's serializer
finishes each field, nested properties included, before the next.

The record path now drains the visit stack down to where it started after
each field, so properties are read in Node's order. Corpus 7139 posts a
record whose fields hold getter-bearing objects and prints the read order.
2026-10-22 10:22:22 -05:00