Skip to content

feat(runtime): let a page be opened on the Web global surface - #67

Merged
x-ror merged 2 commits into
masterfrom
feat/page-web-surface
Nov 18, 2026
Merged

x-ror merged 2 commits into
masterfrom
feat/page-web-surface

Conversation

@x-ror

@x-ror x-ror commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Stacked on #66; retarget to master once that merges.

What changed

page_runner_open and page_dispatcher_submit take a trailing surface: Global_Surface = .Node and hand it to page_open. A .Web page cannot reach process, require, module, Buffer, global, setImmediate or any __lava* hook (#5). The default stays .Node, so every existing page is unchanged.

bench/pages opens its pages on .Web when BENCH_SURFACE=web.

Measured

bench/pages, -o:speed, 16-core dev machine, medians of 7 interleaved launches per arm, 1000 pages per launch, before the Node-only modules were taken out of the build:

surface N cold_ms warm_ms pages_per_s rss_growth_kb_per_live_page
Node 10 10.55 2.79 366 6596
Web 10 8.46 2.88 431 6031
Node 100 10.39 2.78 363 4497
Web 100 8.51 2.89 414 3975

Cold start is about 2 ms lower on .Web (stdio and the node-streams stack never compile). Warm start is not better, 0.1 ms worse; whether that is the cost of deleting properties from the global object or noise was not separated.

Not verified

  • No test in this PR and no suite or gate was run, on the owner's instruction for this phase. make check passes.
  • One check was done by hand before tests were paused: a .Web page run right after a .Node page in the same pooled VM saw none of the Node names and nothing the first page left on its global, and the next .Node page had them all back. Dropping the pass-through in page_runner_open made that check fail. The test file is not committed.
  • What .Web does not promise is unchanged from feat(runtime): add a Web global surface that hides the Node names lava#502: web APIs still hand out Buffer-backed bytes and ERR_* codes.
  • docs/LARVA.md stage status is not updated.

🤖 Generated with Claude Code

page_runner_open and page_dispatcher_submit take a trailing
`surface: Global_Surface = .Node` and hand it to page_open. A `.Web` page
cannot reach process, require, Buffer or the other Node names (#5). The
default stays `.Node`, so every existing page is unchanged.

bench/pages opens its pages on `.Web` when BENCH_SURFACE=web.

No test in this commit: tests are paused for this phase.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Base automatically changed from sync/lava to master November 18, 2026 19:00
@x-ror
x-ror merged commit 2db557c into master Nov 18, 2026
1 check passed
@x-ror
x-ror deleted the feat/page-web-surface branch November 18, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant