Expand description
Composing one connection’s transition out of the shared delta.
This is the heart of the runtime, and it is about fifteen lines:
let shared = filter(journal.replay(cursor, head), see);
let private = plan_elements(&overlay_sent, &overlay_new);
let mut ops = splice(shared, private);
collapse(&mut ops);§What must not be done instead
diff(overlay + shared, committed) is the honest formulation and it is always
correct - and it costs O(V) per connection, so O(N·W) overall. That is
precisely the quadratic this design exists to escape. Composition costs
O(|D|) + O(|overlay|) + O(|ops|).
REF: docs/design/guide-implementation.md 6