Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Matched PyKEP benchmarks

The 0.1.5 benchmark tree was measured against PyKEP 3.1.0 at c01e19debad5ea22b7079189f786f473046a79d5. Warmed heyoka led on nine scalar Taylor fixtures. Rust led on both equinoctial Pontryagin fixtures and on the complete ZOH Jacobian in the three leg pilots. The nominal ZOH mismatch and full Jacobian give different results. Source workloads

Native scalar Taylor

The reference uses heyoka 7.10.0 ABI 42. The host was an Intel Xeon Platinum 8573C under Linux. The Rust binary uses Rust 1.88, release thin LTO and the portable x86-64 target with SIMD compiled in. The native driver uses Clang 20.1.2, libstdc++ 13 and -O3 -march=x86-64. Heyoka generates its model kernels at runtime. The SDK used a development-only header adapter to link the Clang build to the packaged heyoka ABI. Each process is pinned to one logical CPU. The study uses ten paired rounds in alternating order. Upstream resets and reuses a warmed integrator. The raw samples include separate cold setup, first call and reset-only results.

Both arms use the same initial states, parameters, times and tight DOP853 endpoint vector. Both requested 1e-12 and passed the 1e-11 scaled endpoint-error gate. The ratio is the median of paired Rust / upstream times. The interval resamples whole pairs.

ModelRust µsWarmed heyoka µsRust / heyoka time95% paired intervalScaled errors Rust / heyoka
kepler4.62.022.26×1.73–3.316.7e-16 / 7.3e-15
cr3bp10.84.592.57×1.98–3.248.6e-15 / 5.1e-15
bcp7.014.221.94×1.31–2.226.9e-16 / 6.0e-15
zoh_kepler5.112.921.77×1.25–2.112.8e-15 / 8.1e-15
zoh_cr3bp11.26.541.67×1.50–1.843.0e-15 / 1.1e-14
zoh_equinoctial156.732.19×1.69–3.123.0e-15 / 3.0e-15
solar_sail21.39.092.49×2.00–2.857.1e-15 / 1.1e-14
cartesian_mass8.884.022.28×1.91–2.545.6e-16 / 5.6e-16
cartesian_time8.243.722.27×1.71–2.392.3e-15 / 2.3e-15
equinoctial_mass5366730.78×0.69–0.879.2e-14 / 2.8e-13
equinoctial_time5166230.83×0.75–0.919.1e-14 / 2.8e-13

Seven upstream benchmark programs

The full-size shared-input matrix uses the upstream case counts. The runners check finiteness and aggregate output counts for every case and retain complete sampled vectors. The numbers are orientation results from one ABBA block. Small differences are sensitive to host load.

WorkloadCases per rowUpstream / Rust time by case bandMax sampled scaled difference
Anomaly conversion1,000,0001.21× / 1.25× / 0.69×1.1e-15
Anomaly round trip100,0000.48× / 1.15× / 1.47×9.4e-16
Lagrange state1,000,0001.31× / 2.94× / 1.15× / 2.28×2.4e-15
Lagrange round trip100,0001.54× / 1.23× / 1.57×5.1e-15
State and 6 × 6 STM100,0002.47× / 2.49× / 1.58×3.5e-14
Lambert 0 / ≤20 revolutions50,0000.84× / 0.79×3.3e-16
SF simple mismatch11.33×1.9e-16
SF complete Jacobian1,0004.05× / 4.47× / 3.29× / 2.53×1.8e-15
SF numerical UDP gradient1,0001.05× / 1.14× / 1.12× / 1.17×1.1e-07

The initial sweep found convergence exhaustion in the previous Lagrange anomaly solve. With safeguarded Newton iteration, the repeat passed the failure-count, output-count and sampled-value gates. The measurement archive preserves the initial failed cases and the repeat.

Complete ZOH legs

Each segment count uses 200 shared cases, seed 424242, cached legs and five passes per arm. The complete Jacobian includes both endpoint-state blocks, every segment control and all grid-node derivatives. The table uses 1e-13 for both variational tolerances and 1e-14 for nominal integration. The measurement archive also records the source 1e-8 derivative setting and a separate Rust DOP853 arm. That arm predates the analytic DOP853 model Jacobians for the Kepler and CR3BP ZOH models in 0.1.5; the Taylor rows are unaffected.

SegmentsOperationRust µsUpstream µsUpstream / Rust timeSampled scaled difference
20mismatch36.923.90.65×4.4e-16
20jacobian2725562.05×1.9e-15
40mismatch67.251.20.76×2.2e-16
40jacobian5251.16e+032.22×1.0e-15
80mismatch1261020.81×2.2e-16
80jacobian1.1e+032.13e+031.93×1.6e-15

Python gym evaluation

Four TOPS cases use 16 segments, uniform time and the same first vector in each Python implementation. The source variational tolerance is 1e-13. Fitness and derivative agreement was checked on four vectors for each case. Each cell is the median of seven inner samples in one process. The measurement archive has the softmax results, two classical examples, construction, ordered batch, fitness plus gradient, and history timings.

ProblemRust fitness µsPyKEP fitness µsRust gradient µsPyKEP gradient µs
tops.twobody.P427.261.2301670
tops.mee.P85.03e+032.9e+033.8e+048.28e+04
tops.cr3bp.P04348175.49e+031.21e+04
tops.sail.P41.54e+031.01e+036.91e+031.1e+04
gym.eve_mga1dsm6.1166.7——
gym.juice_mo22.6530——

Gym validation

The catalog exposes 82 stable IDs. The primary comparison covers 14 classical configurations and both time encodings for each of the 68 TOPS IDs. It uses 16 segments and two vectors per configuration. A five-segment DOP853 arm exercises an alternative cut and direction mode.

Source catalogConfigurationsDirect passRust extensionDiscrepancyNonfinite/failed
Classical1414000
Fixed TOPS6868000
Moving TOPS683414128

The moving discrepancies are ten moving-MEE rows and two moving-CR3BP stress vectors whose trajectories pass close to the Moon. The CR3BP pair differs from the source gradient by a scaled 1.07e-6 and 4.23e-6, inside the 2.4e-5 spread of the Rust Taylor gradient across tolerances on the same vectors; see TOPS known limitations. Moving CR3BP softmax has a separate Rust formulation ID and an independent gradient check. The source moving CR3BP constructor selects uniform time. Moving MEE retains the original source discrepancies and a separate comparison using the source symbolic MEE conversion and finite differences. The P5 and P8 fixed-time anchors have off-anchor full-column checks. TOPS guide

Optimizer comparisons

The same native fcmaes DE-to-CMA adapter ran the two Rust backends on four fixed-boundary TOPS cases with 20 held-out seeds per case and budget. The fixed-work arm requests 128 evaluations. The wall arm uses an 80 ms budget checked between populations. The four feasible tutorials use a separate least-squares run and a tighter independent forward replay.

CaseTranscription128 calls, ms Taylor / DOP85380 ms, calls Taylor / DOP853Runs with feasible candidate
tops.twobody.P416 uniform9.24 / 14.21616 / 8960/80
tops.mee.P824 softmax350 / 14132 / 960/80
tops.cr3bp.P030 uniform85.2 / 72.8128 / 1920/80
tops.sail.P424 softmax103 / 51.2128 / 2240/80

For Sims–Flanagan, both Python evaluator arms use the same PyGMO NLopt SLSQP, starting points, 1e-8 raw feasibility threshold and maximum 1,000 solver evaluations. Each segment count has 100 starts. The raw counts include the calls made by numerical differentiation.

SegmentsRust analyticPyKEP analyticRust numericalPyKEP numerical
584/10084/10084/10084/100
1083/10083/10083/10083/100
1584/10084/10085/10085/100

Benchmark notebooks

The five-segment SF notebook checks all Jacobian groups against both the C++ leg and symbolic heyoka. Its legacy Isp assignment uses the current exhaust-velocity constructor in the reproduction. Complete derivative differences were below 2.4e-13 in both checks.

The provider study ran TLE and the available SPICE notebook cells as reference-only rows. The SPICE wrapper batch cell fails on its list-to-time multiplication. The separately labelled provider comparison covers Keplerian, JPL low-precision and VSOP2013 scalar and batch paths.

The measurement archive attached to the 0.1.5 release contains the paired samples, per-case gym results, optimizer records, fixture hashes and SDK provenance, including the development-only heyoka header adapter. Run the comparisons