PhysGate: A Physics-Checking Workflow to Catch Silent Errors in AI-Written Scientific Code

A PhD student in atmospheric physics at UCAS built PhysGate, an open-source MIT-licensed workflow that forces AI coding agents to pass physics checks before scientific code is accepted. The author noticed that agent-written Python often runs without errors and passes basic tests while still producing physically wrong results. PhysGate works through four gates: a spec with explicit physical constraints, executable pytest assertions for conservation, units and bounds, isolated git worktrees for parallel agents, and a blind review by models from other families. The author shares three reproducible benchmarks comparing unconstrained AI output with gated output, covering atmospheric rivers, deep-ocean Argo data, and capped supercell CAPE. The tool is available on GitHub and can be installed as a skill for Claude Code, Antigravity, or Codex CLI.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in