Commit graph

43 commits

Author SHA1 Message Date
Claude
6197361b22 feat: cycle 6 — asymmetric block, partition-register, bidir suspicion, 3-way partition
4 new distribution sim tests:
- asymmetric_one_way_block_does_not_kill_node: gossip recovery through intermediates
- names_registered_during_partition_propagate_after_heal: re_disseminate_all on Alive
- bidirectional_suspicion_both_nodes_recover: mutual suspicion + refutation cycle
- three_way_partition_heals_and_converges: 9-node 3-group split recovers

35 total distribution sim tests (15 registry + 10 lifecycle + 10 property), all green.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:56:43 +00:00
Claude
7d55a01198 feat: cycle 6 lifecycle tests — asymmetric block, partition-register, bidirectional suspicion
3 new lifecycle sim tests:
- asymmetric_one_way_block_does_not_kill_node: gossip recovery through intermediate nodes
- names_registered_during_partition_propagate_after_heal: re_disseminate_all on Alive transition
- bidirectional_suspicion_both_nodes_recover: mutual suspicion + refutation via gossip

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:55:02 +00:00
Claude
6f98b54d01 feat: cycle 5 lifecycle tests — partition+death combined, registry GC
New tests:
- partition_then_death_during_partition_then_heal (combined lifecycle scenario)
- registry_tombstones_gc_after_ttl (tombstone GC with short TTL + clock advancement)

Total: 15 registry + 7 lifecycle + 9 property = 31 new distribution sim tests.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:35:54 +00:00
Claude
fc2532ce18 feat: cycle 4 property tests — asymmetric partition, revive, monotonicity, large cluster
New tests:
- asymmetric_partition_registry_converges_after_heal (one-way reachability)
- revived_node_re_registration_overwrites_tombstone (death + revive + takeover)
- registry_convergence_is_monotonic_in_stable_cluster (once converged, stays converged)
- large_cluster_registry_converges (15-node stress with 2 deaths)

Total: 15 registry + 5 lifecycle + 9 property = 29 distribution sim tests.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:31:46 +00:00
Claude
57d9135c54 feat: cycle 3 edge case registry tests — message loss, multi-kill, churn
New tests:
- registry_converges_despite_message_loss (30% loss window + clean convergence)
- simultaneous_kill_of_multiple_name_owners (3 name-owning nodes killed at once)
- suspected_name_owner_recovers_and_registry_survives (Suspect→Alive path)
- registry_correct_under_rapid_churn (interleaved kills + registrations + takeover)

Total: 15 registry tests, 5 lifecycle, 5 property = 25 distribution sim tests.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:27:23 +00:00
Claude
9327d0734c feat: edge case registry sim tests + GracefulLeave action
Cycle 2 tests:
- explicit_unregister_propagates_to_all_nodes
- re_registration_after_tombstone_succeeds
- all_names_tombstoned_when_owner_dies
- graceful_leave_tombstones_registry_names
- piggyback_contention_both_propagate

Also:
- Add GracefulLeave variant to SimAction enum
- Fix cluster_survives_brief_message_loss config (dead_reprobe + suspicion_timeout)
- Harden split_brain test config (suspicion_timeout=200 prevents cascading false deaths)

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:22:07 +00:00
Claude
1c07f02be2 fix: SWIM Suspect recovery + piggyback ordering race condition
Two bugs found by simulation testing:

1. Suspect nodes could never recover after dissemination budget expired.
   When probing a target, the Suspect state was not re-enqueued into the
   dissemination queue (only Dead was). After budget exhaustion, the
   Suspect node never received a piggyback telling it it was suspected,
   so it could never refute via incarnation bump. Fix: re-enqueue both
   Suspect and Dead state on outgoing probes.

2. Registry entries merged before membership changes in same piggyback.
   When a message carried both a death notification and registry entries,
   the entries were merged first, then immediately tombstoned. Fix: split
   extract_registry_piggyback into unpack + deferred merge, processing
   membership changes before merging registry entries.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 09:21:59 +00:00
Claude
3226ba3764 feat: lifecycle and property sim tests, remove debug test
Phase 3 — lifecycle sim tests (distribution_lifecycle.rs):
- dead_node_triggers_repair_queue_and_cache_invalidation
- revived_node_has_empty_directory
- cache_shrinks_after_node_death
- routing_table_recovers_after_partition_heals
- routing_table_bounded_by_alive_count

Phase 4 — property-based sim tests (distribution_properties.rs):
- routing_table_bounded_across_configs (3 config variants)
- cache_bounded_across_configs (2 config variants)
- repair_queue_populates_on_death_with_directory_entries
- registry_eventually_consistent_across_configs (3 config variants)
- cascading_deaths_maintain_invariants

Also: update cluster_scenarios 10% message loss test to use
suspicion_timeout=60 + indirect_probes=3 + dead_reprobe=15
for resilience under correct death dissemination.

Remove diagnostic debug_registry.rs (superseded by distribution_registry.rs).

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 08:53:07 +00:00
Claude
5d8e413db2 fix: three SWIM notification bugs — death dissemination, piggyback notifications, partition recovery
Bug 1 (swim/node.rs): SwimProbe::check_suspicion_timeouts() calls
members.declare_dead() before translate_probe_actions() processes the
DeclareDead action. The second declare_dead() returned false (already dead),
so MembershipChanged{Dead} was never emitted and the death was never
enqueued for dissemination. Fix: remove the redundant declare_dead() call
in translate_probe_actions since the probe already performed the mutation.

Bug 2 (swim/node.rs): apply_membership_update() — which processes piggyback
on every ping/ack/ping_req — updated the internal member list but never
emitted NodeAction::MembershipChanged. This meant DistributedNode was blind
to all state transitions learned via gossip piggyback (e.g., a dead node
refuting via incarnation bump). Fix: return MembershipChanged actions from
apply_piggyback and propagate through handle_ping/handle_ack/handle_ping_req.

Bug 3 (node.rs): DistributedNode::handle_ping/handle_ack/handle_ping_req
never processed MembershipChanged actions from SwimNode — only tick() did.
Fix: extract process_membership_changes() helper and call it from all four
message paths (tick, handle_ping, handle_ack, handle_ping_req).

Additional fixes:
- registry.rs: add re_disseminate_all() for anti-entropy on partition heal
- node.rs: call re_disseminate_all on MemberState::Alive transitions so
  registry state accumulated during partition reaches recovering nodes
- cluster_scenarios: enable dead_reprobe in 10% message loss test, since
  correct death dissemination (now working) causes cascading false deaths
  without a recovery mechanism

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 08:39:14 +00:00
Claude
c84e708846 feat: registry sim tests — 4 pass, 2 ignored (SWIM death bug)
Add sim infrastructure for registry testing:
- Extend DistributionSnapshot with registry_size, registry_tombstone_count
- Add SimAction enum (RegisterName, RegisterNameWithActor, UnregisterName)
- Add action_schedule to DistributionSimConfig for mid-sim registry ops
- Add run_simulation_with_nodes() returning node references for assertions
- Add property checks: registry_propagation, registry_tombstones, etc.

6 registry sim tests:
- registry_name_converges_across_cluster (PASS)
- split_brain_naming_converges_after_partition_heals (IGNORED — bug)
- tombstone_propagates_when_name_owner_dies (IGNORED — bug)
- rapid_re_registration_converges_to_latest (PASS)
- simultaneous_registration_converges_deterministically (PASS)
- multiple_names_from_different_nodes_all_propagate (PASS)

BUG FOUND: SwimProbe::check_suspicion_timeouts() calls
members.declare_dead() internally before SwimNode::translate_probe_actions()
processes the DeclareDead action, so the second declare_dead() returns false
and MembershipChanged{Dead} is never emitted. This silently breaks all
death-related side effects: RT cleanup, cache invalidation, repair queue
population, and registry tombstoning.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 08:29:37 +00:00
a7124cb3d4 distribution realization (#33)
Write tests for docker integration, as docker is how we will initially handle distribution on heterogeneous hardware.
2026-02-13 07:55:12 +00:00
78cbd80803 skeleton of wasm runner actors (#32) 2026-02-13 07:42:44 +00:00
f4f26c9f41 major feature update
Improve the runtime, increase test coverage, add new actor types for monitoring and supervision to an `std` crate.
2026-02-13 07:11:24 +00:00
d817ad952f feat: distributed runtime (#30)
Major feature addition. For full details read `./docs/development_history/DISTRIBUTION.md`
2026-02-12 09:13:50 +00:00
076f1194bf feat: tui, agent interface, stats hook (#29)
Runtime dashboard now features a TUI option and an interface for LLM tool use. Removed some bloat from stats collecting and replaced with a hook function to dump runtime stats into.
2026-02-11 15:23:26 +00:00
2da9198ee9 fix: stats datatypes and refactor channel signature (#28) 2026-02-10 07:35:58 +00:00
ef08d3e7a5 feat: transport protocol (#27)
Address actors via ID, send messages over transport (TCP, QUIC, etc)
2026-02-09 19:05:37 +00:00
bc70d5fd89 feat: data parallel mnist example (#26) 2026-02-09 14:42:25 +00:00
845132ff18 feat: mt benchmark (#25) 2026-02-09 14:02:40 +00:00
d61ea50414 fix: gossip dashboard (#24)
Better, but still imperfect, performance in replay for large simulation sizes.
2026-02-09 09:07:38 +00:00
1a64f421bf feat: runtime dashboard and docs (#23)
Live and replay demo for a runtime dashboard. Added docs with svg files.
2026-02-09 09:04:57 +00:00
09504d0b67 cfuzz (#22) 2026-02-09 07:24:16 +00:00
9beca6c5dc feat: gossip simulation (#21)
Simulate a simple push-pull epidemic broadcast.
2026-02-08 16:18:39 +00:00
b828ff0fae feat: fuzz-harness (#20) 2026-02-07 18:30:22 +00:00
75aefa0c49 refactor: repack external bindings into their own crates (#19) 2026-02-07 17:39:02 +00:00
282fcc3d01 refactor: better tests (#18)
Still unsatisfied, but these are better than before.
2026-02-07 17:29:01 +00:00
Zachery Aaron Shores-Chmielewski
204b4aa289 refactor: clean modules, remove dead files 2026-02-08 00:20:03 +07:00
08a655d88a refactor: graph-optimization (#17)
Use spectral analysis tool to find spurious edges in the code DAG, refactoring to prune.
2026-02-07 16:51:40 +00:00
Zachery Aaron Shores-Chmielewski
6897d71e4b feat: refactor based on spectral spectral_analysis
Asking the agent to refactor to reduce spectral complexity, it worked. Trivial change, but this did reduce code complexity.
2026-02-07 17:36:45 +07:00
Zachery Aaron Shores-Chmielewski
89be164c19 feat: spectral analysis report
Generates a report on the connectivity properties of the code interdependency DAG.
2026-02-07 17:36:07 +07:00
de0f3960f4 feat: docs and README (#13)
Update the docs and readme with all the changes we've made
2026-02-06 17:12:04 +00:00
042ccd0db0 feat: basic wasm (#12)
Unfeatured wasm module. Mostly to test that wasm builds
2026-02-06 16:47:43 +00:00
1234838361 feat: code DAG visualizer (#11)
Visualize the inter-module code dependency DAG
2026-02-06 14:54:56 +00:00
Zachery Aaron Shores-Chmielewski
d3fdf9e550 feat: worker thread api (#6)
Make the worker thread api clearly seperated and ready for test harness
2026-02-06 21:45:19 +07:00
29bb51004f feat: jupyter example (#10) 2026-02-06 14:04:48 +00:00
796bd1f2c5 feat: runtime information display (#9)
Show basic information from the runtime, such as number of actors, worker threads, etc.
2026-02-06 13:35:46 +00:00
85c7c557ee feat: python bindings (#7)
Python bindings allowing us to interact with the library in a python REPL
2026-02-06 12:47:51 +00:00
5a9af73de6 refactor: major library changes (#5)
Refactoring to logically separate component modules in order to make it easier to develop tests, metrics, tracing, etc.
2026-02-06 11:25:37 +00:00
Zachery Aaron Shores-Chmielewski
c56a05433f 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 14:14:00 +07:00
b422605f6b feat: Multithreaded runtime (#2)
Implements a tunable configuration for a single or multi-threaded runtime.

Co-authored-by: Zachery Aaron Shores-Chmielewski <zachanon@gmail.com>
Reviewed-on: http://zachery.lol/code/code/zacheryasc/swactor/pulls/2
2026-01-25 13:38:34 +00:00
55077dbf57 feat: rewrite (#1)
Did not like the requirement of a tokio runtime and async/await. Rewrote
to use lock free queues (`crossbeam_queue::ArrayQueue`) as the basic
primitive to enable a runtime consisting of many pseudo-processes that
can pass messages to each other.

Co-authored-by: Zachery Aaron Shores-Chmielewski <zachanon@gmail.com>
Reviewed-on: http://zachery.lol/code/code/zacheryasc/swactor/pulls/1
2026-01-23 05:00:57 +00:00
Zachery Aaron Shores-Chmielewski
b8b5b839df feat: types for request/response handling 2025-11-25 20:51:13 -05:00
Zachery Aaron Shores-Chmielewski
120ba0ec71 init
Skeletal actor framework. Somewhat unweildy, needs a message box, a better runtime, and different channels. However, hello world example works
2025-11-24 19:39:17 -05:00