One placed program's state machine across the cluster: placement changes coordinated by the leader, state handed over, frames shown on every machine
$ sexc add @ajax/mesh-placer- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 04:09v/# 1 version
- drwxr-xr-x-Oct 27 04:09files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 04:09 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0, @ajax/mesh-mt ^0.1.0, @ajax/rust-fmt ^0.1.0, @ajax/mesh-place-spec ^0.1.0, @ajax/mesh-place-mode ^0.1.0, @ajax/mesh-place-wire ^0.1.0, @ajax/mesh-place-compose ^0.1.0, @ajax/mesh-abi-base ^0.1.0, @ajax/mesh-abi-place-ops ^0.1.0, @ajax/mesh-abi-placement ^0.1.0, @ajax/mesh-abi-peer-frames ^0.1.0
- dependents
- none yet
- keywords
- mesh alphaos fleet placement state-machine frames
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-placer
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-placer 2 3One placed program's state machine across the cluster (`mpl_placer`), sans-IO. The driver feeds it 4events (a frame batch completed here, a peer frame arrived, a placement request, the fleet's view, a 5tick) and carries out the acts it returns (send a frame, write the state into the view, show a composed 6frame, publish the follow batch, change the run state, answer a request). 7 8The fleet's leader coordinates every change among the up members: it pauses the others (PL_PAUSE), 9collects their drained state and time per part (PL_PAUSED), picks the state that continues (the old 10mode's authority's, or a survivor's copy when it is gone), sets the new mode everywhere (PL_SET with 11that state) and waits for PL_DONE; a change not done in 5 s is rolled back (PL_FAIL). It re-plans at once 12when a member of the mode drops, and 5 s after one comes back; with no leader, a mode that needs a lost 13member goes local. Frames go point to point: a runner sends whole frames, a split owner sends its parts 14and the state, followers render their parts on the owner's state and send them on, and every machine 15(mirrors included) composes and shows the same whole frame. 16 17## Ported from 18 19[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) `crates/mesh-host/src/place.rs`: 20`Placer`, `Act`, `Dest`, `Stats`, `CHANGE_TIMEOUT`, `JOIN_DWELL`. Instants are monotonic microseconds. 21 22## Tests 23 24`tests/placer.c`: the Rust's `change_protocol_moves_state_across_three`, 25`split_auto_uses_measured_times`, `change_times_out_and_rolls_back`, 26`split_frames_assemble_on_every_machine` (six splits over 2..4 machines), 27`follower_keeps_the_newest_and_rejects_strays` and `member_loss_replans_and_return_rejoins`, with the 28Rust's message pump between placers. 29 30## Licence 31 32MIT. See the repository's LICENSE.