Skip to content

Promote gamma and epsilon_decay to evolvable genes with tests#719

Open
csmangum wants to merge 6 commits intomainfrom
dev
Open

Promote gamma and epsilon_decay to evolvable genes with tests#719
csmangum wants to merge 6 commits intomainfrom
dev

Conversation

@csmangum
Copy link
Copy Markdown
Contributor

@csmangum csmangum commented Apr 18, 2026

This pull request extends the hyperparameter chromosome schema to support two additional continuously evolvable genes: gamma (discount factor) and epsilon_decay (exploration decay rate). Both are now evolvable with linear 8-bit quantization, and the codebase and tests are updated to reflect this. The groundwork for future support of integer and categorical genes is also documented. Extensive new and updated tests ensure correct encoding, mutation, crossover, and config projection for all evolvable genes.

Chromosome schema and encoding updates:

  • Added gamma as an evolvable gene (range [0.0, 1.0], default 0.99, linear 8-bit encoding) and made epsilon_decay evolvable (range (0, 1.0], default 0.995, linear 8-bit encoding) in both DEFAULT_HYPERPARAMETER_GENES and DEFAULT_GENE_ENCODINGS in farm/core/hyperparameter_chromosome.py. [1] [2]
  • Updated documentation to describe the new schema, encoding policies, and to clarify that memory_size remains fixed pending integer gene support. Added a roadmap for future discrete/integer gene support in docs/design/hyperparameter_chromosome.md. [1] [2]

Serialization, mutation, and crossover:

  • Updated all encode/decode and mutation/crossover logic and tests to include gamma and epsilon_decay as evolvable, ensuring correct round-tripping, mutation, and crossover for all three continuous genes. [1] [2] [3]

Test suite improvements:

  • Added a dedicated test class for the new continuous genes, covering bounds, serialization, encoding, mutation, crossover, and config projection for gamma and epsilon_decay in tests/test_hyperparameter_chromosome.py.
  • Updated existing tests and test fixtures to set all evolvable genes appropriately, ensuring that tests for boundary penalties and mutation only penalize or mutate the intended genes. [1] [2] [3] [4] [5] [6]

Documentation and roadmap:

  • Expanded design docs with a discrete-gene roadmap, describing planned support for integer, binary, and categorical genes, and clarifying current limitations and next steps.

These changes collectively enable richer hyperparameter evolution experiments and lay the foundation for future extensibility.


Note

Medium Risk
Expands the set of evolved hyperparameters, changing mutation/crossover/encoding behavior and boundary-penalty calculations in evolution and reproduction flows; issues would primarily affect training dynamics and experiment determinism rather than system safety.

Overview
Promotes two additional learning hyperparameters into the evolution chromosome. gamma is added as a new evolvable gene and epsilon_decay is switched from fixed to evolvable, both using default linear 8-bit quantized encoding alongside existing log-encoded learning_rate; memory_size stays fixed.

Updates docs and tests to reflect the expanded evolvable gene set, including encode/decode dict+vector round-trips, mutation/crossover coverage, reproduction wiring expectations, and boundary-penalty tests that now set non-target evolvable genes away from bounds to keep penalties deterministic.

Reviewed by Cursor Bugbot for commit dd44b5b. Configure here.

Copilot AI and others added 5 commits April 18, 2026 06:35
…t epsilon_decay boundary assertions, clarify gamma/epsilon_decay span comment

Agent-Logs-Url: https://github.com/Dooders/AgentFarm/sessions/7bad1e22-d439-46f3-bb9f-5566cdf47a59

Co-authored-by: csmangum <30098247+csmangum@users.noreply.github.com>
…dpoint overrides

Agent-Logs-Url: https://github.com/Dooders/AgentFarm/sessions/7bad1e22-d439-46f3-bb9f-5566cdf47a59

Co-authored-by: csmangum <30098247+csmangum@users.noreply.github.com>
…enes

Scale chromosome model: promote gamma and epsilon_decay to evolvable genes
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the hyperparameter evolution chromosome to treat gamma and epsilon_decay as continuously evolvable genes (alongside learning_rate), using linear 8‑bit quantization for the new genes, and updates tests/docs to reflect the expanded schema.

Changes:

  • Added gamma and promoted epsilon_decay to evolvable genes in the default chromosome schema and default encoding map.
  • Expanded/adjusted unit tests to cover encoding/decoding, mutation, crossover, and config projection with the new evolvable genes.
  • Updated the design doc to describe the new schema and a roadmap for future discrete/integer gene support.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
farm/core/hyperparameter_chromosome.py Adds gamma gene, makes epsilon_decay evolvable, and defines default linear 8-bit encodings for both.
tests/test_hyperparameter_chromosome.py Adds a dedicated test class for gamma/epsilon_decay and updates boundary-penalty tests for the expanded evolvable set.
tests/test_agent_reproduction_hyperparameters.py Updates reproduction test expectations now that gamma/epsilon_decay mutate during reproduction.
tests/runners/test_evolution_experiment.py Adjusts boundary-penalty test setup so only learning_rate is near a boundary.
docs/design/hyperparameter_chromosome.md Documents the new schema/encodings and adds a discrete-gene roadmap; includes updated examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/design/hyperparameter_chromosome.md
Comment thread docs/design/hyperparameter_chromosome.md
@csmangum
Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

@copilot apply changes based on the comments in this thread

Fixed in b50f85d. Updated the example bucket values in docs/design/hyperparameter_chromosome.md to match the actual encoding output:

  • learning_rate: 102 → 128 (log-scale 8-bit: round(0.5 × 255))
  • gamma: 252 (unchanged, already correct)
  • epsilon_decay: 253 → 254 (linear 8-bit: round(0.995 × 255))

Both the dict and vector examples now show {"learning_rate": 128, "gamma": 252, "epsilon_decay": 254} / (128, 252, 254), verified against the live encoding logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants