Skip to content

fix(runtime): support native erlang send calls - #99

Merged
mremond merged 1 commit into
mainfrom
infinitary-batch/7a527eaf
Nov 29, 2026
Merged

mremond merged 1 commit into
mainfrom
infinitary-batch/7a527eaf

Conversation

@mremond

@mremond mremond commented Nov 29, 2026

Copy link
Copy Markdown
Member

Why

Native Erlang programs could send with the ! operator, but the named send functions were missing.

What changed

  • Direct calls and calls through apply now deliver to a process ID, a registered name, or a name and node pair.
  • The two-argument call returns the message; the three-argument call follows BEAM’s option and return rules.
  • With network distribution off, sending to another node drops the message and returns noconnect when requested.

Before and after

Before: Direct calls did not compile; calls through apply failed at runtime.

After: Nera and BEAM delivered the same four messages in order for each of the three supported destination forms.

The change affects message delivery in compiled programs, so the evidence is mailbox output rather than a picture.

Checked

Live validation: Demonstrated for this version. 2 of 2 scenarios driven live in the product.

Scenario Result Evidence
Run the five focused native send and apply fixtures. ✅ Passed live The native runner reported five passes, with no failures or skips.
Compare the same mailbox assertions on native Nera and non-distributed BEAM. ✅ Passed live Native default and single-scheduler output matched OTP 29.0.5, including ordered delivery, remote drops, and invalid options.
  • Independent review: Review found that send rejected priority. Accepting it matches BEAM without changing message order or adding destination types.
  • Rust and native tests: Lint and 2,299 Rust tests passed with standard permissions. Of the native tests, 552 passed and two skipped because they need external modules.
  • Invalid options: The Rust regression failed when the proper-list check was removed and passed when it was restored.
  • Cowboy dependency analysis: The pinned analysis reported one fewer unresolved call. It did not establish a working server.
  • Batch checks: Approval puts this change in the next batch. The change merges only if the batch checks pass.
How it was checked

Built the locked release runtime and compiler. The native allocator and stacktrace checks passed.

The workspace test run under a group-writable permissions mask reproduced an existing storage fixture failure. The full rerun with umask 0022 passed.

Compiled the send regression to macOS x86-64 and Linux arm64 objects; neither object was linked or run.

Risk

Risk above low: Blast radius, medium — The built-ins share the existing native message delivery path.

Full risk assessment
Dimension Level Why
Blast radius medium The built-ins share the existing native message delivery path.
Behavior low Calls that previously failed now match BEAM for the supported destinations.
Undo low A revert removes the built-ins without touching saved data.
Evidence low Native mailbox output matched BEAM on default and single schedulers.
Sensitivity low No account, credential, or saved-data handling changes.
Novelty low Reuses the destination resolver and delivery code.
Dependencies low No dependencies added or updated.
Not done

Distribution and process aliases remain unsupported. Cowboy server startup was not tested.

Direct calls and calls through apply now deliver to a process ID, a registered name, or a name and node pair.

The two-argument call returns the message; the three-argument call follows BEAM’s option and return rules.

With network distribution off, sending to another node drops the message and returns noconnect when requested.
@github-actions github-actions Bot added this to the 0.1.1 milestone Nov 29, 2026
@mremond
mremond merged commit e059ba8 into main Nov 29, 2026
22 checks passed
@mremond
mremond deleted the infinitary-batch/7a527eaf branch November 29, 2026 14:21
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