Your Simulation Runs but Solves the Wrong Physics: Verifying What LLM-Generated Simulation Code Encodes
Zhenghan SongYLYulong LiuCheng WanChenjun LiLingfu LiuYunyi LiCongcong Yuan
Zhenghan Song
YLYulong Liu
Cheng Wan
Chenjun Li
Lingfu Liu
Yunyi Li
Congcong Yuan
+7
The paper argues that accepting LLM-generated scientific simulation code merely because it runs is unsafe, and introduces MooseBench, a released 220-case multiphysics benchmark. Across three LLMs, 41-60% of runnable MOOSE inputs, and 39-56% of those completing, violate the expert reference by encoding a different problem; this persists in newer models including GPT-6 Sol (68% of its runnable inputs), even when the model first states its intended specification. These violations usually alter solutions: on a 98-case subset, 56 of 63 comparable violating outputs deviate over 1% from the reference versus 6 of 48 fully compliant outputs. Because each MOOSE Kernel and boundary-condition object contributes a known weak-form term, the authors' verifier reads the encoded PDE from the input and compares it to the intended one without running the solver or using an LLM judge; it accepted all 962 physics-preserving rewrites and flagged 1,286 of 1,313 physics-changing mutations. As repair feedback, its usefulness depends on the correctness of the specification it is checked against.

arXiv ·
· May 10, 2026