Skip to content

merge: sync lava master (f54b283) - #65

Merged
x-ror merged 3 commits into
masterfrom
sync/lava
Nov 18, 2026
Merged

x-ror merged 3 commits into
masterfrom
sync/lava

Conversation

@x-ror

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

Copy link
Copy Markdown
Owner

Sync of x-ror/lava master (f54b283). It brings one change: x-ror/lava#502, a second global surface (Global_Surface.Web) behind a defaulted surface parameter on eval. This is the seam for page contexts in #5.

Conflict, resolved by hand

One file, pkg/runtime/runtime.odin: Lava changed eval's body, which Larva keeps in page_open (page.odin). Resolved on Larva's side, with the seam carried through:

  • eval takes surface: Global_Surface = .Node right after report_data, where Lava has it, and before Larva's limits, so Lava's positional calls bind the same parameters. It hands the surface to page_open.
  • page_open takes surface (default .Node) and does what Lava's eval does on .Web: refuses an .mjs source name before a context exists, passes the surface to setup_module_environment, skips both register_entry_module calls, and appends no top-level nextTick drain.

Mutation manifest

Three of the seven entries Lava recorded pointed at lines that live elsewhere in Larva. Retargeted, same mutations:

  • the .mjs refusal and the top-level drain guard: source is now pkg/runtime/page.odin;
  • eval's default surface: the find now includes the limits parameter that follows surface here.

All 368 entries find their line exactly once.

Not in this PR

Pages opened by the page runner and the dispatcher stay on .Node. Nothing selects .Web for a page yet; that, the two-page isolation test and the bench/pages start-up number are the follow-up for #5. page_open's own default is not pinned by a recorded mutation yet, for the same reason.

Gates

Run locally on d8d026c, Node 26.13.1, 16 cores. All passed:

  • make check, make check-js, make check-md, make check-actions, make build
  • make test: 209 Odin tests (113 in cmd/lava, including the four global_surface_* tests from Lava); node-compat (91 cases), sqlite, fs and event-loop oracles
  • make test-odin-serial, make test-eventloop-odin, make test-lava-nohostfn, make test-stdio, make test-property
  • smokes: fetch, net, http, https, multicore, zerocopy, pages bench
  • make bench-gate
  • make test-mutation CHANGED=1: 117/117 died as recorded, including all seven global_surface_* entries against Larva's sources

CI has 4 cores, so the concurrency-sensitive gates above are not proof of a pass there.

Merge with "Create a merge commit", not squash.

🤖 Generated with Claude Code

x-ror and others added 3 commits November 18, 2026 20:29
eval takes a trailing `surface: Global_Surface = .Node`. `.Node` is what every
context got before and stays the default; `run_file` and the CLI never select
anything else. `.Web` exposes the web-platform subset only: no `process`,
`require`, `module`, `exports`, `__filename`, `__dirname`, `Buffer`, `global`,
`setImmediate`/`clearImmediate`, and no `__lava*` hook.

How `.Web` gets there:
- the CommonJS entry bindings are never injected;
- install_stdio does not run, so internal/stdio and the node-streams stack are
  never compiled (console writes through its own native writer);
- `process`, `Buffer`, `setImmediate`, `clearImmediate` and `global` are
  installed for the bootstrap and removed as the last step before user code;
- an `.mjs` source name is Invalid_Input, and no top-level nextTick drain is
  appended.

The one change on the default path: `__lavaDrainNextTicks` and
`__lava_tl_drain` are now defined from install_microtasks instead of
microtasks.js, with the same attributes. They are non-configurable, so a `.Web`
context could not have deleted them.

`.Web` promises that the names are gone, nothing more: web APIs still hand out
Buffer-backed bytes and `ERR_*` codes (#5).

Pinned by cmd/lava/global_surface_test.odin; seven mutations recorded in
tests/mutation-manifest.json.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(runtime): add a Web global surface that hides the Node names
Brings x-ror/lava up to f54b283c:

- 07c29cc feat(runtime): add a Web global surface that hides the Node names

One conflict, pkg/runtime/runtime.odin: Lava changed eval's body, which Larva
keeps in page_open (page.odin). Resolved on Larva's side and the seam carried
through:

- eval takes `surface: Global_Surface = .Node` right after `report_data`, where
  Lava has it, and before Larva's `limits`, so Lava's positional calls bind the
  same parameters. It hands the surface to page_open.
- page_open takes `surface` (default `.Node`) and does what Lava's eval does on
  `.Web`: refuses an `.mjs` source name before a context exists, passes the
  surface to setup_module_environment, skips both register_entry_module calls
  and appends no top-level nextTick drain.

Three of the seven mutation-manifest entries Lava recorded pointed at lines
that live elsewhere here: the `.mjs` refusal and the top-level drain guard are
in page.odin, and eval's signature ends with `limits`. Retargeted, same
mutations.

Pages opened by the page runner and the dispatcher stay on `.Node`: nothing
selects `.Web` for a page yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@x-ror
x-ror merged commit 7e6da17 into master Nov 18, 2026
7 checks passed
@x-ror
x-ror deleted the sync/lava branch November 18, 2026 18:55
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