Reconstruct a partial order without inventing missing history
Combine local sequence, correlated messages, vector histories, and clock intervals while preserving unknown relationships in incomplete traces.
On this page
The question for today
What you’ll understand
- Build an event graph from justified local and message edges.
- Use clock intervals to bound durations without equating physical precedence with causality.
- Classify unobserved relationships as unknown unless the capture and metadata justify concurrency.
An incident timeline often begins as a list sorted by printed timestamps. That view can place a receive before its send, conceal two independent branches, or make a missing event look like a missing operation. A stronger reconstruction records the evidence for each ordering edge and leaves unsupported relationships unresolved. We will combine several kinds of evidence without pretending they are interchangeable, then calculate a duration interval whose negative raw timestamp difference is explained by uncertainty rather than impossible execution.
Use edges with documented meanings
Create a node for each recorded event and annotate its participant identity, incarnation, local sequence, clock domain, and relevant operation or message identifiers. Add local-order edges only where the execution model establishes them; merging several unsynchronized threads under one process label does not justify an arbitrary total sequence. Add send-to-receive edges for correlated instances of the same communication. Distinguish retry attempts, duplicate deliveries, and reused request IDs, since a correlation error can create a false path or even a cycle. Transitive closure then provides further order without requiring every intermediate relationship to have its own explicit edge.
Trace context helps connect operations, but a visual hierarchy is not a universal execution contract. A parent span may end before asynchronously launched work finishes, and a span link can express a relationship whose precise ordering depends on the application. Consult the instrumentation semantics rather than assuming that nesting on a screen proves enclosure in real time. Conversely, a missing span does not prove that the associated work did not run; sampling, loss, failed export, and uninstrumented paths can remove evidence. Preserve capture settings and loss indicators alongside the graph so the strength of later claims remains visible.
Keep physical bounds separate from causal edges
A timestamp with a valid error interval constrains when its event could physically have happened. Two disjoint intervals can establish physical precedence, but do not create a message or synchronization edge. Overlapping intervals leave physical order uncertain unless other evidence constrains it. If a known send-to-receive edge conflicts with the printed midpoint order, examine whether the intervals still admit a valid execution before declaring causality impossible. If even the bounds conflict, investigate clock assumptions, identifier matching, instrumentation placement, and data corruption rather than silently sorting away the contradiction.
For two event intervals, subtract the largest allowed start from the smallest allowed end for a conservative lower duration bound, and the smallest start from the largest end for the upper bound. A known causal send-to-receive relationship can additionally exclude negative transmission time. These interval calculations can be conservative because errors may correlate; independent endpoint choices need not all be jointly realizable. That is acceptable for a containing bound, provided the inputs themselves are valid. It is not acceptable to replace the bound with a preferred midpoint merely because the interval looks inconveniently wide.
Report what the reconstruction cannot decide
Correct vector histories can establish concurrency under their stated participant and propagation model, whereas absent edges in a partial trace usually establish only ignorance. Label those outcomes differently. A topological ordering is one list consistent with known edges; another valid list can exchange independent nodes. It does not recover a unique hidden history. Record which conclusions use causal metadata, calibrated physical bounds, local duration measurements, or an explicit operational assumption. This makes the reconstruction reviewable and identifies the next measurement needed when a critical relationship remains unknown instead of disguising uncertainty as a polished timeline.
The vector instrument offers a small analogy for preserving incomparable dimensions. For each separate view, Reset, set both angle and magnitude, predict the projections, then inspect. Compare angle 0 degrees/magnitude 2 with angle 60 degrees/magnitude 2. One pair has larger x and smaller y, so neither is componentwise below the other. The instrument contains no events, messages, timestamps, or tracing export. Its purpose is to resist collapsing a partial-order comparison into one convenient scalar. The worked example performs the actual trace calculation, and its explicit communication edge supplies evidence that the geometric picture cannot provide.
Work it through
Bound a receive that appears earlier in the log
A correlated send has wall timestamp 100 ms with error±3 ms. Its receive has timestamp 99 ms with error±3 ms in the same physical-time scale. A trusted local elapsed measurement then records 4 ms from that receive to server completion; neglect rate error for this local duration. Bound send-to-receive and send-to-completion time.
The send interval is[97, 103] ms and the receive interval[96, 102] ms. Their raw midpoint difference is−1 ms, but that is not an actual negative transit-time measurement.
Subtract endpoints: receive minus send lies in[96−103, 102−97]=[−7, 5] ms. The correlated causal send-to-receive edge restricts the containing interval to[0, 5] ms.
Add the stipulated 4 ms local processing duration to obtain a containing send-to-completion interval[4, 9] ms. This uses the communication edge and local elapsed contract, not midpoint sorting.
The trace is consistent with nonnegative transit of at most 5 ms and total send-to-completion time between 4 and 9 ms under the stated bounds. No exact transit value is established.
The living notebook
Explore the model
Interactive lab · vectors
Do not replace a partial comparison with one scalar
For each separate view: Reset, set both angle and magnitude, predict, then inspect. Compare 0°, magnitude 2 with 60°, magnitude 2, giving approximately(2, 0) and(1, 1.732). Neither pair dominates componentwise. This is a geometric analogy, not a trace or vector-clock simulator.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forPreserving separate dimensions can retain incomparability. In a real incomplete trace, however, missing causal evidence should be labeled unknown rather than automatically concurrent.
Pause & reason
Check your understanding
Your turn
Try it yourself
Two valid physical-time intervals are A=[200, 204] ms and B=[207, 211] ms, with no communication or synchronization evidence between their participants. What physical order and duration bound follow? Does that prove A happened-before B?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Compare the disjoint intervals and subtract endpoints, then keep physical precedence separate from the defined causal relation.
Compare with the solution
A is physically earlier, and B−A lies in[207−204, 211−200]=[3, 11] ms. That physical precedence alone does not establish a happened-before message or synchronization path. The causal relationship remains unsupported by the supplied evidence.
Keep the idea
Take it with you
- Reconstruction starts from edges whose instrumentation semantics justify them.
- Clock intervals constrain physical time while causal metadata constrains dependency order.
- Incomplete evidence needs explicit unknowns; a convenient sorted list is not a unique recovered execution.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.