Unit 12 of 14 · about 6 hours · implement

Operation history schema, a single-object reference model and a consistency checker

The Systems unit on distributed histories and deterministic failure simulation built a first checker. Here the new work is explicit indeterminate operations, validated event pairing and an independent checker comparison.

You'll be able to

  • Record invocations, responses and indeterminate outcomes without inventing a real-time order.
  • Implement a bounded single-register checker against an independent sequential model.
  • Return a legal witness, a demonstrated violation or an inconclusive search result with its scope.

Covers

Operation history schemaSingle-object reference modelLinearizability or contract checker
1

Read

In this order, only the parts listed

0 of 3 done

  1. Herlihy and Wing (1990): incomplete historiesLinearizability: A Correctness Condition for Concurrent Objects (Herlihy and Wing, 1990)

    Sections 2.1 to 2.2, printed pp. 467 to 469: histories, complete histories, extension and equivalence

    Revisit only the definitions your checker needs; do not repeat the full paper.

  2. Jepsen: operations, crashes and history representationJepsen Consistency Models

    Fundamental Concepts: Processes, Operations, Invocation & Completion Times, Crashes and Histories (page read 2026-10-15)

  3. Jepsen v0.3.14: outcome encoding and Knossos modelsJepsen Consistency Models

    Tutorial 4, Models and the initial checker/linearizable example, lines 27 to 114; read Tutorial 3's outcome rules at https://github.com/jepsen-io/jepsen/blob/e5c458ad6671846938d11c3ac28db6439f9a822f/doc/tutorial/03-client.md#L195-L202

    Use the register model and outcome conventions as an independent reference. Do not provision the tutorial's remote machines; the required work is a local Python checker and Maelstrom's local register oracle.

2

Focus on

  • Pair events by stable operation identity. Record client, object, function, arguments, result, invocation, completion and outcome; keep replica configuration and epoch as diagnostic metadata.
  • Validate the history before checking it: missing or duplicate responses, impossible result shapes and reused identities are input errors, not consistency verdicts.
  • Enumerate legal model transitions subject to response-before-invocation edges. For indeterminate writes, consider both omission and a possible completion; a timeout is not a definite failure.
  • Use the simulator or a single local observer to establish event order. Unsynchronized server timestamps cannot manufacture precise cross-client real-time edges. Exhaustion of a search budget is inconclusive, not a counterexample.
Common mistakes · 3
  • Using the replicated implementation's state or merge function as the supposedly independent sequential oracle.
  • Discarding timed-out writes, or marking a transport error as definite non-execution without evidence.
  • Calling a single-register verdict transaction isolation, multi-key atomicity or a durability proof.
3

Try it yourself

Closed-book, before checking anything

Write a Python 3 checker from the register specification, initially 0. First accept a completed write of 1 followed by a read of 1, and reject the same history when the read returns 0. Next leave a write of 1 pending: a later read of 1 is legal if that write takes effect, but a read of 1 followed by a nonoverlapping read of 0 is illegal with no other writes. Return an actual operation ordering for accepted histories. Cross-check these tiny histories with Knossos's register model; Maelstrom's linearizable key/value workload uses a CAS-register model that also supports compare-and-set. Add a deliberately broken checker that drops every pending write and show that it rejects the legal pending-write case. Keep malformed input and search-budget exhaustion separate from model violations.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Can a timed-out write precede a later successful read in a legal witness?Answer

    Yes. Its effect may have happened despite the missing response. The checker may complete that operation consistently with the observed history.

  2. 2.Why retain both an operation ID and a logical client identity?Answer

    The operation ID pairs events and distinguishes attempts; client identity supplies process-order constraints. After an indeterminate operation, a new logical process identity avoids pretending the old process has no outstanding operation.

  3. 3.What does an accepted bounded history establish?Answer

    That this history has a legal witness for the encoded object model and timing constraints. It does not establish correctness for unobserved schedules or a stronger model.

  4. 4.If a checker reaches its search limit without finding a witness, may it report a violation?Answer

    No. Unless the search is complete or another sound argument proves impossibility, the result is inconclusive.

You're done when

Your checker agrees with the independent oracle on accepted, rejected and indeterminate-write fixtures, returns witnesses for acceptance, and never labels an incomplete search a violation.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 14 more in the section
  • Linearizability: A Correctness Condition for Concurrent Objects (Herlihy and Wing, 1990)ACM TOPLAS (MIT 6.5840 copy) · required

    Read through Section 3.1, as MIT 6.5840 assigns: histories, real-time order and the definition every history check in this section tests. Linearizability is per object, which is why it composes.

  • Jepsen Consistency ModelsJepsen · required

    Use the model hierarchy and history definitions to name the exact contract being checked. Check recorded single-register histories with Knossos, which Maelstrom runs for its lin-kv workload, and never claim a stronger model than the checker covers.

Also in this section