You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9c6da14
Browse filesBrowse the repository at this point in the historyBrowse files
fix(runtime): keep messages between two processes in send order
A message sent to a process is never received before the messages the same sender sent it earlier.
The receive_nil_message test no longer fails intermittently.
A new end-to-end fixture checks message order between processes, natively and on BEAM.
-**Direct-to-heap send** (fast path): `try_lock()` the target when WAITING/READY, copy directly to receiver's heap using `direct_copy_message` (skips HashMap forwarding for simple tuples). Falls back to SegQueue on contention
334
+
-**Direct-to-heap send** (fast path): `try_lock()` the target when WAITING/READY and its inbox is empty, copy directly to receiver's heap using `direct_copy_message` (skips HashMap forwarding for simple tuples). Falls back to SegQueue on contention, and while the inbox holds messages so a later message never overtakes an earlier one from the same sender
335
335
-**Lock-free send** (fallback): deep-copy to fragment → `inbox.push()` → CAS `WAITING→READY` → inject into scheduler + notify workers
336
336
-**Fragment types**: `Immediate(ErlTerm)` for atoms/ints/PIDs/nil, `InlineTuple` (arity ≤ 2, zero alloc), `SimpleTuple` (Vec-backed), `Heap { heap, root }` for complex terms
337
337
-**SendDirect fusion**: IR pass `fuse_make_tuple_send` detects `MakeTuple(msg, elems) + Send(result, pid, msg)` where `msg` is single-use, fuses into `SendDirect(result, pid, elems)`. Codegen emits `nera_rt_send_tuple` which constructs the tuple directly on the receiver's heap without sender heap allocation
Copy file name to clipboardExpand all lines: tests/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -339,6 +339,7 @@ These are automatically skipped by the runner and show up as SKIP in output.
339
339
|`receive_after.erl`| Receive with timeout |~4 |
340
340
|`receive_timeout_domain.erl`|`after` values outside `infinity` and 0..4294967295: a matching queued message is received first, including selective receive and inside `try`; with no match, `error:timeout_value` at once, queued messages kept, no wait for a later sender, and as an uncaught exit; an error in the `after` expression or earlier in a `try` body comes first; valid boundaries; also run on BEAM | Table-driven |
341
341
|`receive_nil_message.erl`| The message `[]` is received like any other: first, middle and last in the mailbox, `[]` patterns and guards, `after 0` and no `after`, selective receive skipping it, and a waiting process woken by it; later messages still arrive; also run on BEAM |~21 |
342
+
|`send_order_between_processes.erl`| Messages one process sends another arrive in the order they were sent: four senders each stream 100,000 numbers to their own receiver, and 2,000 bursts of three come back from an echo process in order; also run on BEAM | 3 |
|`process_dict_exact_keys.erl`| put/get/erase exact numeric and compound keys, signed zeros, equal reconstructed keys, missing lookup/removal, replacement/erase returns, dictionary contents and direct/qualified/dynamic/fun calls; also run on BEAM | Table-driven |
344
345
|`process_dict_get_keys.erl`| get_keys/1 exact value filtering, auto-import/qualified/dynamic/fun calls, dictionary preservation, arbitrary keys, updates/erase and Ranch child-state lookup; also run on BEAM | Table-driven |
0 commit comments