Skip to content

Wave 2 Four-Way Performance Benchmark Report (MESA r26.4.1)

Raw Capture Provenance (benchmarks/raw/26.4.1/, #146)

Measured offline against MESA r26.4.1 (fortran_wave2.txt, rust_waves_1_to_5.txt, python_waves_1_to_5.json). Stage 2/3 Fortran numbers for chem_comp execute eval_comp_hoisted in bench_kernels_wave2.f90 rather than MESA basic_composition_info.

1. Environment & Checksum Consistency

  • 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).

All 12 (workload, N_zones) pairs agree across all 9 printed significant digits. The full f64 Python checksums differ from the printed Fortran values by at most 1.56e-09, within the rounding of a 9-digit print.

Workload \(N_{\mathrm{zones}}\) Comparator Checksum Safe Rust Checksum Python/JAX Checksum |Rust - F90| Rel. |JAX - F90| Rel. Rust max_rel_err JAX max_rel_err
chem_comp 128 2.63419264e+02 2.63419264e+02 2.63419264e+02 0.000e+00 1.231e-09 0.000e+00 8.309e-16
ion_fe56 128 2.73675912e+03 2.73675912e+03 2.73675912e+03 0.000e+00 1.304e-09 0.000e+00 1.842e-16
ion_4d 128 9.79041962e+02 9.79041962e+02 9.79041962e+02 0.000e+00 3.413e-10 0.000e+00 2.787e-13
colors_sed 128 5.76955755e+02 5.76955755e+02 5.76955755e+02 0.000e+00 3.381e-10 2.956e-16 5.915e-15
chem_comp 1024 2.10476347e+03 2.10476347e+03 2.10476347e+03 0.000e+00 8.212e-10 0.000e+00 8.005e-16
ion_fe56 1024 2.19124406e+04 2.19124406e+04 2.19124406e+04 0.000e+00 1.178e-09 3.696e-14 3.696e-14
ion_4d 1024 7.83234656e+03 7.83234656e+03 7.83234656e+03 0.000e+00 3.724e-10 0.000e+00 6.782e-12
colors_sed 1024 4.61546861e+03 4.61546861e+03 4.61546861e+03 0.000e+00 1.078e-09 3.552e-16 6.677e-15
chem_comp 4096 8.41795382e+03 8.41795382e+03 8.41795382e+03 0.000e+00 5.292e-10 0.000e+00 1.013e-15
ion_fe56 4096 8.76575973e+04 8.76575973e+04 8.76575973e+04 0.000e+00 5.832e-11 0.000e+00 3.060e-16
ion_4d 4096 3.13293908e+04 3.13293908e+04 3.13293908e+04 0.000e+00 1.564e-09 0.000e+00 3.433e-11
colors_sed 4096 1.84617990e+04 1.84617990e+04 1.84617990e+04 0.000e+00 2.733e-10 4.816e-16 7.415e-15

Wave 2 four-way runtime staircase

2. Four-Way Runtime Tables (\(N_{\mathrm{zones}} \in \{128, 1024, 4096\}\))

2.1 Fortran Comparator (benchmarks/fortran_mesa/run_wave2_bench)

Workload \(N_{\mathrm{zones}}\) Stage 0 (\(\mu\mathrm{s}\)) Stage 1 (\(\mu\mathrm{s}\)) Stage 2 (\(\mu\mathrm{s}\)) Stage 3 (4t OpenMP) (\(\mu\mathrm{s}\)) Stage 0 / Stage 2 Stage 0 / Stage 3
chem_comp 128 26.78 +/- 0.04 26.75 +/- 0.07 1.80 +/- 0.00 0.94 +/- 0.06 14.88x 28.49x
ion_fe56 128 24.71 +/- 0.02 24.81 +/- 0.07 4.08 +/- 0.01 2.05 +/- 0.05 6.06x 12.05x
ion_4d 128 147.11 +/- 2.57 145.88 +/- 10.64 138.89 +/- 0.21 56.59 +/- 0.45 1.06x 2.60x
colors_sed 128 12233.26 +/- 67.38 12170.76 +/- 83.46 12430.54 +/- 577.24 3079.27 +/- 355.15 0.98x 3.97x
chem_comp 1024 256.88 +/- 0.86 256.15 +/- 0.96 16.50 +/- 1.12 5.33 +/- 0.05 15.57x 48.20x
ion_fe56 1024 232.43 +/- 1.07 203.69 +/- 18.30 31.90 +/- 0.44 8.41 +/- 0.04 7.29x 27.64x
ion_4d 1024 1201.95 +/- 17.15 1193.87 +/- 22.19 1131.37 +/- 15.98 289.40 +/- 9.71 1.06x 4.15x
colors_sed 1024 97790.49 +/- 497.01 98731.03 +/- 989.68 98781.12 +/- 1412.83 25299.86 +/- 371.59 0.99x 3.87x
chem_comp 4096 874.91 +/- 8.73 868.65 +/- 8.73 57.62 +/- 0.11 14.97 +/- 0.17 15.18x 58.44x
ion_fe56 4096 792.85 +/- 9.82 789.75 +/- 9.72 124.65 +/- 0.09 32.05 +/- 0.07 6.36x 24.74x
ion_4d 4096 4780.88 +/- 107.03 4802.42 +/- 72.72 4573.09 +/- 45.08 1169.82 +/- 24.78 1.05x 4.09x
colors_sed 4096 391608.14 +/- 4813.27 393088.42 +/- 8688.46 392540.03 +/- 3401.15 106190.19 +/- 14963.35 1.00x 3.69x

2.2 Safe Rust (strict, --release)

Workload \(N_{\mathrm{zones}}\) Stage 0 (\(\mu\mathrm{s}\)) Stage 1 (\(\mu\mathrm{s}\)) Stage 2 (\(\mu\mathrm{s}\)) Stage 3 (4t rayon) (\(\mu\mathrm{s}\)) Stage 0 / Stage 2 Stage 0 / Stage 3
chem_comp 128 18.46 +/- 0.03 17.98 +/- 0.04 1.84 +/- 0.00 0.63 +/- 0.03 10.03x 29.30x
ion_fe56 128 4.86 +/- 0.00 4.65 +/- 0.01 4.41 +/- 0.02 1.44 +/- 0.02 1.10x 3.38x
ion_4d 128 131.61 +/- 1.05 131.00 +/- 1.07 123.89 +/- 6.08 34.52 +/- 5.24 1.06x 3.81x
colors_sed 128 3794.85 +/- 44.72 3788.40 +/- 26.44 815.17 +/- 24.00 200.28 +/- 26.53 4.66x 18.95x
chem_comp 1024 145.12 +/- 11.90 142.25 +/- 3.32 14.58 +/- 0.04 7.58 +/- 0.08 9.95x 19.15x
ion_fe56 1024 38.88 +/- 0.14 37.19 +/- 0.02 35.16 +/- 0.13 18.12 +/- 0.18 1.11x 2.15x
ion_4d 1024 1119.40 +/- 12.67 1097.56 +/- 20.59 1011.69 +/- 13.32 273.89 +/- 11.78 1.11x 4.09x
colors_sed 1024 30656.43 +/- 372.95 30801.84 +/- 780.40 6669.00 +/- 157.22 1619.97 +/- 55.89 4.60x 18.92x
chem_comp 4096 595.81 +/- 16.13 576.04 +/- 11.70 58.22 +/- 0.17 14.91 +/- 0.08 10.23x 39.96x
ion_fe56 4096 155.62 +/- 0.84 148.26 +/- 0.10 140.60 +/- 0.84 71.69 +/- 0.24 1.11x 2.17x
ion_4d 4096 4531.34 +/- 206.69 4414.72 +/- 146.31 4166.58 +/- 199.63 1083.42 +/- 31.61 1.09x 4.18x
colors_sed 4096 124039.82 +/- 335.67 123844.13 +/- 1924.57 26557.65 +/- 400.55 6770.62 +/- 1778.66 4.67x 18.32x

2.3 Python / PyO3 & JAX float64

Workload \(N_{\mathrm{zones}}\) Stage 0 PyO3 1t (\(\mu\mathrm{s}\)) Stage 1 PyO3 4t (\(\mu\mathrm{s}\)) Stage 2 JAX @jit (\(\mu\mathrm{s}\)) Stage 2 Compile (\(\mathrm{ms}\)) Stage 3 JAX vmap (\(\mu\mathrm{s}\)) Stage 3 Compile (\(\mathrm{ms}\))
chem_comp 128 2.43 +/- 0.09 2.37 +/- 0.40 193.28 +/- 25.99 67.7 91.36 +/- 261.08 68.3
ion_fe56 128 5.38 +/- 0.10 2.88 +/- 0.28 1482.34 +/- 147.89 211.7 358.16 +/- 18.23 223.2
ion_4d 128 133.37 +/- 8.92 35.57 +/- 1.94 1276.46 +/- 68.06 466.4 319.52 +/- 6.50 451.3
colors_sed 128 801.65 +/- 24.17 198.57 +/- 22.39 1520.55 +/- 64.55 1292.6 383.96 +/- 7.17 1486.7
chem_comp 1024 13.79 +/- 0.22 6.87 +/- 0.81 202.38 +/- 30.97 65.1 106.32 +/- 264.36 69.9
ion_fe56 1024 39.20 +/- 0.08 12.70 +/- 0.11 1460.95 +/- 42.51 208.6 369.18 +/- 12.54 234.4
ion_4d 1024 1066.53 +/- 34.03 276.30 +/- 7.42 1291.93 +/- 15.91 536.0 321.78 +/- 2.63 506.5
colors_sed 1024 6499.78 +/- 284.01 1599.59 +/- 30.82 1529.50 +/- 72.77 1773.4 689.47 +/- 51.08 1378.6
chem_comp 4096 55.20 +/- 2.32 35.82 +/- 10.10 319.16 +/- 1012.50 64.7 319.08 +/- 6.84 80.9
ion_fe56 4096 154.74 +/- 3.57 46.74 +/- 2.06 1442.37 +/- 35.16 219.8 363.79 +/- 14.26 242.5
ion_4d 4096 4205.23 +/- 205.07 1664.78 +/- 962.27 1274.67 +/- 12.45 497.6 3019.55 +/- 51.06 566.1
colors_sed 4096 25458.68 +/- 933.99 6340.02 +/- 394.58 2629.70 +/- 217.89 1293.7 2015.82 +/- 32.69 1387.6

3. Key Wave 2 Findings

  1. colors_sed 32-gather stencil & Simpson weights: At 4096 zones, 4-thread Safe Rust evaluates colors_sed in 6770.62 us vs. 106190.19 us in MESA (15.68x). At 1024 zones, @jax.jit(jax.vmap) reaches 689.47 us per profile vs. 25299.86 us in MESA (36.69x).
  2. ion_fe56 comparison: At 4096 zones and 4 threads, MESA eval_charge_of_Fe56_in_He4 (32.05 us) is faster than Safe Rust Stage 3 (71.69 us) and PyO3 Stage 1 (46.74 us).