Documentation

CslibFrontier.Computability.Distributed.ChandyLamport.Snapshot

Chandy–Lamport marker snapshot transformation and FIFO cut invariants #

This module defines the Chandy–Lamport global-state recording transformation ([CL85], §3.2, p. 70) on top of any asynchronous FIFO message-passing System P S M, without freezing or blocking underlying application transitions.

Wire channels carry WireMsg M values—either an application message .app m or a control .marker. Each process p maintains:

The protocol obeys the two Chandy–Lamport rules:

  1. Marker-sending rule: When p transitions from snapState = none to some appState—either spontaneously via SnapEvent.initiateSnapshot p or upon receiving its first .marker at the head of an incoming channel (src, p) via SnapEvent.recvMarker src p—it atomically records appState, marks incoming channel (src, p) (if marker-triggered) and non-edges .done [], initializes all other incoming channels (q, p) to .recording [], and appends .marker to every outgoing channel (p, r) of sys.graph.
  2. Marker-receiving rule: If p has already recorded (snapState = some _), receiving .app m on (src, p) appends m to chanRec src whenever chanRec src = .recording buf while running sys's normal recv transition; receiving .marker on (src, p) transitions chanRec src from .recording buf to .done buf.

In this LTS presentation, SnapEvent.recvMarker src dest executes the marker-sending or marker-receiving rule atomically upon consuming .marker from the head of (src, dest), and SnapEvent.stutter extends finite quiescent runs to infinite executions for liveness (whereas the underlying sys.lts has no stuttering action, so sys.lts.IsTerminal expresses genuine deadlock).

Main definitions #

Main results #

References #

Wire messages and channel marker projections #

Wire message on a FIFO channel of the Chandy–Lamport augmented network.

  • app {M : Type u_1} (m : M) : WireMsg M

    Normal underlying application payload.

  • marker {M : Type u_1} : WireMsg M

    Chandy–Lamport snapshot control marker.

@[instance_reducible]

Extract some m from .app m and none from .marker.

Boolean test checking whether a WireMsg is .marker (without needing DecidableEq M).

Erase all .markers from a wire channel, preserving the FIFO order of application messages.

@[simp]
theorem Cslib.Distributed.ChandyLamport.unmarker_append {M : Type u_1} (ws₁ ws₂ : List (WireMsg M)) :
unmarker (ws₁ ++ ws₂) = unmarker ws₁ ++ unmarker ws₂

Application messages preceding the first .marker in a wire channel.

Application messages strictly following the first .marker in a wire channel.

Snapshot-augmented local and global configurations #

Per-incoming-channel recorder state at a process that has recorded its local snapshot.

  • recording {M : Type u_1} (buf : List M) : ChannelRec M

    Actively buffering application messages arriving on this channel until .marker arrives.

  • done {M : Type u_1} (saved : List M) : ChannelRec M

    Recording finalized with saved message sequence saved.

Recorded message buffer currently stored in a ChannelRec.

Boolean test checking whether a ChannelRec has reached .done.

Record incoming application message m if still .recording, or leave unchanged if .done.

structure Cslib.Distributed.ChandyLamport.SnapProcState (P : Type u_1) (S : Type u_2) (M : Type u_3) :
Type (max (max u_1 u_2) u_3)

Augmented local state of a process in the Chandy–Lamport snapshot protocol.

  • appState : S

    Current local state in the underlying application system.

  • snapState : Option S

    Recorded local state (none before recording, some s_p once recorded).

  • chanRec : P → ChannelRec M

    Per-incoming-channel recorder state (active once snapState.isSome).

theorem Cslib.Distributed.ChandyLamport.SnapProcState.ext {P : Type u_1} {S : Type u_2} {M : Type u_3} {x y : SnapProcState P S M} (appState : x.appState = y.appState) (snapState : x.snapState = y.snapState) (chanRec : x.chanRec = y.chanRec) :
x = y
@[instance_reducible]
structure Cslib.Distributed.ChandyLamport.SnapGlobalState (P : Type u_1) (S : Type u_2) (M : Type u_3) :
Type (max (max u_1 u_2) u_3)

Global configuration of the Chandy–Lamport snapshot-augmented system.

  • proc : P → SnapProcState P S M

    Augmented local state of each process.

  • chan : P → P → List (WireMsg M)

    Point-to-point FIFO wire channels carrying application messages and markers.

theorem Cslib.Distributed.ChandyLamport.SnapGlobalState.ext {P : Type u_1} {S : Type u_2} {M : Type u_3} {x y : SnapGlobalState P S M} (proc : x.proc = y.proc) (chan : x.chan = y.chan) :
x = y
theorem Cslib.Distributed.ChandyLamport.SnapGlobalState.ext_iff {P : Type u_1} {S : Type u_2} {M : Type u_3} {x y : SnapGlobalState P S M} :
x = y ↔ x.proc = y.proc ∧ x.chan = y.chan
def Cslib.Distributed.ChandyLamport.project {P : Type u_1} {S : Type u_2} {M : Type u_3} (S_aug : SnapGlobalState P S M) :

Project an augmented global configuration to its underlying GlobalState by forgetting snapshot fields and erasing .markers from every channel.

def Cslib.Distributed.ChandyLamport.liftState {P : Type u_1} {S : Type u_2} {M : Type u_3} (s : GlobalState P S M) :

Embed an underlying GlobalState as an initial pre-snapshot SnapGlobalState with snapState = none everywhere and no markers in flight.

@[simp]
theorem Cslib.Distributed.ChandyLamport.project_liftState {P : Type u_1} {S : Type u_2} {M : Type u_3} (s : GlobalState P S M) :
def Cslib.Distributed.ChandyLamport.extractSnapshot {P : Type u_1} {S : Type u_2} {M : Type u_3} (S_aug : SnapGlobalState P S M) :

Assemble the recorded global snapshot S* from S_aug: each process takes its recorded snapState (falling back to appState only if unrecorded) and each channel (q, p) takes the saved message sequence ((S_aug.proc p).chanRec q).msgs.

def Cslib.Distributed.ChandyLamport.IsSnapshotComplete {P : Type u_1} {S : Type u_2} {M : Type u_3} (S_aug : SnapGlobalState P S M) :

Global snapshot recording is complete when every process has recorded its local state and every incoming-channel recorder has reached .done.

Instances For
    @[instance_reducible]

    Augmented transition labels and Chandy–Lamport rules #

    inductive Cslib.Distributed.ChandyLamport.SnapEvent (P : Type u_1) (S : Type u_2) (M : Type u_3) :
    Type (max (max u_1 u_2) u_3)

    Transition label of the Chandy–Lamport snapshot-augmented system.

    • app {P : Type u_1} {S : Type u_2} {M : Type u_3} (e : Event P S M) : SnapEvent P S M

      Normal underlying application event (internal or recv of .app m).

    • initiateSnapshot {P : Type u_1} {S : Type u_2} {M : Type u_3} (p : P) : SnapEvent P S M

      Spontaneous snapshot initiation by process p (when snapState = none).

    • recvMarker {P : Type u_1} {S : Type u_2} {M : Type u_3} (src dest : P) : SnapEvent P S M

      Delivery of .marker at the head of channel (src, dest).

    • stutter {P : Type u_1} {S : Type u_2} {M : Type u_3} : SnapEvent P S M

      Stuttering step leaving the augmented state unchanged (used to extend finite executions to infinite executions).

    @[instance_reducible]
    instance Cslib.Distributed.ChandyLamport.instDecidableEqSnapEvent {P✝ : Type u_1} {S✝ : Type u_2} {M✝ : Type u_3} [DecidableEq P✝] [DecidableEq S✝] [DecidableEq M✝] :
    DecidableEq (SnapEvent P✝ S✝ M✝)
    def Cslib.Distributed.ChandyLamport.instDecidableEqSnapEvent.decEq {P✝ : Type u_1} {S✝ : Type u_2} {M✝ : Type u_3} [DecidableEq P✝] [DecidableEq S✝] [DecidableEq M✝] (x✝ x✝¹ : SnapEvent P✝ S✝ M✝) :
    Decidable (x✝ = x✝¹)
    def Cslib.Distributed.ChandyLamport.SnapEvent.toAppEvent {P : Type u_1} {S : Type u_2} {M : Type u_3} :
    SnapEvent P S M → Option (Event P S M)

    Extract some e for an application transition .app e, and none for pure snapshot/stutter transitions.

    def Cslib.Distributed.ChandyLamport.eraseTrace {P : Type u_1} {S : Type u_2} {M : Type u_3} (xl : List (SnapEvent P S M)) :
    List (Event P S M)

    Erase pure marker-control and stuttering steps from an augmented trace, retaining underlying application events in order.

    @[simp]
    @[simp]
    theorem Cslib.Distributed.ChandyLamport.eraseTrace_append {P : Type u_1} {S : Type u_2} {M : Type u_3} (xl₁ xl₂ : List (SnapEvent P S M)) :
    eraseTrace (xl₁ ++ xl₂) = eraseTrace xl₁ ++ eraseTrace xl₂
    def Cslib.Distributed.ChandyLamport.SnapGlobalState.applyApp {P : Type u_1} {S : Type u_2} {M : Type u_3} [DecidableEq P] (S_aug : SnapGlobalState P S M) (e : Event P S M) :

    Apply an application event e to an augmented state S_aug: updates appState, pops .app m if receiving, appends outgoing .app messages, and appends m to chanRec src if dest has already recorded its local state and chanRec src is still .recording.

    def Cslib.Distributed.ChandyLamport.System.applyInitiate {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) (p : P) :

    Apply spontaneous snapshot initiation at process p (Chandy–Lamport marker-sending rule): records appState, sets chanRec q := .recording [] on incoming edges (and .done [] on non-edges), and appends .marker to every outgoing edge (p, r).

    def Cslib.Distributed.ChandyLamport.System.applyRecvMarker {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) (src dest : P) :

    Apply .marker receipt on channel (src, dest) (marker-sending rule on first marker arrival; marker-receiving rule if dest has already recorded).

    def Cslib.Distributed.ChandyLamport.System.EnabledSnap {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) (S_aug : SnapGlobalState P S M) :
    SnapEvent P S M → Prop

    Whether augmented event a is enabled in S_aug.

    Instances For
      @[instance_reducible]
      instance Cslib.Distributed.ChandyLamport.System.instDecidableEnabledSnap {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq M] [DecidableRel sys.graph.Adj] [(p : P) → (st st' : S) → (sent : List (P × M)) → Decidable (sys.internal p st st' sent)] [(src dest : P) → (st : S) → (msg : M) → (st' : S) → (sent : List (P × M)) → Decidable (sys.recv src dest st msg st' sent)] (S_aug : SnapGlobalState P S M) (a : SnapEvent P S M) :
      Decidable (sys.EnabledSnap S_aug a)
      def Cslib.Distributed.ChandyLamport.System.stepSnap {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) :
      SnapEvent P S M → SnapGlobalState P S M

      Next augmented state reached from S_aug under a.

      def Cslib.Distributed.ChandyLamport.System.snapLts {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] :
      LTS (SnapGlobalState P S M) (SnapEvent P S M)

      Labelled transition system of the Chandy–Lamport snapshot-augmented network.

      Instances For

        sys.snapLts is deterministic.

        def Cslib.Distributed.ChandyLamport.System.runSnapEvents {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) :
        List (SnapEvent P S M) → SnapGlobalState P S M

        Augmented state reached from S_aug by applying each event in xl sequentially.

        def Cslib.Distributed.ChandyLamport.System.snapStates {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) :
        List (SnapEvent P S M) → List (SnapGlobalState P S M)

        Sequence of augmented states (S_0, S_1, ..., S_k) visited when executing xl from S_aug (including both endpoints S_aug and sys.runSnapEvents S_aug xl).

        def Cslib.Distributed.ChandyLamport.System.validSnapTrace {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) :
        List (SnapEvent P S M) → Prop

        Executable trace-validity predicate checking that each augmented event in xl is enabled when reached from S_aug.

        Instances For
          @[instance_reducible]
          instance Cslib.Distributed.ChandyLamport.System.instDecidableValidSnapTrace {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableEq M] [DecidableRel sys.graph.Adj] [(p : P) → (st st' : S) → (sent : List (P × M)) → Decidable (sys.internal p st st' sent)] [(src dest : P) → (st : S) → (msg : M) → (st' : S) → (sent : List (P × M)) → Decidable (sys.recv src dest st msg st' sent)] (S_aug : SnapGlobalState P S M) (xl : List (SnapEvent P S M)) :
          Decidable (sys.validSnapTrace S_aug xl)
          theorem Cslib.Distributed.ChandyLamport.System.snapMTr_iff_validSnapTrace {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S₁ S₂ : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} :
          sys.snapLts.MTr S₁ xl S₂ ↔ sys.validSnapTrace S₁ xl ∧ S₂ = sys.runSnapEvents S₁ xl

          Because sys.snapLts is deterministic, sys.snapLts.MTr S₁ xl S₂ holds if and only if xl is a valid augmented trace from S₁ and S₂ = sys.runSnapEvents S₁ xl.

          @[instance_reducible]
          instance Cslib.Distributed.ChandyLamport.System.instDecidableSnapMTr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [Fintype P] [DecidableEq P] [DecidableEq S] [DecidableEq M] [DecidableRel sys.graph.Adj] [(p : P) → (st st' : S) → (sent : List (P × M)) → Decidable (sys.internal p st st' sent)] [(src dest : P) → (st : S) → (msg : M) → (st' : S) → (sent : List (P × M)) → Decidable (sys.recv src dest st msg st' sent)] (S₁ S₂ : SnapGlobalState P S M) (xl : List (SnapEvent P S M)) :
          Decidable (sys.snapLts.MTr S₁ xl S₂)
          theorem Cslib.Distributed.ChandyLamport.System.mem_snapStates_iff_split {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S_init S_final S_k : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} (hmtr : sys.snapLts.MTr S_init xl S_final) :
          S_k ∈ sys.snapStates S_init xl ↔ ∃ (xl₁ : List (SnapEvent P S M)) (xl₂ : List (SnapEvent P S M)), xl = xl₁ ++ xl₂ ∧ sys.snapLts.MTr S_init xl₁ S_k ∧ sys.snapLts.MTr S_k xl₂ S_final

          Along any valid execution S_init →*[xl] S_final of sys.snapLts, sys.snapStates S_init xl is the exact set of intermediate augmented states S_k reached by splitting xl = xl₁ ++ xl₂.

          Projection to the underlying system & non-blocking simulation #

          theorem Cslib.Distributed.ChandyLamport.System.snapTr_project {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S₁ S₂ : SnapGlobalState P S M} {a : SnapEvent P S M} (htr : sys.snapLts.Tr S₁ a S₂) :
          match a.toAppEvent with | some e => sys.lts.Tr (project S₁) e (project S₂) | none => project S₂ = project S₁
          theorem Cslib.Distributed.ChandyLamport.System.snapMTr_project {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S₁ S₂ : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} (hmtr : sys.snapLts.MTr S₁ xl S₂) :
          sys.lts.MTr (project S₁) (eraseTrace xl) (project S₂)

          Erasing marker-control and stuttering steps maps any valid finite execution of sys.snapLts to a valid finite execution of the underlying sys.lts from project S₁ to project S₂.

          theorem Cslib.Distributed.ChandyLamport.System.snapTr_appInternal_of_tr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) {p : P} {st' : S} {sent : List (P × M)} {s' : GlobalState P S M} (htr : sys.lts.Tr (project S_aug) (Event.internal p st' sent) s') :
          sys.snapLts.Tr S_aug (SnapEvent.app (Event.internal p st' sent)) (S_aug.applyApp (Event.internal p st' sent)) ∧ project (S_aug.applyApp (Event.internal p st' sent)) = s'

          Every spontaneous internal step enabled in project S_aug is immediately enabled as a single SnapEvent.app step in sys.snapLts without blocking.

          Pre-snapshot condition and single-marker FIFO cut invariant #

          def Cslib.Distributed.ChandyLamport.System.WellFormedSnapChan {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) (S_aug : SnapGlobalState P S M) :

          An augmented state has well-formed channels if every non-edge of sys.graph is empty.

          Instances For
            @[instance_reducible]
            theorem Cslib.Distributed.ChandyLamport.System.wellFormedSnapChan_mTr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S₁ S₂ : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} (hmtr : sys.snapLts.MTr S₁ xl S₂) (hwf : sys.WellFormedSnapChan S₁) :

            Non-edge wire channels remain empty across any finite execution of sys.snapLts.

            def Cslib.Distributed.ChandyLamport.System.IsPreSnapshot {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) (S_aug : SnapGlobalState P S M) :

            Pre-snapshot initial condition: no process has recorded yet (snapState = none), no .markers are in flight, and non-edge channels are empty (WellFormedSnapChan).

            Instances For
              @[instance_reducible]
              instance Cslib.Distributed.ChandyLamport.System.instDecidableIsPreSnapshot {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [Fintype P] [DecidableEq M] [DecidableRel sys.graph.Adj] (S_aug : SnapGlobalState P S M) :
              theorem Cslib.Distributed.ChandyLamport.System.isPreSnapshot_liftState {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) {s : GlobalState P S M} (hwf : sys.WellFormedChan s) :

              liftState s satisfies IsPreSnapshot whenever s has well-formed channels.

              structure Cslib.Distributed.ChandyLamport.System.SnapInv {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) (S_aug : SnapGlobalState P S M) :

              Inductive invariant of the Chandy–Lamport snapshot protocol:

              1. Non-edges carry empty channels and (once v records) .done [] recorders.
              2. Every channel holds at most one .marker.
              3. While u has not recorded (snapState = none), chan u v contains no .marker, and if v has already recorded along edge (u, v), chanRec u at v is .recording buf.
              4. Once u has recorded along edge (u, v), either .marker ∈ chan u v (and if v has recorded, chanRec u at v is .recording buf), or .marker ∉ chan u v (meaning .marker was already delivered to v, so v has recorded and chanRec u at v is .done saved).
              theorem Cslib.Distributed.ChandyLamport.System.snapInv_of_isPreSnapshot {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) {S_aug : SnapGlobalState P S M} (hpre : sys.IsPreSnapshot S_aug) :
              sys.SnapInv S_aug
              theorem Cslib.Distributed.ChandyLamport.System.enabledSnap_recvMarker_spec {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) {S₁ : SnapGlobalState P S M} {src dest : P} (hinv : sys.SnapInv S₁) (hen : sys.EnabledSnap S₁ (SnapEvent.recvMarker src dest)) :
              sys.graph.Adj src dest ∧ (S₁.proc src).snapState.isSome = true ∧ ∃ (t_sd : List (WireMsg M)), S₁.chan src dest = WireMsg.marker :: t_sd ∧ WireMsg.marker ∉ t_sd
              theorem Cslib.Distributed.ChandyLamport.System.snapInv_tr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] :

              SnapInv is preserved by every single transition of sys.snapLts.

              theorem Cslib.Distributed.ChandyLamport.System.snapInv_mTr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S_init S_aug : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} (hpre : sys.IsPreSnapshot S_init) (hmtr : sys.snapLts.MTr S_init xl S_aug) :
              sys.SnapInv S_aug

              SnapInv holds at the end of every finite execution starting from an IsPreSnapshot state.

              theorem Cslib.Distributed.ChandyLamport.System.count_marker_le_one {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S_init S_aug : SnapGlobalState P S M} {xl : List (SnapEvent P S M)} (hpre : sys.IsPreSnapshot S_init) (hmtr : sys.snapLts.MTr S_init xl S_aug) (u v : P) :

              Single-marker bound: along any execution from a pre-snapshot state, every channel holds at most one .marker.

              theorem Cslib.Distributed.ChandyLamport.System.isSnapshotComplete_no_markers {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) {S_aug : SnapGlobalState P S M} (hinv : sys.SnapInv S_aug) (hcomp : IsSnapshotComplete S_aug) (u v : P) :
              WireMsg.marker ∉ S_aug.chan u v

              No markers remain upon completion: once every process has recorded (snapState.isSome) and every channel recorder has reached .done, zero .markers remain in flight on any channel.

              theorem Cslib.Distributed.ChandyLamport.System.snapMTr_appRecv_of_tr {P : Type u_1} {S : Type u_2} {M : Type u_3} (sys : System P S M) [DecidableEq P] [DecidableRel sys.graph.Adj] {S_aug : SnapGlobalState P S M} (hinv : sys.SnapInv S_aug) {src dest : P} {msg : M} {st' : S} {sent : List (P × M)} {s' : GlobalState P S M} (htr : sys.lts.Tr (project S_aug) (Event.recv src dest msg st' sent) s') :
              ∃ (xl : List (SnapEvent P S M)) (S_aug' : SnapGlobalState P S M), xl.length ≤ 2 ∧ eraseTrace xl = [Event.recv src dest msg st' sent] ∧ sys.snapLts.MTr S_aug xl S_aug' ∧ project S_aug' = s'

              Under SnapInv S_aug, any underlying recv transition enabled in project S_aug can execute in sys.snapLts in at most two steps (optionally delivering a single leading .marker on (src, dest) first, then delivering .app msg) without waiting on any other channel or process.