PSI, EPFL and Max Planck researchers translate the ORB5 plasma simulation code from Fortran to C++/Kokkos with Cursor, Claude Code, Codex and OpenCode, matching the original to near machine accuracy
Researchers from the Paul Scherrer Institute, EPFL and the Max-Planck-Institut für Plasmaphysik built ORB5X, a C++17/Kokkos translation of ORB5, a global electromagnetic gyrokinetic particle-in-cell code for tokamak plasmas written in Fortran. Translation used several coding agents (Cursor, Claude Code, OpenCode and Codex, including local models served by Ollama) in bounded campaigns: each patch was built, run against the Fortran reference, and kept only if HDF5 output parity held or improved, with a human reviewing every patch. ITG, ITPA and chirping benchmark tests show agreement of almost machine accuracy with ORB5 for the field components, and ORB5X compiles and runs on laptops and on LUMI-G, Daint-ALPS, CINECA and Discoverer.
The numbers (as reported)
| Benchmark agreement with Fortran ORB5 | Almost machine accuracy for ITG, ITPA and chirping field components |
|---|---|
| Platforms | Linux and Mac laptops; LUMI-G, Daint-ALPS, CINECA, Discoverer |
| Scaling | Near-ideal on AMD MI250X (LUMI-G) and NVIDIA GH200 (Daint) |
Facts
- Company / subject
- ORB5X (PSI, EPFL, Max-Planck-Institut für Plasmaphysik)
- Tools
- Cursor, Claude Code, OpenCode, OpenAI Codex
- Models
- qwen2.5-coder:32b, gpt-oss:120b
- Codebase
- brownfield
- Work type
- Language port
- Stack
- Fortran, C++17, Kokkos, MPI, HDF5, FFTW, CMake
- Published
- 2026-07-19
- Last checked
- 2026-11-16
What the source claims Practitioner (own blog/paper)
Claimed by the builder, writing about their own work. Not checked independently.
- ITG, ITPA and chirping tests agree with the Fortran original to almost machine accuracy
- Compiles and runs on personal laptops as well as several HPC clusters, lowering the cost of maintaining the Fortran code
Caveats
Written by the researchers who did the translation. The paper gives no code size, duration, cost or share of code written by agents. The tuned Fortran ORB5 is still faster than ORB5X where it runs; the authors present ORB5X as an initial implementation, and some routines still stage through host memory for FFTW, HDF5, LAPACK and MPI. The strong-flow path should not be treated as production-ready until a rotating-plasma case is validated.
More stories by tool: Claude CodeOpenAI CodexCursorOpenCode
Related topics: Language portsBrownfield codebases