Unit 8 of 15 · about 4 hours · implement
Operation-history normalization and linearizability checker scope
A checker verdict is only as good as the history it reads. Normalization turns ambiguous client observations into the exact object the model reasons about.
You'll be able to
- Record operation histories with invocation and completion times, process ids, function names and return values.
- Normalize client observations into a checker-ready history and run a single-register linearizability check on fixed histories.
- State the checker's scope: what a clean run establishes and what it cannot prove.
Covers
Read
In this order, only the parts listed
0 of 2 done
- Consistency Models map: histories and operationsJepsen - Consistency Models and Analyses
Systems, Processes, Operations and Invocation and Completion Times sections: the operation as invoke/ok pairs with function names and values, and the single-object hierarchy (linearizable implies sequential implies causal)
Read the map for vocabulary and the hierarchy arrows. The availability coloring is Jepsen's summary of known results, not a measurement.
- Chapter 10: LinearizabilityDDIA 2e - Chapters 9, 10 and 14 Review
Printed pp. 402-410: what makes a system linearizable, the recency guarantee and history classification
Review only: rebuild from the earlier section on replication, consistency and convergence, and point back to its units by title instead of re-reading at full depth.
Focus on
- Record ordered invocations with
:ok, definite:failor indeterminate:infooutcomes, keeping pending operations and process incarnations. Event order gives precedence without numeric timestamps; never turn an ambiguous timeout into a definite failure. - Normalization resolves ambiguity before checking: failed and crashed operations become explicit outcomes; retries become separate invocations with their identity preserved.
- This exercise uses Knossos with a single-register model, so its verdict covers that register only. Multi-object checks need an appropriate model and complete transaction observations, in Knossos or a transactional checker such as Elle.
- A clean run is bounded evidence. It says these histories show no violation of this model; it is not a proof of the system.
Common mistakes · 3
- Skipping input validation. Check event order, process identities and invocation-completion pairing before calling Knossos; its analysis takes an ordinary event sequence, while Elle's history-object requirement is a different API contract.
- Checking a multi-key workload with a single-register model. The model verdict says nothing about the keys it never saw.
- Presenting a clean run as serializability. A linearizability check on one register cannot establish a multi-object isolation claim.
Try it yourself
Closed-book, before checking anything
valid? true; valid? false).Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What four fields does each history entry need, and why?Answer
Process, type (
:invoke,:ok,:failor:info), function and value. The checker needs per-process order and invocation-completion pairing;:infomarks an operation that may or may not have taken effect.2.Write 2 completes, then a read returns 1. What is the verdict under the register model?Answer
Invalid, because write 2 completes before the read is invoked and no write intervenes. A read that overlaps the write could legally return the old value, even if it completes later.
3.Why must retries keep their identity through normalization?Answer
A retried write that ran twice is one logical operation with two attempts. Dropping the link double-counts effects or hides the duplicate the checker should see.
4.Knossos reports valid on your history. What may you claim?Answer
That this history shows no single-register linearizability violation. Not that the system is linearizable, and nothing about other objects or longer histories.
Practice
- Knossos: check two fixed single-register histories
With
MAELSTROMset to your Maelstrom 0.2.4 directory, callknossos.core/analysiswith(knossos.model/register 0)and an ordered event vector from acheck.cljscript run byjava -cp "$MAELSTROM/lib/*" clojure.main check.clj: the write-then-read history (expectvalid? true) and the stale-read history (expectvalid? false)Record the Maelstrom version beside both verdicts; describe only what these two histories check.
You're done when
Both fixed histories return the predicted verdicts, and you can state the object, the model and the completeness limit of each run in one sentence.
Only when you can do this without notes.
Leads to
- Jepsen generator, client, nemesis and checker roles and a fault and workload coverage matrixEmbed the checker in a full generator, client, nemesis and checker campaign.
- Linearizability as a history property and sequential consistencyReuse the history vocabulary for linearizability versus sequential consistency.
Notes
Resources · 2 for this unit, 13 more in the section
- Jepsen - Consistency Models and AnalysesJepsen · required
Use the framework's generator, client, nemesis and checker roles to design the campaign, Knossos for single-register linearizability and Elle for transactional anomalies on recorded histories, and the public analyses for fault models. A simplified local checker must declare its object, model and completeness limits.
- DDIA 2e - Chapters 9, 10 and 14 ReviewMartin Kleppmann and Chris Riccomini · required
Revisit uncertainty, consistency, consensus and responsible system design while extracting the final contract. Use the book to challenge assumptions and alternatives, not to replace executable evidence.
Also in this section
- TLA+ Video CourseLeslie Lamport · primary
Complete lectures 1 to 10 (lectures 8, 9 and 10 have two parts each) and check the corrections page, while specifying a reduced transaction, workflow or replicated-log model from the capstone. Run TLC after every extension, report the model bounds with every result, and retain the first meaningful counterexample rather than polishing only the final model.
- TLA+ ExamplesTLA+ Foundation · support
Check
specifications/transaction_commit/(TCommit.tla,TwoPhase.tla,PaxosCommit.tlawith their.cfgfiles) with TLC alongside the lectures, and read the Paxos specifications for depth.specifications/TwoPhase/is a hardware handshake, not transaction commit. - Cambridge Concurrent and Distributed Systems Notes (Kleppmann) - CRDTs and CollaborationUniversity of Cambridge (Martin Kleppmann) · support
Use Section 8.1 (operation-based and state-based CRDTs, operational transformation) for the CRDT unit, and work Exercise 21 (prove the operation-based map CRDT converges) and Exercise 22 (its multi-value variant).
- A Comprehensive Study of Convergent and Commutative Replicated Data Types (Shapiro et al., 2011)INRIA report (Berkeley course copy) · support
Read Sections 1 to 3 (state-based and operation-based definitions, the semilattice and delivery conditions) and one example type for your implementation, not the whole catalog.
- Learn TLA+Hillel Wayne · support
Use the core lessons and the examples as a second explanation when a lecture stalls, and as the PlusCal reference if you write algorithms rather than raw actions.
- Hypothesis - Stateful TestingHypothesis · required
Use
RuleBasedStateMachineagainst a reference model for property-based state-machine tests of your extension, keep the failing seeds and shrunk examples, and plant a bug to show the machine detects it. - MIT 6.5840 - Verification Lecture and Final ProjectMIT PDOS · required
Study the Spring 2026 verification lecture and IronFleet reading, then use the final-project guidance to frame a bounded real-system extension, evaluation and report. Course grading and staff review are unavailable to self-study, so use the roadmap defense rubric.
- Elle: Inferring Isolation Anomalies from Experimental Observations (Kingsbury and Alvaro)arXiv · required
Read how Elle infers version orders from list-append and register histories and detects cycles for G0 to G2. It needs complete histories, and a clean run is not a proof of serializability.
- How Amazon Web Services Uses Formal Methods (Newcombe et al., 2015)Amazon Science · support
Read it for why industrial teams specify designs in TLA+ and which bugs model checking found that testing missed. Its effort figures are anecdotes, not benchmarks.
- FoundationDB: A Distributed Unbundled Transactional Key Value Store (Zhou et al., 2021)FoundationDB · support
Read the simulation-testing section (deterministic single-threaded simulation, fault injection, seed replay) as the model for your own scheduler, and the architecture for unbundled transactions.
- HLD Handbook - CRDTs, Multi-Region and Architecture Trade-offsHLD Handbook · support
Read the CRDT, multi-region, distributed SQL and relevant case-study chapters only after the formal core passes. Use its design prompts to prepare the final comparison and defense.
- CMU 15-721 - Selected Advanced Database Systems UnitsCarnegie Mellon Database Group · depth
Select at most one lecture group that informs your extension: #02 and #03 (data formats and encoding), #08 (scheduling and coordination) or #17 to #22 (system analyses such as BigQuery, Databricks, Snowflake, DuckDB and Redshift), with their papers. The course project needs a group, cloud credits and staff sign-off, so there is no runnable self-study project.
- Replicated Log and Stream Processor - Final CapstoneRoadmap-Final · support
Finish the protocol and invariant specification, deterministic fault campaign, bounded real-code extension, fallback, ablations, workload regions, negative result, operations dossier and independent reproduction package.