Repository navigation
Releases
v0.2.1
- The five platform binary npm packages moved to the
@warpspecscope:@warpspec/linux-x64-gnu,@warpspec/linux-arm64-gnu,@warpspec/darwin-arm64,@warpspec/darwin-x64and@warpspec/win32-x64-msvc. npm's spam check refused the unscoped Windows package name, so scoped names let Windows npm installs work.npx warpspecandnpm install -g warpspecare unchanged.
v0.2.0
Most checks no longer need a Rust toolchain. CPU checks compile the model in-process with Cranelift, NVIDIA GPU checks need only the driver, and Apple silicon Macs check on the GPU through Metal. This release also adds TLC's command line (warpspec tlc) and exit codes, a pure-Rust front end that matches SANY, and most of TLC's other search modes: simulation, depth-first iterative deepening, -continue, checkpoints, state-graph dumps and coverage. New prebuilt binaries cover Intel Macs and Windows x64.
Breaking changes
- Exit codes now follow TLC wherever TLC defines one. A PROPERTY that fails in an initial state or on a step (
[][A]_v) exits 13, as TLC files it with liveness; 0.1.0 exited 12. A spec SANY rejects, or a missing spec file, exits 150, and a cfg TLC rejects exits 151; both used to exit 1. The full table is under TLC compatibility below. - The default CPU backend is now the Cranelift JIT, not a runner compiled with rustc. Pass
--cpu-backend rustc(or setWARPSPEC_CPU_BACKEND=rustc) for the old path. - NVIDIA GPU checks no longer compile Rust kernels. warpspec writes the kernels as PTX itself and uses NVRTC only when needed (see below).
- Without
--slots, CPU runs size the fingerprint table themselves. The table starts at 2^20 slots (8 MiB), grows as it fills and spills to disk past a memory budget; 0.1.0 always reserved 2^27 slots (1 GiB).--slots Nstill fixes the size. --int-bitsaccepts only 1 to 32, matching TLC's 32-bit integers, and--slotsaccepts at most 2^32.- Counterexample steps are named by the bare operator, as TLC prints them (
RMPrepare, notRMPrepare(r1)).--jsonkeeps the full call in each step's newcallfield. - Inputs TLC rejects are now rejected too: cfg substitutions of a variable or of an undefined name, substitution chains and cycles, and INSTANCEs that leave a constant or variable unsubstituted or substitute one twice.
- Model libraries loaded with the runner's
gen-cpu-bfs --lib PATH(notwarpspec check --lib DIR, which adds a module search directory) use model ABI version 6. Versions 1 to 5 still load, but--dump-dotand--coverageneed version 3 or later. --jsonreports no longer carryunchecked_assumptions. An ASSUME the generator cannot evaluate now stops the check (exit 1) instead of passing with a warning.
Zero-toolchain execution and backends
warpspec checkcompiles a CPU check's model in-process with Cranelift, with no cargo, rustc or C compiler involved. A small spec's first check into an empty cache takes about 0.1 s (it took about 7 s with rustc), and a warm check of a small spec starts in about 10 ms. Search speed is within about 10% of a rustc build.- The JIT runs every CPU search mode and counterexample traces. It also runs the liveness pass (
PROPERTY,WF,SF,~>, initial-state and[][A]_vconjuncts), including under SYMMETRY, with the same verdicts, counts and lasso counterexamples as the rustc runner. --cpu-backend auto|jit|c|rustc(orWARPSPEC_CPU_BACKEND) picks the compiler.auto, the default, tries the JIT first. A model the JIT cannot compile goes to a C compiler if one is on the machine (optional;WARPSPEC_CC, thenclang,gcc,ccorzig cc), and otherwise to the rustc runner, with a note saying why. An explicitjitorcstops with the reason instead.- A few models still need the rustc runner. These are models with a VIEW, a state wider than 64 words, or liveness atoms the lowering cannot translate. With no cargo on
PATH, such a check stops and explains why it needs Rust. - A checkpoint saved under one CPU backend resumes under any other.
- When a check cannot use the GPU, stderr lists every reason with how to fix it, naming the variable, PROPERTY or flag and its location, and
--jsonreports them ingpu_ineligible. - If the spec, cfg, modules and flags are unchanged, a cached check skips the generator (
generate cachedin the summary,cache.inputs_hitin--json). - Killing
warpspecnow kills the runner, compiler and generator it started. On Linux this holds underkill -9too.
NVIDIA direct PTX and Apple silicon Metal
- NVIDIA: warpspec writes the model's CUDA kernels as PTX in pure Rust, and the NVIDIA driver compiles them, so a GPU check needs only the driver. This covers
sm_70and newer, including states wider than 64 bits and Windows. Against NVRTC-compiled kernels, the search ran 1.6 to 1.8 times faster on PaxosCommit and LamportMutex, and within 6% on EWD998. The LamportMutex and EWD998 runs predate the GPU's refusal of CONSTRAINT checks on pruned states, so--gpunow refuses those configs and the default backend checks them on the CPU.--compactand--spillrun on the GPU, and the PTX is cached per model. - NVRTC is needed only for
--simulate, GPUs older thansm_70, and models the PTX emitter refuses. If no toolkit, Python wheel or cached copy is found,warpspec install-nvrtc,--install-nvrtc,WARPSPEC_INSTALL_NVRTC=1or a yes at an interactive prompt downloads NVIDIA's redistributable NVRTC (13.5.37 or 12.9.86, whichever compiles for the GPU), checked against pinned SHA-256s. warpspec itself ships nothing of NVIDIA's.WARPSPEC_CUDA_BACKEND=ptxornvrtcforces one compiler. See Direct PTX and Finding and installing NVRTC. - Apple silicon: on macOS 15 or later,
--gpuand the default backend lower the model to Metal and search it in-process, with no Rust toolchain or Xcode. Metal checks safety and liveness (PROPERTY,WF/SF) and prints invariant, deadlock and lasso counterexamples from the GPU. It also runs--compact,--spilland--simulate, and the fingerprint table grows in place. See Metal and Metal liveness. --frontier Nsizes the GPU frontier buffers. A full buffer stops with a hint to raise it.- The default backend falls back to the CPU, and
--gpurefuses, for anything the GPU does not run. That includes liveness PROPERTIES on NVIDIA, a VIEW, CONSTRAINT checks on pruned states, TLC's runtime operators,--no-deadlock,--continue,--dfid,--checkpoint,--dump-dotand--coverage. On NVIDIA, counterexample traces are rebuilt on the CPU. See When a check cannot use the GPU.
TLC compatibility and warpspec tlc
-
warpspec tlc [-option] Spec[.tla]takes TLC's command line, so scripts written forjava tlc2.TLCcan run warpspec instead. It reads TLC's search, checkpoint and output options and prints TLC's messages in TLC's order, framed with TLC's message codes under-tool. Options that only tune TLC are accepted with a warning, and options whose output warpspec cannot produce are refused by name. -
warpspec checkandwarpspec tlcexit with TLC's codes:Outcome Exit No error 0 Paused by Ctrl-C or SIGTERM under --checkpoint3 An ASSUME that is false, not a Boolean, or raises an error 10 Deadlock 11 An invariant, or a []PPROPERTY, violated12 A temporal PROPERTY, or one that fails in an initial state or on a step ( [][A]_v), violated13 An error evaluating an action or computing a successor 75 An error evaluating an invariant 76 A spec SANY rejects, or a missing spec file 150 A cfg TLC rejects 151 Anything else that stops the check (usage, unsupported construct, capacity) 1 Four differences from TLC remain. A failed
Assertin an action exits 75 where TLC exits 14. An error evaluating Init exits 1 where TLC exits 75. An error evaluating a[][A]_vproperty exits 76 where TLC exits 14.--continueexits with its highest-ranked failure's code where TLC exits 0. See Exit codes and TLC's command line. -
TLC's
TLCGet("level"),TLCGet(i),TLCSet(i, v),PrintandPrintTrun during the CPU search, where TLC runs them. Printed lines appear before the result and in--json'sprints. A model that callsTLCSetsearches on one worker. Combinations whose effects TLC orders around a CONSTRAINT or ACTION_CONSTRAINT in a way warpspec cannot match are refused, naming the operator. See Runtime builtins. -
The Java-implemented operators of TLC and the CommunityModules are evaluated in ASSUMEs and constant definitions instead of being refused. This covers
ToString,SortSeq,IOEnv, the JSON and CSV operators and a seededRandomElement, among others. A call that depends on the state is refused, with its location. -
Counterexamples print through the cfg's
ALIAS, as in TLC, in text and--json. See ALIAS. -
False ASSUMEs are reported in TLC's words. ASSUMEs that fail an
Assert, raise an error or are not Boolean exit 10 instead of being left unchecked. -
Values are ordered as TLC orders them, so
CHOOSEand iteration order match TLC. Evaluation errors such as aCHOOSEwith no match, comparisons across incompatible kinds, an error computing a quantifier's domain, and errors insideENABLEDare raised where TLC raises them.
Language coverage and builtins
warpspec-syntaxis a pure-Rust TLA+ parser and semantic checker ported from SANY. It accepts and rejects what SANY does, including user-defined operators, indentation-sensitive/\and\/lists, proofs, unicode and modules ...
v0.1.0
- Add the
warpspeccommand:warpspec check Spec.tla [Spec.cfg]generates the model, compiles it into a cached runner (~/.cache/warpspec) and checks it on an NVIDIA GPU or every CPU core, printing a TLC-style summary (and shortest counterexample trace on safety/deadlock violations) or, with--json, one JSON object. Its exit codes are TLC's: 0 for no error, 12 for a violated invariant or safety/action property, 13 for a violated liveness property, 11 for deadlock, 10 for a false assumption, 76 for an error evaluating an invariant and 75 for one computing a successor, and 1 when the check couldn't run.warpspec genwrites only the generated Rust - Add shortest counterexample traces with decoded TLA+ states for invariant and deadlock violations (
--no-trace,--trace-limit N), in both TLC text output and--json - Add CPU liveness,
WF/SFfairness, and initial/actionPROPERTYchecking via generalized Büchi automata over the explored state graph (pass--skip-livenessfor safety only) - Bundle
CommunityModules,TLCExtandRandomizationintotla-gpu-gen, removing the need for--libon specs that extend them - Each GitHub release ships
warpspecandtla-gpu-genfor Linux x86_64 and arm64 (glibc 2.28 or newer) and Apple silicon, with SHA-256 checksums, aninstall.shthat installs them into~/.local/bin(curl -LSfs https://github.com/praveenperera/warpspec/releases/latest/download/install.sh | sh), andcargo binstallmetadata - Publish
warpspecto npm:npx warpspec check Spec.tlaornpm install -g warpspec. Thewarpspecpackage runs the binaries fromwarpspec-linux-x64-gnu,warpspec-linux-arm64-gnuorwarpspec-darwin-arm64, which each hold the release'swarpspecandtla-gpu-gen, and needs no install script - Add the
skills/warpspecagent skill for modelling a design in TLA+ and readingwarpspec check --json - Replace the 26 Python and shell maintenance scripts in
scripts/withcargo xtask(including sharded parallel PTX compilation for GPU corpus verification)