Skip to content

fix(trace): trace children whose parent left the archive - #581

Merged
codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
SUPR1M3:fix/trace-evicted-parent
Nov 2, 2026
Merged

codelion merged 1 commit into
algorithmicsuperintelligence:mainfrom
SUPR1M3:fix/trace-evicted-parent

Conversation

@SUPR1M3

@SUPR1M3 SUPR1M3 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

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 returns None and the child is silently missing from evolution_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_metrics the worker already stores in the child's metadata: a SimpleNamespace with id, metrics (or {} if none were stored), and code=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 have parent_code: null.

Tests

tests/test_controller_trace_logging.py runs 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 on main ([2] != [1, 2]) and passes with the fix.

python -m unittest discover tests: 1014 tests, OK.

Related

Found while running the full_rewrite_probability experiment for #116 (#580). Independent of that PR, the two merge cleanly in either order.

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.
@codelion
codelion merged commit 44e46b5 into algorithmicsuperintelligence:main Nov 2, 2026
5 checks passed
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.

2 participants