Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:AIScientists Dev WorldSeed AutoresearchWorker

From Leeroopedia
Knowledge Sources
Domains Research_Automation, Distributed_Computing
Last Updated 2026-10-26 18:00 GMT

Overview

Concrete async training worker that drains the pending experiment queue, creates git branches, acquires GPUs from a pool, dispatches training to a remote EC2 daemon, and creates experiment entities with results.

Description

The AutoresearchWorker class runs as a single asyncio task. Each dequeued item (ExperimentRequest or VerifyRequest) is spawned as its own task, claiming one GPU from a `GPUPool`.

Flow for ExperimentRequest:

  1. Create `experiment/{agent}/{exp_id}` git branch from baseline
  2. Write agent's `train_gpt.py` payload, commit (under git lock)
  3. Acquire GPU from pool
  4. POST source + gpu_id to EC2 daemon, parse `val_loss`
  5. Create `experiment` entity, bump corpus counters
  6. Emit `experiment_completed` / `experiment_crashed`
  7. Release GPU

Flow for VerifyRequest:

  1. Read `train_gpt.py` at the paper's `method_commit` via `git show`
  2. Acquire GPU → POST source → parse val_loss
  3. Compare to `expected_val_loss` within `VERIFY_TOLERANCE = 0.02`
  4. Transition paper to `under_review` (within) or `contested` (outside)

Key constants: `EXPERIMENT_BUDGET_SEC = 600`, `DEFAULT_GPU_COUNT = 8`, `VERIFY_MAX_ATTEMPTS = 3`, `EXPERIMENT_INFRA_MAX_ATTEMPTS = 2`.

Usage

Import this class to run the training worker. Started by the autoresearch scene initialization as a background asyncio task.

Code Reference

Source Location

  • Repository: WorldSeed
  • File: src/worldseed/autoresearch/worker.py

Signature

class AutoresearchWorker:
    def __init__(
        self,
        store: StateStore,
        event_log: EventLog,
        recorder: RunRecorder | NullRecorder | None = None,
        runner: EC2Runner | None = None,
        gpu_count: int = DEFAULT_GPU_COUNT,
    ) -> None: ...

    def start(self) -> None: ...
    def stop(self) -> None: ...

EXPERIMENT_BUDGET_SEC = 600
VERIFY_TOLERANCE = 0.02
VERIFY_MAX_ATTEMPTS = 3
DEFAULT_GPU_COUNT = 8

Import

from worldseed.autoresearch.worker import AutoresearchWorker

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment