Repository navigation
Load lunar lander champions saved before #60 (5-field genes) - #121
Merged
Merged
Conversation
Champions written before #60 store each gene as (in, out, weight, enabled, is_bias). OrganismData now reads genes in either the current 4-field format or that one: is_bias is dropped and, since those files have no biases, every bias loads as 0. - tests/fixtures/champion_pre_60.json: a champion in the pre-#60 format (the one written by examples/openai_lunar_lander.rs before d18337b), loaded through ChampionFile::load by tests/lunar_lander_tests.rs. - Genes with any other number of fields are still an error. - README: old champions load but behave differently since #59/#60 (sigmoid output, real bias), so they should be evolved again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
examples/lunar_lander_common:OrganismData.genesis deserialized withdeserialize_genes, which accepts the current 4-field genes(in, out, weight, enabled)and the pre-Sesgo real por neurona #60 5-field genes(in, out, weight, enabled, is_bias).is_biasis dropped; those files have nobiases, so every bias loads as 0. Any other number of fields is still an error. Saving always writes the current format.tests/fixtures/champion_pre_60.json: a champion in the formatexamples/openai_lunar_lander.rswrote before d18337b (Sesgo real por neurona #60):fitness,generation,neurons_len, 5-fieldgenes, nothing else.tests/lunar_lander_tests.rs: loads the fixture throughChampionFile::load(the pathtest_championuses), checks the genes, zero biases, lander dynamics defaults, that it activates with finite outputs and round-trips in the new format; plus a test that 3- and 6-field genes are rejected.Verification
invalid length 5, expected 4 elements in sequence, then passes.cargo fmt -- --check: okcargo clippy --release --all-targets -- -D warnings: ok; with--all-features(pyo3 stub): okcargo build --release --examples: okcargo test --release --no-fail-fast: 210 passed, 0 failed (incl. README doc-tests)Closing criterion
Old files load (migration:
is_biasdropped, bias defaults to 0) with a test using a fixture in the old format: met —cargo test --release --test lunar_lander_tests champions_saved_before_60passes. The incompatibility in behaviour is also documented in the README.ref #104
Part of epic #55
🤖 Generated with Claude Code