Verification & Benchmarks Overview¶
FlexMESA compares its numerical kernels, microphysics evaluators, linear solvers, and stellar evolution drivers against upstream Fortran MESA (release 26.4.1, commit c8c2026, Zenodo record 19722306) across four execution paths:
- Fortran Comparator (
gfortran -O2 -fopenmp): Compiled against MESAr26.4.1static archives inbenchmarks/fortran_mesa/. Across the28benchmark workloads,21call MESA subroutines in all stages,3call MESA in Stages 0-1 and Reference Fortran in Stages 2-3 (auto_diff,mtx_tridiag,chem_comp),3combine MESA utilities with local loops (w5_diff_rot,w5_binary_rlof,w5_astero_seism), and1is standalone non-MESA Reference Fortran (w5_riemann_rsp2). - Safe Rust (
crates/flexmesa-*): Canonical implementation inNumericsMode::Strict(crlibm, no FMA contraction, 4-threadrayonpool). - Python / PyO3 (
flexmesa._rust): Zero-copy C-contiguousnumpy.float64bindings releasing the Python GIL. - Python / JAX (
@jax.jit&jax.vmapinfloat64): Derived XLA GPU kernels validated against Safe Ruststrictmode (#166,DECISIONS #17,#23).
The acceptance pass rate against MESA 26.4.1 references currently stands at 96 / 106 passing cases (10 declared gaps, 0 awaiting reference runs; see Declared Known Gaps and Port Coverage Map).
Provenance & Representative MESA r26.4.1 Timings¶
- Raw archive:
benchmarks/raw/26.4.1/(provenance.json,fortran_wave*.txt,rust_waves_1_to_5.txt,python_waves_1_to_5.json). - Capture timestamp (UTC):
2026-11-17T22:46:37Z(with cleanfortran_wave3b.txtandfortran_wave4.txtrerun from a relativeMESA_DIRlayout at2026-11-17T23:25:34Zon base commitb5b6abd). - Continuous verification:
ci_continuous_verification = false(CI builds and tests Safe Rust, PyO3, and JAX without a MESA installation, so the Fortran comparators run offline on a workstation). - Host hardware:
AMD Ryzen 7 9800X3D 8-Core Processor(16 logical cores,OMP_NUM_THREADS=4,RAYON_NUM_THREADS=4),NVIDIA GeForce RTX 5080,Linux x86_64. - Toolchains: MESA
r26.4.1, SDKx86_64-linux-26.6.1,GNU Fortran (GCC) 15.2.0(-O2 -fopenmp -cpp -ffree-form -ffree-line-length-none),rustc 1.100.0 (0ef1bc386 2026-11-09),Python 3.14.0, JAX0.11.0(gpu,jax_enable_x64=True). -
Workload taxonomy (
28workloads,84(workload, N_zones)points):21full MESAr26.4.1workloads,3mixed MESA0-1/ Ref. Fortran2-3workloads (auto_diff,mtx_tridiag,chem_comp),3hybrid Reference Fortran workloads (w5_diff_rot,w5_binary_rlof,w5_astero_seism), and1standalone non-MESA Reference Fortran workload (w5_riemann_rsp2). -
Checksum accounting: Across all
57(workload, N_zones)operating points in Waves 1-3b, Safe Rust and Fortran match across all 9 printed significant digits. The fullfloat64Python checksums differ from the printed Fortran values by at most4.84e-09, within the5e-09rounding of a 9-digit print. The 1D stellar-structure workloads diverge on all five cases: across all sizes the Rust and Fortran checksums differ by between2.10e-06and a factor of12.6(thestar_remeshstages also time different work). Wave 5w5_diff_rotdiverges by99.17%(#158). - Cases where Fortran is faster: At 4 threads, Fortran is faster than Safe Rust on
interp_2d,mtx_tridiag(batch Thomas),ion_fe56,star_hydro_eqns,star_newton_step,w5_diff_rot,w5_binary_rlof, andw5_astero_seism.star_remeshis not listed either way: its Fortran stage times onlyset_mesh_function_data, while the Rust stage times the wholedo_adjust_mesh.
| Physics Domain | Workload (\(N_{\mathrm{zones}}\)) | Comparator | Comparator 4t (\(\mu\mathrm{s}\)) | Safe Rust 4t (\(\mu\mathrm{s}\)) | JAX vmap Batch/4 (\(\mu\mathrm{s}\)) |
Scope & Result Notes |
|---|---|---|---|---|---|---|
| Turbulent Convection | turb_tdc (4096) |
MESA r26.4.1 (all stages) |
49494.47 |
2566.56 (19.28x) |
391.66 (126.37x) |
MESA set_TDC; scalar f64 root + IFT (DualOrder1<6>) |
| Mixing Length Theory | turb_mlt (4096) |
MESA r26.4.1 (all stages) |
1797.47 |
300.97 (5.97x) |
68.38 (26.29x) |
MESA set_MLT; closed-form cubic root + IFT tangents |
| Synthetic Photometry | colors_sed (1024) |
MESA r26.4.1 (all stages) |
25299.86 |
1619.97 (15.62x) |
689.47 (36.69x) |
MESA colors; 32-gather stencil + precomputed Simpson weights |
| Model Atmospheres | atm_table (4096) |
MESA r26.4.1 (all stages) |
1954.16 |
255.46 (7.65x) |
367.99 (5.31x) |
MESA atm_eval_table; pre-validated bicubic spline lookup |
| 4D Tabulated EOS | eos_4d (4096) |
MESA r26.4.1 (all stages) |
2697.28 |
839.76 (3.21x) |
333.70 (8.08x) |
MESA eosDT_get; sorted patch_lut + stack 16-channel blend |
Analytical Skye EOS |
eos_skye (4096) |
MESA r26.4.1 (all stages) |
16540.28 |
9525.61 (1.74x) |
4202.59 (3.94x) |
MESA eosDT_get_component; OnceLock<NuclideCatalog> + AD |
| Nuclear Networks | net_eval (4096) |
MESA r26.4.1 (all stages) |
26085.18 |
5411.82 (4.82x) |
5210.01 (5.01x) |
MESA net_get; real(qp) sums + thread-local buffers |
| 2D Bicubic Spline | interp_2d (4096) |
MESA r26.4.1 (all stages) |
41.69 |
70.69 (0.59x) |
318.67 (0.13x) |
MESA interp_evbicub_db; Fortran 4t faster; printed checksums identical |
| 1D Hydro Equations | star_hydro_eqns (1024) |
MESA r26.4.1 (all stages) |
2962.80 |
13814.92 (0.21x) |
541.21 (5.47x) |
MESA eval_equ; Fortran 4t faster; 1.60e-5 checksum diff |
| 1D Stellar Evolution | star_evolve_step (1024) |
MESA r26.4.1 (all stages) |
235422.09 |
59578.93 (3.95x) |
66017.92 (3.57x) |
Unequal dt = 100 s vs base.dt; checksum diff 7.48e-6 |
Riemann Hydro & RSP2 |
w5_riemann_rsp2 (1024) |
Ref. Fortran (non-MESA) | 45.71 |
12.16 (3.76x) |
323.75 (0.14x) |
Non-MESA Reference Fortran (bench_kernels_wave5.f90) |
Visual Benchmark Gallery (MESA r26.4.1, benchmarks/raw/26.4.1/)¶
1. Foundational Numerics, Splines, Neutrinos & Convection¶

2. Composition Moments, Partial Ionization & Kurucz SED Photometry¶

3. Analytical & Single-Table Equations of State (Ideal, HELM, PC, Skye)¶

4. 4D Tabulated EOS, Opacities, Reaction Networks & Model Atmospheres¶

5. 1D Stellar Structure, Henyey Solver & Coupled Evolution Step¶

6. Reference Fortran Comparator vs. FlexMESA (w5_*, Hybrid & Non-MESA)¶

Reproducing the Benchmarks Locally¶
Run the standalone Rust benchmark binary, Python/JAX suite, or (when a local MESA 26.4.1 build is installed) the Fortran comparator drivers:
# 1. Safe Rust Waves 1-5 CLI table (`--quick` runs N_zones=8 smoke pass)
cargo run --release -p flexmesa-bench --bin run_rust_benchmarks -- --quick
# 2. Fortran comparator against a local MESA 26.4.1 checkout
make -C benchmarks/fortran_mesa MESA_DIR=/path/to/mesa run
from flexmesa import bench
# Quick 128-zone Wave 1 PyO3 / JAX timing pass
records = bench.run_all_wave1_benchmarks(
zone_counts=(128,), n_warmup=1, n_repeats=2
)
for rec in records[:3]:
print(
f"{rec.workload:12s} n_zones={rec.n_zones:4d} "
f"stage0={rec.stage0.median_us:8.2f} us "
f"checksum={rec.checksum:.8e}"
)
For all 28 benchmark workload tables, see Kernel Performance Scorecards. For tolerance rules and documented discrepancies, see Tolerance & Discrepancy Ledger.