Skip to content

fix(parallel): always send the parent's artifacts to the worker - #624

Open
shaojunying wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
shaojunying:fix/snapshot-parent-artifacts
Open

shaojunying wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
shaojunying:fix/snapshot-parent-artifacts

Conversation

@shaojunying

Copy link
Copy Markdown

Fixes #623

Problem

The worker builds the prompt with the parent's artifacts. The controller sends artifacts only for the first max_snapshot_artifacts programs (default 100) in insertion order, and it ignores which program is the parent. A parent added after the first 100 programs gets no artifacts, so its errors and outputs never reach the LLM.

Change

  • _create_database_snapshot() takes an optional parent_id. It moves the parent to the front of the program list before the max_snapshot_artifacts slice.
  • _submit_iteration() passes the sampled parent.
  • The limit keeps its meaning: at most max_snapshot_artifacts programs, None for no limit, 0 for no artifacts.
  • The comment that said the limit keeps "recent programs" is corrected.

Verification

  • New tests in tests/test_snapshot_artifacts_limit.py:
    • a parent added after the limit keeps its artifacts in the snapshot, and the snapshot still holds at most max_snapshot_artifacts entries;
    • the snapshot that _submit_iteration() passes to the executor contains the parent's artifacts;
    • max_snapshot_artifacts: 0 still sends no artifacts.
      The first two fail on main.
  • python -m pytest tests --ignore=tests/integration --ignore=tests/alphaevolve_upstream on Windows, Python 3.12: 29 failed, 1108 passed, 8 skipped. The same 29 tests fail on main on this machine (POSIX path assumptions, os.kill on Windows, locale encoding). No new failures.
  • black --check passes on the changed files.

The worker snapshot kept artifacts for the first max_snapshot_artifacts
programs in insertion order. The worker only reads the parent's
artifacts, so a parent added after the first 100 programs got none, and
its errors and outputs never reached the prompt. Put the parent first
before the limit is applied.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

Parent artifacts are missing from the prompt once the database holds more than max_snapshot_artifacts programs

2 participants