Commit Graph
22 Commits
Author SHA1 Message Date
Malte Ubl bf508eb70f Publish typed object graphs to workers by reference (@scriptc/threads)
The new @scriptc/threads package exports publish(value) and
sharesPublishedGraphs. Node.js runs its JavaScript: publish validates
the whole graph (plain objects, arrays, class instances, Maps, Sets and
primitives other than symbols), then deep-freezes it, and published Maps
and Sets reject mutation. scriptc builds lower both exports to
intrinsics and never compile the package body.

In scriptc, publish makes the graph immutable and immortal: a
compiler-emitted walker per static type (llvm/publish.ts) marks every
object rc == SIZE_MAX through a runtime worklist (scr_publish.c), so
retains, releases and the collector skip it and nothing frees it, and
the objects leave the collector's buffers. Hierarchy members dispatch on
the concrete class; arrays, maps, sets, strings and dyn subgraphs have
runtime walkers. Static types over-approximate a graph, so an
unpublishable type gets a refusing walker that fails only when a value
is present, and every mark is logged so a refusal restores the whole
graph, exactly like the Node implementation's validate-first order.

A typed-ref capsule over a published object travels through postMessage
and workerData as a pointer (a fresh capsule in the receiver; vtables,
adapters and type keys are process-wide); immortal dyn graphs inside a
message are shared the same way. Iterating a published map no longer
writes its iteration depth.

Stores into the static types a program publishes (computed by
backend/publication.ts, a class with its whole hierarchy) carry a guard
that throws Node's frozen-object TypeErrors, and may-throw counts them.
The corpus program pins the contract against Node: shared and cyclic
class graphs with arrays, maps, sets and records read identically on
both threads, every write form fails with Node's message, unpublished
instances of the same classes stay writable, a refused publish leaves
its graph unchanged, and a worker-published graph reaches the main
thread. packages/threads/README.md documents the contract and the
differences (prototypes and identity across messages).

Each mark records its object kind, so a successful publish takes the
objects out of the RC audit's live counts (immortal objects are never
freed).

Dates (time values) and process streams (descriptors) are scalars in
scriptc, so their walkers refuse a date field or root directly instead
of pushing its bits as a pointer; the refusal corpus program pins the
statically typed refusals (date, function, RegExp, typed array and Error
values in class and record fields, and a date root) against Node.

Main lowers a discarded or union-typed `xs.pop()` to a length
truncation; those stores now carry a `pop` marker so a published array
fails with pop's own TypeError ("Cannot delete property 'N'", or the
length message for an empty array, whose `length = 0` store the emitter
drops unless the array type can be published).
2026-10-10 01:00:36 -05:00
Malte Ubl 10b246d604 Add a runtime benchmark suite with Node-verified A/B timing
Fourteen application-shaped workloads (JSON, regex, parsing and class
dispatch, sorting, rendering, collection pipelines, async fan-out,
Map/Set graphs, allocation, numeric kernels, exceptions, CSV, and the
two multi-module build benchmark apps on large inputs).

bench:runtime builds each workload with one or two checkouts, refuses to
time any executable whose stdout, stderr, or exit status differs from
Node, interleaves baseline and candidate launches, and reports medians
with bootstrap 95% confidence intervals, binary size, and peak RSS.
2026-10-08 09:38:23 -07:00
Chris Tate c08ab955ae Enforce linting and consistent source formatting
- Enforce oxlint and oxfmt for owned JavaScript and TypeScript with independent CI checks.
- Preserve compiler import boundaries and protected fixtures while cleaning up lint findings.
- Standardize source formatting and validate import, fixture, and embedded-source protections.
2026-10-05 17:51:24 -05:00
Chris Tate b97ea1d929 Cache repeated AST child lookups in packed tables (#657) 2026-10-04 03:16:34 -05:00
Chris Tate 91a7732531 Speed up compiler graph propagation (#644) 2026-10-03 16:25:29 -05:00
Chris Tate 6d1907aa06 feat: support static Three.js collision workloads
- Compile Three.js capsule, sphere, and ray collision queries for native and WebAssembly targets.
- Preserve JavaScript constructor results, shared arrays, and nullable class fields.
- Resolve static methods against their exact class receivers.
2026-09-30 09:19:17 -05:00
Chris Tate ee9f0d64eb feat: ship the self-hosted native scriptc CLI (#585)
* feat: ship the self-hosted native scriptc CLI

- Run the shared compiler and CLI natively, including library builds and compile-time evaluation.
- Install native platform packages and ship relocatable standalone distributions.
- Preserve program semantics and reuse validated build artifacts for fast rebuilds.

* fix: complete native CLI integration and validation

- Preserve library diagnostics and run recursive compiler work on the main stack.
- Restore packaged helper permissions and exercise native npm and Wasm library builds.
- Recover interrupted Sandbox status probes within the original command deadline.
2026-09-30 02:17:56 -05:00
Chris Tate d3dfdade8e Compile three.js math modules with LLVM
- Run published three.js vector, matrix, and quaternion operations natively and as Wasm without a JavaScript engine.
- Preserve shared class prototype data and JavaScript overload arguments.
- Support Math function values and distinct npm import and require entries.
2026-09-29 20:58:04 -05:00
Chris Tate 0d9d946dde Bootstrap a standalone native compiler (#572)
- Build static programs through the TypeScript 7 frontend, C and LLVM emitters, and native linker without a JavaScript host
- Share runtime-pack verification and link planning across native and Node compiler hosts
- Handle large C output and deep logical-expression validation during compiler bootstrapping
2026-09-29 09:21:59 -05:00
Chris Tate 82d7d9a237 feat(compiler): use a statically compilable TypeScript AST model
- Replace SDK AST materialization with checked native node, list, and text decoding.
- Preserve checker handle identity and snapshot reuse across the frontend.
- Compile generic visitors and guarded node-list iteration without dynamic execution.
2026-09-28 00:40:27 -05:00
Chris Tate b2c160cb2a perf(compiler): reduce development build fingerprint overhead (#487)
- Parallelize compiler fingerprint reads while preserving cache identity and invalidation guarantees.
- Add a reproducible development build benchmark and regression coverage for file changes.
2026-09-27 09:02:28 -05:00
Chris Tate 266e22b151 Enable initial static compilation of published Effect modules (#428)
* Enable initial static compilation of published Effect modules

- Compile the published Effect Function subpath and deeper npm module chains as static program code.

- Preserve JavaScript argument and string search behavior across native backends, with differential coverage.

* Prune unused static npm namespace re-exports

- Honor package sideEffects metadata across nested ESM scopes and pure dependencies.
- Keep preflight, linking, and initialization consistent, with Node differential coverage.

* Fix static npm pruning across dependency cycles

- Make package purity caching safe across dependency cycles.

- Cover transitive module initialization with a Node differential fixture.
2026-09-25 12:52:27 -05:00
Chris Tate 5c557d8ea4 Fix static JavaScript edge cases and add Test262 coverage (#414) 2026-09-24 23:01:48 -05:00
Chris Tate 073c840564 Enforce TypeScript 7 and Node type-link parity (#315)
* Enforce TypeScript 7 and Node type-link parity

* fix(compiler): normalize Windows resolver paths

* fix(compiler): canonicalize Windows realpaths
2026-09-14 09:19:08 -05:00
Chris Tate 8faad2f639 feat: add Node.js compatibility matrix (#284)
* feat: add Node.js compatibility matrix

- Add generated Node.js v24 compatibility inventory with static and dynamic support classifications.
- Publish the interactive /compatibility matrix and wire manifest generation into runtime and docs checks.

* fix: correct compatibility matrix generation

* fix: address PR 284 review findings

* fix: address PR 284 review findings

* test: exercise stream web loader through npm graph

* fix: correct dynamic global availability

* fix: keep compatibility module mappings precise
2026-09-02 16:03:36 -05:00
Chris Tate 2d0bc2df0b Add generated Node 24 fetch conformance
- Pin the supported fetch surface to an explicit Node and Undici profile.
- Generate deterministic WebIDL, AbortSignal, and stream differential campaigns.
- Match Node stream pull scheduling while preserving typed source identity.
2026-08-01 15:33:37 -05:00
Chris Tate a4906d4948 chore(test): upgrade Vercel CLI to 58.1.0
- Refresh the pinned Sandbox runner dependency graph.

- Exempt only Vercel 58.1.0 from the release-age gate.
2026-07-28 20:24:49 -05:00
Chris Tate dd0a5cf076 fix(test): make sandbox requirements explicit
- Document Pro and Hobby gate configurations without reducing coverage.
- Pin the Vercel CLI and its release-age-safe dependency graph.
2026-07-28 19:51:17 -05:00
Chris Tate ce8c447d87 Speed up full test validation with Vercel Sandbox
- Add a custom Node 24 test image with tenant-neutral VCR configuration.
- Shard differential suites across disposable Sandboxes while preserving host-specific coverage.
- Load local agent credentials safely and document the validation workflow.
2026-07-28 13:27:18 -05:00
Chris Tate 50b135de8d Fix workspace build on Windows 2026-07-26 16:01:30 -05:00
Chris Tate d66c36b020 Ship a per-release surface manifest with stable ids and refusal codes
- packages/compiler/surface-manifest.json is generated (pnpm manifest), committed, and shipped in @scriptc/compiler; entries project mechanically from the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib/builtin lowering tables, and the supported-builtin-module list
- every non-static entry carries the SC code the compiler raises for it, and the version spine is the exact published release version
- FENCE_CODES joins the diagnostics registry so factory-minted construct fences are enumerable
- the sampling harness compiles listed-static probes and asserts each sampled non-static entry refuses with exactly its listed code, beside a byte-identical staleness guard
- the release workflow regenerates the manifest, fails on drift, and attaches it to the GitHub release
2026-07-22 22:01:45 -05:00
Chris Tate 23d5918a53 init 2026-07-22 18:08:04 -05:00