Molecular dynamics simulations are computationally expensive, but optimizing them requires more than preserving exact program behavior. Many useful changes alter numerical trajectories while still preserving the physical properties that matter for a given simulation, such as energy stability, reversibility, or ensemble-level statistics.
We present a source-to-source optimization framework that searches for faster molecular dynamics implementations under physics-aware validation. The framework combines equivalence-preserving rewrites with stochastic program mutations that deliberately explore beyond ordinary semantic equivalence. For each candidate, a staged verifier checks both structural requirements and simulation-specific physical behavior, while a population-based search balances runtime, physical deviation, and program simplicity.