Repository navigation
test: record how each solve was configured and the environment of the run (#409, part 1) - #412
Merged
Merged
Conversation
… run (#409) Each row of <report>-results.tsv gets the modeler, the solver, every option given to the solver (inline TOML) and the constraint violation; each run with solves writes <report>-environment.toml (Julia, machine, commit, run, versions of the packages that discretize and solve). The options come from one function per solve module, used by the solve itself, so that what is recorded is what ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ocots
marked this pull request as ready for review
November 7, 2026 15:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #409 (part 1 of 2). Conventions: ct-conventions v0.10.0, ct-agents v0.4.0.
Plan
Goal. A reference solution says how it was obtained (#409). Part 1 makes the tests record it; part 2 (after the crons have run on
mainwith this change) stores it inext/MetaData/references/and exposes it as typed references.Why two parts. A cron dispatched on a branch publishes to
resultsand updates the cron issues (#348, #350, #351 came from such a run). The references of part 2 must be computed from runs onmainthat already record the new fields.Steps (this PR).
SolveOptimalControl.solver_options,SolveJuMP.solver_options); the solve uses it, so what is recorded is what ran.settings(config; options)givesmodeler,solver,optionsforresult!.outcomereturns the constraint violation:OptimalControl.constraints_violation(sol); JuMP: the largest entry ofJuMP.primal_feasibility_report.TestStatus.result!records them;<report>-results.tsvgets four columns after the existing ones:modeler,solver,options(inline TOML),violation. The Markdown table is unchanged.<report>-environment.toml: Julia, OS, architecture, CPU, threads, commit, run URL, versions of the direct dependencies and ofKEY_DEPENDENCIES(CTDirect, CTModels, CTSolvers, ADNLPModels, ExaModels, MadNLP, NLPModelsIpopt, Ipopt_jll, MUMPS_seq_jll).test/suite/core/test_status.jl), shown failing on a broken case.test/README.md.Out of scope (part 2).
tools/references/update.jl, the loader,AbstractReferenceand the API, regenerated reference files.Done when (part 1 of #409)
*-results.tsvhasmodeler,solver,options,violation; each run writes*-environment.toml; shown on a local run of one problem per modeling (below).main(CronOptimalControl,CronJuMP,CronOptimalControlScalarized,CronRobustness), run ids recorded in [Metadata] Reference solutions with how they were obtained: typed references and API #409.Evidence
Local runs (macOS, Julia 1.12.7), in the worktree:
Rows written (
problem,configuration,reason, then the new columns):OptimalControl-cron-environment.toml:All 16
optionscells of the run parse back withTOML.parse.tools/cron/report.pyreads the new files unchanged (it reads the TSV by column name): checked on these reports.The new test fails on a broken case. With
value(x) = string(x)ininline_toml(strings not quoted),Pkg.test(test_args=["*status*"])fails:how a solve was configured is recorded (#409): Error During Test ... test_status.jl:79(the TOML does not parse). Restored: 29 passed.Choices
mu_initandbarrier=:loqoare turned into abarrierobject bySolveOptimalControl.barrier; the record keepsmu_init/barrier = "loqo", which is what a user writes and what reproduces the solve.finallyofrun_environment.jl, a top-level expression started before the solvers were loaded: printing aMadNLP.LogLevelsthere fails on the world age (MethodError: no method matching namemap(::Type{MadNLP.LogLevels}), seen on the first run).result!runs inside the tests, in the newest world.k=vformat: read back with the standard library, types kept (1000stays an integer,1.0e-8a float).1e-8(bound_relax_factor):beamshows ~1e-8 with JuMP and ~1e-16 with OptimalControl. Recorded as is, documented intest/README.md; comparing it across modelings is not meaningful.KEY_DEPENDENCIES, a short list of package names, because the direct dependencies of a test environment miss CTDirect, ExaModels, ADNLPModels, MadNLP's version through OptimalControl… The full manifest of a cron run belongs to [Doc] Results pipeline for the documentation, and a gallery of problems #314 (env/<run id>/onresults).mainis not fully formatted ([AUTO] JuliaFormatter.jl run #333 is open): running JuliaFormatter on the touched files rewrites unrelated lines, so only the new code is in the blue style; the formatter run of [AUTO] JuliaFormatter.jl run #333 will cover the rest.Labels
run ci github-runner,test convergence(runs thecron/tests changed here). No label runsrobustness/on a pull request: checked locally above.Main checkout
git -C OptimalControlProblems status --shortbefore: empty; after: empty.🤖 Generated with Claude Code