AI NewsDev toolsAnnouncement

Warpspec runs TLA+ model checking on a GPU, 4,600 times faster than TLC

Praveen Perera compiled TLA+ specifications to GPU code. A PaxosCommit check that took TLC 4 hours and 40 minutes on 24 CPU cores finished in 3.65 seconds.

AI News

Editorial3 min read

LinkedInX
Table of warpspec GPU model-checking results versus TLC on three specs

Why it mattersFormal checks that were too slow to run in CI are now short enough to run on every commit. The work is Apache-2.0 on GitHub.

A formal check that took 4 hours and 40 minutes on 24 CPU cores now finishes in under four seconds. Praveen Perera published Warpspec on 1 December. It is a TLA+ model checker. It compiles a specification into Rust code. It then runs the search on an NVIDIA GPU. The post reached 95 points on Hacker News.

TLA+ is a language for writing out what a concurrent or distributed system is allowed to do. A model checker then explores every state the system can reach and reports any state that breaks the rules. The standard tool, TLC, has been the way most teams run those checks for 25 years. TLC is written in Java and runs on the CPU. It is the baseline Warpspec compares against.

The method and the numbers

Warpspec takes a TLA+ spec and compiles it into a fixed-size, bit-packed state representation. A state becomes an array of 64-bit integers, with no dynamic typing. The search then runs as a GPU kernel. The hash table uses atomic compare-and-swap for insertion, in a two-phase design: an enable bitmask comes first, then a shared emit path, which keeps the instruction cache happy.

Perera ran three benchmarks on an NVIDIA RTX 5090 with 32GB of VRAM. On PaxosCommit with three resource managers, TLC on 24 workers took 4 hours and 40 minutes. Warpspec on the GPU finished in 3.65 seconds, which Perera reports as a 4,600 times speed-up. On EWD998 with four nodes, TLC took 401.5 seconds and Warpspec took 0.121 seconds, a 3,318 times speed-up. On LamportMutex with four processes, TLC took 1,824 seconds and Warpspec took 0.473 seconds, a 3,856 times speed-up. Perera also ran the same specs on an NVIDIA L40S and on a 24-core CPU build. He reports those numbers separately in the post.

How to run it, and what is still missing

Warpspec is released under Apache 2.0 on GitHub. It needs the Rust 1.89 toolchain. The CPU-only mode runs on Linux and macOS without a GPU. Perera says Warpspec is still experimental and that not every TLA+ feature is supported yet. A team that already uses TLA+ can try an existing spec and see whether it compiles.

This is a bar-six story: a result with the method published beside it, in enough detail that another team can run the same check. The pieces are the Rust spec compiler, the bit-packed state layout, the two-phase hash table, and the three published runs. Each is in the post or in the repository.

What this changes for AI engineering

TLA+ has always been a tool for the hardest layer of a product. These are the parts where a wrong behaviour causes money to go missing or a transaction to be lost. The reason few teams use it is cost. A check that runs for half a day cannot sit in CI. The spec and the code drift apart. The check is the thing that gets dropped.

A GPU run that finishes in seconds changes that trade. A spec can live beside the code it covers. It can run on every pull request. It can fail the build on a new counterexample. For a team building an agent that writes code, that is a check an unattended system can still produce. The agent writes the TLA+ change with the code change, and the shorter check decides.

Source

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project