Repository navigation
fix(runtime): preserve negative integers in messages - #92
Merged
Merged
Conversation
Native messages preserve negative integers, whether a process sends to itself or another process. Unused table data is freed sooner as it builds up, without repeatedly cleaning up for one unchanged value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Native programs could receive a large positive number when they sent a negative one.
What changed
Before and after
Before: Six of eight native sends disagreed with standard Erlang: one sent `{-3}` but delivered `{1152921504606846973}`.
After: All eight sends delivered the same values as standard Erlang, including `{-3}` and a spawned process’s `-7`.
The change affects what programs receive, not what appears on screen.
Checked
Live validation: Demonstrated for this version. 2 of 2 scenarios driven live in the product.
How it was checked
Compared exact stdout with BEAM OTP 27 on Linux x86-64, using default Nera schedulers and NERA_SCHEDULERS=1.
Ran cargo build --release --locked and cargo clippy --workspace --all-targets --locked -- -D warnings, plus allocator and stacktrace-order regressions.
Ran cargo test --workspace --locked --no-fail-fast under umask 0022 and all three native end-to-end shards. One Rust test was ignored; two native tests require external modules.
Seven targeted Rust regressions rejected broken behavior and passed ten consecutive runs on the fix.
Risk
Risk above low: Blast radius, high — The shared native runtime copies messages and collects memory for every process.; Behavior, high — Accumulating retained table data can trigger a full collection sooner by default.; Novelty, medium — New snapshot accounting sits beside the existing generational collector.
Full risk assessment
Not done
The batch still needs to run the selected macOS integration and cross-target checks.