Repository navigation
Island handle operations, native subclasses of island classes, arrays and collections by reference (NI-5b/5c/5d) - #1903
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… 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>
999213f to
5fa44d9
Compare
4c9347d to
0f41b7b
Compare
# Conflicts: # packages/compiler/src/backend/llvm/lib-shared.ts # packages/compiler/src/ir/builtin-signatures.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review pass on this PR. All Vercel Agent findings are already addressed on this branch, and I re-verified each against the head (76a60ff):
Vercel Agent's re-review of the current head reports 0 suggestions, and CI is green (run 40505952799). Stack note: 🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Restacked onto the new signed Conflict —
No semantic overlap: the enum is a value hint, the class block is the interface/prototype surface. Verified both remain the only definitions (no duplicate declarations).
Verified in a Linux sandbox on the merged tree: 🤖 Generated with Claude Code |
Resolve tests/harness/npm.test.ts by taking main's npm-suite split and porting the island path normalisation and the two island KNOWN entries into tests/harness/npm-suite.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lowerer journal test requires every collection to be journaled, checked or left out by name. islandHandleBindings is a memo keyed by symbol and islandInstanceofHandled is unwound scratch of the lowering in progress, so both are unjournaled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stale i6 branch marked lazy-traps island-only, which held while the whole package was refused and ran in a Node island. main compiles the package statically with a throwing stub per blocked edge, so its require() edges still match Node through an island while an import() whose literal specifier resolves nowhere is a deferred SC2012 fence. Record that remaining gap the way main does instead of claiming Node parity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Stack maintenance round on this branch; head is now CI root cause (the one failure in the whole stack). Every PR from here up fails Conflict. Sandbox validation with a libnode pack built from the top branch's bridge sources (bridgeAbi 10, so the pack matches the stack): Zero-cost gate. The only compiler edit adds field names to 🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Restacked after 🤖 Generated with Claude Code |
Stacked on #1902. Sixth of nine Node islands PRs.
What it does
Handle operations.
Symbol.toPrimitive/toString/valueOfforString(), templates,+and numeric conversion. This uses a newto_primitivehandle hook inscr_dyn.h; only handle classes that set it see a change.lazy-trapsandnode24-commonjs-metadatanow match.$ORIGIN/load paths resolve against the executable's directory.constbindings. Any other use is SC8010 at that use.?.) and spread now work on island values.Native subclasses (NI-5b, 5d).
class X extends IslandBaseat module top level is created in Node with native methods, accessors, field initializers,super(...)andsuper.m(). When the base is a deferred island class, the subclass is created lazily on first use, so it does not start Node at boot. SC8011 now also covers classes of compiler-managed island packages, for the forms that are still not supported.By reference (NI-5b).
Array.isArrayis true.export_opon the native collection. This is bridge ABI 8: the host struct gains NI-6's fields and thenexport_op.util.promisify(islandFn)runs Node's promisify in the island.NI-5c. Native
x instanceof Error(and the builtin error subclasses) asks Node for island objects.util.inspectin the island shows the contents of array, Map and Set exports.The island helpers module is released at exit, which fixes the sanitized-lane RC audit for 6862 and 6864.
Two changes from int/islands to keep good code untouched:
scr_ni_to_primitivecall underSCR_NODE_ISLANDS, not a newScrDynHandleOpsmember. On int/islands the member grew every handle class's ops table, and the zero-cost gate flagged about 590 executables.util.promisifyoverloads in the fallback types match only functions that return nothing. On int/islands they capturedexecFile/execin TypeScript's subtype pass, and corpus 1473, 1573, 5626 and 5636 failed preflight.The island lowering keeps its caches on the
Lowerer, not in module-level weak collections (compiler-weak-collections.test.ts).Evidence
6848-node-island-handle-ops: undeclared arrays and Maps as handles, identity, spread both ways, ToPrimitive, compound assignment, optional chains.6862-node-island-native-subclass: an error subclass and a subclass of it,super.describe(), a getter,instanceofon both sides, throw and catch, and a semaphore subclass with an async override.6863: native arrays.6864: promisify.6865: collections.6866/6867: a deferred class subclassed at top level. Node is never mapped when the class is unused, and starts at the first throw when it is used.Shortcuts
x.m?.()reads the method twice. Handle bindings areconstonly, andx++on island members is not lowered.promisify(islandFn)is not handled.Gate results
node-island*.test.ts,npm.test.ts,packages/compiler/src/node-islands, differential68xx): plain 223/223 + diff 64/64; sanitized 223/223 + 64/64.pnpm lint,pnpm format:checkandpnpm test:ts7 --baselines-onlypass.packages/compiler/src/native/cli.ts --emit=llvm) builds.corpus/fs-extra-package(%m0.settleVoid). It differs in every gate of the stack, including Bound V8's stack scan by Node's own stack in Node islands #1898, which does not touch the compiler, so it is nondeterministic on the base.both-failcovers only the island programs, because the gate host has no libnode pack. Compile time stays within tolerance.CI on the first push found failures outside the focused island set: the ABI in
bridge.test.ts, the runtime ABI header declarations, the effect gate on the ts7 allowlist, weak collections in the compiler, the pipeline scout and the Node version line. The fixes are folded into the PRs that introduce each piece, and they are re-checked in a Sandbox on the final tree.Stack
#1898
#1899
#1900
#1901
#1902
→ #1903
#1904
#1905
#1906
#1907
#1908
🤖 Generated with Claude Code