Skip to content

Re-pin the JANUS pipeline tests to SOCRATES 2607.3 - #98

Merged
timlichtenberg merged 3 commits into
mainfrom
tl/janus-socrates-2607-3-pins
Oct 28, 2026
Merged

timlichtenberg merged 3 commits into
mainfrom
tl/janus-socrates-2607-3-pins

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

Description

The JANUS nightly on main has failed since SOCRATES 2607.3 (FormingWorlds/SOCRATES#36, the Simpson's rule fix for an odd number of intervals): https://github.com/FormingWorlds/JANUS/actions/runs/40663649252 (5 failed, 321 passed, SOCRATES e34954c5). The 5 stored-value cases of test_runaway_greenhouse and test_instellation compare the full JANUS + SOCRATES pipeline at a relative 1e-5. The SOCRATES change moves their output past that tolerance. The same commit of main passed the day before with SOCRATES 2607.2 (9b729fd8): https://github.com/FormingWorlds/JANUS/actions/runs/40475336776.

This PR re-pins the 5 cases to SOCRATES 2607.3 and names the SOCRATES version in a failed comparison. tests/helpers/__init__.py holds SOCRATES_PINNED_VERSION. The assert message says whether the SOCRATES version string of the run matches it. A SOCRATES release that raises the version string and moves these values then fails with a version mismatch, not as an unexplained regression. A change that leaves the version string as it is still fails, but the message cannot tell it apart from a JANUS regression. The parametrize ids now name each case (sub_runaway_200K, plateau_1705K, post_runaway_2800K, inner_0p3au, outer_1p4au). The Validation page and its plots show the new stored values. No source lines change.

CI builds SOCRATES from its main branch, so a later SOCRATES commit can move these values again; this PR does not pin the SOCRATES build.

Validation of changes

  • Nightly on the branch head, with SOCRATES 2607.3 (e34954c5): https://github.com/FormingWorlds/JANUS/actions/runs/40674020295 (326 passed, 3 warnings; the failed run on main also had 3 warnings).
  • PYTHONPATH=src pytest -m "unit or smoke" tests on the branch with an older local SOCRATES: 321 passed, 5 deselected (the 5 pipeline cases need SOCRATES 2607.3 and ran only in the nightly above).
  • Docs build with zensical 0.0.39 on main and on the branch: the same 7 warnings.
  • The failure note, checked with a stub janus.set_socrates_env whose version string is 2607.2\n: version mismatch: stored values are from SOCRATES 2607.3; this run uses SOCRATES 2607.2; with 2607.3\n it states the match.
  • git grep -n "9.07314e01\|2.78990e02\|6.58379e03\|2.34297e03\|1.94521e03\|4.54446e01" for the old stored values: no hits.

macOS 26, Python 3.12.

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

Relevant people

None beyond the code owners.

SOCRATES 2607.3 corrects Simpson's rule for an odd number of intervals. This raises about half of the Planck table values that prep_spec writes into the spectral file of these tests, by up to 1.1 %. The upward longwave and net fluxes of the instellation test and the outgoing longwave radiation of the runaway-greenhouse test move by 1.6e-5 to 1.3e-2 relative, outside the 1e-5 tolerance.

The 5 active rows now hold the 2607.3 values to 8 significant digits, and the tolerance stays at 1e-5. The Validation page and its plots show the new values.
The stored values of the instellation and runaway-greenhouse tests belong to one SOCRATES version, while CI builds SOCRATES main. A constant in tests/helpers now holds that version, and a failed comparison names it next to the version in use.

The runaway-greenhouse cases get ids for their regime instead of the stored value, so the ids stay the same when the values change. The Validation page says that the commented-out rows are not kept at that version.
The note on a failed stored-value comparison now says when the SOCRATES version of the run differs from the version of the stored values, and states a match plainly otherwise. It is a module constant in tests/helpers.

Both pipeline tests take their parametrize ids from a table keyed by the input, so a reordered or added row cannot take the id of another case, and the instellation cases are named for their orbital distance. The Validation page points to the version constant instead of repeating it, and both sections say that the commented-out rows are not checked against that version.
@timlichtenberg
timlichtenberg requested a review from a team as a code owner October 28, 2026 13:05
@timlichtenberg
timlichtenberg merged commit 4e43d5e into main Oct 28, 2026
6 checks passed
@timlichtenberg
timlichtenberg deleted the tl/janus-socrates-2607-3-pins branch October 28, 2026 15:35
@egpbos

egpbos commented Oct 28, 2026

Copy link
Copy Markdown
Member

tests/helpers/__init__.py holds SOCRATES_PINNED_VERSION

Wouldn't this be better solved by packaging SOCRATES and pinning in a regular package manager? See also #96 (review)

@timlichtenberg

Copy link
Copy Markdown
Member Author

HI @egpbos Yes agree, my PRs were simply patches for CI failing. In the long run your solution is clearly better. Even though SOCRATES is kind of "special", as we manually try to remain consistent with the main code. @nichollsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants