mattzcarey/everystate
Developer ToolsA Rust TLA+ model checker that runs .tla specs and TLC .cfg files without Java, for engineers verifying distributed designs.
What it does
everystate is a TLA+ model checker written in Rust that runs without a Java dependency. It reads ordinary .tla modules and TLC-style .cfg files, enumerates reachable states, and reports results, exit codes, and traces in the format TLC users already expect.
It targets engineers who use TLA+ to check concurrency and distributed protocols but want a single native binary instead of tla2tools.jar. Beyond plain safety checks it supports liveness, fairness, symmetry, VIEW, and ALIAS, plus random simulation (-simulate) for models too large to enumerate, trace conformance against a running system's log (everystate conform), and parallel search with -workers.
A PlusCal translator (everystate pcal) aims to reproduce the Java pcal.trans output byte for byte, and the standard and community modules are built in. The same engine is also compiled to WebAssembly and exposed through the npm package.
Quick start
Install one of the supported ways:
npm install -g everystate # prebuilt binary for Linux, macOS and Windows
brew install mattzcarey/tap/everystate
cargo install everystate # or build from source
Then write a spec and a config. The README's counter example declaress Init, Next, and Spec, and checks two invariants (TypeOK, NeverFour) with deadlock checking off:
---- MODULE Counter ----
EXTENDS Naturals
VARIABLE n
Init == n = 0
Next == n < 5 /\ n' = n + 1
Spec == Init /\ [][Next]_n
TypeOK == n \in 0..5
NeverFour == n /= 4
====
SPECIFICATION Spec
INVARIANT TypeOK
INVARIANT NeverFour
CHECK_DEADLOCK FALSE
Run the checker with the module path; the config defaults to Counter.cfg:
everystate examples/Counter.tla
The run should find the NeverFour violation and print the TLC-style counterexample trace, exiting with status 12. Add -json to get a single machine-readable result object instead. A fuller example, including a race-condition check of a load/save store, is in examples/Store.tla.
Checking code against the spec
Model checking proves properties of the model, not of your implementation. everystate conform takes a JSONL log of the running system (each line a step with an optional action and the variables the code knows) and reports the first step the spec does not allow:
everystate conform -trace run.jsonl Charge.tla
Exit status 0 means the trace conforms; 20 means it does not; 21 is a malformed trace and 22 is a limit being reached. Details on hidden and stuttering steps are in the formal-verification skill.
Limits and compatibility
The engine keeps all state in memory, so a few million distinct states is the practical ceiling; disk-backed storage is not supported. Java module overrides, labels, and subexpression selectors are unsupported, and TLAPS proofs are parsed but skipped.
Parallel search (-workers N) is native-only; liveness checking, simulation, and conform run on a single thread, and the WebAssembly build is single-threaded. Operators whose results depend on exploration order (such as Print, TLCSet/TLCGet, and RandomElement) cause the run to fall back to sequential search when they recur.
The WASM build is roughly 2x slower than native and cannot use the file-based community operators. The README documents a few deliberate divergences from TLC: deadlocks are reported only for states with no successor, and a PROPERTY given as a state predicate is checked on initial states. Same-seed simulation does not reproduce Java TLC runs.
How it is validated
The project treats real TLC as the reference. Per the README's conformance notes, it matches TLC on result and exact state counts for 122 of 122 models from tlaplus/Examples up to 5 s, 384 of 414 of TLC's own test-model suite, and 33 of 33 pstack statechart outputs byte-identically. On the 12 benchmark models it claims 1.1x–4.6x speedups over single-worker Java TLC (thin on three of them). These are the author's measurements, not independently reproduced here; the benchmark notes and conformance details describe the setup.
Agent skill
The repo ships a formal-verification skill that guides a coding agent through choosing a property, modeling the steps, running the check, and reporting the counterexample in terms of the code. Copy the folder into an agent's skills directory (for example .claude/skills/).
HotRepo's take
This is an early-stage project: it entered the new-project board on 2026-11-18, showing 10 stars gained over the roughly hour-long measured window at 112 stars and 6 forks. There is no daily all-language ranking recorded yet, so the numbers support noting initial attention, not a trend. The interesting technical fact for readers is the conformance work against TLC rather than the star count: a Rust reimplementation that matches state counts on a published model corpus and reproduces PlusCal output byte for byte is a concrete claim readers can check against the conformance notes.
Written by AI from the project's README, updated . The project's own docs are the source of truth.