solverpilot 0.1__py3-none-any.whl
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.
- solverpilot/__init__.py +250 -0
- solverpilot/_immutability.py +27 -0
- solverpilot/_version.py +3 -0
- solverpilot/applications/__init__.py +3 -0
- solverpilot/applications/routing/__init__.py +19 -0
- solverpilot/applications/routing/compile_milp.py +321 -0
- solverpilot/applications/routing/diagnostics.py +78 -0
- solverpilot/applications/routing/errors.py +14 -0
- solverpilot/applications/routing/heuristics.py +167 -0
- solverpilot/applications/routing/model.py +259 -0
- solverpilot/applications/routing/reference.py +81 -0
- solverpilot/applications/routing/solution.py +89 -0
- solverpilot/applications/routing/timeline.py +79 -0
- solverpilot/applications/routing/validation.py +169 -0
- solverpilot/applications/tsp/__init__.py +41 -0
- solverpilot/applications/tsp/compile_cp.py +121 -0
- solverpilot/applications/tsp/compile_milp.py +139 -0
- solverpilot/applications/tsp/distance.py +60 -0
- solverpilot/applications/tsp/errors.py +17 -0
- solverpilot/applications/tsp/heuristics.py +112 -0
- solverpilot/applications/tsp/model.py +175 -0
- solverpilot/applications/tsp/reference.py +121 -0
- solverpilot/applications/tsp/solution.py +65 -0
- solverpilot/applications/tsp/validation.py +92 -0
- solverpilot/backends/__init__.py +51 -0
- solverpilot/backends/_casadi_highs_worker.py +92 -0
- solverpilot/backends/base.py +28 -0
- solverpilot/backends/bundled_capi.py +910 -0
- solverpilot/backends/casadi_conic.py +303 -0
- solverpilot/backends/health.py +240 -0
- solverpilot/backends/highspy_native.py +217 -0
- solverpilot/backends/nlopt_native.py +237 -0
- solverpilot/backends/osqp_native.py +297 -0
- solverpilot/backends/protocol_v2.py +119 -0
- solverpilot/backends/pyscipopt_native.py +200 -0
- solverpilot/backends/registry.py +38 -0
- solverpilot/backends/scipy_highs.py +138 -0
- solverpilot/backends/scipy_highs_lp.py +195 -0
- solverpilot/backends/scipy_slsqp_qp.py +133 -0
- solverpilot/backends/scipy_vendored_highs_dev.py +363 -0
- solverpilot/benchmark/__init__.py +23 -0
- solverpilot/benchmark/acquire.py +199 -0
- solverpilot/benchmark/baselines.py +70 -0
- solverpilot/benchmark/bundle.py +37 -0
- solverpilot/benchmark/campaign.py +150 -0
- solverpilot/benchmark/environment.py +115 -0
- solverpilot/benchmark/integrity.py +46 -0
- solverpilot/benchmark/model.py +146 -0
- solverpilot/benchmark/policy.py +182 -0
- solverpilot/benchmark/registry.py +38 -0
- solverpilot/benchmark/report.py +44 -0
- solverpilot/benchmark/runner.py +516 -0
- solverpilot/benchmark/slurm.py +55 -0
- solverpilot/benchmark/specs.py +75 -0
- solverpilot/benchmark/splits.py +181 -0
- solverpilot/benchmark/summary.py +384 -0
- solverpilot/benchmark/verify.py +142 -0
- solverpilot/benchmark/worker.py +71 -0
- solverpilot/bridges/__init__.py +19 -0
- solverpilot/bridges/engine.py +44 -0
- solverpilot/bridges/indicator.py +232 -0
- solverpilot/bridges/registry.py +78 -0
- solverpilot/bridges/transformation-tape.schema.json +53 -0
- solverpilot/bridges/types.py +149 -0
- solverpilot/bridges/validation.py +110 -0
- solverpilot/capabilities/__init__.py +32 -0
- solverpilot/capabilities/backend-capability-v2.schema.json +21 -0
- solverpilot/capabilities/conformance.py +151 -0
- solverpilot/capabilities/enums.py +27 -0
- solverpilot/capabilities/manifest.py +19 -0
- solverpilot/capabilities/ontology.py +73 -0
- solverpilot/capabilities/requirements.py +37 -0
- solverpilot/capabilities/resolve.py +30 -0
- solverpilot/capabilities/v2.py +711 -0
- solverpilot/cli/__init__.py +1 -0
- solverpilot/cli/backend_health.py +77 -0
- solverpilot/cli/benchmark.py +331 -0
- solverpilot/cli/benchmark_worker.py +33 -0
- solverpilot/cli/capabilities.py +65 -0
- solverpilot/conic/__init__.py +11 -0
- solverpilot/conic/backend.py +263 -0
- solverpilot/conic/compiler.py +310 -0
- solverpilot/conic/conformance.py +60 -0
- solverpilot/conic/conic-ir-v1.schema.json +24 -0
- solverpilot/conic/ir.py +299 -0
- solverpilot/conic/validation.py +149 -0
- solverpilot/cp/__init__.py +7 -0
- solverpilot/cp/conformance.py +32 -0
- solverpilot/cp/cp-ir-v1.schema.json +13 -0
- solverpilot/cp/ir.py +170 -0
- solverpilot/cp/model.py +143 -0
- solverpilot/cp/ortools_backend.py +423 -0
- solverpilot/cp/ortools_worker.py +75 -0
- solverpilot/cp/reference.py +51 -0
- solverpilot/cp/serialization.py +117 -0
- solverpilot/cp/validate.py +83 -0
- solverpilot/diagnose/__init__.py +33 -0
- solverpilot/diagnose/infeasibility.py +463 -0
- solverpilot/diagnose/model.py +87 -0
- solverpilot/evaluation/__init__.py +53 -0
- solverpilot/evaluation/metrics.py +150 -0
- solverpilot/evaluation/oracle.py +288 -0
- solverpilot/evaluation/proof.py +53 -0
- solverpilot/evaluation/references.py +73 -0
- solverpilot/evaluation/regret.py +281 -0
- solverpilot/exceptions.py +34 -0
- solverpilot/experimental/__init__.py +32 -0
- solverpilot/extensions/__init__.py +56 -0
- solverpilot/extensions/entrypoints.py +34 -0
- solverpilot/extensions/errors.py +35 -0
- solverpilot/extensions/manager.py +651 -0
- solverpilot/extensions/manifest.py +232 -0
- solverpilot/extensions/model.py +101 -0
- solverpilot/extensions/versioning.py +136 -0
- solverpilot/history/__init__.py +22 -0
- solverpilot/history/errors.py +15 -0
- solverpilot/history/model.py +129 -0
- solverpilot/history/sqlite.py +651 -0
- solverpilot/inspect/__init__.py +3 -0
- solverpilot/inspect/fingerprint.py +199 -0
- solverpilot/intelligence/__init__.py +36 -0
- solverpilot/intelligence/errors.py +16 -0
- solverpilot/intelligence/fingerprint.py +108 -0
- solverpilot/intelligence/leakage.py +69 -0
- solverpilot/intelligence/schema.py +314 -0
- solverpilot/intelligence/shift.py +208 -0
- solverpilot/io/__init__.py +41 -0
- solverpilot/io/binary64.py +49 -0
- solverpilot/io/csv.py +230 -0
- solverpilot/io/errors.py +25 -0
- solverpilot/io/hashing.py +111 -0
- solverpilot/io/json.py +90 -0
- solverpilot/io/mapping.py +195 -0
- solverpilot/io/model.py +407 -0
- solverpilot/io/numeric.py +108 -0
- solverpilot/io/provenance.py +114 -0
- solverpilot/io/result.py +45 -0
- solverpilot/io/source.py +104 -0
- solverpilot/io/strict_json.py +133 -0
- solverpilot/minlp/__init__.py +6 -0
- solverpilot/minlp/compiler.py +66 -0
- solverpilot/minlp/conformance.py +34 -0
- solverpilot/minlp/convexity.py +85 -0
- solverpilot/minlp/ir.py +35 -0
- solverpilot/minlp/minlp-ir-v1.schema.json +1 -0
- solverpilot/minlp/orchestrator.py +220 -0
- solverpilot/minlp/validation.py +28 -0
- solverpilot/model/__init__.py +27 -0
- solverpilot/model/compiler.py +1263 -0
- solverpilot/model/errors.py +22 -0
- solverpilot/model/expression.py +373 -0
- solverpilot/model/model.py +716 -0
- solverpilot/model/sets.py +60 -0
- solverpilot/model/types.py +36 -0
- solverpilot/nlp/__init__.py +7 -0
- solverpilot/nlp/ad.py +166 -0
- solverpilot/nlp/backend.py +113 -0
- solverpilot/nlp/compiler.py +116 -0
- solverpilot/nlp/conformance.py +58 -0
- solverpilot/nlp/ir.py +70 -0
- solverpilot/nlp/nlp-ir-v1.schema.json +1 -0
- solverpilot/nlp/validation.py +60 -0
- solverpilot/plan/__init__.py +33 -0
- solverpilot/plan/model.py +79 -0
- solverpilot/plan/planner.py +201 -0
- solverpilot/plan/production.py +627 -0
- solverpilot/plan/selective_lp.py +65 -0
- solverpilot/problem/__init__.py +16 -0
- solverpilot/problem/enums.py +20 -0
- solverpilot/problem/hashing.py +88 -0
- solverpilot/problem/linear.py +196 -0
- solverpilot/problem/mps.py +447 -0
- solverpilot/problem/quadratic.py +192 -0
- solverpilot/reporting/__init__.py +27 -0
- solverpilot/reporting/explain.py +327 -0
- solverpilot/reporting/model.py +264 -0
- solverpilot/reporting/render.py +55 -0
- solverpilot/runtime/__init__.py +19 -0
- solverpilot/runtime/auto.py +193 -0
- solverpilot/runtime/budgeting.py +43 -0
- solverpilot/runtime/executor.py +126 -0
- solverpilot/runtime/portfolio.py +197 -0
- solverpilot/runtime/result.py +72 -0
- solverpilot/session/__init__.py +29 -0
- solverpilot/session/conformance_v2.py +239 -0
- solverpilot/session/mutations.py +115 -0
- solverpilot/session/persistent-session-trace.schema.json +45 -0
- solverpilot/session/persistent.py +491 -0
- solverpilot/session/reuse.py +81 -0
- solverpilot/session/session.py +236 -0
- solverpilot/trace/__init__.py +3 -0
- solverpilot/trace/schema.py +47 -0
- solverpilot/validate/__init__.py +10 -0
- solverpilot/validate/core.py +179 -0
- solverpilot/validate/result.py +55 -0
- solverpilot-0.1.dist-info/METADATA +554 -0
- solverpilot-0.1.dist-info/RECORD +201 -0
- solverpilot-0.1.dist-info/WHEEL +5 -0
- solverpilot-0.1.dist-info/entry_points.txt +4 -0
- solverpilot-0.1.dist-info/licenses/LICENSE +202 -0
- solverpilot-0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: solverpilot
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: Trust-aware optimization runtime for mathematical and constraint programming in Python
|
|
5
|
+
Author: Amirhossein Heidari Rashtabad
|
|
6
|
+
Maintainer: Amirhossein Heidari Rashtabad
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: Repository, https://github.com/Amirhosseinheidari/SolverPilot
|
|
9
|
+
Project-URL: Issues, https://github.com/Amirhosseinheidari/SolverPilot/issues
|
|
10
|
+
Keywords: optimization,linear-programming,mixed-integer-programming,quadratic-programming,conic-optimization,nonlinear-programming,minlp,constraint-programming,cp-sat,solver,reoptimization
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
20
|
+
Requires-Python: <3.15,>=3.12
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy<3,>=2.2
|
|
24
|
+
Requires-Dist: scipy<2,>=1.15
|
|
25
|
+
Provides-Extra: quality
|
|
26
|
+
Requires-Dist: pytest-cov<8,>=7; extra == "quality"
|
|
27
|
+
Requires-Dist: ruff<1,>=0.12; extra == "quality"
|
|
28
|
+
Requires-Dist: mypy<2,>=1.17; extra == "quality"
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
31
|
+
Requires-Dist: pyyaml>=6; extra == "test"
|
|
32
|
+
Requires-Dist: jsonschema>=4; extra == "test"
|
|
33
|
+
Provides-Extra: ci
|
|
34
|
+
Requires-Dist: pytest>=8; extra == "ci"
|
|
35
|
+
Requires-Dist: pyyaml>=6; extra == "ci"
|
|
36
|
+
Requires-Dist: jsonschema>=4; extra == "ci"
|
|
37
|
+
Requires-Dist: highspy<2,>=1.15.1; extra == "ci"
|
|
38
|
+
Requires-Dist: osqp<2,>=1.1.3; extra == "ci"
|
|
39
|
+
Provides-Extra: release
|
|
40
|
+
Requires-Dist: build<2,>=1.6; extra == "release"
|
|
41
|
+
Requires-Dist: twine<8,>=7; extra == "release"
|
|
42
|
+
Requires-Dist: packaging<27,>=26; extra == "release"
|
|
43
|
+
Requires-Dist: pip-audit==2.10.1; extra == "release"
|
|
44
|
+
Provides-Extra: highs
|
|
45
|
+
Requires-Dist: highspy<2,>=1.15.1; extra == "highs"
|
|
46
|
+
Provides-Extra: osqp
|
|
47
|
+
Requires-Dist: osqp<2,>=1.1.3; extra == "osqp"
|
|
48
|
+
Provides-Extra: scip
|
|
49
|
+
Requires-Dist: pyscipopt<7,>=6.2.1; extra == "scip"
|
|
50
|
+
Provides-Extra: benchmark
|
|
51
|
+
Requires-Dist: benchopt<2,>=1.9.1; extra == "benchmark"
|
|
52
|
+
Requires-Dist: scikit-learn<2,>=1.5; extra == "benchmark"
|
|
53
|
+
Provides-Extra: open-source
|
|
54
|
+
Requires-Dist: highspy<2,>=1.15.1; extra == "open-source"
|
|
55
|
+
Requires-Dist: osqp<2,>=1.1.3; extra == "open-source"
|
|
56
|
+
Requires-Dist: pyscipopt<7,>=6.2.1; extra == "open-source"
|
|
57
|
+
Requires-Dist: nlopt<3,>=2.11; extra == "open-source"
|
|
58
|
+
Provides-Extra: native
|
|
59
|
+
Requires-Dist: highspy<2,>=1.15.1; extra == "native"
|
|
60
|
+
Requires-Dist: osqp<2,>=1.1.3; extra == "native"
|
|
61
|
+
Requires-Dist: pyscipopt<7,>=6.2.1; extra == "native"
|
|
62
|
+
Requires-Dist: nlopt<3,>=2.11; extra == "native"
|
|
63
|
+
Provides-Extra: nlopt
|
|
64
|
+
Requires-Dist: nlopt<3,>=2.11; extra == "nlopt"
|
|
65
|
+
Provides-Extra: casadi
|
|
66
|
+
Requires-Dist: casadi==3.7.2; extra == "casadi"
|
|
67
|
+
Provides-Extra: conic
|
|
68
|
+
Requires-Dist: casadi==3.7.2; extra == "conic"
|
|
69
|
+
Provides-Extra: nlp
|
|
70
|
+
Requires-Dist: casadi==3.7.2; extra == "nlp"
|
|
71
|
+
Provides-Extra: minlp
|
|
72
|
+
Requires-Dist: casadi==3.7.2; extra == "minlp"
|
|
73
|
+
Provides-Extra: cp
|
|
74
|
+
Requires-Dist: ortools==9.15.6755; extra == "cp"
|
|
75
|
+
Dynamic: license-file
|
|
76
|
+
|
|
77
|
+
# SolverPilot
|
|
78
|
+
|
|
79
|
+
> **Current version:** `0.1`. This release promotes the published `0.1.0rc2` code with no algorithm or API changes. Performance improvements are deferred to a future version. Every publication still requires exact-artifact qualification.
|
|
80
|
+
|
|
81
|
+
SolverPilot is a **trust-aware optimization runtime and modeling layer for Python**. It combines a small matrix-first solve API for LP/MILP/convex QP with a higher-level semantic modeling system that can compile into conic, smooth nonlinear, certified convex binary MINLP, and constraint-programming execution paths.
|
|
82
|
+
|
|
83
|
+
The project is deliberately conservative about claims: candidate solutions are independently validated where possible, backend capabilities are version/evidence aware, and local or backend-reported success is not silently promoted to a stronger proof category.
|
|
84
|
+
|
|
85
|
+
## What SolverPilot provides
|
|
86
|
+
|
|
87
|
+
SolverPilot has two complementary layers.
|
|
88
|
+
|
|
89
|
+
### Core runtime
|
|
90
|
+
|
|
91
|
+
- canonical `LinearProblem` / `QuadraticProblem` representations;
|
|
92
|
+
- LP, MILP, and continuous convex-QP execution;
|
|
93
|
+
- explicit or capability-aware backend routing;
|
|
94
|
+
- independent candidate validation and objective recomputation;
|
|
95
|
+
- infeasibility diagnostics;
|
|
96
|
+
- portfolio/fallback execution;
|
|
97
|
+
- repeated-solve `Session` support;
|
|
98
|
+
- auditable production-routing decisions with learned LP performance routing disabled.
|
|
99
|
+
|
|
100
|
+
### Extended modeling platform — Track P P0–P9
|
|
101
|
+
|
|
102
|
+
- semantic `Model`, `Variable`, `Parameter`, and expression DAG;
|
|
103
|
+
- parameter-aware compile cache and partial recompilation;
|
|
104
|
+
- backend Capability Protocol 2.0 with version-bound evidence;
|
|
105
|
+
- exact/restricted bridge and reformulation infrastructure with transformation tapes;
|
|
106
|
+
- `PersistentSession` with fail-closed native-patch vs rebuild decisions;
|
|
107
|
+
- SOC/RSOC/PSD conic representation and validation;
|
|
108
|
+
- smooth continuous NLP + automatic differentiation through the pinned CasADi verification path;
|
|
109
|
+
- proof-aware **certified convex binary MINLP** orchestration;
|
|
110
|
+
- integer/Boolean/interval constraint programming with an exhaustive reference backend and optional OR-Tools CP-SAT.
|
|
111
|
+
|
|
112
|
+
The extended APIs are canonically imported from submodules such as `solverpilot.model`, `solverpilot.conic`, `solverpilot.nlp`, `solverpilot.minlp`, and `solverpilot.cp`. The M30-frozen top-level `solverpilot.__all__` surface remains unchanged in this merge candidate.
|
|
113
|
+
|
|
114
|
+
### Verified trust, evaluation, extension, and application layers
|
|
115
|
+
|
|
116
|
+
The `0.1` release keeps the S2–S10 additive layers and adds correctness/trust hardening discovered during adversarial review of `0.1.0rc1`. The historical `0.0.40rc2` artifacts remain separate provenance and are not overwritten.
|
|
117
|
+
|
|
118
|
+
- `solverpilot.io`: strict local JSON/CSV ingestion, bounded reads, explicit mapping, content hashes, and source provenance;
|
|
119
|
+
- `solverpilot.evaluation`: direct-run oracle construction and decomposed quality/runtime/failure regret;
|
|
120
|
+
- `solverpilot.intelligence`: versioned pre-solve feature schema, leakage audit, and simple train-only OOD/shift diagnostics;
|
|
121
|
+
- `solverpilot.reporting`: claim-safe structured explanations for core `SolveResult`;
|
|
122
|
+
- `solverpilot.extensions`: explicit trusted-code extension staging without creating a second backend/bridge registry;
|
|
123
|
+
- `solverpilot.applications.tsp`: exact small-instance references, conservative heuristics, independent validation, MILP and restricted CP compilation;
|
|
124
|
+
- `solverpilot.applications.routing`: CVRP/VRPTW model, validation, timelines, diagnostics, exact small-instance reference, MILP, and conservative heuristics;
|
|
125
|
+
- `solverpilot.history`: explicit opt-in local SQLite history that excludes raw solution vectors and raw problem arrays by design.
|
|
126
|
+
|
|
127
|
+
These APIs remain submodule-scoped and do not change the frozen 78-symbol top-level API.
|
|
128
|
+
|
|
129
|
+
## Supported problem families and guarantee boundary
|
|
130
|
+
|
|
131
|
+
| Family | Current support | Guarantee boundary |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| LP | ✅ solve | validated candidate + backend termination semantics |
|
|
134
|
+
| MILP | ✅ solve | validated candidate/integrality + backend termination semantics |
|
|
135
|
+
| Continuous convex QP | ✅ solve | validated candidate; bridge-specific optimality claims stay conservative |
|
|
136
|
+
| Semantic LP/MILP/QP modeling | ✅ | compiles to canonical core IR |
|
|
137
|
+
| Indicator constraints | ✅ restricted exact bridges | fixed-state simplification or finite-bound-certified Big-M; otherwise fail-closed |
|
|
138
|
+
| SOC | ✅ representation/validation; verified restricted solve path | linear-objective supported verification path only |
|
|
139
|
+
| RSOC | ✅ representation/validation; verified restricted solve path | exact map to SOC in verified path |
|
|
140
|
+
| PSD | ✅ representation/validation | generic PSD solving is not authorized by current conformance evidence |
|
|
141
|
+
| Smooth continuous NLP | ✅ optional | local-optimal candidate only after validation/KKT checks; **no global NLP proof** |
|
|
142
|
+
| Convex binary MINLP | ✅ restricted | `globally_proven` is solver-certified inside the certified P8 binary/convex scope; `independently_verified_global` remains false until the full proof chain is independently reconstructed |
|
|
143
|
+
| General integer/nonconvex MINLP | ❌ | fail-closed |
|
|
144
|
+
| Constraint programming | ✅ reference solver | exhaustive proof only within reference state budget |
|
|
145
|
+
| OR-Tools CP-SAT | ✅ optional | exact verified integration target: OR-Tools `9.15.6755` |
|
|
146
|
+
| TSP application | ✅ reference / MILP / restricted CP / heuristics | independent route validation; only exhaustive reference paths issue an independent optimality proof |
|
|
147
|
+
| CVRP / VRPTW application | ✅ reference / MILP / heuristics | independent route/timeline validation; exponential reference solver is for small instances only |
|
|
148
|
+
|
|
149
|
+
## Important current limitations
|
|
150
|
+
|
|
151
|
+
- The learned production solver selector remains disabled; OOD diagnostics are **not** calibrated model-confidence probabilities.
|
|
152
|
+
- The S4 feature schema currently targets canonical LP/MILP/convex-QP fingerprints; conic/NLP/MINLP/CP/TSP/VRP do not yet share that learned-selector feature contract.
|
|
153
|
+
- `solverpilot.reporting.explain_result` and the automatic history adapters are centered on core `SolveResult` / `LinearProblem` / `QuadraticProblem`; application-specific TSP/VRP results have their own validators rather than a unified report/history adapter today.
|
|
154
|
+
- Extension activation is transactional under the manager's documented ownership assumptions, but caller-owned `BackendRegistry` / `BridgeRegistry` objects must not be mutated concurrently outside the manager during activation.
|
|
155
|
+
- Local-file symlink/path checks are fail-closed for static paths, but they are not a sandbox against a hostile process racing filesystem entries between validation and open.
|
|
156
|
+
- `HistoryStore` is a local plaintext SQLite store. It is opt-in and minimizes persisted solver/problem payloads, but it is not encrypted and caller-supplied metadata can still contain sensitive information.
|
|
157
|
+
- TSP/VRP exact reference algorithms are exponential and intentionally state-budgeted; the routing layer does not yet claim pickup-and-delivery, split delivery, stochastic travel time, live traffic, or real-time redispatch support.
|
|
158
|
+
- The local salvage qualification environment did not contain the exact release build pins or OR-Tools runtime; those remain external release gates rather than locally claimed passes.
|
|
159
|
+
|
|
160
|
+
## Requirements
|
|
161
|
+
|
|
162
|
+
Base runtime:
|
|
163
|
+
|
|
164
|
+
- Python **3.12, 3.13, or 3.14**
|
|
165
|
+
- NumPy `>=2.2,<3`
|
|
166
|
+
- SciPy `>=1.15,<2`
|
|
167
|
+
|
|
168
|
+
Optional integrations are installed separately. OR-Tools 9.15 provides Python 3.12–3.14 wheels upstream; SolverPilot still requires its own cross-platform qualification before public support is promoted.
|
|
169
|
+
|
|
170
|
+
## Installation
|
|
171
|
+
|
|
172
|
+
### From PyPI
|
|
173
|
+
|
|
174
|
+
After the first public release:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
python -m pip install solverpilot
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### From the repository before PyPI publication
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
git clone <REPOSITORY_URL>
|
|
184
|
+
cd solverpilot
|
|
185
|
+
python -m pip install .
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
For development:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
python -m pip install ".[test]"
|
|
192
|
+
python -m pytest
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Quick Start — LP
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import numpy as np
|
|
199
|
+
from solverpilot import LinearProblem, solve
|
|
200
|
+
|
|
201
|
+
problem = LinearProblem.from_data(
|
|
202
|
+
A=[[1.0, 1.0]],
|
|
203
|
+
c=[1.0, 2.0],
|
|
204
|
+
variable_lower=[0.0, 0.0],
|
|
205
|
+
variable_upper=[1.0, 1.0],
|
|
206
|
+
constraint_lower=[1.0],
|
|
207
|
+
constraint_upper=[np.inf],
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
result = solve(problem)
|
|
211
|
+
|
|
212
|
+
print(result.status.value) # valid_optimal
|
|
213
|
+
print(result.objective) # 1.0
|
|
214
|
+
print(result.x) # approximately [1.0, 0.0]
|
|
215
|
+
print(result.validation.valid) # True
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Full example: [`examples/01_lp_basic.py`](examples/01_lp_basic.py)
|
|
219
|
+
|
|
220
|
+
## Core examples
|
|
221
|
+
|
|
222
|
+
### Linear Programming (LP)
|
|
223
|
+
|
|
224
|
+
Use `LinearProblem` for continuous linear models. Lower/upper row arrays represent
|
|
225
|
+
`constraint_lower <= A @ x <= constraint_upper`.
|
|
226
|
+
|
|
227
|
+
Full example: [`examples/01_lp_basic.py`](examples/01_lp_basic.py)
|
|
228
|
+
|
|
229
|
+
### Mixed-Integer Linear Programming (MILP)
|
|
230
|
+
|
|
231
|
+
Integer structure is declared through `VariableDomain`.
|
|
232
|
+
|
|
233
|
+
Full example: [`examples/02_milp_binary.py`](examples/02_milp_binary.py)
|
|
234
|
+
|
|
235
|
+
### Continuous convex QP
|
|
236
|
+
|
|
237
|
+
`QuadraticProblem` uses:
|
|
238
|
+
|
|
239
|
+
```text
|
|
240
|
+
0.5 * x.T @ P @ x + q.T @ x + objective_offset
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Full example: [`examples/03_qp_convex.py`](examples/03_qp_convex.py)
|
|
244
|
+
|
|
245
|
+
## Semantic modeling
|
|
246
|
+
|
|
247
|
+
The extended modeling layer builds a symbolic model and compiles it into the appropriate execution IR.
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from solverpilot.model import Model
|
|
251
|
+
|
|
252
|
+
m = Model("semantic-lp")
|
|
253
|
+
x = m.variable(2, lower=0.0, upper=5.0, name="x")
|
|
254
|
+
m.add(x[0] + x[1] >= 1.0)
|
|
255
|
+
m.minimize(2.0 * x[0] + x[1])
|
|
256
|
+
|
|
257
|
+
compiled = m.compile()
|
|
258
|
+
result = compiled.solve()
|
|
259
|
+
|
|
260
|
+
print(type(compiled.execution_ir).__name__) # LinearProblem
|
|
261
|
+
print(result.status.value)
|
|
262
|
+
print(result.objective)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Parameters preserve semantic structure while allowing data changes and compiler-cache reuse:
|
|
266
|
+
|
|
267
|
+
```python
|
|
268
|
+
cost = m.parameter(2, value=[2.0, 1.0], name="cost")
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
See [`examples/08_semantic_model.py`](examples/08_semantic_model.py) and the [Extended Modeling API](docs/api/EXTENDED-MODELING-API.md).
|
|
272
|
+
|
|
273
|
+
## Conic modeling
|
|
274
|
+
|
|
275
|
+
The semantic layer supports SOC, RSOC, and PSD representation/validation.
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
from solverpilot.model import Model
|
|
279
|
+
from solverpilot.conic import ConicProblem
|
|
280
|
+
|
|
281
|
+
m = Model("soc")
|
|
282
|
+
x = m.variable(2)
|
|
283
|
+
t = m.variable(lower=0.0)
|
|
284
|
+
m.soc(t, x)
|
|
285
|
+
m.minimize(t)
|
|
286
|
+
|
|
287
|
+
compiled = m.compile(use_cache=False)
|
|
288
|
+
assert isinstance(compiled.execution_ir, ConicProblem)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Representation support is intentionally broader than verified solver support. PSD and generic quadratic-conic solving are **not** automatically authorized by the current backend conformance evidence.
|
|
292
|
+
|
|
293
|
+
See [`examples/09_conic_model.py`](examples/09_conic_model.py).
|
|
294
|
+
|
|
295
|
+
## Smooth nonlinear programming (NLP)
|
|
296
|
+
|
|
297
|
+
Install the pinned verification dependency:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
python -m pip install "solverpilot[nlp]"
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Example:
|
|
304
|
+
|
|
305
|
+
```python
|
|
306
|
+
from solverpilot.model import Model
|
|
307
|
+
|
|
308
|
+
m = Model("nlp")
|
|
309
|
+
x = m.variable(lower=-4.0, upper=4.0)
|
|
310
|
+
m.minimize((x - 1.25) ** 4 + 0.2 * (x - 1.25) ** 2)
|
|
311
|
+
result = m.solve(x0=[0.0])
|
|
312
|
+
|
|
313
|
+
print(result.validation.valid)
|
|
314
|
+
print(result.local_optimal_candidate)
|
|
315
|
+
print(result.globally_proven) # False for generic NLP
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
SolverPilot does **not** claim global optimality for generic NLPs. The optional CasADi/Ipopt path promotes a candidate only after independent primal/objective validation and recomputed KKT stationarity checks.
|
|
319
|
+
|
|
320
|
+
See [`examples/10_nlp_optional.py`](examples/10_nlp_optional.py).
|
|
321
|
+
|
|
322
|
+
## Certified convex binary MINLP
|
|
323
|
+
|
|
324
|
+
Install the NLP verification dependency:
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
python -m pip install "solverpilot[minlp]"
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
The current MINLP layer is intentionally narrow: binary discrete variables + certified convex supported nonlinear structure. It provides exact binary enumeration and an Outer Approximation orchestrator.
|
|
331
|
+
|
|
332
|
+
```python
|
|
333
|
+
from solverpilot.model import Model
|
|
334
|
+
|
|
335
|
+
m = Model("binary-minlp")
|
|
336
|
+
x = m.variable(lower=0.0, upper=3.0)
|
|
337
|
+
z = m.binary()
|
|
338
|
+
m.minimize((x - 2.0) ** 2 + 0.2 * (1 - z))
|
|
339
|
+
|
|
340
|
+
result = m.compile().solve()
|
|
341
|
+
print(result.algorithm)
|
|
342
|
+
print(result.globally_proven)
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
`globally_proven=True` is emitted only when the certified scope, original-space validation, and bound-closure conditions all pass. In `0.1` this is a **solver-certified proof under the compiler's convexity assumptions**, not an independently reconstructed end-to-end proof; inspect `result.proof_scope` and `result.independently_verified_global`. General integer, nonconvex, nonlinear-equality, and indicator+MINLP compositions remain fail-closed.
|
|
346
|
+
|
|
347
|
+
See [`examples/11_minlp_optional.py`](examples/11_minlp_optional.py).
|
|
348
|
+
|
|
349
|
+
## Constraint programming (CP)
|
|
350
|
+
|
|
351
|
+
The CP layer is separate from the LP/MILP runtime; CP semantics are not silently converted to MILP.
|
|
352
|
+
|
|
353
|
+
A dependency-free exhaustive reference backend is included for small models:
|
|
354
|
+
|
|
355
|
+
```python
|
|
356
|
+
from solverpilot.cp import CPModel
|
|
357
|
+
|
|
358
|
+
m = CPModel("tiny-cp")
|
|
359
|
+
x = m.int_var(0, 2, "x")
|
|
360
|
+
y = m.int_var(0, 2, "y")
|
|
361
|
+
m.add_all_different([x, y])
|
|
362
|
+
m.minimize(x + y)
|
|
363
|
+
|
|
364
|
+
result = m.solve()
|
|
365
|
+
print(result.objective)
|
|
366
|
+
print(result.validation.valid)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
See [`examples/12_cp_reference.py`](examples/12_cp_reference.py).
|
|
370
|
+
|
|
371
|
+
For CP-SAT:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
python -m pip install "solverpilot[cp]"
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
The integration is locked to **OR-Tools 9.15.6755** in this release candidate. The native CP-SAT solve runs in an **isolated subprocess** so an earlier SciPy/HiGHS solve cannot poison OR-Tools with a conflicting HiGHS shared-library ABI. SolverPilot transfers only canonical JSON CP IR/results across that boundary and independently revalidates the assignment/objective in the parent process. Supported CP families include integer/Boolean variables, interval variables, linear constraints, `AllDifferent`, `ExactlyOne`, allowed `Table`, `Element`, `Circuit`, `NoOverlap`, `Cumulative`, and integer min/max objectives.
|
|
378
|
+
|
|
379
|
+
See [`examples/13_cp_sat_optional.py`](examples/13_cp_sat_optional.py).
|
|
380
|
+
|
|
381
|
+
## Choosing a backend
|
|
382
|
+
|
|
383
|
+
For the matrix-first runtime, omit `backend` for deterministic capability-aware routing:
|
|
384
|
+
|
|
385
|
+
```python
|
|
386
|
+
result = solve(problem)
|
|
387
|
+
print(result.trace.backend)
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
Or request a backend explicitly:
|
|
391
|
+
|
|
392
|
+
```python
|
|
393
|
+
result = solve(problem, backend="scipy-highs-ipm")
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
The Capability Protocol 2.0 extended layer is available under `solverpilot.capabilities` and can represent version-bound support, restrictions, verification evidence, incremental-update channels, starts, callbacks, and result artifacts without upgrading legacy declarations to verified claims.
|
|
397
|
+
|
|
398
|
+
CLI:
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
solverpilot-backend-health
|
|
402
|
+
solverpilot-capabilities --verify
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Full example: [`examples/04_choose_backend.py`](examples/04_choose_backend.py)
|
|
406
|
+
|
|
407
|
+
## Understanding `SolveResult`
|
|
408
|
+
|
|
409
|
+
The matrix-first `solve()` API returns `SolveResult`.
|
|
410
|
+
|
|
411
|
+
| Field | Meaning |
|
|
412
|
+
| --- | --- |
|
|
413
|
+
| `result.status` | SolverPilot public status (`PublicStatus`) |
|
|
414
|
+
| `result.objective` | accepted/recomputed candidate objective where applicable |
|
|
415
|
+
| `result.x` | candidate vector, or `None` without a candidate |
|
|
416
|
+
| `result.validation` | independent candidate validation report |
|
|
417
|
+
| `result.diagnostics` | optional infeasibility diagnostics |
|
|
418
|
+
| `result.backend_status` | raw backend termination text |
|
|
419
|
+
| `result.trace` | executed backend and phase timings |
|
|
420
|
+
| `result.plan` | planner decision for automatic routing |
|
|
421
|
+
|
|
422
|
+
Candidate-bearing success statuses are exposed only after validation. `INFEASIBLE`, `UNBOUNDED`, and `INFEASIBLE_OR_UNBOUNDED` normally reflect backend termination unless separate certificate/diagnostic evidence is explicitly recorded.
|
|
423
|
+
|
|
424
|
+
See [`examples/06_validation_diagnostics.py`](examples/06_validation_diagnostics.py).
|
|
425
|
+
|
|
426
|
+
## Infeasible problems and diagnostics
|
|
427
|
+
|
|
428
|
+
Diagnostics are opt-in:
|
|
429
|
+
|
|
430
|
+
```python
|
|
431
|
+
result = solve(problem, diagnose_infeasible=True)
|
|
432
|
+
print(result.status.value)
|
|
433
|
+
print(result.diagnostics)
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
See [`examples/05_infeasible.py`](examples/05_infeasible.py).
|
|
437
|
+
|
|
438
|
+
## Repeated solves and persistence
|
|
439
|
+
|
|
440
|
+
### Lightweight `Session`
|
|
441
|
+
|
|
442
|
+
`Session` tracks problem revisions and reports reuse conservatively.
|
|
443
|
+
|
|
444
|
+
See [`examples/07_reoptimization_session.py`](examples/07_reoptimization_session.py).
|
|
445
|
+
|
|
446
|
+
### Track P `PersistentSession`
|
|
447
|
+
|
|
448
|
+
`solverpilot.session.PersistentSession` binds a semantic `Model` to one backend lifecycle. Each update is routed through one of:
|
|
449
|
+
|
|
450
|
+
- `cold_build`
|
|
451
|
+
- `native_patch`
|
|
452
|
+
- `safe_rebuild`
|
|
453
|
+
- `full_rebuild`
|
|
454
|
+
- `no_mutation_reuse`
|
|
455
|
+
|
|
456
|
+
A native patch is selected only when the exact granular capability and persistent-lifecycle evidence are verified. Reuse is **not** treated as a universal performance win.
|
|
457
|
+
|
|
458
|
+
## Optional solver dependencies
|
|
459
|
+
|
|
460
|
+
| Extra | Install | Purpose |
|
|
461
|
+
| --- | --- | --- |
|
|
462
|
+
| HiGHS | `python -m pip install "solverpilot[highs]"` | public `highspy` native adapter |
|
|
463
|
+
| OSQP | `python -m pip install "solverpilot[osqp]"` | public OSQP Python adapter |
|
|
464
|
+
| SCIP | `python -m pip install "solverpilot[scip]"` | PySCIPOpt adapter |
|
|
465
|
+
| NLopt | `python -m pip install "solverpilot[nlopt]"` | NLopt SLSQP integration |
|
|
466
|
+
| CasADi | `python -m pip install "solverpilot[casadi]"` | pinned CasADi 3.7.2 verification bridge |
|
|
467
|
+
| Conic | `python -m pip install "solverpilot[conic]"` | CasADi-based conic verification path |
|
|
468
|
+
| NLP | `python -m pip install "solverpilot[nlp]"` | CasADi 3.7.2 + Ipopt path |
|
|
469
|
+
| MINLP | `python -m pip install "solverpilot[minlp]"` | dependencies for certified binary MINLP orchestration |
|
|
470
|
+
| CP | `python -m pip install "solverpilot[cp]"` | OR-Tools CP-SAT 9.15.6755 |
|
|
471
|
+
| Native bundle | `python -m pip install "solverpilot[native]"` | HiGHS + OSQP + PySCIPOpt + NLopt |
|
|
472
|
+
| Open-source bundle | `python -m pip install "solverpilot[open-source]"` | same open-source native solver set as the current bundle |
|
|
473
|
+
| Benchmarking | `python -m pip install "solverpilot[benchmark]"` | benchmark/research tooling |
|
|
474
|
+
|
|
475
|
+
An upstream package being installable is not by itself SolverPilot integration evidence. Release qualification remains platform/version specific.
|
|
476
|
+
|
|
477
|
+
## What is not supported or not claimed yet
|
|
478
|
+
|
|
479
|
+
- learned LP performance routing in production;
|
|
480
|
+
- nonconvex continuous QP in the matrix-first QP path;
|
|
481
|
+
- mixed-integer `QuadraticProblem` / general MIQP as a stable matrix-first path;
|
|
482
|
+
- exponential/power/generalized-power cone families;
|
|
483
|
+
- generic verified PSD solving;
|
|
484
|
+
- global optimality for generic NLP;
|
|
485
|
+
- nonsmooth generic NLP atoms such as arbitrary `abs/max/min`;
|
|
486
|
+
- general-integer or nonconvex/global MINLP;
|
|
487
|
+
- nonlinear equalities/two-sided nonlinear constraints in the current MINLP proof path;
|
|
488
|
+
- indicator+MINLP bridge composition;
|
|
489
|
+
- automatic guarantee that repeated solves use native warm starts/factorization reuse;
|
|
490
|
+
- automatic independent certificates for every infeasible/unbounded backend termination;
|
|
491
|
+
- a per-call validation-tolerance argument on high-level `solve()` / `solve_production()`.
|
|
492
|
+
|
|
493
|
+
See [Known Limitations](KNOWN-LIMITATIONS.md).
|
|
494
|
+
|
|
495
|
+
## Examples
|
|
496
|
+
|
|
497
|
+
Core/runtime:
|
|
498
|
+
|
|
499
|
+
1. [`01_lp_basic.py`](examples/01_lp_basic.py) — LP
|
|
500
|
+
2. [`02_milp_binary.py`](examples/02_milp_binary.py) — binary MILP
|
|
501
|
+
3. [`03_qp_convex.py`](examples/03_qp_convex.py) — convex QP
|
|
502
|
+
4. [`04_choose_backend.py`](examples/04_choose_backend.py) — backend selection
|
|
503
|
+
5. [`05_infeasible.py`](examples/05_infeasible.py) — diagnostics
|
|
504
|
+
6. [`06_validation_diagnostics.py`](examples/06_validation_diagnostics.py) — result validation
|
|
505
|
+
7. [`07_reoptimization_session.py`](examples/07_reoptimization_session.py) — repeated solves
|
|
506
|
+
|
|
507
|
+
Extended modeling:
|
|
508
|
+
|
|
509
|
+
8. [`08_semantic_model.py`](examples/08_semantic_model.py) — semantic model/compiler
|
|
510
|
+
9. [`09_conic_model.py`](examples/09_conic_model.py) — SOC representation
|
|
511
|
+
10. [`10_nlp_optional.py`](examples/10_nlp_optional.py) — optional smooth NLP
|
|
512
|
+
11. [`11_minlp_optional.py`](examples/11_minlp_optional.py) — optional certified binary MINLP
|
|
513
|
+
12. [`12_cp_reference.py`](examples/12_cp_reference.py) — dependency-free CP reference backend
|
|
514
|
+
13. [`13_cp_sat_optional.py`](examples/13_cp_sat_optional.py) — optional OR-Tools CP-SAT
|
|
515
|
+
14. [`14_persistent_session_optional.py`](examples/14_persistent_session_optional.py) — persistent semantic-model session
|
|
516
|
+
|
|
517
|
+
See [`examples/README.md`](examples/README.md).
|
|
518
|
+
|
|
519
|
+
## API Reference
|
|
520
|
+
|
|
521
|
+
- [Stable top-level Public API](docs/api/PUBLIC-API-v1.md)
|
|
522
|
+
- [Extended Modeling API](docs/api/EXTENDED-MODELING-API.md)
|
|
523
|
+
- [Current frozen top-level API snapshot](PUBLIC-API-V0_1_0RC2.json)
|
|
524
|
+
- [Current core backend contract](BACKEND-CONTRACT-V0_1_0RC2.json)
|
|
525
|
+
- [Track P merge provenance](TRACK-P-MERGE-PROVENANCE.json)
|
|
526
|
+
|
|
527
|
+
## Trust and provenance
|
|
528
|
+
|
|
529
|
+
The original frozen Track P P0–P9 bundle was verified before forward-porting:
|
|
530
|
+
|
|
531
|
+
- source bundle SHA-256: `6cc282b9428450ab7bbc39cd6c768de2da2fc092f8d7f79cbbf319f657df24a2`
|
|
532
|
+
- internal checksum rows: `816`
|
|
533
|
+
- checksum mismatches: `0`
|
|
534
|
+
- original Track P final version: `0.0.40`
|
|
535
|
+
- OR-Tools qualification target: `9.15.6755`
|
|
536
|
+
|
|
537
|
+
Frozen historical Track P documents remain under [`docs/history/track-p-p0-p9-frozen/`](docs/history/track-p-p0-p9-frozen/). They intentionally retain the old OptiMind naming as provenance; the current public brand and namespace are SolverPilot / `solverpilot`.
|
|
538
|
+
|
|
539
|
+
## Production routing
|
|
540
|
+
|
|
541
|
+
`solve_production()` remains conservative. The historical learned LP selector remains disabled; merging Track P does not authorize a new empirical performance-ranking claim.
|
|
542
|
+
|
|
543
|
+
## Development, security, and release status
|
|
544
|
+
|
|
545
|
+
- [Contributing](CONTRIBUTING.md)
|
|
546
|
+
- [Security policy](SECURITY.md)
|
|
547
|
+
- [Release process](RELEASING.md)
|
|
548
|
+
- [Known limitations](KNOWN-LIMITATIONS.md)
|
|
549
|
+
|
|
550
|
+
Normal CI targets Python 3.12–3.14. The exact-artifact cross-platform release qualification workflow remains the authority for public release support.
|
|
551
|
+
|
|
552
|
+
## License
|
|
553
|
+
|
|
554
|
+
SolverPilot is licensed under the [Apache License 2.0](LICENSE). Apache-2.0 permits commercial and closed-source use subject to its terms. It does not grant trademark rights.
|