Replies: 5 comments 7 replies
-
Not sure I got your point clearly. But I am sharing my opinion about what I understood. I think that Interpretation B makes room for (data) non-determinism, particularly if the reactions triggered by
These constraints are the source of determinism. They are, kind of omitted in Interpretation B, again, if my understanding is correct. Reducing the lag between Logical Time and Physical Time, however, is kind of a measurable QoS metric, in the sense that:
If I succeed to come up with an illustrating diagram, I will share it. |
Beta Was this translation helpful? Give feedback.
-
Here are two possible executions, which follow LF semantics (Interpretation A). |
Beta Was this translation helpful? Give feedback.
-
Part of the art here is what we mean by "observer." If an observer has to be a reactor, and reactors do not share state, then every observer sees all events in timestamp order. Events it does not see are irrelevant. |
Beta Was this translation helpful? Give feedback.
-
Here is a short summary of the points discussed:
|
Beta Was this translation helpful? Give feedback.
-
In theory, consensus among all observers is only possible if all events occur at exactly one point in space. If any two events occur at different points in space, then the order in which they occur can be different for different observers. This follows from relativity. Hence, the consensus you ask for is only (theoretically) possible if the entire execution is a single sequence occurring at one point in space. Reducing this to a practical level, we can approximate a universal consensus by implementing a barrier synchronization for every tag advancement. In order to advance time, a federate would have to wait until it has heard from all other federates that they are ready to advance time too. This would still only be an approximation, because events that occur within a tag, such as actuating something the physical world, will still be distributed and therefore can occur in different orders for different observers. The only way to get rid of that ambiguity is to reduce the physical size of the implementation to a single point. Only then will all possible observers see everything in the same order. |
Beta Was this translation helpful? Give feedback.
-
In the back of my head, I always have the understanding that "each LF program defines a single global logical timeline" and this single logical timeline is the source of (data-)determinism. However, after thinking about this further, this might not be the case. I am bringing up this topic here to make sure we are on the same page.
Consider the following example.
We often say that reactors have discrete-event (DE) semantics, which seems to involve a single global logical timeline/behavior (let's call this Interpretation A).
The DE semantics implies that the above program has the following logical behavior.
All the scheduling and formal analyses can be done w.r.t. this "correct" logical behavior defined by the program.
On the other hand, in CyPhy'19, TECS'21, and ISoLA'21, each reactor is said to "see events/inputs in timestamp order," which seems to define the logical timeline at a "local" level. In other words, the reactor semantics mandates that each reactor processes its inputs and locally generated events (firings of timers and actions) in timestamp order but says nothing about the "global" ordering of events across reactors (Interpretation B).
The CAL'21 paper seems to further strengthen this view by allowing unavailabilities to be -oo when two reactors do not have data dependencies between each other, suggesting that each of them can be independently executed.
Under this view, from
t1
's andt2
's perspectives, each of them has a well-defined single logical timeline.But from the view of the top-level reactor
TimersInReactors
, its logical timeline is undefined, which potentially means that any interleaving oft1
's timeline andt2
's timeline is valid, including the following.Our runtime currently implements global barrier synchronization, which could be understood as either following Interpretation A precisely or choosing a very specific interleaving out of all interleavings allowed by Interpretation B.
Whether Interpretation A or Interpretation B is used has implications on runtime scheduling, formal analyses, and developer ergonomics.
If Interpretation A is used:
If Interpretation B is used:
I think in general we are heading toward Interpretation B. Please leave comments below if there are alternative views to any of the points above. Thanks!
Update: there should be only one logical timeline (Interpretation A). A short summary is added below.
Beta Was this translation helpful? Give feedback.
All reactions