Evolution Loop Flowchart
The engine follows a fixed generational loop. Each iteration produces, validates, and evaluates offspring before updating the population.Phase Descriptions
Initialize Search Space The engine reads the ModelRegistry to discover available parent models. It builds a search space of possible merge configurations based on registered, validated, and compatible models. Only models in VALIDATED or REGISTERED state are eligible. Initialize Population The first generation is created using one or more initialization strategies: random, seeded from known good candidates, or Latin hypercube sampling. Population size is configurable. The Population component manages size and diversity targets. Validate Candidates Each candidate passes through the ModelCompatibilityAnalyzer. Candidates receive COMPATIBLE, CONDITIONALLY_COMPATIBLE, or INCOMPATIBLE status. Only COMPATIBLE and CONDITIONALLY_COMPATIBLE candidates proceed. INCOMPATIBLE candidates are discarded with a logged reason. Evaluate Candidates The EvaluationEngine runs each candidate through the benchmark suite. Metrics are collected from the Optimization Set only. The Hidden Test Set is never used during evolution. This isolation prevents overfitting the search process. Calculate Fitness The FitnessEngine computes scalar or vector fitness values. Fitness is computed solely from the Optimization Set. The Validation Set and Hidden Test Set are reserved for post-evolution reporting. Rank Candidates Candidates are ranked by fitness. For single-objective runs, this is a simple sort. For multi-objective runs, non-dominated sorting and crowding distance (NSGA-II, Deb et al. 2002) determine ranking. Selection The Selection component chooses parents for the next generation. Supported selectors include tournament, truncation, elitism, and roulette. Elitism preserves the top-performing candidates unconditionally. Check Termination Termination triggers when any of the following conditions are met:- Maximum generations reached
- Fitness plateau (no improvement for N generations)
- Diversity collapse (population variance below threshold)
- Target fitness achieved
- User cancellation
Integration Points
Research Basis
The EvolutionEngine design is grounded in Evolutionary Model Merge (Akiba et al. 2024), which demonstrated that evolutionary search can discover merge configurations outperforming manual tuning. NSGA-II (Deb et al. 2002) and NSGA-III (Deb & Jain 2014) provide the multi-objective optimization foundation. CMA-ES (Hansen 2001) is reserved as a future alternative search strategy.Configuration Parameters
Candidate Status Mapping
Candidates receive status from the EvaluationEngine:- PASS: Meets all thresholds, proceeds to ranking
- FAIL: Below minimum thresholds, excluded from selection
- REGRESSION: Worse than baseline on critical metrics, flagged for review
- INVALID: Failed compatibility or integrity checks
- INCOMPLETE: Evaluation interrupted, candidate excluded
Notes
The EvolutionEngine does not access the Hidden Test Set at any point. All fitness calculations, rankings, and termination decisions use the Optimization Set exclusively. The Validation Set and Hidden Test Set are reserved for post-evolution evaluation and final reporting.