gp-lite
Version:
Tiny, zero-dependency GA/GP engine for TypeScript/JS with first-class types, deterministic RNG, and budget-aware runs.
112 lines (65 loc) • 5.25 kB
Markdown
## [1.6.1](https://github.com/eenlars/gp-lite/compare/v1.6.0...v1.6.1) (2025-09-04)
# [1.6.0](https://github.com/eenlars/gp-lite/compare/v1.5.0...v1.6.0) (2025-09-03)
### Features
* enhance GP-CHECK with mathematical verification and new tests ([494cf54](https://github.com/eenlars/gp-lite/commit/494cf54f3add198a9353358af356a24dc45c6764))
# [1.5.0](https://github.com/eenlars/gp-lite/compare/v1.4.1...v1.5.0) (2025-09-03)
### Features
* add GP-CHECK checklist and enhance validation structure ([68174d7](https://github.com/eenlars/gp-lite/commit/68174d781525528944da076a39685ff5a1b71d23))
## [1.4.1](https://github.com/eenlars/gp-lite/compare/v1.4.0...v1.4.1) (2025-09-03)
# [1.4.0](https://github.com/eenlars/gp-lite/compare/v1.3.0...v1.4.0) (2025-09-03)
### Features
* enhance `run` function with immigration support and update documentation ([96b2891](https://github.com/eenlars/gp-lite/commit/96b289186e8d560bb63878541c512f0c7c063883))
# [1.3.0](https://github.com/eenlars/gp-lite/compare/v1.2.2...v1.3.0) (2025-09-03)
### Features
* add progress demo example and refine progress tracker exports ([146d57e](https://github.com/eenlars/gp-lite/commit/146d57e0b2d9098135217d2fbe23fe4543c561a4))
* unify generation payloads and enhance documentation ([538c62c](https://github.com/eenlars/gp-lite/commit/538c62cee749ae55a44babb8144c030d3889b398))
## [1.2.2](https://github.com/eenlars/gp-lite/compare/v1.2.1...v1.2.2) (2025-09-03)
## [1.2.1](https://github.com/eenlars/gp-lite/compare/v1.2.0...v1.2.1) (2025-09-03)
# [1.2.0](https://github.com/eenlars/gp-lite/compare/v1.1.0...v1.2.0) (2025-09-03)
### Features
* add todos.md to .gitignore and implement parallel evaluation test for GPLiteAsync ([d2f2b1e](https://github.com/eenlars/gp-lite/commit/d2f2b1e069b3edd982715c1209d60869555c410b))
# [1.1.0](https://github.com/eenlars/gp-lite/compare/v1.0.0...v1.1.0) (2025-09-03)
### Features
* enhance async control in GPLiteAsync and GPLite ([0ace929](https://github.com/eenlars/gp-lite/commit/0ace929576a04ada35bef1caa60d825cbebf8195))
# 1.0.0 (2025-09-02)
### Features
* add GPLiteAsync for asynchronous genetic programming support ([0dec709](https://github.com/eenlars/gp-lite/commit/0dec709893eca3655e546f95af39387c85f40351))
# Changelog
## 1.3.0 - 2025-09-03
Breaking changes and API unification across generation callbacks, hooks, and results.
- feat!: unify per-generation payloads and result field names
- OnGeneration now receives a single object `{ generation, bestFitness, avgFitness, popSize, invalidCount, validShare, bestGenome, elapsedMs, stopReason? }`.
- Hooks: `onGenerationStart({ generation, popSize, elapsedMs })`; `onGenerationEnd` and `onIteration` receive the same payload as `OnGeneration`.
- Results renamed for clarity: `bestGenome` (was `best`), `bestFitnessHistory` (was `history`), `avgFitnessHistory` (was `meanHistory`), `invalidCountHistory` (was `invalidHistory`).
- feat: include `popSize`, `elapsedMs`, and `bestGenome` directly in `OnGeneration` payload.
- feat: add `seed` to `GPConfig`; engines use `mulberry32(seed)` when `rng` is not supplied.
- feat: add `initialPopulation` to `GPConfig` for `GPLiteAsync`; seeds gen-0 without calling `createRandom` for those slots.
- feat: surface `stopReason` in per-generation callback payload on the final generation.
- docs: document async concurrency semantics, budget enforcement, and unified payloads.
- chore: remove `any` usage in code/tests; tighten types.
Migration guide
- Callbacks/hook payloads
- Before: `onGen((ctx, extra) => { ctx.best; ctx.mean; extra.bestGenome; ... })`
- After: `onGen((info) => { info.bestFitness; info.avgFitness; info.bestGenome; info.generation; ... })`
- Hooks: `onGenerationStart({ generation, popSize, elapsedMs })`; `onGenerationEnd`/`onIteration` receive `GenerationInfo`.
- Result fields
- `result.best` → `result.bestGenome`
- `result.history` → `result.bestFitnessHistory`
- `result.meanHistory` → `result.avgFitnessHistory`
- `result.invalidHistory` → `result.invalidCountHistory`
- Config additions (optional)
- `seed?: number` for deterministic RNG without supplying `rng`.
- `initialPopulation?: ReadonlyArray<T>` for `GPLiteAsync` to seed generation 0.
Notes
- Concurrency semantics for async engine: bounded in-flight work by `concurrency`; budgets (`maxEvaluations`, `maxWallMs`) enforced between task completions; hooks fire once per generation after stats.
- `stopReason` is populated in the final generation payload so you can log the reason in your progress handlers.
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Generic time/cost estimator: `estimateRun`, `estimateFromMetrics`.
- Extended README with configuration, budgets, and estimator docs.
- Architecture, Contributing, Code of Conduct, and Security documents.
### Changed
- Engine now stops immediately after initialization if `maxEvaluations` budget is exhausted.
- Relaxed tournament size guard to allow sampling-with-replacement with `tournament > popSize`.