Commit Graph
170 Commits
Author SHA1 Message Date
Chris Tate b40dbe9bb7 Show 0.2.8 in the coverage diagnostics example 2026-10-10 10:18:09 -05:00
Chris Tate c67e08a9cf Prepare v0.2.8
- Synchronize published packages and the compiler surface manifest at v0.2.8, and bump the runtime ABI marker to v9.
- Add release notes for worker graph sharing, catchable deep recursion, parallel code generation, runtime performance, and compatibility fixes.
2026-10-10 10:08:39 -05:00
Malte Ubl 6835e5a734 Document sharing published graphs between workers
The new docs page (/docs/threads) explains @scriptc/threads: a runnable
example that publishes a million-order ledger and sends it to four
workers, verified under Node.js 24 and as a scriptc executable; what
publish accepts and refuses, and that a refused publish leaves the graph
unchanged; the frozen-object TypeErrors of the write guard; a comparison
with Node's structured clone (constant-time sends, preserved classes and
identity, immortal objects) and the three rules that make a program
behave the same under both; the automatic sharing of deeply frozen
untyped data; and the cost model. The limitations page gains a Published
graphs section (immortality, class and identity differences, write-check
evaluation order, private fields) and links the new page from the
worker-threads section.

This is the first page added since the migration, so the route-test
fixture now accepts pages without a legacy URL, and the agent guide's
checklist for new pages names the fixture.
2026-10-10 01:00:36 -05:00
Chris Tate 3ea231d70d Optimize and generate native code in parallel partitions
Large executables were simplified and inlined as one module before the
optimizer split them, so most of a release build ran on a single core,
and any edit recompiled the whole program.

The LLVM helper now divides the program before optimization. It splits
the emitter's assembly text directly, so partitions also parse
concurrently, and falls back to LLVM's module splitter for any input
outside the emitter's grammar. Internal functions referenced by a single
function stay with that function, and globals stay with their first user.
Optimized partitions follow the ThinLTO model: each is simplified and
summarized on its own thread, a thin link imports small functions across
partitions for inlining and returns unexported hidden definitions to
internal linkage, then each partition is optimized and compiled on its
own thread. Unoptimized partitions compile independently, so dev builds
of large programs are parallel too.

A private per-helper cache directory stores simplified partitions under
the hash of their source and objects under the hash of the module after
importing, so a rebuild recompiles only the partitions an edit can
affect. To keep unchanged partitions identical across edits, each
partition numbers its metadata in first-use order, lists only the debug
compile units it uses, and orders declarations by name, and interned
string constants are named by their content rather than first-use order.

Partition counts are powers of two that depend only on the module size,
up to 64, so output stays the same on every host and functions keep
their partition across ordinary edits. LLVM text that arrives in parts is
written in large batches and handed to the helper in place instead of
being written a second time.
2026-10-09 19:51:47 -05:00
Chris Tate d1e7f9088c Give async bodies and generators 512 KiB stacks
Async functions and generators run on their own fiber stacks. The new
stack-overflow guard keeps a quarter of each stack as a reserve for
unwinding and error reporting, which cut the depth they could recurse to
from 256 KiB to 192 KiB of frames. Moderately deep recursion inside an
async body or generator then threw RangeError where Node runs it, for
example 3000 frames of an unoptimized build on arm64 macOS.

Fibers now get 512 KiB, which leaves 384 KiB after the reserve. Pages are
still committed lazily, so idle and shallow fibers cost address space, not
memory. The corpus pins recursion inside async functions and generators
next to deeper recursion on the main stack.
2026-10-09 17:33:59 -05:00
Chris Tate 3bcf761f42 Throw a catchable RangeError on deep recursion
Native executables used to terminate with a signal when recursion
exhausted the stack. Functions that can take part in unbounded recursion
now compare the stack pointer against a per-stack guard on entry and
throw Node's `RangeError: Maximum call stack size exceeded` through the
ordinary exception path, so catch handlers, finally blocks, worker error
events and the uncaught-error exit code behave as they do under Node.

- The checked set is every function on a cycle of the call graph, where
  operations that can reenter compiled code indirectly (indirect calls,
  callbacks, dynamic and library operations) reach closure targets and
  class members. Non-recursive functions, including leaf callbacks, stay
  check-free, and the may-throw analysis accounts for the new throw.
- The runtime installs the guard per context (main thread from the stack
  rlimit, workers from their thread attributes) and per async fiber, with
  a reserve for the throw, unwinding and error reporting. Worker threads
  now get an explicit 8 MiB stack.
- Scalar call results pass through the unwind path as its dummy value, so
  calls in tail position keep tail-call and recursion elimination.
2026-10-09 16:55:35 -05:00
Chris Tate cd28e4d6ca Answer undefined for out-of-range typed array reads like Node (#797) 2026-10-09 11:37:16 -05:00
Chris Tate 3e41bcbfd0 Make compile blockers and Node differences actionable (#786) 2026-10-09 10:30:31 -05:00
Malte Ubl 2076f793f6 Keep 64-byte x86 runtime alignment for --optimization=speed only
The default build's largest size contributor on the stack was H23's
-falign-functions=64 on every x86-64 runtime unit (2-11 KB per program;
results/h45-size-budget). Release and library flavors now keep the
compiler's default function alignment; the opt-in speed flavor keeps the
blanket 64-byte alignment. Vendored archives stay 64-byte aligned
(lre_exec keeps its pinned placement) except libunicode.c, whose small
table helpers were most of the regex programs' padding. The runtime-first
link order is unchanged.

Docs and usage text describe speed without the reverted runtime profile.
2026-10-08 15:46:34 -05:00
Malte Ubl 99566b2dfb Document --optimization=speed on the CLI page
Final numbers for the speed posture (H30 inline RC + H02 runtime bitcode import + H28 runtime PGO) against release on the same tree. Release executables are byte-identical to perf/stack/06-h23-layout-noise on both lanes (14/14).

Linux x86_64 sandbox, --layouts=4 --runs=16 (linux-speed-vs-release.json):

| workload | baseline ms | candidate ms | change | 95% CI | verdict | size (bytes) | cold build ms | node ms | candidate/node |
| --- | ---: | ---: | ---: | --- | --- | ---: | ---: | ---: | ---: |
| json-records | 194.4 | 164.7 | -15.3% | -17.3% .. -13.7% | faster | +18.3% (239328 → 283176) | 1311 → 1987 | 439.51 | 0.38x |
| regex-logs | 165.9 | 147.6 | -11.0% | -12.4% .. -7.1% | faster | +11.2% (325648 → 362136) | 1003 → 1539 | 235.96 | 0.63x |
| ast-interp | 271.7 | 200.8 | -26.1% | -27.7% .. -22.9% | faster | +14.9% (149032 → 171264) | 1230 → 1797 | 243.44 | 0.82x |
| records-sort | 669.8 | 553.9 | -17.3% | -22.0% .. -10.8% | faster | +24.2% (140840 → 174960) | 1232 → 1829 | 226.37 | 2.45x |
| template-render | 70.5 | 62.9 | -10.7% | -12.9% .. -7.1% | faster | +4.1% (244976 → 254968) | 1049 → 1550 | 193.97 | 0.32x |
| functional-pipeline | 220.8 | 189.3 | -14.3% | -19.8% .. -10.4% | faster | +23.1% (112928 → 139008) | 1130 → 1841 | 269.15 | 0.70x |
| async-pipeline | 197.0 | 196.8 | -0.1% | -2.4% .. +5.3% | neutral | +7.3% (169944 → 182392) | 978 → 1297 | 91.97 | 2.14x |
| word-graph | 251.9 | 231.1 | -8.3% | -14.4% .. -4.6% | faster | +30.7% (139040 → 181664) | 1279 → 1974 | 471.96 | 0.49x |
| alloc-trees | 321.6 | 271.4 | -15.6% | -18.2% .. -13.3% | faster | +10.8% (88672 → 98280) | 946 → 1281 | 125.46 | 2.16x |
| numeric-kernels | 51.2 | 48.3 | -5.5% | -17.4% .. +4.9% | neutral | +16.8% (106600 → 124488) | 1061 → 1411 | 147.98 | 0.33x |
| validate-errors | 188.9 | 163.0 | -13.7% | -23.3% .. +10.3% | neutral | +8.2% (285424 → 308904) | 991 → 1447 | 793.58 | 0.20x |
| csv-numbers | 357.6 | 317.1 | -11.3% | -15.9% .. -7.6% | faster | +21.1% (146856 → 177792) | 986 → 1572 | 541.06 | 0.59x |
| log-summary | 167.6 | 157.4 | -6.1% | -9.5% .. -1.3% | faster | +30.5% (225256 → 294024) | 1331 → 2143 | 311.61 | 0.51x |
| inventory-report | 327.6 | 263.5 | -19.6% | -28.2% .. -15.3% | faster | +22.2% (311336 → 380312) | 1599 → 2410 | 445.01 | 0.59x |

contenders: baseline=release@, candidate=speed@; layouts 4, runs 16
geomean change -12.7%; faster 11/14; slower: none; size geomean +17.1% (max +30.7%); cold build geomean +48.5%; candidate/node 0.658x (baseline/node 0.754x)

macOS arm64 (shared host), --layouts=4 --runs=16 (local-speed-vs-release.json; file sizes move in 16 KiB pages, __text geomean +30.8%):

| workload | baseline ms | candidate ms | change | 95% CI | verdict | size (bytes) | cold build ms | node ms | candidate/node |
| --- | ---: | ---: | ---: | --- | --- | ---: | ---: | ---: | ---: |
| json-records | 113.7 | 89.4 | -21.4% | -22.4% .. -20.5% | faster | +28.8% (222592 → 286688) | 958 → 1523 | 224.67 | 0.40x |
| regex-logs | 106.0 | 91.6 | -13.5% | -15.4% .. -11.7% | faster | +22.7% (279128 → 342456) | 996 → 1106 | 129.92 | 0.70x |
| ast-interp | 164.6 | 111.7 | -32.1% | -32.9% .. -31.4% | faster | +17.8% (148376 → 174760) | 896 → 1288 | 136.99 | 0.82x |
| records-sort | 369.7 | 286.4 | -22.5% | -26.6% .. -18.9% | faster | +17.8% (147888 → 174192) | 980 → 1244 | 133.39 | 2.15x |
| template-render | 50.4 | 46.6 | -7.4% | -9.6% .. -5.9% | faster | +13.0% (205808 → 232512) | 942 → 1039 | 95.49 | 0.49x |
| functional-pipeline | 129.9 | 104.5 | -19.6% | -22.3% .. -15.1% | faster | +36.0% (112464 → 152912) | 872 → 1523 | 120.64 | 0.87x |
| async-pipeline | 261.6 | 261.8 | +0.1% | -2.2% .. +3.4% | neutral | +21.4% (154624 → 187776) | 750 → 962 | 57.94 | 4.52x |
| word-graph | 133.1 | 110.7 | -16.9% | -22.0% .. -10.2% | faster | +30.3% (147192 → 191816) | 876 → 1298 | 276.89 | 0.40x |
| alloc-trees | 216.8 | 163.7 | -24.5% | -25.5% .. -23.8% | faster | +25.5% (92792 → 116424) | 746 → 962 | 75.59 | 2.17x |
| numeric-kernels | 32.1 | 31.1 | -2.8% | -5.4% .. -0.5% | faster | +21.8% (110832 → 134960) | 853 → 979 | 78.45 | 0.40x |
| validate-errors | 110.6 | 86.3 | -22.0% | -22.8% .. -21.0% | faster | +31.0% (205136 → 268720) | 784 → 1507 | 428.13 | 0.20x |
| csv-numbers | 184.2 | 160.8 | -12.7% | -17.1% .. -10.6% | faster | +19.9% (146984 → 176200) | 1217 → 1380 | 252.81 | 0.64x |
| log-summary | 88.8 | 72.8 | -17.9% | -19.9% .. -16.3% | faster | +38.7% (205144 → 284520) | 1440 → 1731 | 152.02 | 0.48x |
| inventory-report | 132.7 | 105.4 | -20.6% | -23.3% .. -16.7% | faster | +43.0% (223120 → 319088) | 1472 → 1940 | 199.93 | 0.53x |

contenders: baseline=release@a5a5b961+dirty, candidate=speed@a5a5b961+dirty; layouts 4, runs 16
geomean change -17.1%; faster 13/14; slower: none; size geomean +26.0% (max +43.0%); cold build geomean +34.0%; candidate/node 0.722x (baseline/node 0.871x)

Incremental, Linux: H30 vs release -2.3%; H02 on H30 -6.6%; H28 on H30+H02 -4.4%. Linux text+data speed vs release: geomean +19.0%, max +33.7%. Full report: results/h45-speed-posture/REPORT.md.
2026-10-08 15:46:34 -05:00
Chris Tate 1f10e83720 Promote canary to main (#738)
- Preserve callback identity, receiver binding, and class references across unions and collections.
- Track record field presence independently of undefined values and improve native runtime behavior.
- Expand differential coverage and streamline CI bootstrap and compiler rebuild checks.
2026-10-08 11:00:13 -05:00
Chris Tate 095b619330 Add native workers and shared memory
- Add native worker execution with isolated module state, structured messages, and lifecycle controls.
- Support shared buffers and integer atomics with coordinated runtime ownership and cancellation.
- Extend compiler, runtime-pack, differential, and compatibility coverage for native concurrency.
2026-10-07 19:07:02 -05:00
Chris Tate 13291c68d3 Preserve interface identity and extend native library calls
- Preserve live class identity through interface receivers and object methods.
- Extend synchronous text reads and regular expression replacement callbacks.
- Keep unsupported generic dispatch boundaries explicit.
2026-10-07 13:55:11 -05:00
Chris Tate 6aa48c111a Strengthen generic type and class boundaries
- Support concrete generic inheritance, forward references, and nullable substitutions.
- Bound recursive specialization demands while preserving independent concrete uses.
- Preserve class identity through checked assertions and contextual lowering.
2026-10-07 11:47:54 -05:00
Chris Tate e936346215 Parallelize large native builds and adapt cycle collection (#722) 2026-10-07 10:47:31 -05:00
Chris Tate 4ec55cdf64 Accelerate default primitive array ordering (#721)
- Sort primitive arrays with stable native ordering and pure conversion keys.
- Preserve sparse semantics and argument effects while avoiding callback overhead.
- Verify Unicode ordering and ownership across native and WASI paths.
2026-10-07 08:15:08 -05:00
Chris Tate 4427f1fb5a Expand native collection keys and construction
- Support boolean, bigint, and mixed value keys in native Maps and Sets.
- Reuse key hashes and copy collections directly into compact storage.
- Preserve collection identity, ordering, iteration, and ownership behavior.
2026-10-05 09:32:14 -05:00
Chris Tate 7efc573285 Add Node 24 filesystem-capacity queries (#666) 2026-10-04 11:12:43 -05:00
Chris Tate 46188eefe1 Add Node 24 filesystem link support (#664)
* Add Node 24 filesystem link support

* Use executable extensions in Windows link fixtures

* Remove Windows links without walking their targets

* Match Windows symlink inference and Buffer validation

* Match Node Windows symlink paths and fallback state

* Preserve Windows errors when following filesystem links
2026-10-04 09:46:00 -05:00
Chris Tate 4d3fe2c140 feat: support Node 24 filesystem timestamps (#663)
* feat: support Node 24 filesystem timestamp operations

* test: record frontend baselines for timestamp fixtures

* test: link timestamp validation into the runtime smoke test
2026-10-04 07:54:11 -05:00
Chris Tate e7d5c67cdc Add Node 24 readable stream readers, controllers, and tee (#661) 2026-10-04 06:07:41 -05:00
Chris Tate 3aad3e8ebe Add Node 24 Web Stream pipelines and streaming encoding (#660) 2026-10-04 05:36:27 -05:00
Chris Tate 99613bce5a Add Node 24 writable Web Streams support (#659) 2026-10-04 04:54:43 -05:00
Chris Tate 095673351e Add Node 24 URL authority and protocol mutation support (#658) 2026-10-04 04:14:12 -05:00
Chris Tate 41b5eed650 Add Node 24 URL mutation support (#654)
* Add Node 24 URL mutation support

* Record preflight baselines for URL mutation fixtures
2026-10-04 01:57:10 -05:00
Chris Tate 4eb4e71d9b Expand Node 24 ESM metadata compatibility (#653)
* Expand Node 24 ESM metadata compatibility

* Fix ESM metadata lowering in native compiler bootstrap
2026-10-04 01:03:02 -05:00
Chris Tate 2dcd4b9e35 Add native util.types probes and reliable embedded brand checks (#652) 2026-10-03 23:49:39 -05:00
Chris Tate 44f7e7680e Add Node 24 util.styleText compatibility (#651) 2026-10-03 22:54:00 -05:00
Chris Tate ba79399aba Add Node 24 deep equality support (#650) 2026-10-03 21:56:40 -05:00
Chris Tate b7d5ea2722 Support Node 24 no-error assertions (#648) 2026-10-03 20:16:24 -05:00
Chris Tate eb83febcf2 Support Node 24 text utilities (#647) 2026-10-03 19:21:34 -05:00
Chris Tate b8344a6cb5 Support Node 24 system error utilities (#646)
* Support Node 24 system error utilities

* Wait for writable drain in the stream fixture
2026-10-03 18:34:51 -05:00
Chris Tate bc7c9f6bf6 Support Node 24 file URL buffers and platform options (#645)
* Support Node 24 file URL bytes and runtime platform options

* Record preflight baselines for file URL conversion fixtures
2026-10-03 17:33:04 -05:00
Chris Tate 7a0f38cbb3 Expand Node 24 diagnostics channel compatibility (#643) 2026-10-03 15:51:00 -05:00
Chris Tate 7a3794d8dd fix: emit TypeScript runtime package sources (#641) 2026-10-03 15:43:26 -05:00
Chris Tate 91ab7a68ce Expand Node 24 CommonJS module compatibility (#642) 2026-10-03 15:12:07 -05:00
Chris Tate 6aa1370507 feat: support Node 24 MIME utilities (#640)
* feat: support Node 24 MIME utilities in the dynamic runtime

* test: record frontend baselines for MIME fixtures
2026-10-03 14:23:41 -05:00
Chris Tate 64a66ddd46 Expand Node 24 promise timer compatibility (#637) 2026-10-03 13:00:14 -05:00
Chris Tate b76aa555f0 Expand Node 24 async event consumption compatibility (#636) 2026-10-03 12:18:14 -05:00
Chris Tate 724fa7591b Expand Node 24 EventEmitter listener lifecycle compatibility (#635) 2026-10-03 11:37:49 -05:00
Chris Tate 992e49159f Expand Node 24 callback and promise adapter compatibility (#633)
* Expand Node 24 callback and promise adapter compatibility

* Keep runtime diff focused on util adapters
2026-10-03 10:17:30 -05:00
Chris Tate c76ac2b95f Expand Node 24 dynamic argument parsing compatibility (#632)
* Expand Node 24 dynamic argument parsing compatibility

* Match Node argument error string truncation and quoting
2026-10-03 09:29:06 -05:00
Chris Tate 50a2731631 Expand Node 24 text-encoding support (#629)
* Expand Node 24 text-encoding support

* Update codec diagnostics for encodeInto support
2026-10-03 05:38:29 -05:00
Chris Tate 176305530c Add Node 24 environment-file support (#628)
* Add Node 24 environment-file support

* Update runtime harnesses for environment-file URL paths

* Link URL dependencies in weak metadata runtime tests
2026-10-03 04:44:57 -05:00
Chris Tate da852757a3 Add Node 24 URL factories and shared parsing (#627)
* Add Node 24 URL factories and shared parsing

* Clarify URL fixture name and remaining refusal coverage

* Update island URL test for protocol-relative resolution
2026-10-03 03:19:05 -05:00
Chris Tate 8d161d4982 Add Node 24 scrypt, HKDF, and SHA-2 crypto support (#626) 2026-10-03 01:47:42 -05:00
Chris Tate 7d2d2116ec Expand Node 24 filesystem descriptor and FileHandle support (#625)
* Expand Node 24 filesystem descriptor and FileHandle support

* Preserve filesystem options getter evaluation and record fixture baselines

* Normalize the known Linux fiber warning in npm stderr comparisons
2026-10-03 00:41:02 -05:00
Chris Tate a07998f667 Expand static three.js workflows and host integration (#621)
* Expand static three.js workflows and host integration

* Preserve JavaScript class state in static three.js workflows

* Preserve inferred JavaScript behavior across static workflows

* Preserve inferred callables and native compatibility boundaries

* Retain annotated JavaScript factory exports and bootstrap-safe call spreads

* Preserve Buffer and child callback identities in static packages

* Clarify JavaScript symbol spread support
2026-10-02 19:56:34 -05:00
Chris Tate 0e764aad1b Support stored Map and Set iterators in static builds (#618)
* Support stored Map and Set iterators in static builds

* Record collection iterator parity baselines
2026-10-02 13:26:27 -05:00
Chris Tate 5aa450c6b2 docs: migrate to Geistdocs (#611)
* docs: migrate to Geistdocs

* Restore compiler files to main
2026-10-02 00:58:25 -05:00