Commit Graph
7 Commits
Author SHA1 Message Date
Chris Tate 88a2c557d1 Link the child-process unit only in programs that spawn
The event loop called scr_children_pending, scr_children_poll and the other
child hooks directly on native targets, so every async program linked the
child-process unit (the reap pass, IPC service, pipe readers and writers).
The loop now reaches them through a nullable ScrLoopChildren table that the
child unit installs with its first spawned child or IPC channel, the shape
the events, net, dgram and fs.watch hooks already use. The WASI stubs for
the old direct calls are removed.
2026-10-19 07:59:51 -05:00
Chris Tate 5a574e86ce Raise the static hello size ceiling to 96 KiB on Linux
The tree-shaking test failed on Linux x64 after main was merged into
this branch: "expected 84496 to be less than 81920". Measured with the
release runtime pack (hello = console.log("hello", "world")):

  tree                 file   R+E segment
  main b866ae323       80288  0x5fe9
  989d0d6bc            79928  0x5fe9
  merge 474012f04      84488  0x6579

No runtime family comes back: hello's absence checks still pass. The
code that grows is the cycle collector and the release paths that feed
it, which hello's exit reaches (scr_lib_init -> scr_lib_cleanup ->
scr_arr_release -> scr_cyc_on_release -> scr_cyc_collect_due -> the
pass). Main grew it by 1,447 bytes (the death rule and
scr_mem_order_for_free), this branch by 1,386 (the inline nursery
appends in the runtime's release functions, scr_cyc_route_bypassed and
the window). Main left .text 23 bytes under the executable segment's
24 KiB page, so together they cross it, and every later segment and the
file move by 4 KiB. 96 KiB, the Mach-O ceiling, restores several pages
of slack.
2026-10-18 16:46:10 -05:00
Malte Ubl 994a6b9940 Raise the Linux static hello size ceiling to 80 KiB
The tree-shaking test failed on Linux x64 with "expected 68344 to be less
than 65536". Measured with the release helper/runtime-pack pipeline in a
Linux x64 sandbox (hello = console.log("hello", "world")):

  PR    file   .text  R+E segment
  #743  64256  15794  0x3f11
  #744  68416  16050  0x4011
  #764  68520  16546  0x4221

The allocator adds 256 bytes of .text to hello: the inline scr_mem_free
fast path in the release functions hello already links (scr_str_release,
scr_arr_destroy, scr_arr_gc_free, scr_cyc_free, scr_dyn_dispose). Its
slow path and address-space reservation (scr_sa_slow, scr_sa_reserve)
are already stripped from hello. ELF segments are page aligned, and #743
left only 239 bytes before the executable segment's 16 KiB page, so 17
bytes over the boundary move every later segment, and the file, by 4 KiB.

Shrinking hello back under the old ceiling is not a reasonable trade.
At the top of the stack the executable segment is 545 bytes past the
page boundary. The extra bytes come from hot-path code the later PRs add
on purpose (number-to-string fast paths in scr_f64_to_str, inline-alloc
release paths, the direct fd write), all reached through console.log's
generic argument rendering. Outlining them to save one page would undo
the optimizations those PRs add.

The ceiling's documented intent is "several native pages of
linker-version slack" above a hello that the comment put at about 41KB.
That no longer held before this stack (64256 bytes on #743, 1.2 KiB of
slack). 80 KiB restores about three pages of slack over the stack's
largest hello and still catches lost section GC (the old always-linked
runtime was about 400KB). Symbol absence remains the primary
reachability contract. The Mach-O ceiling is unchanged.

Verified in the Linux x64 sandbox: pnpm test
tests/harness/runtime-tree-shaking.test.ts fails on #744 before this
change (68416 vs 65536) and passes after it, on #744 and on #764.
2026-10-08 15:01:26 -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 9d30b56c6b Speed up compiler startup and trim release runtime packs
- Cache host libc detection and load TypeScript 5 only when needed.
- Exclude debug payloads from release runtime packs and vendor archives.
- Preserve native self-hosting, portable diagnostics, and reliable Sandbox execution.
2026-09-29 21:41:39 -05:00
Chris Tate 3f66c8e20b Make LLVM the sole production backend
- Remove C emission, debugging options, and automatic backend fallback.
- Complete LLVM lowering and native bootstrap coverage across supported targets.
- Link executables and libraries with precompiled C runtime packs, including iOS and Android.
2026-09-29 20:54:09 -05:00
Chris Tateandmmamedel 837f6bc62b Tree-shake unreachable executable runtime sections (#271)
* feat: tree-shake executable runtime sections

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>

* test: run runtime tree-shaking checks in sandbox

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>

* fix(runtime): release lazy process caches

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>

* test: stabilize runtime tree-shaking size guard

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>

---------

Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
2026-08-31 09:01:19 -05:00