A complete, fast and reliable optimization library, in Rust and for Python: evolutionary and population-based methods, local and gradient-based methods, constrained nonlinear programming and Bayesian optimization, with the same guarantees of reproducibility, validation and speed. The plan for the methods beyond the evolutionary ones is docs/optimization-plan.md.
- Coverage: the algorithms and operators of DEAP and pymoo combined; the local, gradient-based and constrained methods of SciPy's optimize; Bayesian optimization with Gaussian processes and TPE.
- Speed: fast on every problem of the public benchmark suite, in time to target and evaluations per second.
- Reproducibility: bit-identical results per seed on any thread count.
- Docs: the whole public API, and an example per algorithm.
- Python: the same capabilities.
- Validated, typed configuration: invalid settings are builder errors; mismatched operators don't compile.
- Guaranteed determinism: seeded streams per run, island and worker; no hash-order or scheduling effects; explicit ties.
- Ask / tell at the core: every algorithm is an
ask() → evaluate → tell()state machine; the run loop is a thin layer. - No wasted work: mutations always change something; invalid solutions are cached; no allocations per generation.
- Explicit semantics: documented probabilities and edge cases; rates validated to [0, 1].
- Batteries included, costs opt-in: statistics, hall of fame and checkpoints cost only when enabled.
From a review of existing libraries (e.g. genetic_algorithm, issues #11 to #78). Each rule has a test.
| Pitfall | genoxide rule |
|---|---|
| Wrong best index with missing fitness values | Invalid is a separate state |
HashMap order or unstable sorts change results |
Ordered containers; index tie-breaks |
| Identical parallel runs under one seed | One derived rng stream per run, island and thread |
| No selection pressure without surplus survivors | Separate parent selection and survival |
| No-op mutations or crossovers (self-swap, point 0) | Operators guarantee a change (property-tested) |
| Off-by-one elitism | Exact, property-tested elitism counts |
| Integer overflow, float steps that don't advance | Checked or saturating arithmetic; guaranteed progress |
| NaN fitness taken as a valid score | NaN is an error or Invalid, configurable |
| Deadlocks with one rayon thread | No blocking waits on pool threads; tested in CI |
| Docs drifting from the code | The docs' code blocks, README.md and AGENTS.md are doctests; CI runs examples/ and compares their output |
Genome: the representation: bits (bit-packed), integers, bounded reals, permutations; planned: mixed (per-gene types), trees (GP), graphs (NEAT).Fitness: totally orderedf64, single or multi-objective ([f64; M], with the number of objectives fixed at compile time), optional constraint violation; batch and async evaluation.- Operators:
Select,Crossover,Mutate, generic over the genome; survival is each algorithm's scheme. Algorithm: ask / tell state machines (GA, ES, CMA-ES, DE, PSO, NSGA-II, …; Nelder-Mead, L-BFGS-B, MMA, Bayesian optimization; planned: SQP).- Derivatives (planned): supplied gradients, finite differences, constraint and residual Jacobians, declared by the fitness function.
- Models: Gaussian processes (
model::gp) for Bayesian optimization; planned: for surrogate-assisted evolution. Engine: termination, parallel evaluation, observers, cancellation, and a hook that changes the algorithm between generations (parameter control, re-evaluation).Observer: statistics, hall of fame, Pareto archive, logging, checkpoints.- Errors: one typed error enum; no
&'static strerrors, no panics in library code.
Done means implemented, documented, tested (property tests for operators) and benchmarked where relevant.
- Name, repository, dual MIT / Apache-2.0 license
- README (homepage) and this roadmap
- Crate skeleton (edition 2024, MSRV 1.86; 1.88 since #314; 1.95 since #402, where it stays)
- CI on Linux, macOS, Windows, MSRV and a single rayon thread
-
#![forbid(unsafe_code)],#![warn(missing_docs)] - Benchmark suite in
benchmarks/ - Contributing guide, issue and PR templates
- Versioning policy and automated releases (release-plz, cargo-semver-checks)
- Error enum (no panics in library code)
- Portable, seedable rng with derived streams per run / island / worker
- Fitness: totally ordered
f64,Invalid, NaN policy, maximize / minimize - Individual (genome, fitness, age) and Population
-
Genometrait - Binary, bit-packed
- Integer, bounded per gene
- Real, bounded per gene
- Permutation
- Tournament
- Roulette wheel and stochastic universal sampling
- Rank
- Truncation
- Random
- One-point, two-point, k-point (points between genes only)
- Uniform (exactly 50% per gene, or a given rate)
- Bit-flip (per-gene rate or exactly n genes)
- Uniform (integer / real)
- Swap (permutation)
- Ask / tell core
- Generational GA, steady-state GA, (μ+λ) and (μ,λ)
- Elitism
- Stop conditions and their combinations
- Deterministic parallel evaluation (rayon)
- Cancellation (abort flag)
- Validating builder
- Statistics per generation
- Hall of fame (top-k unique)
- API docs for everything public, with doctests
- Examples: OneMax, knapsack, N-Queens, Rastrigin
- AGENTS.md (guide for AI coding assistants)
- criterion benchmarks for the hot paths
- Instruction-count benchmarks in CI (gungraun)
- genoxide in the benchmark suite, first results
- Real-valued crossover: SBX, BLX-α, arithmetic
- Real-valued mutation: Gaussian, polynomial
- Self-adaptive Gaussian mutation (a step size per individual)
- Permutation crossover: PMX, OX1, CX, edge recombination
- Permutation mutation: inversion (2-opt), insertion, scramble
- Local search: hill climbing, simulated annealing
- Local search: tabu search, iterated local search
- Memetic (Lamarckian) GA
- Constraint handling: Deb's feasibility rules, penalty functions
- CMA-ES, with IPOP / BIPOP restarts
- sep-CMA-ES for high dimensions
- Differential evolution: rand/1, best/1, current-to-pbest
- Adaptive DE: JADE, SHADE, L-SHADE
- Particle swarm: global and local topologies
- (μ/ρ +, λ)-ES with self-adaptation
- Non-dominated sorting (fast and log variants), crowding distance
- NSGA-II
- NSGA-III (reference points)
- SPEA2
- MOEA/D
- SMS-EMOA
- Pareto archive
- Indicators: hypervolume, IGD / IGD+, spread
- Constrained dominance
- Island model: ring, fully connected and random topologies
- Asynchronous steady-state evaluation
- Batch evaluation hook (SIMD, GPU, remote)
- GPU evaluation example
- Checkpoint and resume (
serdefeature) - Runs described in TOML / JSON, with a small CLI
-
tracingintegration and progress reporting
-
pip install genoxide(PyO3 / maturin) for Linux, macOS, Windows - Python fitness functions and vectorized numpy batch fitness
- Pythonic builders
- Examples matching the DEAP / pymoo tutorials
- Zero-copy numpy genomes: moved to 0.10.
Fixes from the review of 0.6.0 (#116). Some change seeded results.
- DE restarts: trials visible to observers, no restart every other generation on constrained problems, migrants evaluated once
- Duplicate elimination without fingerprint collisions, same on 32 and 64 bits
- Runs that could never end stop as stalled
- Huge sizes are setting errors, not panics or hangs
- The steady-state GA doesn't propose twins, and PSO's initial velocities respect
max_velocity - Python: clearer errors, stricter settings, license files in the wheels
- Benchmarks: numpy fitness in pymoo and PyGAD, timings on pinned P-cores
- DE defaults: SHADE's published settings, with its random
pper trial
The test problem library of docs/problems-plan.md, batches 1 to 3, and the fixes from the review of 0.7 (#201 to #229). multi::problems::TestProblem became MultiProblem: a breaking change.
-
problems: 16 classic functions, CEC 2006's g01-g06 and 8 engineering design problems, each with its optimum and reference (#170, #191) -
multi::problems:MultiProblem, constraints, and 13 classic two- and three-objective problems (#177) - The same problems in Python, evaluated in Rust, and
genoxide.indicators - Examples with their output checked in CI, a full explanation and a recorded run (#193, #194, #198), one per problem (#253)
- The fixes from the review of 0.7
-
genoxide::math: the same results to the bit on every platform (#263) - A GA's rates and operators changed between generations, and its population re-evaluated when the fitness function changes (#248, #249)
- Batch 4: DTLZ5-7, the binary ZDT5 and WFG1-9 (#270); batch 5 in 0.9.1: CEC 2006's g07-g18 (#277); each with its example
- A multi-objective front has each genome once, and polynomial mutation reaches the bounds: breaking fixes (#273, #276)
- Benchmarks: genoxide's releases compared by instruction counts (#267)
- Genetic programming and neuroevolution, first planned for 0.9: moved to 0.10.
On main, in the release PR (#280). New features, compatible with 0.9.1's API, so a patch release; the breaking changes of #283 and #284 are the benchmark harness's, not the library's.
- Parameter control:
Engine::control, setters for DE, PSO and local search,Islands::islands_mut(#292); in Python,run(control=...)(#294) - Re-evaluation in every single-objective algorithm but the steady-state GA, for a fitness function that changes during a run (#292)
- Parallel breeding for the GA, DE and ES, the same results on any number of threads (#289, #295), also in Python (#296)
- Isolated islands, without migration (#293)
- Faster: the Python package on bit genomes (#291), the ES (#298)
- Benchmarks: a matched suite of three problems, one method each (#284), with every library bug it found reported upstream (notes)
- What a fitness function computes besides the fitness, kept by the engine for the individuals it holds (#246)
- Rust 1.88, and small performance gains across the library (#314, #315)
- Python:
Progressbuilds its arrays only when a callback reads them (#324)
The plan: docs/gp-neuroevolution-plan.md.
- Tree GP, strongly typed
- Subtree crossover; point, subtree and hoist mutation; bloat control
- Symbolic regression examples (#359, #360)
- NEAT (speciation, innovation numbers)
- Neuroevolution with evolution strategies
- Python: the ES, islands and checkpoints, and a batch's matrix reused (#342)
- Python: OpenAI's ES, the networks and control tasks, NEAT, and genetic programming with built-in primitives and your own, evaluated by numpy (#385, #387, #389)
- Convergence as a stop reason (
StopReason::Converged), random restarts for local methods, Nelder-Mead with adaptive coefficients and speculative asks (#371; docs/optimization-plan.md, batch A1) - Linear algebra in the crate, the same bits on every platform and thread count (#373; batch A1)
- Gradients (supplied, or by finite differences evaluated as one batch), line searches, L-BFGS-B, in Python and the
genoxideprogram (batch A2) - For up to millions of variables, with O(n) memory and work per step: gradient descent, momentum, Nesterov, Adam and AdamW, with learning-rate schedules by
control(FirstOrder; batch A3) - MMA and GCMMA for many variables with few constraints, with the inequality constraints' values and Jacobian supplied through the engine, in Python and the
genoxideprogram (Mma,Constrained; batch A3) - Continuation in stages that keeps the optimizer's state, in Python (
Continuation,Continue; batch A3)
- EI, log-EI, UCB and PI; Latin hypercube designs; portable
erf,erfcanderfcx(batch B, the parts that need neither linear algebra nor L-BFGS-B) - Gaussian processes (
model::gp, unstable for one release) and Bayesian optimization (Bo): an initial Latin hypercube of 2(n + 1) points, log-EI by default, an output transform, in Python (gx.Bo,gx.model.gp) and thegenoxideprogram, with thebayesian_optimizationexample (batch B, its first part) - Batch Bayesian optimization (Kriging believer, constant liar),
Incrementalfor the asynchronous engine, constrained Bayesian optimization and integer genes, with thebo_hartmann6,bo_asynchronousandbo_constrainedexamples (batch B, its second part)
- Rust 1.95 as the minimum, kept there from now on (#402)
- SQP and the augmented Lagrangian, on the constrained test problems (batch C)
- BFGS, conjugate gradient, trust region, Levenberg-Marquardt (batch D1)
- BOBYQA, COBYLA, pattern search, MADS, basin hopping (batch D2)
- ParEGO, EHVI, TPE, TuRBO, mixed variables (batch E)
- Surrogate-assisted evolution, multi-fidelity, DIRECT (batch F)
- Quality-diversity: MAP-Elites, CMA-ME, novelty search
- LLM-guided evolution (async operators calling a language model)
- Adaptive operator selection and automatic parameter tuning
- The test problem library's later batches, each problem with its example (#260), checked against the original papers (#168)
- More benchmark problems, one matched method each, once the current three are settled (see Benchmarks)
- API stabilization, semver guarantees, MSRV policy
- Published benchmark report
- Book (mdBook) with a guide per problem type
- CI: Linux, macOS, Windows; stable and MSRV; clippy, fmt, rustdoc with
-D warnings; a single-thread rayon job. - Property tests (proptest) for every operator: validity (permutations stay permutations), bounds, no no-ops, exact rates.
- Fuzzing of builders and the configuration format: planned.
- Performance: criterion (wall time) and gungraun (exact instruction counts; fail CI on regressions) for every hot path.
- Safety:
#![forbid(unsafe_code)]; anyunsafe(SIMD, bit tricks) behind a feature, withSAFETYcomments and Miri tests. - Docs: every code block in the API docs, README.md and AGENTS.md is a doctest; CI runs
examples/and compares each output with itsoutput.txt.
benchmarks/ runs every library on the same problems, with identical fitness functions and budgets. Results are published for every release.
- Now: a small matched suite. Three problems, one method each, the same in every library, with its own implementation set to a written definition (rules): a GA on OneMax 1000, DE/rand/1/bin on Rastrigin 30 and CMA-ES on Rosenbrock 10. It compares implementations of the same algorithm, not each library's pick of a method.
- Later, after these: more problems, one matched method each: binary (LeadingOnes, deceptive trap, NK landscapes, knapsack), permutation (N-Queens, TSPLIB, QAP, flow shop), continuous (BBOB / COCO functions in 10–100 dimensions); then multi-objective problems (ZDT, DTLZ, WFG) with a matched NSGA-II.
- Measurements: success rate, time and evaluations to target, the distance to the optimum at the end, evaluations per second, genoxide's own releases compared by the CPU instructions of the same runs (Callgrind, genoxide only); later peak memory and scaling with population, genome size and threads.
- Output: library versions, JSON, a markdown table and graphs.
- Libraries: those with their own implementation of a suite's method. Now: genoxide and its Python package, DEAP, PyGAD, radiate, pycma, SciPy, pygmo, pymoo, jMetal, Evolutionary.jl and Metaheuristics.jl (the methodology lists which runs which). Others come back with the problems whose methods they have:
| Language | Libraries |
|---|---|
| Python | Nevergrad, EvoX, geatpy |
| Java | Jenetics, MOEA Framework |
| C++ | openGA, ParadisEO |
| C# | GeneticSharp |
| Rust | moors, genetic_algorithm, genevo, oxigen |
Reverse-mode automatic differentiation, model training frameworks and general-purpose machine learning; linear, quadratic and mixed-integer programming solvers; large sparse nonlinear programming. genoxide focuses on black-box and small-to-medium dense problems.