Skip to content

Parity games: PGSolver format, Python bindings, Oink differential tests - #153

Merged
leonbohn merged 3 commits into
mainfrom
game-python-oink
Nov 9, 2026
Merged

leonbohn merged 3 commits into
mainfrom
game-python-oink

Conversation

@leonbohn

@leonbohn leonbohn commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Follow-up to #152.

  • ParityGame::from_pgsolver / to_pgsolver (PGSolver format), GameError::PgSolver.
  • Python: MaxEvenParityGame, MinEvenParityGame, MaxOddParityGame, MinOddParityGame (add_vertex, add_edge, solve, from_pgsolver, to_pgsolver) and GameError.
  • Differential tests against Oink (tests/oink.rs, 200 random games per parity condition; skipped without oink). The oink package of nixpkgs is an unrelated DDNS client, so nix/oink.nix builds the solver; it is part of the dev shell.
  • Benchmark game (gungraun, added to the default benchmarks of tools/bench).
  • CI: new job running the Oink tests via nix develop (fails if oink is missing); the Nix jobs (nix flake check, Spot tests) use DeterminateSystems/magic-nix-cache-action. Other jobs are unchanged.

Not run locally: the MSRV check (1.88) and the workflows themselves; the first CI run will show whether the cache action needs different permissions.

ParityGame::from_pgsolver/to_pgsolver read and write the PGSolver format.
tests/oink.rs checks the solver against Oink on random games for all four
parity conditions; nix/oink.nix packages Oink (the nixpkgs package of that
name is unrelated) and the dev shell provides it. benches/game.rs benchmarks
the solver.
MaxEven-, MinEven-, MaxOdd- and MinOddParityGame with add_vertex, add_edge,
solve and the PGSolver format, and the exception GameError.
@leonbohn leonbohn added performance Runtime or memory performance and removed performance Runtime or memory performance labels Nov 9, 2026
@leonbohn
leonbohn merged commit e8e0504 into main Nov 9, 2026
15 checks passed
@leonbohn
leonbohn deleted the game-python-oink branch November 9, 2026 18:09
leonbohn added a commit that referenced this pull request Nov 9, 2026
Part of #143 (WP9), builds on #153.

- `benches/versus/`: Python harness (`compare.py`,
`@operation`/`Case`/`Contender`) with operations `dpa/equivalence`,
`dpa/inclusion` (vs Spot, fixtures) and `game/solve` (vs Spot, Oink
`zlk` and `ppp`; random and ladder games). Median wall-clock per side,
inputs never timed, each comparison records whether both sides computed
the same result. README explains how to add operations (e.g.
determinization).
- `tools/bench`: after the other targets the engine builds the wheel
(`maturin`), runs the script and stores the rows (tables `versus`,
`versus_settings`). New dashboard page `/versus` (latest `main`, ratio
history per operation) and a section in the run view. Informational
only; failing/missing tools skip it. Flags `--versus-script`,
`--no-versus`.
- Nix: `package.nix` wraps `maturin`, `python3`, Oink and Spot; module
option `versusScript`; default `benches` now include `nondeterministic`
and `game` (they were never run by the service, the list replaces the
CLI default).
- `python/tests/test_spot_games.py`: 100 random games against
`spot.solve_parity_game`. CI: smoke run of the script in the Spot job.

Checked locally: `cargo test/clippy` in `tools/bench`, `nix flake check
--no-build`, an end-to-end `automata-bench run` (wheel build + script),
pytest for the new test. Not run: `./scripts/check` (library untouched),
the workflows, the real service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant