Repository navigation
Releases: crowecawcaw/snappea
Releases · crowecawcaw/snappea
Release list
Snap Pea v0.1.0
What's Changed in v0.1.0
Features
snappea checkmodel-checks P models by interpreting the sources directly, with no compile step and no .NET. It reads the.pprojin the current folder, a.pprojor.pfile given as an argument, or the local*.pfiles, and reports type errors in the same format asp compile. (#18)- The
snappeacommand line hascheck,replay,tests,observeandcoverage merge-observe. Test cases can be given as arguments or globs, and options include-n,-j,--timewith units (--time 5m),--strategyand--exhaustive. Exit status is 0 for no bug, 1 for a bug and 2 for an error. (#23) snappea checkprints one line per test case. When a test case finds a bug, it also prints the bug report and thesnappea replaycommand that reproduces it, then a summary with total time and peak memory. Upstream-style progress appears only with-v. Each test case's files go to<out>/<test>/with fixed names (bug.txt,bug.schedule,bug.trace.json,coverage.txt,summary.txt,scenario_coverage.json). (#78)snappea replayprints the reproduced bug and accepts--max-steps,--fair-max-stepsand--fail-on-max-steps, so bugs found with--fail-on-max-stepscan be replayed. (#78)snappea-compatis a drop-in replacement for upstream'sptool. It accepts the same options and writes the same console output, text, JSON and XML traces,.schedulefiles, activity coverage reports and output folders.p compileis accepted and does nothing, so existingp compile && p checkscripts still work. (#23, #18)- The checker supports the
random,pct,fairpct,probabilistic,pos,feedback,feedbackpct,feedbackposandrlscheduling strategies, plus exhaustive search (snappea check --exhaustive, or--mode pexinsnappea-compat), which skips states it has already visited and reports whether every behavior was explored. (#10) snappea checkruns schedules on several worker threads, one per core by default (-j). Combined with a faster interpreter, checking the Raft tutorial is about 2.5× faster on one worker and about 8× faster with the default workers.-j 1explores exactly the same schedules as upstream. (#21)- P models can use scenario (coverage) monitors, with
merge-scenario-coverageto combine their results, and foreign types and functions implemented in Rust. (c651c2a) - Latency budgets:
snappea check --latency FILE[:PROFILE]and--timedcheck models against message latencies. Specs checked withsnappea observecan callNow(),NowBest(),Mark(),Elapsed()andElapsedBest()to check latencies against log timestamps. (#26) snappea observechecks recorded event logs against P spec monitors, with no P model needed. Sources and logs are passed as arguments, globs are expanded, and the built-in parsers read JSON Lines and P traces. Custom parsers can be written in Rust.snappea-compat observeis a drop-in replacement for upstream PObserve and matches its console output, output files and exit codes. (#11, #58, #78)snappea observeoptions:--spec,--all-specsand--exclude-specsselect several specs in one run;--json-reportwrites a machine-readable result;--check-hotreports keys left in a hot state;--strictfails when a selected spec saw no relevant events; and--unknown-events ignore|warn|errorreports event names no P source declares, with a "did you mean" suggestion. (#25, #40, #56)snappea observe --coveragereports which monitor states, handlers and transitions the events exercised, as text and in the JSON report.snappea coverage merge-observemerges these reports across a test suite. (#34, #39, #55)snappea observecan check live inputs:--stdinand--live PATH(repeatable, including pipes and/dev/fd/N) stop at the first error without waiting for end of input.--sequence FIELDmerges several live inputs by a sequence number, and--record FILEsaves the checked lines. (#35, #58, #78)- Python helper (
pip install pysnappea,import snappea): code callsemit(...), and a pytest plugin checks each test's events against your P specs and fails the test if a spec is violated. It also providescheck_spec,expect_violation, events from threads and child processes, monitor coverage across the suite, and a production sink withset_sink. The wheel includes thesnappeabinary. (#25, #36, #60, #63) - Go helper (
go get github.com/crowecawcaw/snappea):snappeatestrecords events during tests and checks them on cleanup, with typed*SpecViolationand*SetupErrorerrors,ExpectViolationand suite coverage throughsnappeatest.Main.snappeaemitemits events and has a production sink. If thesnappeabinary isn't onPATH, the helper downloads the release binary and verifies its checksum. (#42, #61, #63, #66) - Java helper (
io.github.crowecawcaw:snappea) with no runtime dependencies: recordings, a JUnit 5 extension,expectViolation, structuredSpecViolationandSetupError, suite coverage, and a production sink throughSnappeaEmit. The native binary comes in anatives-<os>-<arch>jar. (#43, #59, #63, #67) - Rust crate
snappea:snappea::testchecks events recorded during tests, usingModel::load,expect_violation, structuredSpecViolationandSetupError, and suite coverage.snappea::emitsends events, including to a production sink withset_sink. For production, build withdefault-features = false, features = ["emit"]to leave out the checker. (#41, #62, #63, #68) - The browser playground edits, type-checks and model-checks P models with nothing sent to a server. It includes the upstream tutorials as demos and a step-through trace diagram linked to the log, and a machine filter shows only the steps of the machines you pick. (#4, #6, #51)
- Each GitHub release includes prebuilt
snappeabinaries for Linux (x86-64, ARM), macOS (Intel, Apple silicon) and Windows, with aSHA256SUMSfile.cargo install snappeainstalls bothsnappeaandsnappea-compat. (#69)