everystate 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -7
- package/native/darwin-arm64/everystate +0 -0
- package/native/darwin-x64/everystate +0 -0
- package/native/linux-arm64/everystate +0 -0
- package/native/linux-x64/everystate +0 -0
- package/native/win32-x64/everystate.exe +0 -0
- package/package.json +9 -8
- package/wasm/cli.mjs +2 -2
- package/wasm/everystate.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# everystate
|
|
2
2
|
|
|
3
|
-
A TLA+ model checker
|
|
4
|
-
|
|
3
|
+
A lightning-fast TLA+ model checker. It reads `.tla` specs and TLC `.cfg` files, checks every
|
|
4
|
+
reachable state, and reports results in TLC's format. No Java needed.
|
|
5
|
+
|
|
6
|
+
Find race conditions, deadlocks and lost updates in your design before they reach your code.
|
|
5
7
|
|
|
6
8
|
```text
|
|
7
9
|
> use everystate's formal verification skill to find race conditions in my amazing software
|
|
@@ -232,17 +234,44 @@ Real TLC is the reference (details in [CONFORMANCE.md](CONFORMANCE.md)):
|
|
|
232
234
|
|
|
233
235
|
- [tlaplus/Examples](https://github.com/tlaplus/Examples), models up to 5 s: 122 of 122 match on
|
|
234
236
|
result and exact state counts.
|
|
235
|
-
- TLC's own `test-model` suite, run side by side with `tla2tools.jar`:
|
|
237
|
+
- TLC's own `test-model` suite, run side by side with `tla2tools.jar`: 389 of 414 match.
|
|
236
238
|
- pstack `statechart` corpus: 33 of 33 outputs byte-identical.
|
|
237
239
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
+
## Speed
|
|
241
|
+
|
|
242
|
+
Wall-clock seconds for the whole process on a 4-core Linux machine, median of 3, against
|
|
243
|
+
[tlc-rs](https://github.com/polvi/tlc-rs) (a Rust port of TLC's safety checking),
|
|
244
|
+
[tla-ts](https://github.com/aidenybai/tla-ts) 0.0.10 (run by Node) and Java TLC. The first three
|
|
245
|
+
models are tla-ts's own benchmarks. A dash means the checker does not support the model or the worker
|
|
246
|
+
option. Every checker that completes a model reports the same state counts.
|
|
247
|
+
|
|
248
|
+
| Model | Distinct states | everystate | tlc-rs | tla-ts | TLC |
|
|
249
|
+
|---|---:|---:|---:|---:|---:|
|
|
250
|
+
| Commit | 282,251 | 4.14 | 13.44 | 6.76 | 7.20 |
|
|
251
|
+
| Philosophers | 128,889 | 0.83 | 3.64 | 2.12 | 2.33 |
|
|
252
|
+
| Queue | 44,044 | 0.08 | 0.27 | 0.55 | 0.94 |
|
|
253
|
+
| Paxos | 1,207 | 0.95 | - | 6.47 | 2.25 |
|
|
254
|
+
| MCBakery | 655,200 | 8.29 | - | 20.86 | 13.26 |
|
|
255
|
+
| MCLamportMutex | 724,274 | 13.78 | 41.26 | 27.80 | 17.31 |
|
|
256
|
+
| MCbtree | 374,727 | 12.47 | - | 17.95 | 34.86 |
|
|
257
|
+
| MCLamportMutex, 4 workers | 724,274 | 3.66 | - | 25.15 | 10.70 |
|
|
258
|
+
| MCbtree, 4 workers | 374,727 | 4.34 | - | 17.43 | 12.78 |
|
|
259
|
+
| 122 tlaplus/Examples models: total seconds | | 46.8 | - | 180.1 | 203.3 |
|
|
260
|
+
| 122 tlaplus/Examples models: correct | | 122 | 39 | 116 | 122 |
|
|
261
|
+
|
|
262
|
+
With one worker everystate is the fastest of the four on every model that runs long enough to measure:
|
|
263
|
+
3.0x to 11.4x faster than tlc-rs, 1.4x to 6.8x faster than tla-ts and 1.2x to 11.3x faster than TLC.
|
|
264
|
+
tlc-rs uses the least memory on the models it supports. All 15 models, four-worker results, memory and
|
|
265
|
+
the method are in [BENCHMARK.md](BENCHMARK.md).
|
|
240
266
|
|
|
241
267
|
## Not supported
|
|
242
268
|
|
|
243
269
|
Disk-backed state storage (everything is in memory, so a few
|
|
244
|
-
million distinct states is the practical limit), Java module overrides,
|
|
245
|
-
are parsed and skipped).
|
|
270
|
+
million distinct states is the practical limit), Java module overrides, and TLAPS proof checking (proofs
|
|
271
|
+
are parsed and skipped). Labels and subexpression selectors (`Op!lab(x)`, `Op!2`, `Op!<<`, `Op!@`, `Op!(x)`) work
|
|
272
|
+
except in a few rare forms, which are reported as errors: a selector applied to an operator defined in a LET or
|
|
273
|
+
in a standard module, the left operand of `a /\ b /\ c` written without parentheses, the argument tuple of
|
|
274
|
+
`f[a, b]`, and the body of a recursive function definition (`docs/TLC_NOTES.md`, section 12).
|
|
246
275
|
|
|
247
276
|
## Development
|
|
248
277
|
|
|
@@ -251,6 +280,8 @@ npm run build # native binary and wasm/everystate.wasm
|
|
|
251
280
|
npm test # WASM API, pretty-printer and community-module tests
|
|
252
281
|
```
|
|
253
282
|
|
|
283
|
+
How the code is organised, the rules that keep it sound and how to debug it: [ARCHITECTURE.md](ARCHITECTURE.md).
|
|
284
|
+
|
|
254
285
|
Releases use [changesets](.changeset/README.md): add one with `npx changeset` in your pull request,
|
|
255
286
|
then merge the "Version Packages" pull request that appears. That bumps `package.json` and
|
|
256
287
|
`Cargo.toml`, and `.github/workflows/release.yml` builds the binaries and publishes to npm and
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "everystate",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "A TLA+ model checker
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "A lightning-fast TLA+ model checker (TLC-compatible, no Java needed). Prebuilt native binaries, with a WebAssembly build for use from JavaScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "wasm/everystate.mjs",
|
|
@@ -29,13 +29,14 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"build": "cargo build --release && sh wasm/build.sh",
|
|
31
31
|
"test": "node --experimental-strip-types --no-warnings --test test/*.test.ts && node test/community.mjs && node test/workers.mjs",
|
|
32
|
-
"conformance:examples": "node scripts/conformance.mjs",
|
|
33
|
-
"conformance:tlc": "node scripts/diff-tlc.mjs",
|
|
34
|
-
"conformance:statechart": "node scripts/statechart-corpus.mjs",
|
|
35
|
-
"conformance:pcal": "node scripts/pcal-corpus.mjs",
|
|
36
|
-
"
|
|
32
|
+
"conformance:examples": "node scripts/gates/conformance.mjs",
|
|
33
|
+
"conformance:tlc": "node scripts/gates/diff-tlc.mjs",
|
|
34
|
+
"conformance:statechart": "node scripts/gates/statechart-corpus.mjs",
|
|
35
|
+
"conformance:pcal": "node scripts/gates/pcal-corpus.mjs",
|
|
36
|
+
"gates": "node scripts/gates.mjs",
|
|
37
|
+
"bench": "node scripts/bench/bench.mjs",
|
|
37
38
|
"changeset": "changeset",
|
|
38
|
-
"version": "changeset version && node scripts/sync-version.mjs"
|
|
39
|
+
"version": "changeset version && node scripts/release/sync-version.mjs"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=20"
|
package/wasm/cli.mjs
CHANGED
|
@@ -54,6 +54,6 @@ try {
|
|
|
54
54
|
const codes = { ok: 0, assumption: 10, deadlock: 11, invariant: 12, 'invariant-init': 12, 'action-property': 13, 'implied-init': 13, liveness: 13, incomplete: 75 };
|
|
55
55
|
process.exitCode = codes[result.status] ?? 255;
|
|
56
56
|
} catch (e) {
|
|
57
|
-
console.log(JSON.stringify({ status: 'setup-error', message: e.message }));
|
|
58
|
-
process.exit(150);
|
|
57
|
+
console.log(JSON.stringify({ status: 'setup-error', kind: e.kind, message: e.message }));
|
|
58
|
+
process.exit(e.kind === 'config' ? 151 : 150); // as the native binary: 151 for the configuration, 150 for the spec
|
|
59
59
|
}
|
package/wasm/everystate.wasm
CHANGED
|
Binary file
|