Skip to content

After one evaluation times out, every later evaluation times out too (parallel_evaluations=1) #610

Open

Description

@tushar-mahalya

I ran a small evolution with the default evaluator.parallel_evaluations: 1 and evaluator.timeout: 3, against a local fake OpenAI-compatible server. The first LLM reply rewrote the function body to while True: pass, and the later replies were ordinary edits like return x * 2 + 4.

The first evaluation is reported as a timeout, which is correct. But iterations 2 to 5 are valid programs that evaluate in milliseconds, and all of them come back as error=0.0, timeout=True. The run ends with the seed as the best program.

It also reproduces with Evaluator directly. With timeout=1 and an evaluate() that sleeps whenever the program contains HANG, evaluating "# HANG" and then "x=1" returns {'error': 0.0, 'timeout': True} for both. The second one should return the evaluator's normal metrics.

As far as I can tell, Evaluator runs evaluate() in its own ThreadPoolExecutor(max_workers=parallel_evaluations). asyncio.wait_for stops waiting at the timeout, but the thread keeps running. With a single worker thread, the next call is queued behind it and waits out its own timeout without ever starting. If the program loops forever, nothing gets scored for the rest of the run. I think this came in with the dedicated executor from #485, which fixed the shutdown hang but made the pool size matter; the old default executor had spare threads.

Expected: only the program that hangs is marked as a timeout, and later programs are evaluated normally.

Environment: OpenEvolve at c690eba (main), Python 3.12, macOS.

I have a fix and will open a PR.

Found with help from Claude Code; I reproduced it myself.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions