Kill ambient LIBNEO_* env footgun; use LIBNEO_REF cache var only#392
Merged
Conversation
orbit_symplectic_quasi was the sole consumer of the vendored MINPACK hybrd1. Replace each of the eight hybrd1 calls with fortnum's multiroot_hybrids (Newton step with a backtracking line search and a finite-difference Jacobian), which provides the same warm-started, Jacobian-free root solve the call sites relied on. Each f_*_quasi residual now conforms to the multiroot_fn_t interface (assumed-shape x/f, optional ctx, no iflag); state still travels through the existing module globals f, fs, si. The f_midpoint_quasi double field evaluation ordering (midpoint stage saved, then endpoint) is preserved. xtol and ftol are both set to si%rtol to track the former hybrd1 stopping behavior. Wire fortnum via CMake FetchContent (GIT_TAG a7faa3c, guarded by NOT TARGET fortnum) and link it into the simple library. Delete src/contrib/minpack.f90, minpack_interfaces.f90, and LICENSE.minpack.
fortnum a7faa3c installed its C ABI header from CMAKE_SOURCE_DIR, which resolves to the consumer tree under FetchContent and failed SIMPLE's install step. fortnum main now sources the header from PROJECT_SOURCE_DIR (9595e51); pin to the merge commit that carries the fix.
test_sympl_stell drives the quasi-symplectic steps (timestep_*_quasi), the only code path that calls the root solver behind the quasi method (fortnum multiroot_hybrids on this branch, MINPACK hybrd1 on main). The quasi block sat behind an unconditional stop and the executable had no add_test, so the solver swap ran zero times in the suite. Remove the dead stop so the quasi integrators run, set coord_input and field_input before init_field (now required since the reference-coordinate init was added), and register test_sympl_stell as an integration test. Verified on faepop31 deterministic-FP build: the quasi run calls multiroot_hybrids 359952 times; the run completes in 72 s under ctest.
cmake/Util.cmake: drop $ENV{LIBNEO_BRANCH} read; rename LIBNEO_BRANCH
cache var to LIBNEO_REF. Only -DLIBNEO_REF=<branch|tag|sha> controls
which libneo is fetched. Unset -> existing get_branch_or_main default.
Makefile: unexport LIBNEO_REF LIBNEO_PATH LIBNEO_BRANCH to stop make
from auto-importing them from the shell. Forward to cmake only when
passed explicitly on the make command line ($(origin) == command line).
LIBNEO_PATH maps to -DLIBNEO_SOURCE_DIR for local-checkout overrides.
.github/workflows/main.yml: remove top-level env LIBNEO_BRANCH block.
Pass LIBNEO_REF=${{ inputs.libneo_ref }} explicitly on the make command
line in both the test and cgal-wall jobs, only when the input is set.
README.md: document -DLIBNEO_REF / make LIBNEO_REF= and the local-path
equivalent.
This was referenced Jun 15, 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.
Summary
cmake/Util.cmake: drop$ENV{LIBNEO_BRANCH}read; renameLIBNEO_BRANCHcache var toLIBNEO_REF. The only way to override which libneo ref is fetched is-DLIBNEO_REF=<branch|tag|sha>. When unset, the existingget_branch_or_maindefault applies unchanged.Makefile:unexport LIBNEO_REF LIBNEO_PATH LIBNEO_BRANCHto stop make from auto-importing them from the shell. Forwards to cmake only when passed explicitly on the make command line via$(origin)check.LIBNEO_PATH=<dir>maps to-DLIBNEO_SOURCE_DIR=<dir>..github/workflows/main.yml: remove top-levelenv: LIBNEO_BRANCH:block. PassLIBNEO_REFexplicitly as a make command-line variable in both thetestandcgal-walljobs, only wheninputs.libneo_refis non-empty.README.md: documentmake LIBNEO_REF=/-DLIBNEO_REF=and the local-checkout equivalent.Verification
$ENV{LIBNEO_BRANCH}is gone:Ambient env is ignored by cmake:
Ambient env is ignored by make (env import blocked; command-line value forwarded):
Explicit cache var is honored:
Workflow
env: LIBNEO_BRANCH:block is gone;inputs.libneo_refis forwarded asLIBNEO_REF=on the make command line only when set.