How bullygen/runweaver works
Runweaver is a typed framework for planning and running computational/ML experiments, then recovering, evaluating, and refining them. The principal workflow is declarative configuration or library API → parameter-space plans → validated block pipeline → local or optional-backend execution → durable run state and content-addressed artifacts → decisions and refinement. The README documents broader integrations and planning/selection capabilities; source excerpts confirm key local-engine and CLI behavior. Several subsystems are unsampled, so their documented links are identified as such rather than inferred from imports.
Main entry points: engine.py Local executor · graph.py Validated DAG · planners.py Trial planners · app.py CLI commands
Components 24
Entry and configuration
- CLI commands
src/runweaver/cli/app.py - Run configuration
src/runweaver/config.py - Python API
src/runweaver/api.py
Pipeline and planning
- Typed blocks
src/runweaver/domain/blocks.py - Validated DAG
src/runweaver/pipeline/graph.py - Parameter space
src/runweaver/planning/space.py - Trial planners
src/runweaver/planning/planners.py - Domain contracts
src/runweaver/domain/models.py - PyTorch blocks
src/runweaver/integrations/pytorch/blocks.py
Execution runtime
- Local executor
src/runweaver/execution/engine.py - Run context
src/runweaver/execution/context.py - Study runner
src/runweaver/execution/study.py - Prefect backend
src/runweaver/integrations/prefect/backend.py - Ray backend
src/runweaver/integrations/ray/backend.py
State and artifacts
- Run state store
src/runweaver/persistence/store.py - Checkpoint service
src/runweaver/persistence/checkpoints.py - Artifact store
src/runweaver/artifacts/store.py - Artifact serializers
src/runweaver/artifacts/serializers.py - Lineage hashing
src/runweaver/artifacts/hashing.py
Evaluation and extensions
- Trial decisions
src/runweaver/domain/decisions.py - Plan refinement
src/runweaver/refinement/strategies.py - Optuna adapter
src/runweaver/integrations/optuna/adapter.py - MLflow tracking
src/runweaver/integrations/mlflow/tracker.py
Other components
- Experiment author
Connections 29
- Experiment author → CLI commands: invokes
- Experiment author → Python API: builds runs
- CLI commands → Run configuration: loads config
src/runweaver/cli/app.py - CLI commands → Trial planners: selects planner
src/runweaver/cli/app.py - Run configuration → Validated DAG: builds pipeline
src/runweaver/config.py - Python API → Validated DAG: exposes pipeline
src/runweaver/api.py - Python API → Typed blocks: exposes blocks
src/runweaver/api.py - Parameter space → Trial planners: defines design
src/runweaver/planning/planners.py - Trial planners → Local executor: supplies trial plans
- Validated DAG → Local executor: executes DAG
- Typed blocks → Validated DAG: forms graph nodes
src/runweaver/pipeline/graph.py - Local executor → Run context: constructs context
src/runweaver/execution/engine.py - Local executor → Run state store: records run state
src/runweaver/execution/engine.py - Local executor → Artifact store: reads and writes artifacts
src/runweaver/execution/engine.py - Local executor → Artifact serializers: serializes values
src/runweaver/execution/engine.py - Local executor → Lineage hashing: computes cache key
src/runweaver/execution/engine.py - Checkpoint service → Run state store: persists checkpoints
src/runweaver/persistence/checkpoints.py - Artifact serializers → Lineage hashing: uses fingerprints
src/runweaver/artifacts/serializers.py - Local executor → Study runner: supports study runs
- Local executor → Prefect backend: delegates execution
- Local executor → Ray backend: delegates execution
- Local executor → Trial decisions: produces metrics
- Trial decisions → Plan refinement: guides next design
- Plan refinement → Trial planners: refines plans
- Trial planners → Optuna adapter: uses sampler
src/runweaver/integrations/optuna/adapter.py - Local executor → MLflow tracking: reports tracking
- PyTorch blocks → Typed blocks: implements block patterns
src/runweaver/integrations/pytorch/blocks.py - Validated DAG → Domain contracts: validates contracts
src/runweaver/pipeline/graph.py - Run state store → Domain contracts: stores run records
src/runweaver/persistence/store.py