Repository navigation
feat(xtsci): run Guenole fast inertial relaxation engine 2.0 for fire2 - #871
Merged
Merged
Conversation
With eindir-core linked, XtsciOptimizer::run sends a whole minimization through rgmin_minimize_eindir. That call passed max_move as rgmin_control_t::istep, which the fast inertial relaxation engine (FIRE) and quick-min read as their time step. The session path in step() already passed time_step. On the base, the new test showed it on a quadratic. Time steps of 0.1 and 0.2 ended at the same point, while max_move values of 5 and 50 diverged. Both paths now take istep from one initial_step helper. FIRE, its 2.0 variant and quick-min get time_step. The other methods still start from max_move.
The fire2 token mapped to RGMIN_FIRE2. By default rgmin runs that method with the fast inertial relaxation engine (FIRE) 1.0 parameters. That schedule has no half-step correction, no initial delay and no dt_min. ensureSolver now calls rgmin_solver_set_fire_variant with RGMIN_FIRE_GUENOLE2020 right after rgmin_solver_create. fire2 then runs algorithm 2 of Guenole et al. (2020) with semi-implicit Euler and the parameters of Table 1 in that paper. The variant takes dt0 from control.istep, set from time_step. rgmin_minimize_eindir takes no variant, so Optimizer::run keeps fire2 on the session loop. A client built against rgmin older than application binary interface (ABI) minor 27 refuses fire2 instead of running the old schedule. The fire token and the native FIRE keep the 1.0 schedule. A new test replays algorithm 2 from the paper on a quadratic with three stiffnesses. Over 60 steps it moves half a step back five times inside the delay and three times after it. The fire2 trajectory matches the replay to 1e-17. FIRE 1.0 strays by 0.65, and fire2 without the variant by 1.01. Another test checks that run gives the same end point as a loop of step calls. The docs now describe what fire2 runs in the schema model, the published schema, the glossary and the optimizer guide.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
HaoZeke
force-pushed
the
feat/fire2-optin
branch
from
November 3, 2026 13:24
05c9d11 to
e4a75e7
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.
Summary
[Xtsci] method = fire2now runs version 2.0 of the fast inertial relaxation engine (FIRE) as algorithm 2 of Guenole et al. (2020) gives it, with the parameters of Table 1 in that paper.Until now the token ran the rgmin default schedule for
RGMIN_FIRE2.That schedule keeps the FIRE 1.0 parameters and has no half-step correction, no initial delay and no
dt_min, so a user who asked for FIRE 2.0 got the old parameters.method = fire,opt_backend = rgminand the native FIRE keep the 1.0 schedule.The first commit fixes the time step of the whole-run path.
With eindir-core linked,
XtsciOptimizer::runpassedmax_movetorgmin_minimize_eindirasistep.FIRE and quick-min read
istepas their time step, sotime_stephad no effect there.Both paths now take
istepfrom one helper:fire,fire2andquickmingettime_step, and the other methods still getmax_move.Example
Relax the displaced 13-atom Lennard-Jones (LJ) cluster in
client/unit_tests/data/systems/lj13_saddle/displacement.con, copied topos.con, with thisconfig.ini:eonclientprintsMinimization converged within tolerenceandFinal Energy: -39.96535193391027.In
results.dat, the run records108 total_force_calls,fire2 xtsci_methodandxtsci optimizer_backend.The client refuses
fire2when rgmin is older than application binary interface (ABI) minor 27, and does not fall back to the old schedule.Before and after
Force calls of single
eonclientminimizations with the config above,converged_force = 0.001, the defaulttime_stepandmax_move, and rgmin linked without eindir-core."Before" is a client built without this pull request, and "after" is a client built with it.
Both clients link the same rgmin build.
The inputs come from
client/unit_tests/data/systems.lj13_saddle/displacement.conwithpotential = lj.Pt_Heptamer_FrozenLayers/displacement.conwithpotential = morse_pt.cu_fcc/pos.conwithpotential = emt.The counts for native FIRE and rgmin
firestay the same.We ran on 8 virtual CPUs of an Intel Xeon processor, Linux 6.12 on x86_64, with gcc 13.3.0 and
--buildtype release.One run per system cannot rank the two schedules.
The hierarchical model of Goswami (2025) does that from repeated starts.
Changes
client/XtsciOptimizer.cpp: one helper setsistepfor bothstep()andrun.For the
fire2method, the solver setup callsrgmin_solver_set_fire_variantwithRGMIN_FIRE_GUENOLE2020after it creates the session.rgmin_minimize_eindirtakes a method and no variant, sorunkeepsfire2on the step-wise session loop, andfire2follows the paper in bothstep()andrun.client/unit_tests/XtsciFireTest.cpp: the newtest_xtsci_fire, built only when rgmin is linked.xtsci.json, the glossary and the optimizer guide now describe whatfire2runs, and two newsfragments cover the two commits.Tests
test_xtsci_firereplays algorithm 2 from the paper on a quadratic with stiffnesses 1, 3 and 7.Over 60 steps the replay moves half a step back five times inside the delay and three times after it.
The largest gap between the
fire2trajectory and the replay is 1e-17, and FIRE 1.0 strays from it by 0.65.Three more cases cover the rest.
For
fireandfire2,runfollowstime_stepand ignoresmax_move.For
fire2,runand a loop ofstep()calls reach the same point.fireandfire2relax a displaced LJ13 to the same minimum along different paths.We ran both suites, and every test passed:
meson test --suite eon: 75 of 75 OK with rgmin only, and 75 of 75 OK with eindir-core linked.test_xtsci_fire,test_rgmin_backend,test_xtsci_eindir,test_optimizerandtest_minimizationpass in both builds.pytest packages/eon-schema: 57 passed.To reproduce, inside the pixi
dev-liteenvironment:Build note
No build with eindir-core linked compiles against a published eindir-core.
The published 0.6.0 crate lacks the objective descriptor that the eOn adapter in
XtsciEindir.cppuses.Under C++, its generated header puts every name in
namespace eindir, whilergmin.hand eOn use the names unqualified.We built eindir from its main branch for the runs with eindir-core linked.
For those runs, a local
eindir-core.hincludes the generated header and addsusing namespace eindir.That header is not part of this pull request.
The continuous integration (CI) job builds without eindir-core, so
runthere already used the session loop.Left for later
client/FIRE.cpp.step()caps each atom atmax_move.References
The first reference appears in a journal of the American Institute of Physics (AIP).
The second names the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS).