Skip to Main Content

Climate, weather, ocean and engineering models still run on Fortran written before GPUs existed. That code can’t run on GPUs, can’t be differentiated for calibration or machine learning, and the people who wrote it are retiring. Rewriting it by hand takes years, and nobody can prove the rewrite is right. f2j translates Fortran into JAX one routine at a time and checks each translation against the original. Muse Spark (muse-spark-1.3 on the Meta Model API) writes the code. The original Fortran, compiled with f2py, is the judge. Every candidate must pass five checks: it compiles it matches the Fortran to a relative tolerance of 1e-10 it gives the same results when batched with jax.vmap its gradients agree with finite differences of the Fortran it passes held-out tests the model never sees gcov shows that the tests actually reach the code. When a candidate fails, Muse Spark gets the exact mismatch plus a hint such as “output is transposed”, and tries again. Routines that can’t be translated safely, such as ones that keep hidden state, stay in Fortran behind a JAX callback, so the whole model still runs. On the repo’s shallow-water example, the live run with Muse Spark gave these results: 8 of 9 routines translated, each passing all five checks on its first try; the ninth stayed in Fortran by design 8 model calls, 51 seconds, $0.05 over 200 time steps, the JAX model stayed within 2 × 10⁻¹⁴ of the Fortran The translated model can then do things the Fortran never could: recover a physical parameter from data in five Gauss–Newton steps, using derivatives through the whole model run a 64-member ensemble about 4× faster per member on a laptop CPU You can try it in about two minutes with no API key: an offline replay mode reproduces the full pipeline, including the repair loop.

Team

rabbim

More from Meta Global AI Developer Hackathon

Cardo turns the world around you into Kurdish flashcards. Kurdish is spoken by tens of millions of people, but it has very few learning tools, and most…

Kurdolingo project preview

oqed is an LLM-guided superoptimizer for x86-64. You point it at a C or C++ project and it does the rest: - builds the project and runs its workload…

oqed project preview

Playtest Agent plays a game from screenshots, looks for bugs, then replays each report and has a judge check it. I make games alone. Solo developers and…

Adrian project preview

Open-source npm malware detection on Meta's models: a live monitor that flags new malware about a day before the public lists, a Muse agent that investigates…

Gatekeeper project preview

Video2URDF turns one short phone video of a real articulated object (a laptop lid, a drawer, a desk lamp, a microwave door) into a measured URDF/MJCF a robot…

Video2URDF project preview

Glimmer Scope opens up Muse Glimmer 30B so you can see and steer the concepts it thinks with. I trained sparse autoencoders on nine layers of Glimmer's…

Kroonen AI project preview