Wave 5 Four-Way Benchmark Report (benchmarks/raw/26.4.1/)¶
Reference Fortran Comparator Scope (Hybrid / Non-MESA, #146)
Wave 5 Fortran numbers come from 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 selected MESA helper routines with local Fortran formula loops (hybrid), while w5_riemann_rsp2 calls zero MESA routines (non-MESA). On w5_diff_rot, Reference Fortran (3.12476375e+05) diverges by 99.17% from post-642da54 Safe Rust/JAX (2.60091642e+03), tracked in #158.

1. Environment & Comparator Classification¶
- 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). -
w5_diff_rot(hybrid): Calls MESAhydro_rotation::aandlog_term_poweralongside local Caplan OCP, rotational instability, and Spruit-Tayler formulas (#158). w5_riemann_rsp2(non-MESA): Standalone spherical HLLC +RSP2loop.w5_binary_rlof(hybrid): Calls MESAbinary_utils::eval_rlobeandbinary_tides::f3/f4with standalone Ritter/Kerr/Jdot formulas.w5_astero_seism(hybrid): Calls MESAastero_get_cubic_all_freq_corr,astero_get_combined_all_freq_corr, andastero_support::get_frequency_ratioswith standalone scaling and acoustic integrals.
2. Checksum Comparison Across Backends¶
| 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 |
|---|---|---|---|---|---|---|---|---|
w5_diff_rot |
128 | 3.12459668e+05 |
2.60059307e+03 |
2.60059307e+03 |
9.917e-01 |
9.917e-01 |
0.000e+00 |
6.016e-16 |
w5_riemann_rsp2 |
128 | -2.69003013e+05 |
-2.69003013e+05 |
-2.69003013e+05 |
0.000e+00 |
1.837e-09 |
0.000e+00 |
1.650e-11 |
w5_binary_rlof |
128 | 6.27865748e+00 |
6.27865748e+00 |
6.27865748e+00 |
0.000e+00 |
1.659e-10 |
0.000e+00 |
1.395e-14 |
w5_astero_seism |
128 | 7.37762193e+01 |
7.37762193e+01 |
7.37762193e+01 |
0.000e+00 |
1.052e-10 |
0.000e+00 |
9.631e-16 |
w5_diff_rot |
512 | 3.12476430e+05 |
2.60090094e+03 |
2.60090094e+03 |
9.917e-01 |
9.917e-01 |
0.000e+00 |
5.968e-16 |
w5_riemann_rsp2 |
512 | -2.71777204e+05 |
-2.71777204e+05 |
-2.71777204e+05 |
0.000e+00 |
4.324e-10 |
0.000e+00 |
3.543e-11 |
w5_binary_rlof |
512 | 6.27886018e+00 |
6.27886018e+00 |
6.27886018e+00 |
0.000e+00 |
7.425e-10 |
0.000e+00 |
2.016e-14 |
w5_astero_seism |
512 | 7.36575750e+01 |
7.36575750e+01 |
7.36575750e+01 |
0.000e+00 |
2.784e-10 |
0.000e+00 |
2.122e-15 |
w5_diff_rot |
1024 | 3.12476375e+05 |
2.60091642e+03 |
2.60091642e+03 |
9.917e-01 |
9.917e-01 |
0.000e+00 |
7.801e-16 |
w5_riemann_rsp2 |
1024 | -2.72283698e+05 |
-2.72283698e+05 |
-2.72283698e+05 |
0.000e+00 |
2.498e-10 |
0.000e+00 |
3.377e-11 |
w5_binary_rlof |
1024 | 6.27887032e+00 |
6.27887032e+00 |
6.27887032e+00 |
0.000e+00 |
3.184e-10 |
0.000e+00 |
2.330e-14 |
w5_astero_seism |
1024 | 7.36379793e+01 |
7.36379793e+01 |
7.36379793e+01 |
0.000e+00 |
6.209e-10 |
0.000e+00 |
5.404e-15 |
(Note: Across the \(s \approx 0.435\) zero crossing of w5_riemann_rsp2, vector comparison uses the profile norm; see the Tolerance & Discrepancy Ledger.)
3. Four-Way Runtime Tables (\(N_{\mathrm{zones}} \in \{128, 512, 1024\}\))¶
3.1 Reference Fortran (benchmarks/fortran_mesa/run_wave5_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 |
|---|---|---|---|---|---|---|---|
w5_diff_rot |
128 | 34.76 +/- 0.11 |
34.70 +/- 0.07 |
34.67 +/- 0.03 |
8.97 +/- 0.03 |
1.00x |
3.88x |
w5_riemann_rsp2 |
128 | 6.48 +/- 0.04 |
6.47 +/- 0.03 |
6.47 +/- 0.04 |
4.84 +/- 0.37 |
1.00x |
1.34x |
w5_binary_rlof |
128 | 38.09 +/- 0.06 |
38.07 +/- 0.06 |
38.16 +/- 0.85 |
9.70 +/- 0.05 |
1.00x |
3.93x |
w5_astero_seism |
128 | 1.35 +/- 0.00 |
1.35 +/- 0.01 |
1.35 +/- 0.01 |
1.35 +/- 0.00 |
1.00x |
1.00x |
w5_diff_rot |
512 | 140.30 +/- 0.59 |
140.13 +/- 0.28 |
161.48 +/- 32.44 |
50.32 +/- 0.44 |
0.87x |
2.79x |
w5_riemann_rsp2 |
512 | 30.40 +/- 1.85 |
30.65 +/- 1.10 |
30.05 +/- 2.07 |
23.27 +/- 0.14 |
1.01x |
1.31x |
w5_binary_rlof |
512 | 186.11 +/- 4.61 |
185.25 +/- 2.06 |
153.81 +/- 32.54 |
38.77 +/- 0.07 |
1.21x |
4.80x |
w5_astero_seism |
512 | 3.37 +/- 0.04 |
3.38 +/- 0.05 |
3.35 +/- 0.03 |
3.38 +/- 0.04 |
1.01x |
1.00x |
w5_diff_rot |
1024 | 279.24 +/- 17.83 |
279.40 +/- 10.71 |
279.09 +/- 8.27 |
70.66 +/- 19.95 |
1.00x |
3.95x |
w5_riemann_rsp2 |
1024 | 63.40 +/- 1.88 |
61.98 +/- 1.07 |
62.82 +/- 17.71 |
45.71 +/- 2.97 |
1.01x |
1.39x |
w5_binary_rlof |
1024 | 367.69 +/- 60.44 |
304.93 +/- 19.63 |
304.69 +/- 6.81 |
76.75 +/- 0.09 |
1.21x |
4.79x |
w5_astero_seism |
1024 | 5.83 +/- 0.02 |
5.83 +/- 0.03 |
5.83 +/- 0.02 |
5.84 +/- 0.02 |
1.00x |
1.00x |
3.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 |
|---|---|---|---|---|---|---|---|
w5_diff_rot |
128 | 70.20 +/- 0.26 |
70.17 +/- 1.97 |
70.23 +/- 7.34 |
18.46 +/- 0.04 |
1.00x |
3.80x |
w5_riemann_rsp2 |
128 | 3.38 +/- 0.02 |
3.34 +/- 0.01 |
3.33 +/- 0.01 |
1.04 +/- 0.04 |
1.02x |
3.25x |
w5_binary_rlof |
128 | 38.51 +/- 0.05 |
38.49 +/- 0.12 |
38.50 +/- 1.74 |
20.29 +/- 2.64 |
1.00x |
1.90x |
w5_astero_seism |
128 | 3.00 +/- 0.14 |
2.92 +/- 0.08 |
2.93 +/- 0.06 |
2.93 +/- 0.05 |
1.02x |
1.02x |
w5_diff_rot |
512 | 307.49 +/- 24.20 |
306.86 +/- 15.94 |
307.30 +/- 23.80 |
85.38 +/- 25.38 |
1.00x |
3.60x |
w5_riemann_rsp2 |
512 | 13.47 +/- 0.03 |
13.29 +/- 0.07 |
13.25 +/- 0.07 |
3.82 +/- 0.06 |
1.02x |
3.53x |
w5_binary_rlof |
512 | 154.54 +/- 6.16 |
157.56 +/- 21.11 |
163.05 +/- 19.36 |
39.56 +/- 5.36 |
0.95x |
3.91x |
w5_astero_seism |
512 | 4.15 +/- 0.04 |
4.15 +/- 0.04 |
4.16 +/- 0.03 |
4.14 +/- 0.04 |
1.00x |
1.00x |
w5_diff_rot |
1024 | 763.02 +/- 29.14 |
750.15 +/- 22.26 |
737.64 +/- 21.69 |
174.48 +/- 64.36 |
1.03x |
4.37x |
w5_riemann_rsp2 |
1024 | 26.92 +/- 0.07 |
26.59 +/- 0.09 |
26.48 +/- 0.08 |
12.16 +/- 0.05 |
1.02x |
2.21x |
w5_binary_rlof |
1024 | 362.66 +/- 66.52 |
358.98 +/- 43.86 |
350.09 +/- 68.75 |
78.44 +/- 3.96 |
1.04x |
4.62x |
w5_astero_seism |
1024 | 7.77 +/- 0.17 |
7.67 +/- 0.09 |
7.67 +/- 0.07 |
7.65 +/- 0.21 |
1.01x |
1.02x |
3.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}\)) |
|---|---|---|---|---|---|---|---|
w5_diff_rot |
128 | 71.05 +/- 1.53 |
20.13 +/- 0.86 |
1310.69 +/- 83.97 |
536.4 |
315.83 +/- 7.28 |
570.7 |
w5_riemann_rsp2 |
128 | 10.21 +/- 0.23 |
8.22 +/- 0.77 |
1291.02 +/- 29.27 |
324.0 |
320.14 +/- 3.68 |
364.2 |
w5_binary_rlof |
128 | 40.23 +/- 0.56 |
11.61 +/- 0.55 |
1278.05 +/- 50.84 |
267.7 |
316.88 +/- 3.43 |
275.9 |
w5_astero_seism |
128 | 1.74 +/- 0.72 |
1.66 +/- 0.07 |
1276.82 +/- 35.03 |
275.3 |
320.48 +/- 3.50 |
305.6 |
w5_diff_rot |
512 | 370.51 +/- 67.56 |
77.55 +/- 17.23 |
1279.68 +/- 13.08 |
556.6 |
316.56 +/- 17.54 |
570.8 |
w5_riemann_rsp2 |
512 | 38.87 +/- 0.47 |
29.76 +/- 0.86 |
1265.95 +/- 16.55 |
319.8 |
325.46 +/- 36.29 |
369.0 |
w5_binary_rlof |
512 | 162.02 +/- 27.53 |
41.46 +/- 3.29 |
1250.36 +/- 26.66 |
259.0 |
317.15 +/- 5.20 |
265.7 |
w5_astero_seism |
512 | 4.49 +/- 0.13 |
4.44 +/- 0.05 |
1280.90 +/- 106.45 |
267.2 |
323.42 +/- 22.66 |
271.7 |
w5_diff_rot |
1024 | 782.81 +/- 18.72 |
147.32 +/- 14.09 |
1264.74 +/- 40.06 |
539.9 |
315.74 +/- 8.40 |
567.5 |
w5_riemann_rsp2 |
1024 | 80.77 +/- 4.14 |
60.25 +/- 2.73 |
1296.38 +/- 146.56 |
317.7 |
323.75 +/- 11.88 |
375.9 |
w5_binary_rlof |
1024 | 348.94 +/- 40.53 |
83.29 +/- 6.30 |
1269.81 +/- 16.15 |
260.6 |
317.43 +/- 3.30 |
270.5 |
w5_astero_seism |
1024 | 8.47 +/- 1.09 |
8.62 +/- 3.37 |
1261.53 +/- 28.95 |
262.6 |
319.55 +/- 6.07 |
277.8 |
4. Key Wave 5 Takeaways (\(N_{\mathrm{zones}} = 1024\))¶
- Workloads where Reference Fortran is faster: At 4 threads, Reference Fortran outperforms 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). w5_riemann_rsp2(non-MESA comparator): Safe Rust executes in12.16 us(4t) vs.45.71 usin the standalone OpenMP loop (3.76x), because the Fortran harness runs two consecutive!$omp parallel dobarriers per iteration.