Migrate KiLCA roots, sort, multiroot to fortnum (5/8)#144
Draft
krystophny wants to merge 1 commit into
Draft
Conversation
e8525fb to
a612cb8
Compare
c16d13f to
f7ca693
Compare
f7ca693 to
8c1f673
Compare
This was referenced Jun 14, 2026
0cd18eb to
88506bd
Compare
0c757cd to
473b7b8
Compare
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.
Merge order
These fortnum-migration PRs are individually based on
mainand form onecumulative stack. Merge them in this order:
#140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150
Each PR is opened against
main, so its diff is cumulative versusmainandoverlaps its predecessors. Merging in the order above keeps the history linear:
once a predecessor merges into
main, the next PR's diff shrinks to just itsown increment.
Scope
Route the remaining GSL solver and utility call sites onto the fortnum C ABI. The resonant-surface search (
calc_mode) usesfortnum_root_brent; the eigenmode determinant zero search (calc_eigmode) usesfortnum_multiroot_hybridwith its internal central-difference Jacobian in place of thegsl_multiroot_fdfsolverhybridsj solver plus the hand-rolledeval_jac; the grid index sorts (calc_cond,sysmat_profs,adaptive_grid) go through a newsort_index_doubleshelper wrappingfortnum_argsort. Thegsl_vectorresidual and the unused GSL circle-integration helpers are removed.Dependency removed
GSL roots (
gsl_root_fsolverbrent), multiroot (gsl_multiroot_fdfsolverhybridsj),gsl_deriv_central, andgsl_heapsortin KiLCA.Verification
The fortnum root/multiroot/deriv/argsort signatures compile, link, and compute correctly:
test_root_finding,test_ampere_matricespass in the stack-tipctestrun (see K8). Draft: only the stack tip was built end to end.Stack reconciliation (update)
The migration stack was rebuilt as a strictly linear cumulative chain on main
428a708:Every branch now pins fortnum to main
974dcf1(all kernel fixes plus both new integrators). This branch's standalone golden result above stands. The cumulative tip (#150 z3) does not pass: the KiLCA background equilibrium ODE on#143 k4cannot reproduce the GSLrk8pdgolden with DOP853 at the unchanged1e-8bar. See#143and#150. Tolerances were not weakened and the stored golden was not regenerated.Merge order:
#140 -> #141 -> #142 -> #143 -> #144 -> #145 -> #146 -> #147 -> #148 -> #149 -> #150.Note: fortnum pin updated to current main (92de6e9) after a fortnum history rewrite; old shas no longer resolve.