Skip to main content

solver-support

A generic, domain-agnostic pipeline for running constraint-modelling and planning solvers: Conjure / Savile Row (driving a SAT solver, Minion, OR-Tools CP-SAT, Gecode or Chuffed), Fast Downward, SymK, ENHSP, and UPF-constructed models. It handles the mechanics that every such run needs — building solver command lines from a model registry, spawning subprocesses with timeouts and clean teardown, naming the per-run files, parsing solver output into a uniform timing / cost-layer model, and driving the horizon (increasing-difficulty) loop.

It carries no notion of any particular problem domain or objective. A consumer supplies:

  • its own model registry (a models.yaml) via a config path — the loader is generic, the model content is the consumer's;
  • its scoring / objective strategy via injection — the core reports the raw objective a solver emits and lets the consumer interpret it (is-this-an- optimisation-model, how to read the objective, any reporting multiplier).

Status

Alpha. The pipeline is in day-to-day use by several consumers and is covered by its own test suite, but the API may still shift between 0.x releases. Each release's changes are listed on the releases page.

The package ships unwired, by design and on every release: a bare import solver_support gives a pipeline that resolves no model registry and interprets no objective, because it has no way to guess either. Constructing a ModelRegistry raises rather than falling back on a guess. A consumer registers its scoring, registry paths, warning logger and UPF CLI once, before first use — see Usage.

Installation

pip install solver-support

Requires Python 3.9 or newer (3.9.6 is the system Python on macOS, and is supported deliberately — each release is built and tested against it). The only runtime dependencies are psutil and PyYAML.

Usage

See docs/injection-api.md for the four injection points a consumer wires — model-registry paths, objective extraction, warning logger, UPF CLI — with a worked example.

Docs

  • injection-api.md — the four seams a consumer wires.
  • solver-runner.md — running a solver as a subprocess: SolverResult, timeout vs duration, phases.
  • timing-model.md — how solver timing is recorded, how the backends map onto one shape, and the invariants parsers rely on.

Development

To work on this package, clone and install it editable:

git clone https://github.com/ott2/solver-support
pip install -e solver-support

Consumers pin a released version from PyPI rather than the working tree, so a change here reaches them only when it is released. To try an unreleased change against a consumer, install this editable into that consumer's environment deliberately — it is not the default arrangement.

Tests

pytest tests/ — the core's own suite, and the home for solver-level development. It runs against solver_support alone: no consumer need be installed, and none is imported.

Since the core ships unwired, a test that needs a seam wired wires a stand-in (tests/conftest.py):

fixture supplies
fixture_registry a ModelRegistry over tests/fixtures/models.yaml, this suite's own synthetic config — never a consumer's
wired_stdout_score a consumer-style Score: N extractor, so a score reaches solver_stats
wired_timeout_score a consumer-style extractor for a salvaged timeout solution

Wiring a fixture config rather than mocking the registry keeps the real loader and accessors in the path. Anything a test needs from the registry goes in tests/fixtures/models.yaml, keeping its shape faithful to a real consumer config — that shape is the contract the loader implements.

Licence

BSD-3-Clause — see LICENSE.

By András Salamon, with Claude Opus 4.8 and 5.

Metadata

Release files for solver-support 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solver-support 0.3.2
File Size Uploaded
solver_support-0.3.2.tar.gz 130.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solver-support 0.3.2
File Interpreter ABI Platform
solver_support-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 212.3 kB

Release files / solver_support-0.3.2.tar.gz

Download URL solver_support-0.3.2.tar.gz
Size 130.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f5dcdbbb998f1368aadcfa6c8211bd56b203eae3d8a40fff5c1250991d3a7e02
BLAKE2b-256 checksum
How to use checksums
470392a08ac7a20c4f1faa20973afa80754ce1a735cf71176baa23189d802173
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / solver_support-0.3.2-py3-none-any.whl

Download URL solver_support-0.3.2-py3-none-any.whl
Size 81.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3b747ade3c88ee5fcbabd910c290720e9cb79ac9d5b1b5ef6d937adbb5d44e4
BLAKE2b-256 checksum
How to use checksums
53374b8e069f41bb710f38cff1feeddd6bdbc537f49344473c4fe342729853bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page