Repository navigation
test: record the trajectories, the environment and the fingerprint of the solves (#314, phase A) - #417
Merged
Conversation
JuliaFormatter (blue), no change of content, so that the next commit shows only what it changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the solves Phase A of #314. A result carries the fingerprint of its problem (SHA-256 of the files that define it, OptimalControlProblems._fingerprint) and, from the convergence tests, the trajectory of its solution: time grid (at most 501 nodes), state, control, costate by component, and variable. Each report writes <name>-trajectories.toml and <name>-env/ (Project.toml, Manifest.toml, versioninfo, Pkg.status) next to the results; results.tsv gets a fingerprint column. The publication on the results branch is phase B. Refs #314 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…igits The trajectories key the components by name, in a dictionary that loses the order of the model (Julia's TOML writer, then the JSON of the publish job, sort them): `names` records it, for the state, the control and the variable. Values are rounded to 6 significant digits instead of 8: enough to draw, and stable from one run to the next, so the copies the documentation publishes do not change every week. The check of the comparison follows (rtol 1e-5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 7, 2026
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.
Plan: #314 phase A — the crons record trajectories, environment and fingerprint
Conventions: ct-conventions v0.11.0; ct-agents v0.4.0. Plan of #314 agreed in #314 (comment) (four phases, one PR each; this is A).
What and why
The documentation will draw the solutions in the browser from data published by the crons (decision 1 of the plan), say whether a result is up to date (fingerprint, decision 3) and show the environment of the run (Reproducibility block). This PR makes the tests record them; phase B publishes them on the
resultsbranch.What changes
src/OptimalControlProblems.jl,Project.toml_problem_files(problem)and_fingerprint(problem): SHA-256 of the metadata, description and model files of a problem, relative paths with/, line endings read as\n(same on Windows);SHA(stdlib) added. One function, used by the tests and later by the documentationtest/common/status.jlResultgetsfingerprintand an optionaltrajectory;trajectory(x)reads an OptimalControl solution or a solved JuMP model with the accessors they share (time grid at most 501 nodes, state, control, costate by component, variable, 8 significant digits;nothingwith a warning if unreadable, the solve is still reported);write_reportalso writes<name>-trajectories.tomland<name>-env/(Project.toml,Manifest.toml,versioninfo.txt,status.txt,status-manifest.txt, without the temporary path of the environment);results.tsvgets afingerprintcolumn (read by name by the tools)test/cron/*/test_convergence.jltrajectory=TestStatus.trajectory(sol)(or of the JuMP model)test/Project.tomlInteractiveUtils(stdlib), forversioninfoincore, which runs under the restrictedLOAD_PATHofPkg.testcore: fingerprint (stable, changes with content and path, not with CRLF),fingerprintcolumn, trajectories file, environment files;comparison: the trajectory of a JuMP model and of its OptimalControl solution match the accessorsThe first commit only formats (JuliaFormatter, blue) the three files as they are on
main, so that the second shows only the changes.The costate is recorded as the solver gives it: for JuMP its sign is the opposite of OptimalControl's (#326).
Verification
Pkg.test(; test_args=["core"]): 776 passed, 1 broken (existing).Pkg.test(; test_args=["comparison", "OptimalControl", "JuMP", "convergence", "problem=beam"]): passed. Files written:OptimalControl-trajectories.toml(72 KB, two configurations),JuMP-trajectories.toml(36 KB),*-env/with the five files; the same fingerprint in the trajectories and in the.tsv, 501 time points. About 3 MB per full cron run.broken: same fingerprint with CRLF: false/_fingerprint: … true.tools/cron/test,tools/ci/test: 66 passed (the extra column is read by name).The cron workflow already uploads
test/reports/as the artifact: the new files reach the publish job without change; publishing them is phase B.Labels
run ci github-runner.Refs #314
🤖 Generated with Claude Code