research29 min studyLesson 978 in Engineering

Find a legal sequential explanation that respects real-time order

Check concurrent call histories against a sequential object contract, including overlapping completions, pending calls, and uncertainty in captured order.

On this page

What you’ll understand

  • Construct the non-overlap precedence relation from invocation and response events.
  • Test candidate sequential orders against operation results.
  • Handle pending operations and incomplete or clock-uncertain histories without discarding successful completed calls.

Linearizability asks whether concurrent operations can be explained as a legal sequential execution in which each operation takes effect between its invocation and response. Non-overlapping calls impose real-time order; overlapping calls can admit either order if the results and sequential contract allow it. A history checker searches for such an explanation. Its conclusion concerns the captured history and modeled object semantics, so accurate event boundaries, return values, and unresolved operations are essential inputs.

Real-time precedence is weaker than response sorting

If operation a responds before operation b is invoked, any legal linearization must place a before b. If their intervals overlap, the order of their response events alone does not determine their abstract effect order. A slow response can belong to an operation that took effect earlier. The checker must find an order satisfying both the required precedences and the sequential specification's results. For a register, writes update one value and reads return the most recent preceding write in that sequential order, starting from the declared initial value.

Capture invocation and response boundaries in a harness with a justified ordering mechanism, or preserve reliable causal edges. Comparing unsynchronized timestamps from separate machines can manufacture false non-overlap edges. Operation identity, arguments, result type, and client order also belong in the history. A timeout may mean the operation did not execute or that its response was lost; the API's semantics determine how it should be represented. Treating every timeout as a known no-effect failure can make a legal execution appear inconsistent or conceal an actual contract violation.

a≺Hb⟺resp⁡H(a)<inv⁡H(b),a≺Hb⇒a≺Sba\prec_H b\quad\Longleftrightarrow\quad \operatorname{resp}_H(a)<\operatorname{inv}_H(b),\qquad a\prec_H b\Rightarrow a\prec_S b
H is a captured history with trustworthy event ordering, and S is a proposed sequential explanation. Strict inequality denotes response-before-invocation order, not merely numerical order of unsynchronized clocks. Overlapping intervals impose no such real-time edge by themselves.↔ Scroll wide equations horizontally.

Pending operations can be completed or omitted under the definition

For an incomplete history, the standard definition permits adding responses to some pending invocations, then considering the completed portion. The resulting sequential history must match each retained operation's arguments and return value, preserve per-client behavior, and respect required real-time precedence. Already completed successful operations cannot simply be dropped because they make the check difficult. A pending write may explain a later read if a suitable completion and ordering exists, even though the original client never received a response. This captures uncertainty about execution without declaring uncertainty equivalent to failure.

Retries require a deliberate object contract. Two transport calls with the same idempotency identity may represent attempts at one logical effect, while ordinary register writes are separate operations even when their values match. The checker model must encode whichever semantics the service promises. Similarly, a history of individual key operations does not automatically establish multi-key transaction guarantees. State the object scope, initial state, result meanings, and failure classification. A checker reporting unknown or exhausting resources has not produced either a valid sequential witness or a definitive violation.

∃H′,S:S≡complete⁡(H′),S is legal,≺H∩(OS×OS)⊆≺S\exists H',S:\quad S\equiv\operatorname{complete}(H'),\quad S\text{ is legal},\quad \prec_H\cap(\mathcal O_S\times\mathcal O_S)\subseteq\prec_S
H' extends H only by appending responses to some pending invocations. O_S is the set of operations retained in S, and equivalence preserves each process's operation behavior after removing still-pending calls. Required real-time precedences among retained operations must hold in the legal sequential history. This is an existence condition, not an efficient search algorithm.↔ Scroll wide equations horizontally.

A checked history is evidence about the executions you observed

A rejected complete history with sound capture and a correct sequential model is a concrete inconsistency witness. A passing finite history shows that at least one legal explanation exists for that history; it does not show that every untested schedule will pass. General linearizability proofs must connect all allowed implementation executions to the abstract object, often through invariants and refinement. Crash durability is a further contract dimension: ordinary linearizability does not, by itself, specify which state survives a machine or storage failure. Include those semantics when the service promises them.

The modular instrument supplies a tiny sequential reference operation: add one modulo four. Reset, set m=4 and a=1, predict the sequence 0,1,2,3 after zero through three transitions, then take three Steps. Its state sequence is legal by construction and contains no invocation intervals or overlapping clients. It therefore cannot check linearizability, pending responses, or durability. The value of the illustration is narrower: a concurrent history needs a sequential contract to explain its observations, and that contract must be stated before a checker can search for an explanation.

The later response need not be the later write

A register initially contains zero. W1 writes one during interval [1,4], W2 writes two during [2,3], and R reads two during [5,6]. Both writes respond successfully. Times come from one trusted event-ordering harness. Find a legal sequential explanation and count how precedence narrows the three-operation permutations.

  1. Three distinct operations have 3!=6 possible sequential permutations before constraints. Both write responses occur before R is invoked, so W1 and W2 must both precede R, leaving two candidate orders.

  2. W1 and W2 overlap, so their response order does not force their abstract write order. The candidate W1,W2,R leaves the register at two and matches R's return value.

  3. The other candidate W2,W1,R leaves the register at one and cannot explain the read of two. Thus one of the two precedence-respecting orders is legal, even though W2 responded before W1.

The result

The history is linearizable as W1,W2,R. Sorting writes by response time would incorrectly reject this valid explanation.

Explore the model

Interactive lab

Interactive lab · modular

A sequential object contract precedes history search

Reset, set m=4 and a=1, predict residues 0,1,2,3 at iterations 0 through 3, then take three Steps. This exact additive orbit is a sequential reference example. It has no client histories, invocation/response intervals, incomplete calls, or linearizability checker.

A sequential object contract precedes history searchAddition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Current readings: Residue r0: 0; Orbit period · m/gcd(m,a): 12; Distinct residues visited: 1 of 12. All parameters are adjustable with the labeled controls below.Repeated addition modulo 12: the current residue is 0, and the orbit period is 12.01234567891011+ 5mod 12An additive orbitn = 0rₙ = 0Period = 12Cycle starts at 0:0 → 5 → 10 → 3 →8 → 1 → 6 → 11 →4 → 9 → 2 → 7 → 0Exact residues · two additions per second
Additive orbitCurrent residue / next edge
Residue r0
0
Orbit period · m/gcd(m,a)
12
Distinct residues visited
1 of 12
t = 0 s

Addition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. 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 forConcurrent results are checked against an explicit sequential contract and real-time precedence.

Check your understanding

Two successful writes overlap, and the write returning first writes value two. A later read returns two. Is response order alone enough to reject linearizability?

Try it yourself

Case one: a successful write of seven finishes at time two, and a read invoked at time three returns zero, with no other writes and initial value zero. Case two: a write of nine is invoked at time zero and remains pending, while a read during [1,2] returns nine. Classify each under the ordinary register contract.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the non-overlap edge in the first case and the allowed pending-operation extension in the second.

Compare with the solution

Case one is not linearizable: the completed write must precede the later read, which should return seven. Case two can be linearizable by completing and placing the pending write before the read; its interval overlaps the read. This existence does not prove the pending caller received success, nor does it establish crash durability beyond the ordinary register semantics.

Take it with you

  • Non-overlap creates real-time precedence; overlapping responses do not fix effect order.
  • Pending invocations need explicit completion or omission semantics, while completed calls remain accountable.
  • Passing one finite history does not prove all executions or a stronger durability contract.

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.