Repository navigation
Skip the structure analysis when a phase-stability check is disabled - #288
Conversation
check_if_melted / check_if_solidfied computed the solid fraction with pyscal3 even with `tolerance.solid_fraction: 0` / `liquid_fraction: 1`, where the comparison that follows can never trigger. The analysis is not free, and pyscal3 segfaults in find.neighbors on some LAMMPS triclinic dumps. That killed reversible-scaling runs at the start of a backward sweep, right after the middle equilibration dumps traj.temp.dat, over a check that could not have stopped them. Seen on Mg2Si (antifluorite, 3993-atom 60-degree primitive cell, GRACE potential): the run segfaulted at that point in three separate runs, and pyscal3 reproduces the crash on CPU from the saved traj.temp.dat. An Al2Ca dump in the same kind of box, and synthetic disordered Mg2Si cells, pass. So it depends on the dump, not on the box type alone. Enabled checks are unchanged; liquid.py's melting-cycle check (which needs the analysis) is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RebMnzKCNqF5XyBrSLhBnU
|
The crash that motivated this PR is gone with pyscal3 ≥ 4.0.0, which Root cause, in pyscal3 3.3.2. The cell list that
pyscal3 4.0.0 fixed this in e1aa5b2 ("build cell lists on fractional coordinates so triclinic cells work"). Side note for anyone still on calphy ≤ 2.0.1, which pins the 3.x API. Even when 3.3.2 does not crash, it returns wrong neighbour lists for any triclinic box above 250 atoms.
This change is still worth having on its own. With |
Problem
Phase.check_if_meltedandPhase.check_if_solidfiedalways compute the solid fraction with pyscal3 (helpers.find_solid_fraction) and only then compare it with the tolerance. Withtolerance.solid_fraction: 0(melt detection off) orliquid_fraction: 1(solidification detection off), that comparison can never trigger, yet the analysis still runs.That would only cost time, except that pyscal3 segfaults in
find.neighborson some LAMMPS triclinic dumps. In atsrun the check runs after every backward sweep's middle equilibration, on the freshly dumpedtraj.temp.dat. A segfault there kills the whole job, with exit 139 and no Python traceback, over a check that was switched off.Where it showed up
Mg2Si (antifluorite) as a 3993-atom 60° primitive cell, GRACE potential,
mode: ts,tolerance.solid_fraction: 0(compounds: the solid-fraction criterion does not apply to them):pyscal3.System(traj.temp.dat).find.neighbors(method="cutoff", cutoff=5.0)reproduces the segfault on CPU from the saved dumps.Change
Each check returns immediately when its tolerance disables it:
check_if_meltedsolid_fraction <= 0check_if_solidfiedliquid_fraction >= 1liquid.py's melting-cycle check, which needs the analysis, is untouched.mode: melting_temperatureforce-enables detection, so it is unaffected.Tests
tests/test_disabled_phase_checks.py:find_solid_fraction.The pyscal3 crash itself is worth a separate report upstream (it is reproducible from the saved dump).
🤖 Generated with Claude Code
https://claude.ai/code/session_01RebMnzKCNqF5XyBrSLhBnU