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 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).
Each workload reports medians in microseconds (\(\mu\mathrm{s}\)):
- Stage 0: 1-thread baseline (
gfortran -O2, Safe Rust--releasestrict mode, and 1-threadflexmesa._rustPyO3). - Stage 1: 1-thread contiguous Structure-of-Arrays (SoA) loops in Fortran and Rust, and 4-thread
rayonflexmesa._rustPyO3 in Python. - Stage 2: 1-thread hoisted/fused loops in Fortran and Rust (using Reference Fortran loops on
auto_diff,mtx_tridiag, andchem_comp), and warm single-profile@jax.jit(float64GPU). - Stage 3: 4-thread OpenMP (
OMP_NUM_THREADS=4) in Fortran, 4-threadrayonin 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) andmtx_tridiag(fast_block_thomas_solve) Stages 2-3 time Reference Fortran loops rather than MESA library routines; MESA's single-matrixbcyclic_dble_decsolblk4096-zone timing is2161.30 us(1t) and790.11 us(4t OpenMP). - Workloads where Fortran is faster: At 4 threads, Fortran MESA outperforms Safe Rust on
interp_2d(41.69 usvs.70.69 us), and Reference Fortran batch Thomas outperforms Safe Rust onmtx_tridiag(196.10 usvs.323.73 us). - Checksum precision: Fortran and Rust print 9 significant digits, and every Wave 1 printed checksum is identical. The full
float64Python checksums differ from the printed Fortran values by at most4.84e-09, within the5e-09rounding 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.1outperforms Safe Rust onstar_hydro_eqns(2962.80 usvs.13814.92 us) andstar_newton_step(3165.36 usvs.14296.08 us). Thestar_remeshtimings (21.93 usFortran vs.340.46 usRust 4t /223.41 us1t Stage 2) are not a like-for-like comparison: the Fortran stage times onlyset_mesh_function_data, the Rust stage the wholedo_adjust_mesh. - PyO3
star_newton_stepStage 0 mismatch: Python Stage 0 PyO3 (204.75 us) times only thebcycliclinear solve without callingeval_equations. - Checksum discrepancies (
1024zones):star_micro_varsdiffers by6.04e-05,star_hydro_eqnsby1.60e-05,star_newton_stepby9.15%,star_evolve_stepby7.48e-06(comparing Fortrandt = 100 sindo_struct_burn_mixagainst Rustbase.dt, and Fortran's8-zone pre-flight check logshydro_solver_step returned ierr -1), andstar_remeshshows a three-way mismatch across Fortranset_mesh_function_data(5.73660892e+05), Rustdo_adjust_mesh(4.25843355e+02), and Pythoneval_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 usvs.174.48 us),w5_binary_rlof(76.75 usvs.78.44 us), andw5_astero_seism(5.84 usvs.7.65 us). - Spruit-Tayler checksum divergence:
w5_diff_rotdiverges by99.17%between Reference Fortran (3.12476375e+05) and post-642da54Safe 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 |