Repository navigation
fix(trace): trace children whose parent left the archive - #581
Merged
codelion merged 1 commit intoNov 2, 2026
Merged
Conversation
The controller only wrote a trace entry when database.get(parent_id) still found the parent. A parent replaced in its MAP-Elites cell while its child was being evaluated made that child vanish from the evolution trace, silently. Trace it anyway, from the parent metrics the worker stored in the child's metadata (the parent's code is no longer available). Adds a controller-level test that runs the result loop with a child whose parent is not in the database.
This was referenced Nov 1, 2026
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.
Problem
The controller only writes an evolution-trace entry when
database.get(parent_id)still finds the child's parent. With MAP-Elites, a parent can be replaced in its cell while its child is still being evaluated. When that child comes back, the lookup returnsNoneand the child is silently missing fromevolution_trace.jsonl. Nothing is logged, so the trace looks complete when it isn't.This showed up in a pilot run for the #116 experiment as completed iterations with no trace entry.
Fix
When the parent is gone, trace the child anyway. The controller builds a stand-in parent from the
parent_metricsthe worker already stores in the child's metadata: aSimpleNamespacewithid,metrics(or{}if none were stored), andcode=None/changes_description=None, since the parent's code is no longer available. Children whose parent is still in the archive are traced exactly as before.The only visible difference: with
include_code: true, these entries haveparent_code: null.Tests
tests/test_controller_trace_logging.pyruns the controller's result loop with one child whose parent is not in the database and one whose parent is. Both must appear in the trace, the first with the parent metrics from its metadata. The test fails onmain([2] != [1, 2]) and passes with the fix.python -m unittest discover tests: 1014 tests, OK.Related
Found while running the
full_rewrite_probabilityexperiment for #116 (#580). Independent of that PR, the two merge cleanly in either order.