Changelog¶
All notable changes to Clypto are documented in this file. The project follows Semantic / Calendar Versioning.
Clypto¶
[2026b1]¶
Added¶
AgentFactory& Agent Lifecycle: Delegated agent creation, generation, and initialization toAgentFactory(Population.fill(),add(),remove_at()). Addedcy.population_with_factory(size, factory).Copy Protocol for Agent Subclasses: Subclassable
Agent(unsealed@cython.final) with virtual copy hooks_new_instanceand_copy_state_tofor algorithms requiring extra per-agent state. Addedtools/scaffold_agent.pyhelper.In-Memory Tracking Buffers: Structured
MetricBuffer(pre-allocated float64 metrics matrix) andSnapshotBuffer(population frames buffer).Custom Per-Epoch Metrics (
@cy.metrics): Class decorator that validates metric methods at definition time (float return annotation, one or twopositions/fitsarguments) into aMetricSchemaof pre-resolved column indices;DefaultMetricskeeps the canonicalmealpy-ltscontinuous metric set and can be subclassed to extend it. Passing a metrics class or instance tosolve(problem, metrics=...)enables tracking on its own and allocates(epoch, n_metrics)with zero dictionary lookups in the per-epoch loop; read the result throughtracker["<metric_name>"],tracker.metric_namesor"name" in tracker.cy.metrics,cy.DefaultMetricsandcy.Trackerjoin the flat public API.Problem Decorator & JIT Compilation (
@cy.problem): Added function and class decorator@cy.problemwith opt-in Cython JIT compilation (compile=True). Supports automatic decoding (decode=True) for combinatorial, categorical, and mixed engineering problems, flexible target binding, standardizedevaluatemethods, and vectorized evaluations.Execution Lifecycle Callbacks: Direct
before_iterationandafter_iterationhooks insolve().Local Git Hooks & Release Workflow: Husky pre-commit (Ruff/mypy) and pre-push (pytest) hooks; isolated release branches (
release/v<year><edition><version>).
Changed¶
In-Memory
Tracker: Replaced Zarr storage with in-memory NumPy arrays (tracker[key], typed fields such astracker.n_epochs,tracker.optimizer_name).Unified
Agent&Population: Consolidated catalog agent variants into a singleAgentclass and a finalPopulationclass with a standardized batch evaluation pipeline (best,top(k),bottom(k)).OpenMP Thread Management: Thread team configured once per run via
solve(..., threads=0)and evaluated throughprange.Module Relocation: Moved tracker into
clypto.optimizer.history(tracker.pyx).Citation Metadata: Updated
CITATION.cfffor Clypto.
Fixed¶
Algorithm Repairs & Implementations:
OriginalGA: RepairedOriginalGAby inheriting fromBaseGA, implementing the complete genetic algorithm lifecycle and evolution loop with support for configurable multi-point and single-point mutation strategies; removedNotImplementedError.DS_GWO: Implemented the missingevolve()step following Jiang et al. (2022) with group-stage competition in the exploration phase and 3-leader convergence in the exploitation phase; removedNotImplementedError.
Performance & Algorithm Optimizations:
OriginalASO: Vectorized Lennard-Jones (LJ) potential and acceleration calculations, inlined potential evaluations in C, and eliminated per-atom quadratic memory allocations and loop overhead in the atom force calculation loop.AAO: Optimizedevolve()by hoisting epoch-level invariants (sigmoid_factor, exploration probability, population mean positionx_mean) outside the agent loop; replaced unseeded globalnp.random.rand()withself.generator.random(); eliminated unused random index choice overwrite.EliteMultiGA/MultiGA: Optimized swap mutation by directly swapping two elements viagenerator.integers(eliminatingsetdifference and list conversions), and vectorized flip mutation viagenerator.random.DevEPC: Optimized penguin attractiveness and spiral movement calculation; precomputed trigonometric constants (cos_theta,sin_theta); inlined C-level math and vector operations; eliminated dynamic rotation matrix allocations andnp.allclosecomparisons in inner loops.ImprovedBSO: Clampedm_clustersdynamically tomax_clusters = max(2, int(pop_size / 5))whenpop_size < 25, avoiding validator range exceptions on small population budgets.
Budget-Dependent Parameter Defaults Adaptation:
Dynamically adapted hyperparameter defaults that scale with
epochorpop_sizeto prevent validator out-of-bounds exceptions on small budgets:CHIO(OriginalCHIO,DevCHIO):max_agedefault adapted to upper bound[1, max(1, 1 + int(epoch / 5))].HI_WOA:feedback_maxdefault adapted to upper bound[2, max(2, 2 + int(epoch / 2))].OCRO:restart_countdefault adapted to upper bound[2, max(2, int(epoch / 2))].OriginalEHO:n_clansdefault adapted to upper bound[2, max(2, int(pop_size / 5))].OriginalGSKA:kgdefault adapted to upper bound[1, max(1, 1 + int(epoch / 2))].
Removed / Breaking Changes¶
Removed
zarr>=3dependency,tracker.meta,history_path, and on-disk tracking stores.Removed
tracker.before,tracker.after,on_before, andon_after(usesolve(before_iteration=..., after_iteration=...)).Custom
Populationsubclasses are no longer accepted incy.population(size).
[2026b]¶
Added¶
Decorator-Based Optimizer API: Support for writing custom optimizers via
@cy.optimizer,@cy.agent, and@cy.legacy, declaring hyper-parameters and state viacy.Argumentandcy.Attribute.cy.Population: Clean population container exposing solutions matrix, read-only fitness, and manipulation methods.Opt-in Cython Compilation: Compile decorated classes to native extensions at import time via
compile=True/precompile=True.Documentation: New custom optimizer tutorials and migration guide.
Changed¶
Renamed base
OptimizertoLegacyOptimizer(kept as a backward-compatible alias).
[2026]¶
Added¶
Complete Cython Native Core: Reimplemented core classes, algorithms, and populations in native Cython with C-level evaluation pipelines and OpenMP multithreading (
prange).Monotonic Global Best (
g_bestRatchet): Guaranteed thatg_bestalways tracks the best solution found throughout the entire run using independent snapshots.Unified
cyNamespace: Consolidated the collection underclypto.native.collection.<category>and exposed core utilities viacimport clypto.core as cy.C-Level Bounds & Repair Routines: Added
Boundssystem (NumberBounds,TransferBounds,StringBounds, etc.) and native repair functions (cy.correct_solution,cy.reset_solution,cy.opposite_solution).Fast Batch Pipeline: Batched evaluation pipeline for all catalog algorithms with vectorization and OpenMP execution.
Modern Packaging with
uv: Switched build/test workflow touvwith cross-platform wheel generation (cibuildwheel).
Fixed¶
Fixed memory corruption caused by
wraparound: Falseon negative list indexing.Fixed strict type coercion issues with NumPy 2.x and Cython call boundaries.
Fixed infinite loops in roulette-wheel selection caused by floating-point underflow.
Resolved boundary condition bugs, indexing mismatches, and latent errors inherited from legacy implementations across 90+ algorithm variants.
Removed¶
Removed legacy vectorization tree duplicate engines (
VectorizeOptimizer,NativePopulation,AgentListOptimizer).Permanently stripped all GUI, plotting, external file logging, and unneeded benchmark bloat.
Dropped runtime dependencies on
Cython,flake8, and legacy packaging scripts.
MEALPY (Upstream Archive Summary)¶
Clypto originated as a high-performance Cython rewrite and fork of MEALPY (v1.0.0 through v3.0.4.1 by Thieu Nguyen).
Historical Milestones¶
v3.0.x (2023 - 2024):
Added new algorithm families: state-of-the-art CEC competition variants (
sota_based),game-based, chaotic and fuzzy modules.Expanded swarm, physics, and human-based catalogs (SOO, EAO, SFOA, DOA, MSO, THRO, MShOA).
Switched license from GNU GPLv3 to MIT.
v2.0.x - v2.5.x (2021 - 2023):
Restructured architecture into clean object-oriented modules (
Problem,Optimizer,Agent).Added multi-objective optimization support, termination conditions, and variable search spaces (
*Var).Introduced parallel/multiprocessing modes and expanded the algorithm catalog beyond 150+ metaheuristics.
v1.0.x - v1.2.x (2020 - 2021):
Standardized algorithm interface and modularized legacy procedural implementations.
Introduced base classes for evolutionary, swarm-based, and physics-based metaheuristics.
v0.1.0 - v0.8.x (2019 - 2020):
Initial open-source releases implementing classic metaheuristics (GA, PSO, DE, GWO, BFO).
For the complete granular historical changelog prior to the Clypto fork, refer to the MEALPY repository.