Formal Validation and Real-System Extension
The final stage turns implementation experience into defensible engineering. You will specify the invariant, search adversarial histories, modify one real boundary and preserve evidence about where the change loses.
Section 9 of 9 · 15 units · about 69 hours
By the end you can Deliver a bounded real-system contribution with an executable invariant or history checker, three ablations, three workload regions, one honest neutral or negative result, fault and rollback evidence, and independently reproducible claims labeled by evidence level.
Units
- Abstract state-machine specifications: variables, initial state and next-state relation4h
- Safety invariants, liveness properties and fairness assumptions4h
- Implementation versus specification refinement, nondeterminism and environment actions4h
- Finite model bounds, TLC checking, counterexample traces and a two-phase commit specification6h
- A replicated-log or workflow specification5h
- State-based and operation-based CRDT requirements and one CRDT implementation5h
- Property-based state-machine testing with crash and restart, and deterministic schedule replay4h
- Operation-history normalization and linearizability checker scope4h
- Jepsen generator, client, nemesis and checker roles and a fault and workload coverage matrix4h
- Real-system architecture reconstruction, path tracing and control-plane versus data-plane state5h
- Consistency, durability and delivery contract extraction and ML data-plane provenance closure4h
- Geo-replication assumptions, storage disaggregation and a geo-replication design comparison4h
- One bounded real-code contribution with a reference fallback and layered tests6h
- Three ablations, three workload regions and preserved negative results5h
- Raw histories, evidence labels, an independent reproduction package and a skeptical defense5h
Build it
Mini project · about 18 to 24 hours
Validate a bounded extension and defend its evidence
Use loglab to validate one bounded real-code extension, preserving the working data path as a reference fallback. Connect finite models, replayable failure histories and repeated measurements to a reproduction package that separates checked guarantees from assumptions and local evidence on your machine.
- 1Pin the real-system component you will extend and trace protocol, storage, replication, consistency, recovery, security and operations paths against code and documentation. Retain control-plane/data-plane state ownership, extracted contracts and ML provenance closure; contrast quorum and CRDT dissemination assumptions using the earlier convergence proof.
- 2Run TLC on the pinned TLA+ Examples TwoPhase specification, then model your
loglablog inspec/with explicit environment actions and a refinement mapping. Check committed-prefix safety and conditional liveness; retain bounds, boundary behavior, fairness assumptions, state counts and each extension's first meaningful counterexample. - 3Extend the deterministic scheduler in
net/andfaults/with explicit persistence completions and crash/restart state separation. Use Hypothesis stateful tests against an independent model; plant a recovery or ownership bug, retain its shrunk program and schedule, replay independently of random draws, and state uncontrolled nondeterminism. - 4Build generator, client, nemesis and checker roles around a fault/workload matrix in
history/. Validate normalization of pending, ambiguous and retried operations against fixed histories using Knossos register and Elle read-write-register checks; retain scoped verdicts, empty coverage cells and minimized safety and bounded non-progress histories. - 5Implement the proposed bounded component change through
loglab, retaining the reference fallback. Check unit, property, integration and fault layers independently against baseline contracts before timing; retain failing-then-passing regressions, old-data and mixed-version migration tests, rollback drills, and ambiguous-outcome reconciliation with preserved request identity. - 6Predeclare three mechanism-isolating ablations across three bottleneck-distinct workload regions in
bench/. After correctness gates pass, repeat matched baseline, extension and fallback runs with named versions and workloads; retain raw latency, goodput, resource, checkpoint and recovery records, uncertainty and an honest neutral or negative result. - 7Package raw message, state, WAL and processor histories, pinned environment manifest, seeds, schedules, configurations and per-claim commands in
reports/for independent reproduction. Label claims proved, model-checked within bounds, simulated, locally measured or inferred; quantitatively defend three architectures across workload, failure, consistency, cost and evolution.
What you hand in
- Architecture reconstruction, contracts, provenance closure, bounded log specifications and retained TLC counterexamples in
spec/andreports/. - The bounded real-code patch, reference fallback, migration and rollback evidence, layered tests and replayable minimized failures.
- Ablation records, workload-region comparisons and the preserved negative result with versions, raw measurements and uncertainty.
- An independently exercised reproduction package and evidence-labeled defense comparing simpler architectures and cross-region assumptions.
How to check it
- Self-grade with the rubric below
- TLA+ Examples: TwoPhase with TLC
Keep public-model results separate from your log model; neither a safety-only specification nor a finite run proves implementation liveness.
- Hypothesis stateful crash and restart tests
Retain the pinned testing version, planted-bug failure, shrunk program and reference-model assertions; generated executions do not exhaust all interleavings.
- Knossos single-register history checks
Calibrate on fixed histories and retain the dependency version; do not extend a register verdict to unmodeled objects or transactions.
- Elle read-write-register history checks
Use the section's model-specific API and pinned runtime; report supported anomalies, history completeness and indeterminate outcomes beside each verdict.
How it's graded
Model and code agreement
Pass: Your bounded TLC model checks committed-prefix safety with explicit environment and fairness assumptions. Reference-model property tests catch the planted recovery bug and replay its shrunk schedule.
Great: A trace-to-model mapping exposes a missing action or abstraction mismatch; the corrected model and code retain separate regression evidence without claiming a general proof.
History and fault coverage
Pass: Your normalizer preserves ambiguity and incarnations; Knossos and Elle agree with fixed-history oracles within their scopes. The campaign retains checker verdicts and minimized safety and conditional non-progress examples.
Great: A negative-control checker or normalization defect changes a verdict, and its regression identifies the observation lost rather than merely repairing event formatting.
Extension and safe fallback
Pass: Your code-and-documentation reconstruction identifies state and contracts. Independently failing test layers verify the bounded change, fallback, old data, mixed versions, migration, rollback and retry identity after ambiguity.
Great: Faults during fallback activation and rollback preserve ownership, effect and durability contracts; provenance identifies which derived artifacts require invalidation or rebuild.
Reproduction and design judgment
Pass: An independent reader reproduces exact checks from the package. Repeated matched comparisons retain three ablations, three regions, uncertainty and a negative result; three architectures receive quantitative, evidence-labeled comparisons.
Great: The defense separates measured behavior from inferred geo-replication and disaggregation costs, identifies unsupported claims, and uses the retained alternatives to justify removing an unhelpful mechanism.
Resources
- TLA+ Video CourseLeslie Lamport
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.
- Hypothesis - Stateful TestingHypothesis
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
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.
- Jepsen - Consistency Models and AnalysesJepsen
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.
- Elle: Inferring Isolation Anomalies from Experimental Observations (Kingsbury and Alvaro)arXiv
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.
- DDIA 2e - Chapters 9, 10 and 14 ReviewMartin Kleppmann and Chris Riccomini
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.
- TLA+ ExamplesTLA+ Foundation
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)
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)
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
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.
- How Amazon Web Services Uses Formal Methods (Newcombe et al., 2015)Amazon Science
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
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
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.
- Replicated Log and Stream Processor - Final CapstoneRoadmap-Final
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.
- CMU 15-721 - Selected Advanced Database Systems UnitsCarnegie Mellon Database Group
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.