Commit Graph
225 Commits
Author SHA1 Message Date
Malte Ubl fcdbe88494 Share virtual-slot borrowing with the self-hosted layout stage
Vtables store the borrowing body of a method whose slot borrows its
parameters, but that decision lived in private emitter state, so the
self-hosting layout fixture kept emitting owned entries and no longer
matched production (`@sc_f_...` vs `@sc_bf_...`).

Move the decision into VirtualBorrows (virtual-borrows.ts), used by the
emitter and by the fixture, which now runs the same call-lifetimes
analysis. The slot lookup narrows explicitly instead of combining a
union with `&&`/`||`, which the self-hosted subset rejects (SC1090). The
abstract-slot emission case now expects the borrowing body, since its
implementation borrows its receiver.
2026-10-09 10:10:26 -07:00
Malte Ubl d58a5c3abc Give the self-hosting layout fixture the int32 slots
emitLlvmLayouts now takes the whole-program int32 slot facts, but the
self-hosting layout fixture never passed them and only imported the
Int32Slots type, so the self-compiled stage could not represent
`Int32Slots | undefined` (SC2009). Compute them with analyzeInt32Slots
like the emitter does, so the fixture compiles statically and its native
output mirrors production int32 field storage.
2026-10-09 10:10:20 -07:00
Malte Ubl fb23f3bf17 Give the self-hosting layout fixture the nullable-union host members
WalkerHost now carries the nullable-union registry and the record-field ABSENT test; the natively compiled layout/metadata fixture builds them the same way the emitter does.
2026-10-09 11:59:24 -05:00
Chris Tate df227082a0 Fix console ordering checks under pipe backpressure
- Keep merged-pipe ordering probes small enough for deterministic Node output.
- Preserve large-write coverage for shared files and independent streams.
2026-10-08 18:21:03 -05:00
Malte Ubl c48f059071 Write console and process stream output directly to the descriptor
Every console.log/error/warn line and process.stdout/stderr.write chunk
is still submitted before the call returns, as in Node. On POSIX
executables, each one now goes out as exactly one write(2) on fd 1 or 2.
Before, it went through C stdio, which cost a copy into the stdio
buffer, one stream call per argument, separator, and newline, and a
flush. stderr is unbuffered, so console.error made one write(2) per
piece: 3 writes per line on average in the probe.

- The line renders into a 2 KiB stack buffer (heap above that). A large
  single string goes out with writev and no copy.
- Short writes continue and EINTR retries. Other errors (EAGAIN, EPIPE,
  EBADF) return errno with the rest dropped, which is what the stdio
  flush did. console still ignores them, and SIGPIPE behavior is
  unchanged.
- Runtime-internal bytes still in the C stdout buffer are flushed first
  (__fpending on Linux, the FILE fields on Darwin, an unconditional
  flush elsewhere), so stdout order and merged 2>&1 order are kept.
- Windows, WASI, and library artifacts keep the C stream path, now fed
  one formatted chunk per call.

Tests: corpus 4294 covers line sizes across the stack buffer and the
64 KiB stdio buffer. New console-io harness cases cover stdout and
stderr merged into one pipe and into one file (byte-compared with
Node), and console.log after the stdout reader closes (EPIPE).

Linux sandbox, ns per line (median of 9 launches, 200k lines; scriptc
includes ~1 ms startup). All outputs byte-identical to Node.

  probe      target  node   prev  cand
  p-str      pipe    4040   1323  1239
  p-str      file    3092    849   790
  p-str      null    2193    319   283
  p-args     pipe    6168   1440  1228
  p-args     file    4896    925   802
  p-args     null    3916    389   292
  p-write    pipe    2889   1328  1197
  p-write    file    2267    809   769
  p-write    null    1577    297   265
  p-err      pipe    4672   3253  1132
  p-err      file    3478   2042   717
  p-err      null    2614    562   232
  log-lines  pipe    4958   1490  1356
  log-lines  file    3885    966   877
  log-lines  null    2983    425   368

strace -c (pipe): p-err went from 600,000 to 200,000 write calls. The
other probes stay at one write per line.
2026-10-08 15:51:42 -05:00
Malte Ubl 213cf287b9 Emit inline retain/release fast paths under --optimization=speed (H30)
Re-lands perf/h30-inline-rc (00051ca0, 40398773, 07972360) behind the
speed posture. With inline RC on, every mirrored runtime RC family
retains inline and releases inline down to the rc == 1 / new cycle
candidate slow path (shapes.ts INLINE_RC_FAMILIES). Release emission is
unchanged: ShapeHost.rcHelpers is null unless LlvmTargetOptions.inlineRc
is set, and every retain/release (including capture boxes) stays a
runtime call; the %ScrMapRc type is only emitted with inline RC.

- index.ts and native/prepare.ts pass inlineRc for speed executables,
  speed object/asm emission, and speed library profiles.
- scr_runtime.h keeps H30's static asserts for the mirrored header and
  trace-slot offsets (no code change; the rebuilt macOS pack's manifest is
  identical to the baseline's).
- Tests: shapes.test.ts pins release symbols and H30's speed fast paths
  and header offsets; emitter.test.ts pins that release IR is unchanged
  and speed routes releases through the helpers. The differential harness
  gains `// @optimization: speed` (and a SCRIPTC_TEST_OPTIMIZATION=speed
  lane); corpus 4032 pins every mirrored family under speed.

Release executables stay byte-identical to the stack tip (14/14
workloads, macOS).
2026-10-08 15:46:34 -05:00
Malte Ubl 4ea8d52f63 Pin large HTTP bodies through the coalesced head+body write
Multi-megabyte end(data) and chunked write() bodies under a slow raw
reader force partial vectored sends; the driver checks framing, length,
and digest of every response against Node.
2026-10-08 15:42:37 -05:00
Malte Ubl c0e2d097eb Update self-hosting emission cases for the inline allocator
The full emitter inlines the small-object allocator on 64-bit host targets,
so the self-hosting layout fixture's host enables inlineAlloc for 64-bit
requests (as emitLlvmModule does), and the recursive-records case no longer
asserts the width-specific free path (64-bit pushes onto the allocator's
free list; 32-bit calls scr_cyc_free).

(Split from the stack's later "Update self-hosting emission cases for
acyclic proofs and inline allocation"; the acyclic-proof half moves to the
construction-only acyclic change.)
2026-10-08 15:36:07 -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 b8ce03cc4c Streamline source discovery and checker metadata (#716) 2026-10-07 00:19:01 -05:00
Chris Tate 25b7fd266a Streamline structured text output
- Share bulk string writes and JSON formatting paths.
- Append scalar values directly and streamline exact integer formatting.
- Cover output boundaries and clarify runtime-pack identity failures.
2026-10-06 17:25:57 -05:00
Chris Tate 88e6e6dcd0 Streamline class callbacks and compiler source access
- Defer empty callback storage while preserving method and prototype updates.
- Reuse source and node-handle information within compiler snapshots.
- Coalesce small checker requests and avoid response copies.
2026-10-06 08:10:34 -05:00
Chris Tate d575a5cfda Centralize builtin contracts and IR analysis ownership
- Derive builtin call names from shared signatures and keep call semantics with their ABI contracts.
- Separate runtime dependency detection, exception metadata, and library policy from the core IR while preserving existing exports.
- Enforce the frontend signature boundary and validate native compilation and policy behavior.
2026-10-05 18:36:03 -05: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 665db543e2 Organize compiler conversions and builtin dispatch
- Separate conversion planning, helper generation, and timer lowering into focused modules.
- Share array, closure, record projection, and builtin dispatch logic, including timer namespace calls.
- Validate shared helpers with native correctness and differential coverage.
2026-10-05 16:21:22 -05:00
Chris Tate 98dd1b3f0f Optimize native file processing (#688)
- Read binary and text files into owned storage across filesystem entry points.
- Extend integer inference through module initialization and filtered processing loops.
- Preserve shared bindings, byte views, and filesystem error behavior.
2026-10-05 12:59:31 -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 83b6156282 Expand Node 24 StringDecoder input and streaming support (#631) 2026-10-03 08:20:12 -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 62ab952f02 Speed up native compiler lowering (#623)
* Speed up native compiler traversal and union handling

* Index live deferred initializer placeholders per worklist pass

* Record preflight baseline for deferred registry corpus
2026-10-02 22:14:59 -05:00