interviewpath
  • 0day streak
  • 10total XP
  • Level 1
0/6

Unit 9 · Research methods · Lesson 9 of 12

Correctness guarantees versus empirical evidence

Papers and design documents mix two kinds of claims: guarantees that follow from a proof, invariant or model-checked specification under stated assumptions, and empirical results that hold only for the measured setup. Keeping them apart is essential when discussing consensus, transactions, isolation or performance.
About 3 h 30 minFocus mode

Step 1: Learn the ideas

  • Kinds of claims: guarantee, design argument, measurement
  • System models: crash versus Byzantine faults, synchrony assumptions
  • Safety versus liveness
  • Invariants and inductive arguments
  • Paper proofs, mechanized proofs and model checking
  • The specification-to-implementation gap
  • Assumptions that are themselves empirical
  • Testing and fault injection as evidence
  • Performance claims as conditional measurements

Why it matters

"Does Raft guarantee that?" and "how do you know?" are different questions, and research discussions in systems, databases and networking switch between them constantly. Confusing a measured property with a guaranteed one leads to wrong designs: a system never observed to lose data under test is not a system that cannot lose data.

Core ideas

Three kinds of claims. A guarantee follows from an argument covering every execution a model allows: at most one leader per term, committed entries are never lost, transactions are serializable. A design argument explains why a mechanism should help without proving it. An empirical result reports what happened in particular runs: latency, throughput, availability under a workload. A claim-evidence table should label each.

Every guarantee has a model. Read the fine print: crash-stop or Byzantine failures, synchronous or asynchronous network, bounded clock error, storage that is durable once a write is acknowledged. Raft is a clean example. Section 5.6 of its paper requires that safety never depend on timing, while availability does: Raft can elect and keep a steady leader as long as broadcast time is much smaller than the election timeout, which in turn is much smaller than the mean time between failures. This mirrors a classic result: in an asynchronous system where even one process may crash, no deterministic consensus protocol can guarantee termination, so practical protocols keep safety always and make progress only when timing is good enough.

Safety, liveness and invariants. Safety says nothing bad happens, and a violation shows up in a finite trace. Liveness says something good eventually happens. Safety is usually proved through an invariant: a predicate that holds initially and is preserved by every allowed step, hence true in every reachable state. Finding the right inductive invariant is most of the work, and the same invariant is what tests and runtime assertions should check. Evaluations usually report liveness-like behaviour (election or recovery time) as measured distributions, not as guarantees.

How strong is the evidence? Roughly from weaker to stronger: informal argument, paper proof, model checking (exhaustive, but only for bounded configurations such as three servers and short logs), mechanized proof (checked by a machine, but only for the stated specification and assumptions). Raft's correctness section is instructive: a formal specification, a mechanically checked proof of one property that relies on invariants not themselves mechanically checked, and an informal proof of state machine safety. The seL4 project publishes the assumptions behind its kernel proofs, such as correct assembly code, hardware and boot; the guarantee is exactly as strong as that list.

Specification versus implementation. A proved algorithm does not make the code correct. Implementations add batching, snapshots, membership changes and optimizations, each of which can break an invariant. Testing, fuzzing, fault injection and checking recorded histories against a consistency model are evidence about the implementation: they can find violations but never prove their absence.

Assumptions can be empirical. Spanner's external consistency is guaranteed provided the uncertainty interval reported by TrueTime always contains true time. Keeping that bound small and correct is an engineering achievement supported by measurement. Name both layers when you discuss such systems: the conditional guarantee and the evidence that its condition holds.

Performance is rarely guaranteed. "Commit latency under 10 ms" in an evaluation means "observed under this workload and hardware". A worst-case bound needs analysis and assumptions; the largest observed value is only a sample statistic.

Common misconceptions

  • "The tests pass, so the protocol is correct." Tests sample executions; rare interleavings and failure combinations may never occur.
  • "The algorithm is proven, so the system is correct." The proof covers a model; the implementation and environment are separate claims.
  • "Model checking proves correctness." It explores bounded configurations exhaustively; larger configurations remain an extrapolation unless proven.
  • "Raft guarantees progress." It guarantees safety; progress needs its timing assumptions to hold.
  • "The measured worst case is a bound." It is the largest value you happened to observe.

How to approach it

Classify every claim in Raft's safety, timing and evaluation sections, then do the same for Spanner's external-consistency argument and its clock-uncertainty measurements. In interviews, answer "is X guaranteed?" with the model, the property and the evidence type. Graduates should separate safety from liveness; senior candidates should also discuss the specification-implementation gap and how they would test invariants.

Suggested order

  1. 1Read Raft Section 5.4.3 (Safety argument) and Section 5.6 (Timing and availability), then Section 9.2 (Correctness), noting exactly what is proved, by which method and under which assumptions.
  2. 2Do the "Claim-evidence table for the Raft paper" exercise if you have not, labelling each claim as guarantee, design argument or measurement.
  3. 3Read the seL4 "What the Proofs Assume" page and list which assumptions are backed only by testing or engineering practice.
  4. 4Read Spanner's TrueTime and concurrency-control discussion and separate the conditional guarantee (external consistency) from the measured clock uncertainty.
  5. 5Use the MIT 6.5840 schedule to read the lecture notes on linearizability and, where the current offering includes it, the lecture on verifying distributed systems.
  6. 6Write a one-page answer to "is X guaranteed?" for a system you know (for example a database isolation level), naming model, property and evidence type.

Step 2: Check off what you can do

Tap each one you can genuinely do or explain. Each earns 10 XP.

Step 3: Go deeper

  • In Search of an Understandable Consensus Algorithm (Extended Version)Start here

    raft.github.io

    Section: Sections 5.4.3 (Safety argument), 5.6 (Timing and availability) and 9.2 (Correctness)

    A timing-independent safety argument, timing-dependent availability and the evidence behind each, clearly separated.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • What the Proofs Assume (seL4 verification)Start here

    seL4 Foundation

    Concrete list of what machine-checked kernel proofs assume; a template for asking what any guarantee rests on.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Spanner: Google's Globally-Distributed Database

    Google Research

    A guarantee (external consistency) conditional on an engineered and measured assumption (bounded clock uncertainty).

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • MIT 6.5840 Distributed Systems

    MIT PDOS

    Section: Schedule with paper readings and lecture notes

    Lecture notes on linearizability and on verifying distributed systems, plus labs where passing tests are evidence, not proof.

    Open(opens in a new tab)Link responded, 5 Oct 2026

Step 4: Practice

Add a column to the Raft claim-evidence table for the system model each guarantee assumes. If you work through the 6.5840 Raft labs, write down the invariants your implementation must preserve before coding, and treat every passing test run as evidence rather than proof by noting which failure combinations it exercised.

Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).

Step 5: Test yourself

Answer each one out loud or on paper before you finish the lesson.

  1. Question 1Under which failure and timing model does the guarantee hold?
  2. Question 2Is the property safety or liveness, and how would a violation show up?
  3. Question 3Was the proof about the algorithm, a specification or the running code?
  4. Question 4Which assumption of the guarantee is maintained only by engineering and measurement?
  5. Question 5What would a test campaign need to exercise before you trusted an implementation more?

You’re done when you can

  • Classify every claim in Raft's safety, timing and evaluation sections by type and assumptions.
  • Explain in under two minutes why Raft guarantees safety but not progress in an asynchronous network.
  • List three assumptions behind a formally verified system and say how each is supported.
  • Explain what bounded model checking establishes and what it leaves open.

Finish the lesson

How confident do you feel?

Lesson complete!

+50 XP

Reviews will come up on the Practice tab so it sticks.

Unlocks next: Concurrency control research and isolation correctness, Invariants, safety, liveness and distributed correctness

Your notes and study time

Log study time