Skip to content

Kernel Performance Scorecards (MESA r26.4.1)

These four-stage scorecards report the measurements in the committed MESA r26.4.1 raw captures in benchmarks/raw/26.4.1/. All Rust numbers were recorded in NumericsMode::Strict (crlibm elementary functions, no FMA contraction); see notes/audit/fast_vs_strict.md for fast vs. strict scaling (#165).

Provenance & Stage Semantics

  • 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 clean fortran_wave3b.txt and fortran_wave4.txt rerun from a relative MESA_DIR layout at 2026-11-17T23:25:34Z on base commit b5b6abd).
  • 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, SDK x86_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, JAX 0.11.0 (gpu, jax_enable_x64=True).
  • Workload taxonomy (28 workloads, 84 (workload, N_zones) points): 21 full MESA r26.4.1 workloads, 3 mixed MESA 0-1 / Ref. Fortran 2-3 workloads (auto_diff, mtx_tridiag, chem_comp), 3 hybrid Reference Fortran workloads (w5_diff_rot, w5_binary_rlof, w5_astero_seism), and 1 standalone non-MESA Reference Fortran workload (w5_riemann_rsp2).

Each workload reports medians in microseconds (\(\mu\mathrm{s}\)):

  1. Stage 0: 1-thread baseline (gfortran -O2, Safe Rust --release strict mode, and 1-thread flexmesa._rust PyO3).
  2. Stage 1: 1-thread contiguous Structure-of-Arrays (SoA) loops in Fortran and Rust, and 4-thread rayon flexmesa._rust PyO3 in Python.
  3. Stage 2: 1-thread hoisted/fused loops in Fortran and Rust (using Reference Fortran loops on auto_diff, mtx_tridiag, and chem_comp), and warm single-profile @jax.jit (float64 GPU).
  4. Stage 3: 4-thread OpenMP (OMP_NUM_THREADS=4) in Fortran, 4-thread rayon in Safe Rust, and amortized per-profile batched @jax.jit(jax.vmap) (\(B = 4\) profiles) in JAX.

1. Foundational Numerics, Splines, Neutrinos & Convection (\(N_{\mathrm{zones}} = 4096\))

Full \(N_{\mathrm{zones}} \in \{128, 1024, 4096\}\) tables live in the Wave 1 Benchmark Report. Three Wave 1 caveats apply at \(N_{\mathrm{zones}} = 4096\):

  • Mixed comparators: auto_diff (eval_autodiff_fused) and mtx_tridiag (fast_block_thomas_solve) Stages 2-3 time Reference Fortran loops rather than MESA library routines; MESA's single-matrix bcyclic_dble_decsolblk 4096-zone timing is 2161.30 us (1t) and 790.11 us (4t OpenMP).
  • Workloads where Fortran is faster: At 4 threads, Fortran MESA outperforms Safe Rust on interp_2d (41.69 us vs. 70.69 us), and Reference Fortran batch Thomas outperforms Safe Rust on mtx_tridiag (196.10 us vs. 323.73 us).
  • Checksum precision: Fortran and Rust print 9 significant digits, and every Wave 1 printed checksum is identical. The full float64 Python checksums differ from the printed Fortran values by at most 4.84e-09, within the 5e-09 rounding of a 9-digit print, so these captures cannot show a difference below that.
Workload Comparator Fortran 1t Stage 2 (\(\mu\mathrm{s}\)) Fortran 4t Stage 3 (\(\mu\mathrm{s}\)) Safe Rust 1t Stage 2 (\(\mu\mathrm{s}\)) Safe Rust 4t Stage 3 (\(\mu\mathrm{s}\)) PyO3 Best (\(\mu\mathrm{s}\)) JAX @jit Stage 2 (\(\mu\mathrm{s}\)) JAX vmap Stage 3 (\(\mu\mathrm{s}\)) Fortran Checksum Safe Rust Checksum Rel. Diff
auto_diff (hyperdual) MESA r26.4.1 (0-1) / Ref. Fortran (2-3) 77.78 29.92 64.04 24.83 119.04 1275.88 314.17 4.05502565e+06 4.05502565e+06 0.00e+00
interp_2d (bicubic) MESA r26.4.1 (all stages) 162.39 41.69 142.22 70.69 81.34 1312.13 318.67 1.84483783e+05 1.84483783e+05 0.00e+00
neu (Itoh 5-channel) MESA r26.4.1 (all stages) 2544.49 910.58 1446.90 364.84 394.43 1350.53 330.96 8.14056643e+14 8.14056643e+14 0.00e+00
mtx_tridiag (\(5 \times 5\) block) MESA r26.4.1 (0-1) / Ref. Fortran (2-3) 789.19 196.10 1294.80 323.73 1380.73 7451.55 2795.65 5.52650461e+03 5.52650461e+03 0.00e+00
turb_mlt (Cox MLT) MESA r26.4.1 (all stages) 7122.10 1797.47 1203.47 300.97 297.82 283.67 68.38 1.75167983e+03 1.75167983e+03 0.00e+00
turb_tdc (Kuhfuss TDC) MESA r26.4.1 (all stages) 198002.75 49494.47 9658.27 2566.56 2505.69 1562.54 391.66 1.69966039e+03 1.69966039e+03 0.00e+00

2. Atomic Composition, Ionization & Synthetic Photometry (\(N_{\mathrm{zones}} = 4096\))

Full \(N_{\mathrm{zones}} \in \{128, 1024, 4096\}\) tables live in the Wave 2 Benchmark Report. Stage 2/3 chem_comp Fortran timings run the hoisted Reference Fortran loop (eval_comp_hoisted). At 4 threads on ion_fe56, Fortran MESA (32.05 us) is faster than Safe Rust Stage 3 (71.69 us) and PyO3 Stage 1 (46.74 us).

Workload Comparator Fortran 1t Stage 2 (\(\mu\mathrm{s}\)) Fortran 4t Stage 3 (\(\mu\mathrm{s}\)) Safe Rust 1t Stage 2 (\(\mu\mathrm{s}\)) Safe Rust 4t Stage 3 (\(\mu\mathrm{s}\)) PyO3 4t Stage 1 (\(\mu\mathrm{s}\)) JAX @jit Stage 2 (\(\mu\mathrm{s}\)) JAX vmap Stage 3 (\(\mu\mathrm{s}\)) Fortran Checksum Safe Rust Checksum Rel. Diff
chem_comp (\(\bar{A}, \bar{Z}, Y_e\)) MESA r26.4.1 (0-1) / Ref. Fortran (2-3) 57.62 14.97 58.22 14.91 35.82 319.16 319.08 8.41795382e+03 8.41795382e+03 0.00e+00
ion_fe56 (\(\mathrm{Fe}^{56}\) in \(\mathrm{He}^4\)) MESA r26.4.1 (all stages) 124.65 32.05 140.60 71.69 46.74 1442.37 363.79 8.76575973e+04 8.76575973e+04 0.00e+00
ion_4d (4D partial ion.) MESA r26.4.1 (all stages) 4573.09 1169.82 4166.58 1083.42 1664.78 1274.67 3019.55 3.13293908e+04 3.13293908e+04 0.00e+00
colors_sed (Kurucz + \(UBVRI\)) MESA r26.4.1 (all stages) 392540.03 106190.19 26557.65 6770.62 6340.02 2629.70 2015.82 1.84617990e+04 1.84617990e+04 0.00e+00

3. Equations of State, Opacity, Networks & Atmospheres (\(N_{\mathrm{zones}} = 4096\))

All nine Wave 3a and Wave 3b workloads invoke compiled MESA r26.4.1 subroutines in every Fortran stage and match printed checksums across Fortran, Safe Rust, and Python/JAX (0.00e+00 at 9 significant digits; at most 3.40e-09 between full f64 JSON and the 9-digit printed values, within print rounding). Full per-size tables live in the Wave 3a Report and Wave 3b Report. Note that cold XLA compilation for eos_skye on GPU took 60.7 s (Stage 3 at N_zones = 4096) prior to warm execution.

Workload Comparator MESA 1t Stage 2 (\(\mu\mathrm{s}\)) MESA 4t Stage 3 (\(\mu\mathrm{s}\)) Safe Rust 1t Stage 2 (\(\mu\mathrm{s}\)) Safe Rust 4t Stage 3 (\(\mu\mathrm{s}\)) PyO3 4t Stage 1 (\(\mu\mathrm{s}\)) JAX @jit Stage 2 (\(\mu\mathrm{s}\)) JAX vmap Stage 3 (\(\mu\mathrm{s}\)) MESA Checksum Safe Rust Checksum Rel. Diff
eos_ideal (neutral + rad) MESA r26.4.1 (all stages) 9678.60 2452.50 5027.24 1222.13 1364.69 1295.06 325.25 7.36370820e+04 7.36370820e+04 0.00e+00
eos_helm (Timmes & Swesty) MESA r26.4.1 (all stages) 8845.34 2250.11 2285.51 552.04 818.10 1315.64 339.22 1.82024698e+05 1.82024698e+05 0.00e+00
eos_pc (Potekhin-Chabrier) MESA r26.4.1 (all stages) 43041.36 11229.69 16775.92 4176.51 4284.64 1418.73 645.09 2.10935846e+05 2.10935846e+05 0.00e+00
eos_skye (3rd-order AD) MESA r26.4.1 (all stages) 63575.02 16540.28 38290.31 9525.61 10097.24 3962.46 4202.59 1.82005197e+05 1.82005197e+05 0.00e+00
eos_4d (OPAL/FreeEOS) MESA r26.4.1 (all stages) 10452.64 2697.28 3266.93 839.76 1058.73 1372.01 333.70 1.04313071e+05 1.04313071e+05 0.00e+00
kap_fixed (rad + cond) MESA r26.4.1 (all stages) 13949.47 3484.26 3050.72 775.77 812.53 1691.59 1112.97 1.48945406e+03 1.48945406e+03 0.00e+00
rates_screen (REACLIB) MESA r26.4.1 (all stages) 5562.06 1449.50 2393.40 612.07 571.62 1288.68 319.30 -5.82255771e+04 -5.82255771e+04 0.00e+00
net_eval (basic.net + \(J\)) MESA r26.4.1 (all stages) 97309.08 26085.18 20921.58 5411.82 4789.53 5699.80 5210.01 4.92535290e+04 4.92535290e+04 0.00e+00
atm_table (2D bicubic) MESA r26.4.1 (all stages) 7488.36 1954.16 991.22 255.46 268.96 1504.40 367.99 4.60240965e+04 4.60240965e+04 0.00e+00

4. 1D Stellar Structure, Henyey Solver & Evolution (\(N_{\mathrm{zones}} = 1024\))

Full tables and star/test comparisons live in the Four-Way Benchmark & star/test Report. All five 1D stellar-structure workloads in that report run post-51e1adc (need_to_setvars = .true.), but do not yet match MESA 26.4.1 numerically or execute equal work scope:

  • Workloads where Fortran is faster: At 4 threads, MESA r26.4.1 outperforms Safe Rust on star_hydro_eqns (2962.80 us vs. 13814.92 us) and star_newton_step (3165.36 us vs. 14296.08 us). The star_remesh timings (21.93 us Fortran vs. 340.46 us Rust 4t / 223.41 us 1t Stage 2) are not a like-for-like comparison: the Fortran stage times only set_mesh_function_data, the Rust stage the whole do_adjust_mesh.
  • PyO3 star_newton_step Stage 0 mismatch: Python Stage 0 PyO3 (204.75 us) times only the bcyclic linear solve without calling eval_equations.
  • Checksum discrepancies (1024 zones): star_micro_vars differs by 6.04e-05, star_hydro_eqns by 1.60e-05, star_newton_step by 9.15%, star_evolve_step by 7.48e-06 (comparing Fortran dt = 100 s in do_struct_burn_mix against Rust base.dt, and Fortran's 8-zone pre-flight check logs hydro_solver_step returned ierr -1), and star_remesh shows a three-way mismatch across Fortran set_mesh_function_data (5.73660892e+05), Rust do_adjust_mesh (4.25843355e+02), and Python eval_mesh_gval_jax (4.21132239e+02).
Workload Comparator MESA 1t Stage 2 (\(\mu\mathrm{s}\)) MESA 4t Stage 3 (\(\mu\mathrm{s}\)) Safe Rust 1t Stage 2 (\(\mu\mathrm{s}\)) Safe Rust 4t Stage 3 (\(\mu\mathrm{s}\)) PyO3 1t Stage 0 (\(\mu\mathrm{s}\)) JAX @jit Stage 2 (\(\mu\mathrm{s}\)) JAX vmap Stage 3 (\(\mu\mathrm{s}\)) MESA Checksum Safe Rust Checksum Rel. Diff
star_micro_vars (EOS/kap/net/MLT) MESA r26.4.1 (all stages) 79607.37 20756.76 13196.81 13153.37 13402.37 1555.02 392.63 3.36107957e+04 3.36128273e+04 6.04e-05
star_hydro_eqns (residuals + \(J\)) MESA r26.4.1 (all stages) 11972.73 2962.80 14088.93 13814.92 14427.72 1957.63 541.21 6.71023666e+07 6.71034373e+07 1.60e-05
star_newton_step (Henyey solve) MESA r26.4.1 (all stages) 12198.39 3165.36 14420.08 14296.08 204.75 3005.96 2774.89 1.18210818e+05 1.29023078e+05 9.15e-02
star_remesh (3-way mismatch) MESA r26.4.1 (all stages) 21.65 21.93 223.41 340.46 1524.88 195.19 47.41 5.73660892e+05 4.25843355e+02 9.99e-01
star_evolve_step (unequal dt) MESA r26.4.1 (all stages) 917795.98 235422.09 63085.87 59578.93 57947.11 64630.34 66017.92 1.45656372e+04 1.45655283e+04 7.48e-06

5. Wave 5 Reference Fortran vs. FlexMESA (\(N_{\mathrm{zones}} = 1024\))

Full tables live in the Wave 5 Benchmark Report. Wave 5 compares FlexMESA against benchmarks/fortran_mesa/bench_kernels_wave5.f90 (Reference Fortran, not upstream MESA evolution drivers): w5_diff_rot, w5_binary_rlof, and w5_astero_seism mix MESA utility subroutines with local Fortran formula loops (hybrid), while w5_riemann_rsp2 calls zero MESA subroutines (non-MESA).

  • Workloads where Reference Fortran is faster: At 4 threads, Reference Fortran is faster than Safe Rust on w5_diff_rot (70.66 us vs. 174.48 us), w5_binary_rlof (76.75 us vs. 78.44 us), and w5_astero_seism (5.84 us vs. 7.65 us).
  • Spruit-Tayler checksum divergence: w5_diff_rot diverges by 99.17% between Reference Fortran (3.12476375e+05) and post-642da54 Safe Rust/JAX (2.60091642e+03), tracked in #158.
Workload Comparator Ref. Fortran 1t Stage 2 (\(\mu\mathrm{s}\)) Ref. Fortran 4t Stage 3 (\(\mu\mathrm{s}\)) Safe Rust 1t Stage 2 (\(\mu\mathrm{s}\)) Safe Rust 4t Stage 3 (\(\mu\mathrm{s}\)) PyO3 4t Stage 1 (\(\mu\mathrm{s}\)) JAX @jit Stage 2 (\(\mu\mathrm{s}\)) JAX vmap Stage 3 (\(\mu\mathrm{s}\)) Ref. Fortran Checksum Safe Rust Checksum Rel. Diff
w5_diff_rot (Spruit divergence) Ref. Fortran (hybrid) 279.09 70.66 737.64 174.48 147.32 1264.74 315.74 3.12476375e+05 2.60091642e+03 9.92e-01
w5_riemann_rsp2 (HLLC + RSP2) Ref. Fortran (non-MESA) 62.82 45.71 26.48 12.16 60.25 1296.38 323.75 -2.72283698e+05 -2.72283698e+05 0.00e+00
w5_binary_rlof (RLOF + Kerr + tides) Ref. Fortran (hybrid) 304.69 76.75 350.09 78.44 83.29 1269.81 317.43 6.27887032e+00 6.27887032e+00 0.00e+00
w5_astero_seism (BG14 + \(r_{01}/r_{10}\)) Ref. Fortran (hybrid) 5.83 5.84 7.67 7.65 8.62 1261.53 319.55 7.36379793e+01 7.36379793e+01 0.00e+00