Migrate KIM Fokker-Planck QUADPACK to fortnum (2/8)#141
Draft
krystophny wants to merge 1 commit into
Draft
Conversation
3635b49 to
6048ea8
Compare
6048ea8 to
5ad67b0
Compare
This was referenced Jun 14, 2026
b20511c to
ee0728e
Compare
5fcc8d9 to
b091cad
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.
Migrate the KIM Fokker-Planck QUADPACK calls (vendored Netlib
dqag/dqags) onto the fortnum adaptive integrator, and pin fortnum to the main commit that makes its QAGS/QAGP/QAGIU path reproduce QUADPACK.The fortnum adaptive driver previously used a clean-room extrapolation control that drifted on singular and semi-infinite integrands and used 5-11x more panels than QUADPACK at the same tolerance, which is what timed out this golden. fortnum main
974dcf1reimplements the extrapolation path to follow QUADPACK dqagse/dqagpe (faithful dqelg Wynn-epsilon table, incremental dqpsrt ordering, depth-keyed level/levmax extrapolation gate, break-adjacent ndin error inflation).int_0^1 ln xandint_0^1 x^-1/2now reach machine precision in 6 subintervals (231 GK21 evals), bit-matching Netlib dqagse.Verification
Built against fortnum main
974dcf1and ran the golden under a uv venv (pytest numpy scipy h5py f90nml matplotlib), Python 3.13.Before (CI, this branch on the old fortnum):
ql-balance_golden_recordexceeded the 600 s timeout (the slow over-subdividing QAGS/QAGIU path).After:
Per-quantity pytest run (golden bar rtol=1e-8, atol=1e-15, unchanged):
All LinearProfiles/KinProfiles quantities including Br_Re/Br_Im/Br_abs, dqle*/dqli*, T_EM_phi_e/i pass; no quantity exceeds rtol=1e-8.
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.