2026-02-07 17:39:02 +00:00
|
|
|
[workspace]
|
feat: extract swactor-std crate with RuntimeExtension hook pattern
Debloat the core swactor crate by moving higher-level features to a new
swactor-std crate, leaving core with only the essential actor primitives
(spawn, send, stop, timers, lifecycle hooks).
Phase 1: Move Supervisor + Router to swactor-std
- Supervisor (ChildSpec, RestartPolicy, SupervisorStrategy) and Router
(RoutingStrategy) extracted to crates/std/
- ~465 lines removed from src/actor.rs
Phase 2: Remove restart fields from Actor<A>
- Actor<A> slimmed to { inner: A } — no restart_factory, max_restarts
- Removed spawn_restartable from Ctx and Runtime
- Simplified panic handler: always poison, never inline restart
- Supervision-based restart via Supervisor in swactor-std
Phase 3: RuntimeExtension trait + registry extraction
- New src/extension.rs: RuntimeExtension trait (on_actor_death,
cleanup_dead, as_any) — single hybrid hook for lifecycle events
- ContextInner slimmed from 11 methods to 5 (removed 7 registry
methods, added extension())
- Ctx slimmed: removed all registry methods, added extension() accessor
- Runtime: removed 3 registry fields + 9 methods, added
with_extension() builder + extension() accessor
- TickContext: replaced 3 registry fields with extension hook
- tick_once phase 7: uses ext.on_actor_death() + ext.cleanup_dead()
- Moved NameRegistry, MonitorRegistry, GroupRegistry from delivery.rs
to swactor-std
- StdExtension wraps the 3 registries, implements RuntimeExtension
- Extension traits: CtxMonitoring, CtxNaming, CtxGroups on Ctx;
RuntimeNaming, RuntimeGroups on Runtime
- Down, StopReason, MonitorRef, handle_down remain in core
- AddrMap/AddrSet/AddrBuildHasher made public, re-exported
- MonitorRef::from_raw(u64) added for cross-crate construction
All 140 tests pass. Benchmarks updated.
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 06:59:29 +00:00
|
|
|
members = [".", "crates/python", "crates/wasm", "crates/simulation", "crates/runtime-dashboard", "crates/distribution", "crates/simulation-dashboard", "crates/std"]
|
2026-02-07 17:39:02 +00:00
|
|
|
exclude = ["tools/depgraph"]
|
|
|
|
|
|
2025-11-25 00:39:17 +00:00
|
|
|
[package]
|
|
|
|
|
name = "swactor"
|
|
|
|
|
version = "0.1.0"
|
|
|
|
|
edition = "2024"
|
feat: Stress tests, benchmarking, and non-failing queues and inboxes #3
Adds some basic benchmarking, stress tests. They still need to be properly examined to ensure they are testing the correct properties, but fit for "good enough". Implements the HybridChannel type, which features a channel buffer that can withstand overflows. It does so by providing a dequeue behind a mutex. Without overflow, will push messages into the lock free ArrayQueue implemented by crossbeam_queue; when that buffer fills, will use the locking portion provided by the Mutex<VecDequeue>.
In the future we can even further optimize this, perhaps with some linked list implementations of lock-free channels, but, like the benchmarks, this fits the "good enough" bar for now.
2026-01-26 07:14:00 +00:00
|
|
|
autobenches = false
|
2025-11-25 00:39:17 +00:00
|
|
|
|
2026-02-09 14:42:25 +00:00
|
|
|
[profile.bench]
|
|
|
|
|
debug = true
|
|
|
|
|
strip = false
|
|
|
|
|
|
2025-11-25 00:39:17 +00:00
|
|
|
[lib]
|
2026-02-07 17:39:02 +00:00
|
|
|
crate-type = ["rlib"]
|
2025-11-25 00:39:17 +00:00
|
|
|
|
2026-01-23 05:00:57 +00:00
|
|
|
[features]
|
|
|
|
|
default = ["getrandom"]
|
|
|
|
|
getrandom = ["dep:getrandom"]
|
2026-02-08 16:18:39 +00:00
|
|
|
serde = ["dep:serde"]
|
2026-02-09 09:04:57 +00:00
|
|
|
tracing = ["dep:tracing"]
|
feat: Stress tests, benchmarking, and non-failing queues and inboxes #3
Adds some basic benchmarking, stress tests. They still need to be properly examined to ensure they are testing the correct properties, but fit for "good enough". Implements the HybridChannel type, which features a channel buffer that can withstand overflows. It does so by providing a dequeue behind a mutex. Without overflow, will push messages into the lock free ArrayQueue implemented by crossbeam_queue; when that buffer fills, will use the locking portion provided by the Mutex<VecDequeue>.
In the future we can even further optimize this, perhaps with some linked list implementations of lock-free channels, but, like the benchmarks, this fits the "good enough" bar for now.
2026-01-26 07:14:00 +00:00
|
|
|
no_random = [] # compile without access to a source of randomness
|
2026-02-09 19:05:37 +00:00
|
|
|
transport = [] # transport-agnostic messaging (no mandatory deps; codec is user-provided)
|
2026-01-23 05:00:57 +00:00
|
|
|
|
2025-11-25 00:39:17 +00:00
|
|
|
[dependencies]
|
2026-01-23 05:00:57 +00:00
|
|
|
getrandom = { version = "0.2", optional = true }
|
2026-02-08 16:18:39 +00:00
|
|
|
serde = { version = "1", features = ["derive"], optional = true }
|
2026-02-09 09:04:57 +00:00
|
|
|
tracing = { version = "0.1", optional = true }
|
2026-01-23 05:00:57 +00:00
|
|
|
crossbeam-queue = "0.3.12"
|
2026-02-06 11:25:37 +00:00
|
|
|
crossbeam-utils = "0.8.21"
|
feat: Stress tests, benchmarking, and non-failing queues and inboxes #3
Adds some basic benchmarking, stress tests. They still need to be properly examined to ensure they are testing the correct properties, but fit for "good enough". Implements the HybridChannel type, which features a channel buffer that can withstand overflows. It does so by providing a dequeue behind a mutex. Without overflow, will push messages into the lock free ArrayQueue implemented by crossbeam_queue; when that buffer fills, will use the locking portion provided by the Mutex<VecDequeue>.
In the future we can even further optimize this, perhaps with some linked list implementations of lock-free channels, but, like the benchmarks, this fits the "good enough" bar for now.
2026-01-26 07:14:00 +00:00
|
|
|
|
2026-02-06 11:25:37 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
|
criterion = { version = "0.5", features = ["html_reports"] }
|
2026-02-12 12:57:44 +00:00
|
|
|
proptest = "1"
|
|
|
|
|
proptest-state-machine = "0.3"
|
feat: extract swactor-std crate with RuntimeExtension hook pattern
Debloat the core swactor crate by moving higher-level features to a new
swactor-std crate, leaving core with only the essential actor primitives
(spawn, send, stop, timers, lifecycle hooks).
Phase 1: Move Supervisor + Router to swactor-std
- Supervisor (ChildSpec, RestartPolicy, SupervisorStrategy) and Router
(RoutingStrategy) extracted to crates/std/
- ~465 lines removed from src/actor.rs
Phase 2: Remove restart fields from Actor<A>
- Actor<A> slimmed to { inner: A } — no restart_factory, max_restarts
- Removed spawn_restartable from Ctx and Runtime
- Simplified panic handler: always poison, never inline restart
- Supervision-based restart via Supervisor in swactor-std
Phase 3: RuntimeExtension trait + registry extraction
- New src/extension.rs: RuntimeExtension trait (on_actor_death,
cleanup_dead, as_any) — single hybrid hook for lifecycle events
- ContextInner slimmed from 11 methods to 5 (removed 7 registry
methods, added extension())
- Ctx slimmed: removed all registry methods, added extension() accessor
- Runtime: removed 3 registry fields + 9 methods, added
with_extension() builder + extension() accessor
- TickContext: replaced 3 registry fields with extension hook
- tick_once phase 7: uses ext.on_actor_death() + ext.cleanup_dead()
- Moved NameRegistry, MonitorRegistry, GroupRegistry from delivery.rs
to swactor-std
- StdExtension wraps the 3 registries, implements RuntimeExtension
- Extension traits: CtxMonitoring, CtxNaming, CtxGroups on Ctx;
RuntimeNaming, RuntimeGroups on Runtime
- Down, StopReason, MonitorRef, handle_down remain in core
- AddrMap/AddrSet/AddrBuildHasher made public, re-exported
- MonitorRef::from_raw(u64) added for cross-crate construction
All 140 tests pass. Benchmarks updated.
Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 06:59:29 +00:00
|
|
|
swactor-std = { path = "crates/std" }
|
2026-02-06 11:25:37 +00:00
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "runtime_benchmarks"
|
|
|
|
|
harness = false
|
2026-02-06 14:45:19 +00:00
|
|
|
|
2026-02-09 14:02:40 +00:00
|
|
|
[[bench]]
|
|
|
|
|
name = "mt_benchmarks"
|
|
|
|
|
harness = false
|
2026-02-11 15:23:26 +00:00
|
|
|
|
2026-02-12 18:01:30 +00:00
|
|
|
[[bench]]
|
|
|
|
|
name = "hasher_benchmarks"
|
|
|
|
|
harness = false
|
|
|
|
|
|
2026-02-11 15:23:26 +00:00
|
|
|
[[example]]
|
|
|
|
|
name = "tcp_ping_pong"
|
|
|
|
|
required-features = ["transport"]
|