Changelog
All notable changes to SQP-craft are documented here. Versions are the workspace version in Cargo.toml (Rust crates, Python package sqp-craft and the job worker share it). Dates are those of the commits that set each version.
[Unreleased]
Changed
- The optimization-jobs pin moves from
2bfa8e4toded566f(optimization-jobs main after #50) inCargo.tomlandCargo.lock; only the optimization-jobs entries change. Between the two revisions only the guide behindget_guidechanged: it names fcmaes-core 0.5, lp-ip-craft 0.33 and sqp-craft 0.21. The job crates are still 0.5.0, and the envelope, worker protocol and result contract are unchanged.ai-context.mdanddocs/job-api/models.mdname the new revision. - The structured-tutorials workflow installs lp-ip-craft 0.33.0 (was 0.29.0)
for the DC model of X2. X2’s recorded summaries take the new label of that
backend (0.33.0) and the three effective options LP-IP-craft added since
0.29.0 (
adaptive_root,integer_equality_presolve,diagnostics.unweighted_node_retries); every other recorded value is unchanged and fresh runs match them in both presets.
[0.21.0] - 2026-11-27
Added
- Optional tiled inverse-factor kernel for dense active-set QPs of size
80–256, selectable in Rust (
ActiveSetQp::with_tiled_inverse) and Python (tiled_dense_inverse). Results are bit-identical; the factor takes half the time at 80 variables and 17% less at 256. - Optional local initial scaling for partitioned BFGS
(
partitioned_initial_scaling, also insqp.solve/1, wheretruerequireshessian: "partitioned"), bounded element-based row and variable scaling (scaling="elements"), and scalar shift bracketing for small exact Hessians (exact_shift_bracketing). All default to off. See structured SQP and the review: the local scaling halves the steps of the low-thrust transfer problem, and bracketing verified 182 instead of 168 of 240 further S2MPJ problems with exact Hessians. - Benchmark arms
clarabel+exact+bracketandactive-set+tiled. - POUNCE curvature pilot: an optional 20-problem comparison in the S2MPJ harness with independent KKT and objective checks, callback counts, and analytic release regressions. Its records and generated tables are committed and replay without either optimizer (#60).
- EPIGRIDS study: the 250-bus New England
MATPOWER cases as a checked DC dispatch (LP-IP-craft against HiGHS) and a
sparse AC regression with an independent PYPOWER reference and frozen
acceptance gates. With partitioned curvature, an initial Hessian scale of
0.01, the augmented-Lagrangian merit and a QP tolerance of 1e-12, 5 of 14
AC runs are accepted (0 of 14 before the Clarabel recovery below). The
compact results and
verify.py, which rechecks them without an optimizer, are in the repository. - Fan QP study: direct CSR assembly and transport for the published four-branch spring–mass fixture. Clarabel and the pinned FanCyQPALM reference passed independent original-coordinate checks. The study records the first exact-Hessian SQP step, symbolic fill and sparse storage counts. The exported fixture, the reference solution and the records are committed, and CI replays the comparison from them (#61).
Changed
-
Exact SQP regularizes a rejected zero Hessian with the configured initial curvature scale when the step objective has a nonzero gradient. This prevents the tiny numerical shift from generating the first CATENARY step.
-
The S2MPJ verifier uses the original model Jacobian and checks both bound multiplier arrays when a solver supplies them. The curvature report can replay saved points and distinguishes actual evaluations from distinct points.
-
The S2MPJ verifier takes a zero multiplier of a fixed variable from stationarity before it judges a solver’s own certificate, because a solver that removes fixed variables reports none. This changes which certificate is credited (
solverinstead ofleast-squares); a point needs a valid certificate as before. -
Clarabel uses an
AlmostSolvedresult when it passes the same independent check as aSolvedone, and checks the step clipped onto its variable bounds as SQP uses it. -
record_qp_limitkeeps the most recent step QPs instead of the first ones, so a trace shows the QP that stopped a solve. -
qp_retry_reasonjoins all recovery reasons of a call with;, including an accepted polish;qp_cold_retriesalso counts Clarabel’s unequilibrated retry. -
optimization-jobs pin
2bfa8e4(the merge of the optimization-jobs 0.5.0 release; was41d5f00, main after 0.4.1; the job crates are 0.5.0). It adds an optional progress file to command jobs (jobs progress), which experiment-craft uses to prune adaptive trials, and guide entries, among them the releases of 20 November 2026 (fcmaes 2.2.0, fcmaes-rust 0.4.0); the job envelope, the worker protocol and the result contract are unchanged.
Fixed
- Clarabel step QPs that its equilibrated stopping test accepted but the
independent original-coordinate check rejected ended the solve with
qp_failure; on the EPIGRIDS power-flow cases this happened in the first steps. A rejected cold solve is now recovered within the call’s iteration and time budget, by a bounded sparse active-set polish of the candidate and, if needed, an unequilibrated retry at tighter internal accuracy. Every recovered step must pass the unchanged independent check. Two captured 250-bus step QPs are regression tests (details). - The documentation of
RunReport::qp_tracesaid the QPs were in original coordinates; with scaling they are scaled.
[0.20.0] - 2026-11-16
Fixed
- Solver-internal non-finite arithmetic (merit, complementarity, violation,
curvature) ends a solve with
numerical_failure, naming the quantity and the iteration, and returns the last complete point. Before, it raised an exception: 20 runs on six CUTEst problems did, HS25NE under the default configuration. Model callback errors, including non-finite callback values, stay errors, and a model undefined at the user’s own start still raises. - A model undefined at the start projected onto the declared linear rows
returns
numerical_failurewithout a candidate instead of raising. - A malformed or non-finite answer of a QP backend returns
qp_failure, also in the projection, restoration and second-order-correction QPs. The active-set backend reports such an answer as a backend failure, not as an input error. - The active-set Householder reflector divides tails whose squared norm would
underflow or overflow by their largest entry first. HS25NE’s first QP (row
normals of order 1e-290) now ends
Infeasibleinstead of a NaN step; the ordinary path’s arithmetic is unchanged.
Changed
- New Rust error variant
Error::Numerical(the enum is#[non_exhaustive]) for arithmetic overflow in solver arithmetic and independent checks. Python maps it toRuntimeError, so an overflowingkkt_residualsraisesRuntimeErrorinstead ofEvaluationError.
Added
- Experimental, off by default:
major_step_limit(a relative infinity-norm limit on each line search’s first trial length) andinitial_curvature_scaling(Shanno–Phua rescaling of fresh BFGS curvature after a limited step), in Rust, Python andsqp.solve/1, whose resolved payload freezes both values. Reports addstep_limited_iterationsandinitial_curvature_scale; the recorded tutorial summaries (SQP1–SQP6, X2) gain these two fields and are otherwise unchanged. On the 1,036-problem benchmark the proposed setting (limit 2 with scaling) accepted 824 problems against 814, but lost one net bound-constrained problem, so the predeclared gates keep it off. - First-step evidence: the benchmark, callback, panel, stress and tutorial records behind that decision, the exception panel before and after, and the rejected first-pass guards.
[0.19.0] - 2026-11-16
Changed
- Python
SqpOptions.qp_solvernow defaults to"auto": full/block BFGS selects active-set with elastic steps; partitioned/exact curvature selects Clarabel without elastic steps.elastic_mode=Nonefollows this policy; explicit booleans override it. Explicit backend choices keep their previous nonelastic default and are never silently replaced. Dense size limits and all numerical tolerances are unchanged.SqpOptions(qp_solver="clarabel", elastic_mode=False)reproduces the 0.18.0 default. sqp.solve/1acceptsbackend: "auto"(the field remains required). Validation freezes the selected backend and elastic boolean in the resolved job; generated examples use automatic selection. Existing explicit jobs retain their behavior. Python reports expose resolvedqp_solverandelastic_mode, even when no QP ran; the recorded tutorial summaries (SQP1–SQP6, X2) gain these two fields and are otherwise unchanged.- Named benchmark variants explicitly pin their backends and elastic settings;
a separate
autovariant exercises the public default. Native RustNativeSqp<B>stays explicit;QpSolver::resolveexposes the frontend policy. See backend selection. - Elastic mode without a row to relax (no constraint rows, or every row
declared linear) solves the plain step QP, so the active-set backend’s
checked direct step applies and
report.elastic_weightstaysNone. The elastic QP is the same problem there, but it had bypassed that step: on the backend-selection panel the automatic default lost three unconstrained problems (BROWNDEN, HIMMELBF, PENALTY2) that explicit active-set solves. - optimization-jobs pin
78970a2(tagv0.4.1; the job crates are 0.4.1) in the manifest and the lockfile. That release documents every public item and updates the guide thatget_guideserves; the CLI, the MCP tools, the job envelope, the worker protocol and the result contract are unchanged.
Added
- Backend-selection evidence: the 53-problem panel of backend disagreements with its records for this release and 0.18.0, the generated tables and the 3,000-run stress tallies of the automatic default.
- README: links the documentation site, now that it is published.
- A documentation site of the user pages: this overview, the API contract, the crate and Python package pages, the method notes, the benchmark results, the seven application tutorials, the AI context and the job interface.
book/SUMMARY.mdlists the pages; plans, iteration logs and evidence are linked to GitHub, and no file moved. The workflow shared through optimization-jobs builds it with mdBook, checks the relative links of all Markdown files and the links of the built pages, and deploys to GitHub Pages only when the repository variablePUBLISH_DOCS_SITEistrue.
Fixed
docs/api.mdnamed the return type of thetry_solve_manyfactory as bareResult<Model>, which Markdown renderers read as an HTML tag and drop. It is now code.
[0.18.0] - 2026-11-10
Added
-
Experimental structured SQP above the 256-variable dense limit.
SqpOptions::hessian/hessian=selectsfull(default, unchanged arithmetic),partitioned(element-wise damped BFGS on overlapping constraint cliques) orexact.ProblemSpecgains optionalwith_elements,with_objective_patternandwith_lagrangian_hessiandeclarations (elements,objective_pattern,hessian_indptrandhessian_indicesin Python, preserved by pickling). Restoration builds its Gauss–Newton model in the same sparse pattern. A memory and fill estimate (structured_memory_limit_bytes, default 64 MiB, at most 128 MiB) is checked before solving, andRunReport::structurereports the pattern, fill estimates, Clarabel’s factor size and per-element update counts. Above 256 variables only Clarabel without elastic mode is accepted; the full and uniform-block modes keep their cap. -
Clarabel’s large sparse path: dense Hessians stay limited to 256 variables; larger sparse Hessians are checked by symbolic analysis and sparse Cholesky before conversion.
QpBackend::supports_large_sparse(defaultfalse) lets a backend opt in;QpReport::factor_nnzandRunReport::qp_factor_nnzreport the factor size. -
Optional exact Lagrangian Hessian:
NlpProblem::lagrangian_hessian(Pythonmodel.lagrangian_hessian(x, lambda)) writes∇²f − Σλᵢ∇²cᵢin the declared lower-CSR order. Calls count againstmax_callback_calls. A backend rejection triggers a Gershgorin diagonal shift, at most two per iterate; the count and size are reported.check_lagrangian_hessian(Rust and Python) compares it with differences of the analytic Lagrangian gradient, including entries outside the pattern. -
sqp.solve/1accepts optionalhessian(fullorpartitioned),elementsandobjective_pattern. Application workers can register models with up to 5,000 variables and 262,144 Jacobian entries (registry::MAX_DIMENSION,MAX_STRUCTURED_JACOBIAN_ENTRIES); above 256 variables a job needshessian: "partitioned",backend: "clarabel"and a declared objective pattern. Results reportdetails.structure. -
SQP5 multiple-shooting scaling study (
bench/trajectory_scale.py, with pykep-rust 0.1.6’sSimsFlanaganChain) up to 4,994 variables, its experiment-craft campaign generator (bench/trajectory_campaign.py), the target card, a structured S2MPJ selection (docs/benchmarks/structured-selection.json) and exact-Hessian variants of SQP4 and SQP6 (tutorials/_support/exact_hessian.py). The raw run records, sealed campaign results and comparator runs are indocs/benchmarks/structured/.bench/trajectory_scale.pydefaults to--scaling none, the documented configuration;jacobianis the adverse case. -
A link to the nonlinear CRN BDF-sensitivity extension from SQP6, preserving the closed-form identifiability reference.
-
Application tutorials SQP1–SQP6 and X2 (constrained calibration, multistart and scaling, hanging chain, collocation, Earth–Mars low thrust with pykep-rust, reaction kinetics, AC power dispatch). Each checks derivatives before solving, reconstructs KKT residuals from the model’s own derivatives, compares with an independent reference and keeps recorded smoke and study results. The
structured-tutorialsworkflow runs all seven chapters and compares them with the recorded results. -
The prompt-driven SQP tutorial solves a simplex allocation with both QP backends from four starts and runs Rosenbrock multistart through the existing
sqp-job-worker, rechecking objectives and stationarity. No numerical code or dependency pin changes. -
The prompt-driven curve-fitting tutorial runs the existing constrained decay-fit worker and checks its half-sum-of-squares objective, anchor equality and first-order evidence.
Changed
registry::MAX_DIMENSIONis now 5,000;ModelInfo::newstill defaults to dimensions 1..=256.Model::check_derivativeschecks every coordinate instead of the default 256 directions.QpReportandRunReporthave new public fields, so code that builds them with struct literals must add them (..Default::default()works).tutorials/_support/compare_results.pycompares the active-set backend’sqp_backendlabel without SQP-craft’s own package version (goldfarb-idnani 0.17.0matchesgoldfarb-idnani 0.18.0), so a release bump alone does not break the recorded tutorial summaries, here or in optimization-jobs’ twenty-chapter workflow, which installs the published wheel. Every numerical field and Clarabel’s engine version are still compared; the recorded summaries keep the version that produced them.- README: links the overview of the 18 related repositories.
- The structured-tutorial CI job runs on
ubuntu-24.04instead ofubuntu-latest. Sinceubuntu-latestmoved to Ubuntu 26.04, the SQP3 study and both SQP5 presets differ from their recorded summaries with the same package versions (38 differences in SQP3, 3,285 and 3,880 in the SQP5 presets); on Ubuntu 24.04 all three match again. docs/api.mdno longer states a version; the workspace version is inCargo.toml(it said 0.4.0).- The README points to experiment-craft,
which runs reproducible campaigns of
sqp-job-workerjobs and rebuilds and tests this repository at a pinned revision. - optimization-jobs pin
12f9d57(its 0.4.0 release602d31aplus documentation-only changes: doc comments on every public item, and a simulator section and corrections in the guide thatget_guideserves, so the job crates are 0.4.0) in the manifest and the lockfile. The runner gainsnode capabilities,jobs execution JOB_ID(an execution record of how each job’s worker process ended), opt-in trusted command jobs with verified binary file transfer, and explicitly placed jobs on SSH nodes with persisted dispatch and reconciliation, all through the CLI. Envelope, result contract, worker protocol and solver behavior are unchanged. - README badges as in fcmaes-rust: pure-Rust solver,
unsafeforbidden in the library crates, no C/C++ dependencies, crates.io, docs.rs, PyPI and the AI agent guide. - optimization-jobs pin
37b30e4(tagv0.3.0, the first crates.io release ofoptimization-job-apiandoptimization-runner): crate metadata, the shared guide thatget_guideserves names the October 2026 registry releases, and the job crates are 0.3.0. Envelope, result contract and worker protocol are unchanged. - Clippy 1.88, the job worker’s minimum Rust, is clean on the workspace too: the worker’s thread-limit message inlines its format argument. The text is unchanged.
Fixed
- Documentation:
ai-context.mdcounts the MCP server’s fifteen tools (it said thirteen); the README headline describes 0.17.0, the first PyPI and crates.io release, and labels 0.16.0 as previous;docs/dependencies.mdno longer says nothing is published;docs/api.mdnamessqp-craft-parallelas a dependency of the active-set backend; the hanging-chain tutorial quotes the recorded continuum potential (-0.911208463399); the README describesdocs/validation.mdas the iteration 3 (0.4.0) validation.
[0.17.0] - 2026-10-22
The first release on PyPI (sqp-craft) and crates.io (sqp-craft,
sqp-craft-parallel, sqp-craft-activeset, sqp-craft-clarabel,
sqp-craft-solver). The first crates.io upload needs an API
token; later releases use Trusted Publishing (RELEASING.md).
Everything merged after the commit that set 0.16.0 (8c9bc0c, #11): #10
and #12 to #21, and the release preparation. The code of the solver crates
and of the Python package is unchanged since 0.16.0; the crates gained
publishing metadata.
Added
- CUTEst benchmark harness
bench/on the S2MPJ problems, with SciPy SLSQP and Uno’s filterSQP and IPOPT presets as comparators and one independent first-order check per run; first results on 1,036 problems indocs/benchmark-results.md, tests intests/test_bench.py, and a CI job on 20 Hock-Schittkowski problems that fails on a sqp-craft false claim (#10). Measured with 0.14: Clarabel solves 754 problems, the active-set backend 799 and 813 with elastic mode, with no false claim in 12,432 sqp-craft runs. The 0.16 review reran it: the active-set backend solves 801, Clarabel and elastic mode are unchanged. - Shared agent job API 0.1 (#12):
optimization-job-api(versioned envelope, input hashes, checked journals, result contract, worker SDK),optimization-runnerwith the runneroptimization-run(worker registry, staging, idempotent request keys, CPU-slot admission, process-group supervision, cancellation, deadlines, journal recovery) andsqp-job-workerwith the profilesqp.solve/1(registered modelsbenchmark.quadratic,benchmark.simplexandbenchmark.rosenbrock, active-set or Clarabel backend, independent KKT recheck). Guide, tutorialtutorials/job-api/, integration harness anddocs/job-api/VALIDATION.md. The job layer needs Rust 1.88; CI checks the solver crates with Rust 1.85 and the job layer with 1.88. ai-context.md: operational context for AI agents, covering formulation, options and backend choice, statuses and multiplier signs, independent KKT checks, multistart and the job worker (#13).- Result contract 0.2 (#15): shared job crates 0.2.0 with the result schema
optimization.result/0.2(new claims; evidence with checks, refutations and a certificate slot; objective bounds), worker protocol 0.2 with 0.1 still accepted, coded runner errors,already_terminalon cancelling a finished job, and JSON Schemas for the job envelope and the result manifest. The worker adds the point-evaluation profilesqp.evaluate/1. optimization-mcp, the MCP server over one node, from optimization-jobs0ee495f;cargo build -p optimization-runnerbuilds it here, and CI runs the shared MCP tests (test_mcp.py) with this worker (#18).tutorials/job-api/run.py --bin-dir; the script also honorsCARGO_TARGET_DIRand reports a missing binary clearly (review SQP-04, #19).- Release workflows modeled on fcmaes-rust, with
RELEASING.md:python-release.ymlbuilds abi3 wheels (CPython 3.10+) for Linux x86_64, macOS x86_64 and arm64 and Windows x86_64 plus the source distribution, installs and tests each one, attests them and publishessqp-craftto PyPI through Trusted Publishing on av*tag that equals the workspace version (a manual run builds and tests without publishing).publish-crates.ymlchecks and publishes the five library crates (sqp-craft,sqp-craft-parallel,sqp-craft-activeset,sqp-craft-clarabel,sqp-craft-solver) to crates.io once the repository variableCRATES_IO_TRUSTED_PUBLISHINGistrue; until then it runs every check and skips the upload. - The library crates are publishable: crates.io metadata, a README and the license in each crate, and versions on their path dependencies. The Python package, the worker and the benchmarks stay unpublished crates.
- README section “Install from source”: requirements (Rust 1.85, 1.88 for the job layer, a C linker but no external optimizer, BLAS or CMake), the Python build, the job worker with its git dependency on optimization-jobs, and the crates as git dependencies.
ai-context.mdpoints to the AI entry point of optimization-jobs, which chooses between the four solver repositories, and says what the release workflows will publish.- Application models for the job worker (agent-discovery review F03):
sqp-job-workeris a library plus a thin binary.sqp_job_worker::Registrytakes models with an id, a version and a description (ModelInfo), a typedconfigwith its JSON Schema, declared data inputs (SHA-256 checked by the runner and the worker) and a factory that builds theProblemSpecand aModel, which makes a freshNlpProbleminstance for every task and every recheck.Registry::checkandModel::check_derivativescompare the derivatives with finite differences before a model is advertised. The stock binary registers the three benchmarks through this API.examples/custom_worker.rsis a standalone application worker withapp.decay-fit, a constrained least-squares fit to a CSV input; the tutorial runs it (decay-fit.json,decay.csv) and rechecks the fit in Python, andtests/custom_worker.rsdrives it throughprepareandsolve. Guide:docs/job-api/models.md. - Optional payload fields of
sqp.solve/1andsqp.evaluate/1:problem_version(must equal the registered version, the default) andconfig(the model’s parameters); the envelope’sinputsare accepted exactly when the model declares them. The benchmarks still reject inputs. elastic_modeinsqp.solve/1(review F10): optional, defaultfalse, needsbackend: "active_set"and is rejected at validation with Clarabel. Outcomes report the effective options indetails.optionsand, in elastic mode, the elastic counters indetails.elastic.- Discovery (review F01): the worker’s
describelistspayload_schemas(a strict JSON Schema per profile, with per-model rules for version, dimensions and config) andexamples(one job per registered model and profile, in resolved form, inputs ascontent_text), built from the registry, so an application worker advertises its own models. Model entries addversion,description,profiles,config,inputsandbounds.tests/discovery.rsturns every example of the stock worker, the custom worker and a worker without benchmarks into a job and runs it; the tutorial checks every example and tutorial payload against the schemas withjsonschema>=4.18. An explicitnullforproblem_versionorconfigmeans the same as leaving it out, in the worker and in the schemas (tests/discovery.rsand the tutorial check absent, null, valid and invalid values for both profiles and both workers). examples/multistart_processes.py: many starts of a Python model in aProcessPoolExecutor, one native thread per process, and akkt_residualsrecheck of the best result; CI andscripts/check.shrun it. The model libraries’ thread pools are set to--model-threads(default 1), overwriting inherited values. The default worker count stays within the usable CPUs: the affinity mask lowered to the cgroup v1 or v2 quota (tests/test_multistart_example.py). The script prints the topology.AGENTS.mdfor coding agents;ai-context.mdgains a “Many cores” section, the discovery keys, the application registry (replacing the instruction to edit the worker’s enum) and the MCP toolput_input.
Changed
-
crates.io and docs.rs pages: the core crate describes SQP with sparse (CSR) constraint Jacobians instead of “a sparse SQP solver” (the solver is dense BFGS), and its rustdoc drops the development note “Iteration 1”; the five crates’ homepage is the SQP-craft entry of the ecosystem page; the READMEs show
cargo add, and the solver README a complete, tested example with the limits; the solver’s rustdoc linksdocs/snopt-lessons.mdabsolutely and no longer says “four” SNOPT mechanisms for a list of five. -
publish-crates.yml: while Trusted Publishing is not enabled (CRATES_IO_TRUSTED_PUBLISHING), a tag publishes the crates with the secretCARGO_REGISTRY_TOKEN, one crate at a time in dependency order and skipping versions already on crates.io. This publishes the first release without a local toolchain;RELEASING.mddescribes the token and its removal afterwards. -
The PyPI description is
python/README.md, a short page with installation, an example, the limits and absolute links; the repository README, with its relative links and history, stays on GitHub. -
Discovery: the README opens with the title, a short description (dense BFGS, at most 256 variables, derivatives needed) and links to the shared solver-selection guide and the ecosystem overview; the five crate READMEs link them too.
pyproject.tomladds keywords and project URLs (documentation, issues, changelog, ecosystem, agent guide).RELEASING.mdcovers discovery after a release. -
The README opens with a banner (
docs/images/sqp-craft.png). It is linked by absolute URL, so the PyPI description shows it too. -
The resolved
sqp.solve/1job recordsproblem_versionandelastic_mode, and the effectiveconfigof a model with parameters; the resolvedsqp.evaluate/1job recordsproblem_version. Every existing tutorial and harness job validates and gives the same outcomes and work counts; outcomes gaindetails.options. -
CI builds the
custom_workerexample for the tutorial. -
The job worker records a
convergedstatus that fails the recomputed KKT acceptance as a refutation instead of failing the job, mapslocally_infeasibleandlinear_infeasibleto claims withclaimedevidence, and reports the workspace version as its engine version instead of a hard-coded string (#15). -
The shared job crates were synchronized as the 0.1.1 set of 20 files, identical in fcmaes-rust, LP-IP-craft and SQP-craft: zero-work repair of a queued job whose launcher died, the fcmaes set and archive claims, and shared
test_review.pyandfake_worker.py; CI checks the manifest (#14). The shared guide, plan and harness were synchronized with fcmaes-rust (#16). -
optimization-job-apiandoptimization-runner, the shared guide, plan, JSON Schemas and scripts moved to https://github.com/dietmarwo/optimization-jobs. The workspace depends on the crates at a pinned git revision instead of in-tree copies and their checksum manifest;docs/job-api.mdis a pointer to the shared guide; CI and the tutorial run the shared harness and schemas from Cargo’s checkout (scripts/job-api/shared_root.py) (#17). -
optimization-jobs pin:
9feb72e(#17),0ee495f(#18),eb1c9de(#19: cancellation race, bound consistency inOutcome::check, MCP request limits) and6a42472(#20: worker-declared artifacts and paged artifact reads,jobs artifact --offset/--limitand MCPget_artifactwithoffsetandlimit; no change for this worker’s profiles). The shared tests were rerun at each pin (docs/job-api/VALIDATION.md). Then423cd87:artifact::pagestreams the file and parses only the page’s records; no change for this worker. -
optimization-jobs pin
069d87c(its review of agent discovery):optimization-mcpgainsput_input(stages an input file, such as a model or a CSV, and returns itssha256andinput_dir) andget_guide(the cross-repository AI entry point);node doctorreports the host’s usable CPUs and memory;workers addaccepts up to 1 MiB ofdescribeoutput; and the shared harness, which CI runs from Cargo’s checkout, checks the worker’s payload schemas and runs its examples, also over MCP. -
optimization-jobs pin
43ef3ae(third review of agent workflows, N1; the merge of optimization-jobs #10, which adds only the landing page and discovery docs to8d19278): the guide thatoptimization-mcpserves withget_guidehas the corrected Pareto guidance (scalarization gives candidates), and the shared harness, which CI runs from the pinned checkout, checks that the payload schemas and the worker agree onnulloptional fields. The new workflowshared-pin.ymlfails when optimization-jobsmainhas changed the shared crates, guide, job API docs or test scripts since the pinned revision (weekly, and on changes to Cargo files), so the pin no longer drifts. Landing-page and discovery files do not count. -
ai-context.mdreviewed againstmain: the MCP server, routing to the sibling workers LP-IP-craft and fcmaes-rust, andinner_threads=1as a requirement of the evaluate profile; the README names the sibling workers (#20).
Fixed
- Job worker (review SQP-01): two finite but invalid
convergedresults aborted the whole multistart job. Multipliers whose KKT residuals overflow now refutefirst_orderwithfalse_optimality; a finite candidate outside the variable bounds is judged infeasible (infeasible_point, checks["bounds"]) without evaluating the model there; a point without finite model values is refuted withobjective_mismatch. Candidates or multipliers of the wrong length or with non-finite entries still fail the task.validation_callscounts the model calls actually made (#19). - README layout table: the active-set backend depends on
sqp-craft-parallelsince 0.16, andcrates/parallelandcrates/sqp-job-workerwere missing (#21).
[0.16.0] - 2026-10-18
Set by #11 (8c9bc0c). It also contains #6 to #9, merged on 2026-10-17
while the workspace version was still 0.14.0 (their docs say “Version
0.14.0”). #11 squashes the reviewed 0.15 and 0.16 performance deliveries
(docs/performance-30/, docs/performance-60/); 0.15.0 has no commit of
its own on main.
Added
- Dense dual active-set QP backend, crate
sqp-craft-activeset(ActiveSetQp, #6): the Goldfarb-Idnani method on a dense Cholesky factor of H, which is also the exact positive-definiteness gate; a Householder reflector for entering constraints, Givens rotations for leaving ones; x and u recomputed from the factors with one refinement step before any result or infeasibility claim. Select it withSqpOptions(qp_solver="active-set")(ValueErrorfor an unknown name) orNativeSqp<ActiveSetQp>; Clarabel stays the default. On the four fixtures it takes the same steps to the same objectives and the whole solve is 5.4-6.4x faster (orbit, 164 variables: 2,985 -> 546 ms); same status as Clarabel in all 4,500 paired stress runs. SqpOptions.qp_warm_start(default true): the next step QP starts from the last working set when the backend reports one. Clarabel reports none, so its runs are unchanged. A warm attempt that ends infeasible or fails the independent check is repeated cold (#6).docs/gaps.md: weaknesses compared with SNOPT, filterSQP, NLPQL, SLSQP and the IPOPT/WORHP/KNITRO family, and the order of work (#6).- Elastic mode (#7):
SqpOptions.elastic_mode(default false) andelastic_weight(default 1e4, timesmax(1, |grad f(x0)|_inf)) solve every step QP as an l1-elastic QP instead of entering restoration. It needs the active-set backend (QpBackend::supports_elastic; Clarabel rejectsQpOptions.elastic_weight). Independent checksQpModel::accepts_elasticandkkt::elastic_residuals_with_workspace. New statuslocally_infeasibleafter six tenfold weight increases; report fieldselastic_steps,elastic_weightandelastic_weight_increases. Stress family: 14locally_infeasibleagainst 15 restoration failures (13 the same); restoration stays the default. - Second-order correction (#8):
SqpOptions.second_order_correction(default false), Nocedal & Wright Algorithm 18.3 once per iteration, with both backends and in elastic mode; report fieldssecond_order_corrections,second_order_stepsandIterationRecord.second_order_correction. Maratos example from 200 starts: -16% iterations, -21% callbacks; stress family: -2.3% iterations, two problems end in failed restoration instead. - Four opt-in mechanisms from SNOPT (Gill, Murray and Saunders 2005;
docs/snopt-lessons.md, #9); with all of them off the 9,000 stress runs are bit-identical:hessian_update="augmented": curvature repair with the augmented-Lagrangian term instead of damping; countersbfgs_damped_updates,bfgs_modified_updatesandIterationRecord.curvature;merit="augmented-lagrangian"andviolation_limit, withRunReport.violation_limit_rejections;- declared linear rows,
ProblemSpec(..., linear_rows=[...])orProblemSpec::with_linear_rows: the start is projected onto them, every QP keeps them hard (QpOptions.hard_rows), new statuslinear_infeasible,RunReport.linear_projection; scaling="linear"or"jacobian"(SNOPT’s Scale options 1 and 2): the QP and the BFGS matrix are scaled by powers of two; report fieldsvariable_scalesandrow_scales.
- Native thread budgets (#11):
Options.threadsis a maximum native budget of 1 to 8 (default 1; before, only 1 was accepted). New cratesqp-craft-parallel(bounded Rayon pools). The active-set backend splits large QP kernels (512 variables or 32,768 bounded-row entries) bit-identically to the serial path. HooksNlpProblem::set_threadsandQpBackend::set_threads, whose defaults keep the model serial and reject more than one backend thread. Python callbacks stay on the calling thread; the Clarabel engine stays serial. - Batch solves (#11):
batch::solve_manyandtry_solve_manysolve ordered independent starts with worker-local models and backends, shared cancellation and a total budget of at most 8; outer tasks run on dedicated threads. Delivery host: 16 orbit-20 solves 4.5x (active-set) and 6.2x (Clarabel) faster with eight outer workers. - Test families and scripts:
examples/stress_mpcc.py(complementarity constraints),examples/stress_linear.py,scripts/compare_corrections.py,scripts/compare_variants.py.
Changed
- 0.15 performance work (#11): cheaper validation, matrix products and BFGS; exact-bit Cholesky factor and inverse caches in the active-set backend; a checked closed-form path for unconstrained and diagonal-box QPs. On the delivery host the active-set path is 1.12-1.50x faster on the four fixtures (geometric mean 1.247x); Clarabel wall times are mixed.
- The closed-form QP path changes active-set results on unconstrained problems in the last bits. On 1,036 CUTEst problems (review) 55 runs change numerically, 50 of them unconstrained, and the active-set backend solves 801 instead of 799. Clarabel and elastic mode give identical runs apart from runs near the time limit.
Fixed
- Convergence is no longer claimed on residuals at their rounding level
(#7). Stationarity and complementarity must clear their tolerances by
(k_j + 2) eps (|grad f_j| + sum_i |J_ij lambda_i| + |z_j|)per entry and|mu| eps (|v| + |b|)per product. With Clarabel, QP multipliers of 5e9 had produced a false convergence claim on the complementarity family (seed 1, case 80). The 9,000 stress runs of both backends are bit-identical with and without the guard.
[0.14.0] - 2026-10-17
Ten performance iterations, reviewed (#5). The per-iteration versions 0.5.0
to 0.13.0 exist only as checkpoints of the delivery, not on main.
Added
SqpOptions.hessian_block_size(0, the default, keeps full BFGS): explicit block-diagonal damped BFGS. A failed block update uses one Hessian reset and switches once to full BFGS, counted inRunReport.block_hessian_fallbacks.QpOutcome::NotPositiveDefiniteandRunReport.qp_not_positive_definite(also in Python). A rejected step QP resets B and re-solves the same QP at the same iterate without counting an iteration; repeated rejections endnumerical_failureonce the reset budget is spent.- Native
performanceexample andscripts/compare_performance.py, which pairs any number of labeled builds (it replacescompare_performance_final.py).
Changed
- Breaking (custom
QpBackendimplementations): the driver no longer factorizes B. A backend that needs a positive-definite Hessian must check every model exactly and reportQpOutcome::NotPositiveDefinite. The Clarabel adapter’s exact check is the single gate and keeps its cached workspace and conversion data on a rejection. In review this replaced the delivered rank-updated BFGS factor, which let an indefinite B abort solves above 16 variables. - Allocation and work reductions with full-mode results bit-identical to 0.4.0 (6,000 stress runs, 26 comparison runs, orbit objectives): one BFGS triangle computed and mirrored in a reused workspace; one step-QP template per solve; reusable KKT-check buffers; recycled derivative output buffers, refilled with NaN before each callback; restoration QPs that keep exact sparsity; strictly diagonally dominant Hessians certified without Cholesky; cached conic conversion data and scatter maps.
- Orbit, 164 variables, workspace reuse (medians, baseline -> reviewed release): BFGS phase 95.6 -> 33.8 ms, BFGS plus conversion 163.9 -> 105.2 ms. The Clarabel engine still dominates the wall time.
[0.4.0] - 2026-10-16
Iteration 3: QP workspace reuse, reviewed (#4).
Added
- Opt-in Clarabel workspace reuse:
SqpOptions.qp_reuse_workspace(Rust and Python) andQpOptions.reuse_workspace, default false. A workspace is reused when dimensions, P/A CSC structure, cone kinds and the signed dual mapping match; all values are replaced and the iterates still start cold. A reused solution that is not independently accepted gets one cold retry, and a reused infeasibility finding needs cold confirmation before restoration. Clarabel’s setup and post-processing timers are reset per call, so earlier calls do not count towards its time limit. - QP phase telemetry:
qp_setups,qp_updates,qp_cold_retries,qp_retry_reasonand conversion, setup, update, solve and check seconds in the run report. examples/compare_workspace.py. Delivery host: median orbit wall time -9.9% (84 variables) and -15.6% (164) with reuse, same outer iterations, acceptance unchanged (13 of 13 cases, 1,186 of 1,200 stress problems).
Changed
- QP conversion builds Clarabel’s CSC data directly in O(nnz) instead of sorting triplets (orbit, 164 variables: about 0.145 -> 0.075 s per run); the cache key is compared in place; the BFGS update is computed entry-wise without five n x n temporaries. Results are bit-identical.
[0.3.0] - 2026-10-16
Iteration 2: bounded feasibility restoration, reviewed (#3).
Added
- Bounded feasibility restoration: after an infeasible step QP, regularized Gauss-Newton steps on the squared row violation within the variable bounds. An accepted point must decrease the violation and be completely evaluated; curvature and penalties are then reset. Restoration-QP multipliers never become NLP multipliers, and only the unchanged NLP KKT test declares convergence.
- Options
max_restoration_steps(10; 0 gives the previous behavior),restoration_step_limit(1.0) andrestoration_regularization(1e-4), in Rust and Python. - Statuses
restoration_failedandrestoration_limit; report fieldsrestoration_attempts,restoration_steps,restoration_seconds,restoration_history(RestorationRecord) andbound_step_corrections. Restoration stops asrestoration_failedwhen a step not cut by the direction bound predicts less than1e-8 * psi. - HS071 from (1, 1, 1, 1) converges (one restoration and seven SQP steps)
instead of ending
linearization_infeasible; the SLSQP comparison accepts 13 of 13 sqp-craft results (12 before). examples/restore_hs071.pyandexamples/stress_random.py(random problems feasible by construction, run in CI for seeds 1-4): 1,186 of 1,200 converge, with no false convergence claim.
Fixed
- A QP step overshooting a nearly active bound (room 3e-14, overshoot
1e-11) cut the step length to about zero and stalled the solve. Step
components that exceed their step bounds by at most the feasibility
tolerance are moved onto the bound, and trial components that rounding
of
x + alpha pputs a few ulps beyond a bound are set to it. - A step whose predicted merit decrease is non-positive only within the
QP’s accuracy ended
stalledjust short of convergence. It is now taken once at full length if the merit rises by no more than that accuracy, at most three times in a row.
[0.2.0] - 2026-10-16
Iteration 1: native SQP pilot, reviewed (#2).
Added
- Native SQP driver, crate
sqp-craft-solver(crates/sqp), selected withmethod="sqp"(the default"dummy"still only evaluates the start): step QPs in shifted coordinates, dense damped BFGS with positive-definiteness checks and bounded resets, an l1 merit with Powell’s per-row penaltiesmu_i <- max(t_i, (mu_i + t_i)/2),t_i = 1.1|lambda_i|, Armijo backtracking with retries at undefined points and a first-order convergence test. Research pilot with at most 256 variables (dense_size_limit). - Clarabel 0.11.1 QP adapter, crate
sqp-craft-clarabel: two-sided rows as cones, signed multipliers, and one scale-aware acceptance rule,QpModel::accepts, shared by adapter and driver. - Derivative checker
check_derivatives: coordinate finite differences inside the box with several step sizes, every output row compared; fixed variables are listed infixedand do not affectpassed, and an undefined perturbed point does not abort the check. - Iteration, callback and time budgets;
RunReport; optional QP trace and iteration history (record_history); typed Python results (Statusliteral,DerivativeIssue,IterationRecord); descriptive status messages. A non-positive predicted decrease within the QP’s accuracy endsstalled. - Numerical hardening: checked KKT intermediates (an overflow is an error,
never a zero residual),
Bounds::checked_violationand finite QP warm-start validation. - Fixtures: orbit-transfer collocation with 84 and 164 variables (Rust
test and Python example), HS071 and a bound-active quartic.
examples/compare_baseline.pycompares with SciPy SLSQP under one independent evaluator: sqp-craft is accepted on 12 of 13 cases (HS071 from (1, 1, 1, 1) endslinearization_infeasible), SLSQP on 12. - CI runs debug tests, the orbit example, the SLSQP comparison and a build without the native solver.
Changed
- Python: native phases run detached from the interpreter, and the exception of a callback the solver recovered from (an undefined point) is dropped; only the most recent callback’s exception is re-raised, and only for the matching solver error.
[0.1.0] - 2026-10-15
Interface draft (#1). No optimizer: DummySolver evaluates the start point
once and returns status "stub".
Added
- Core crate
sqp-craftwithout dependencies: validated, immutableProblemSpecwith field- and entry-specific errors;NlpProblemwith two grouped callbacks,functions(x)for f and c andderivatives(x)for the gradient and the Jacobian values, written into solver buffers. Solvers never evaluate outside the variable bounds, and derivatives only at the point of the precedingfunctionscall. - Multiplier sign convention
grad f = J^T lambda + z, independent KKT residuals (kktmodule) and theUndefinedPointerror kind. - QP seam with multipliers,
QpOutcome, active-set warm start and an independent residual check;DummyQpnever fabricates a step. - Python package
sqp_craft(PyO3 0.30.1, abi3 for CPython 3.10+): keyword-only, picklableProblemSpec, NumPy-friendly input and output,EvaluationErrorandUndefinedPointErrorwith the original exceptions re-raised; an observer returnsTrueto stop. - Docs (API, design notes with the review record, target card), a check script and GitHub Actions CI: fmt, Clippy, tests, MSRV 1.85, and Python 3.10 and 3.14 on Linux, macOS and Windows.
Repository: https://github.com/dietmarwo/SQP-craft