(WIP) agent-fuzz-harness #31
Loading…
Reference in a new issue
No description provided.
Delete branch "cfuzz"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Sent the agent out to review public histories of various similar architectures and implement improvements. Needs review and cleaning.
Replace thread::sleep with thread::park_timeout in worker backoff loop. Workers register their thread handle via OnceLock<Thread> on startup. When send_to or spawn routes work to a worker, Thread::unpark() wakes it instantly instead of waiting for the sleep timer to expire. Inspired by tokio's parker state machine and Linux NO_HZ adaptive ticks. Implementation: - Runtime stores Vec<OnceLock<Thread>> for worker thread handles - Workers call OnceLock::set(thread::current()) on startup - Runtime::send_any, spawn_any, and WorkerContext cross-worker sends call notify_worker() → Thread::unpark() on the target worker - TickContext carries worker_threads reference for cross-worker notification - Zero new dependencies (std::sync::OnceLock + std:🧵:park_timeout) Benefits: - Parked workers wake instantly when work arrives (vs up to 1ms sleep delay) - No overhead on hot path — unpark() is no-op if thread isn't parked - Single-threaded tick() mode unaffected (OnceLock never set) All 58 tests pass (52 runtime_api + 5 transport + 1 doctest). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Add MonitorRegistry for death watch subscriptions. Actors subscribe via ctx.monitor(target) and receive a Down { addr, reason } message when the target dies (stop or panic). Supports stacking, demonitor, and automatic cleanup of dead watcher subscriptions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>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-Chmielewski812826bb0ato8a9ff9aa5a