1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Beamr — a Rust runtime with the BEAM's execution model.
//!
//! Loads `.beam` bytecode produced by the Gleam toolchain (via `erlc`)
//! and executes it with preemptive scheduling, per-process isolation,
//! supervision primitives, and a native function interface.
extern crate alloc;
// AR-1 R10: the accumulator-rooting hunt's control fixtures. Ships nothing —
// every item inside is `#[cfg(test)]`. It must stay under `crates/` and must
// NOT be renamed to anything ending `_tests.rs`, or the hunt stops walking it
// and all five per-class controls silently disappear. See the module docs.
// AR-1 row 1: the ordering detector's control fixtures — one committed site
// the detector must FLAG (rooting after the first collecting call) and one it
// must CLEAR. Same residency rules as `ar1_shape_control` above.
// The sink seam (`IoSink`/`NullSink`/`IoStream`) is deliberately OUTSIDE the
// `threads` gate: the cooperative wasm closure routes `io`-family output
// through it (WPORT-5 R2). The `io` module re-exports these names so threaded
// import paths stay unchanged.
// The replay driver is a passive, in-memory event-log consumer (no threads, no
// tokio); it is reused by the cooperative runtime for deterministic delivery.
// Only its on-disk log format (`replay::file`) needs net/fs and stays gated.
//
// ⛔ UNGATED ON PURPOSE (B-144 R1). This module names NO optional dependency --
// `replay::file`'s zstd is already gated separately at replay/mod.rs. The old
// `any(threads, cooperative)` gate was not required by any dependency, and it
// made `crate::replay` vanish under `--no-default-features` while 7 sites in
// ungated modules still named it. Re-gating it re-breaks that build.
// The passive timer wheel is polled (no thread, no tokio::sleep), so it is
// usable by the cooperative single-threaded runtime as well as the threaded one.
//
// ⛔ UNGATED ON PURPOSE (B-144 R1). `timer.rs` imports only std, `web_time` and
// `crate::term` -- no optional dependency at all. Same reasoning as `replay`
// above: the gate bought nothing and cost 12 of R1's 20 errors.
// Ergonomic native-actor surface (NATIVE-003), re-exported at the crate root so
// downstream crates depend only on `beamr::` — not on scheduler internals.
// The platform-neutral trait/type surface is available in both the threaded
// native runtime and the cooperative (wasm) runtime so haematite/liminal import
// `beamr::Actor` etc. unchanged on both targets.
pub use ;
// The external-driver request/reply handles (`ActorRef`/`SenderHandle`) and
// `spawn_actor` own the threaded `Scheduler` and block on a channel, so they are
// threaded-only.
pub use ;
// The cooperative actor surface (WR-6): `spawn_actor_cooperative` +
// `CoopActorRef`/`CoopSenderHandle` bound to the single-threaded `WasmScheduler`,
// with a non-blocking, host-pumpable `call_async` returning a `CallFuture`. Built
// wherever the `WasmScheduler` exists (the wasm `cooperative` build, and the
// `threads` build so the native test gate covers it).
pub use ;
// The dynamic, term-carrying actor (WR-8): an `Actor` whose `Call`/`Reply`/`Cast`
// are opaque term graphs, so an untyped host (`beamr-wasm`) can spawn one and
// drive it over the cooperative `call_async`/`CallFuture` surface above.
pub use ;
pub use ;