feat(client): modernize further and modularize#329
Open
HaoZeke wants to merge 12 commits intoTheochemUI:mainfrom
Open
feat(client): modernize further and modularize#329HaoZeke wants to merge 12 commits intoTheochemUI:mainfrom
HaoZeke wants to merge 12 commits intoTheochemUI:mainfrom
Conversation
eOn Documentation PreviewDownload: documentation.zip Unzip and open |
Benchmark ResultsWarning 1 benchmark(s) regressed
Regressions
Improvements
5 unchanged benchmark(s)
Details
Raw asv-spyglass output |
61b1783 to
889ab41
Compare
cce6e6b to
6c81771
Compare
Remove all `using namespace std;` from 60+ non-thirdparty files. Qualify all bare abs/fabs/sqrt/exp/min/max/pow with std:: prefix. Replace C-style casts with static_cast, NULL with nullptr, (void) with (), bool flags with proper bool, == true/false with direct bool. Fix 15 latent bugs uncovered during modernization: - DynamicsSaddleSearch snapshot aliasing (shared_ptr copy vs alias) - BondBoost/LBFGS/Hessian bare abs() integer truncation on doubles - Prefactor Hessian size check compared min1 vs saddle twice - TestJob double-free on unique_ptr and use-after-free - maxAtomMotionV out-of-bounds read on vectors < 3 elements - LBFGS degenerate curvature abort (now resets memory) - QSC delete vs delete[] UB, EAM per-loop allocation - Matter operator= cache invalidation, convel extension bug - Float precision in QQ-HTST prefactor constants Performance: eliminate pow() with integer exponents in LJ, EAM, IDPP, NEB spline (Horner's method), Water_Pt force loops. Replace division with inverse-multiply in Matter getAccelerations. Vectorize Matter getKineticEnergy. Pre-compute box reciprocals and r^2 cutoff. RAII: replace new[]/delete[] with std::vector in Water_Pt and EMT. Parallel replica dynamics in ReplicaExchangeJob via std::thread with per-image potential instances.
…ork) Remove INIFile.cpp/h (superseded by inih header-only subproject), 36 CMakeLists.txt files and Makefile/buildRules.mk (replaced by meson), old unittests/ framework (ported to Catch2), LAMMPS fakempi.h (no longer needed with runtime dlopen). ~2600 lines removed.
LammpsLoader singleton loads liblammps at runtime via dlopen/LoadLibrary. Cross-platform DynLib.h abstraction (Linux/macOS/Windows). LAMMPS potential always compiled; clear error if library not installed. Removes with_lammps meson option and -DLAMMPS_POT compile flag.
Highway 1.2.0 via wrap file with cmake defines to disable tests/gtest. Detected at configure time; sets -DWITH_HIGHWAY when found. SIMD potential kernels planned but not yet implemented.
…sion outputs Always compile LAMMPS (runtime dlopen). Add Highway cmake subproject detection. Move bench_pot to meson benchmark(). Add ci-lammps, ci-xtb, ci-mta pixi environments. Gitignore regression workdirs and snakemake metadata.
… SVN coverage New test files: - NEBSubsystemTest (20 cases: tangent, spring, projection, DNEB, spline) - HelperFunctionsTest (9 cases: random, gaussRandom, split_string_int) - LammpsLoaderTest (2 cases: singleton, availability check) - PotBenchmark (4 cases: Morse, LJ, PBC, kinetic energy timing) Enhanced JobIntegrationTest with SVN-verified Si potential point tests (SW, Tersoff, EDIP, Lenosky -- guarded by WITH_FORTRAN). Enhanced OptimizerTest with explicit parameter initialization.
Changelog fragments: bugfix-bare-abs, bugfix-lbfgs-curvature, bugfix-maxatommotionv, bugfix-prefactor-hessian, bugfix-snapshot-aliasing, dead-code-removal, highway-simd, lammps-runtime, namespace-cleanup, parallel-replica-exchange, perf-pow-elimination. Dev beads: approval/fuzz testing, competitive benchmarks, EMT RAII, Fortran modernization, Highway potential kernels, SafeHyper test, SVN reference coverage.
9a86170 to
6b23325
Compare
0409e83 to
1b3a16c
Compare
…ture Core NEB refactoring: decompose into strategy pattern with variant-based dispatch (tangent, spring, projection axes). OCINEB hybrid refinement. SIDPP improvements (frontier convergence, reparameterization). Per-image parallel potentials for NEB, Dimer, ImprovedDimer, ProcessSearch. Parameter decomposition: 33 option-group structs with JSON serialization. inih-based INI parsing replacing monolithic Parameters god object. Quality infrastructure: Catch2 test framework, SVN regression reference data, ASV benchmarks, Quill logging (replacing spdlog). Test data: .con files for Morse Pt, LJ cluster, Si diamond, Al FCC, Cu FCC, Fe BCC, and NEB Morse systems with SVN-verified reference values.
7d87389 to
eae9d0a
Compare
d2ed087 to
23e68a5
Compare
Root cause: PyTorch's JIT profiler specializes the computation graph after the first forward pass. A fresh MetatomicPotential instance produces ULP-level different forces than one that has already processed other inputs. In parallel NEB, per-image potentials (each freshly loaded via makePotential) diverge from the sequential case (shared instance, warmed after endpoint evaluation). Reproduced with PET-MAD v1.1.0 on CUDA: neb_000.dat endpoint 9 differs at 6th decimal between parallel=true and parallel=false. This accumulates across NEB iterations causing trajectory divergence (different force call counts and barrier heights). Fix: - Disable JIT profiling (torch::jit::getProfilingMode() = false) in MetatomicPotential constructor. All instances now use the unoptimized interpreter, producing bitwise-identical results regardless of call history. - Only create per-image potentials for intermediate NEB images, not endpoints (which are evaluated once during initialization). Verified: parallel=true and parallel=false produce identical neb.dat and identical force call counts (419) on the hconh3_cation benchmark.
5ba7cd7 to
d32ccf4
Compare
Add Potential::forceBatch() virtual method for evaluating N systems in a single call. Default implementation loops over force(). MetatomicPotential overrides with native batching: single model.forward() for all N systems, single backward() for gradients (each system has independent positions tensor so gradients naturally separate). NEB updateForces() uses batched path when pot->supportsBatchEvaluation(). Dimer and ImprovedDimer batch their 2-system evaluations similarly. Eliminates per-image potential instances, JIT profiling divergence, N model copies, and threading overhead. One model, one forward pass, one backward pass. Also adds Matter::forcesData() and Matter::setComputedPotential() for external result injection by batched callers.
d32ccf4 to
17c380a
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.
Comprehensive modernization of the eOn C++ client:
Implementation details: