Architecture
mace.orchestrator.run_mace_loop() checks a run’s inputs once, then repeats the stages from Planning to Iteration in each iteration.
Requirement MaceSpec, verify_checksums() -> checksum_mismatch
|
+--> Planning plan() -> planning_failed
| |
| Task Decomposition parse_tasks(), topological_levels()
| |
| Parallel Execution integrate_parallel()
| |
| RTL/System Integration _config_for_task(), build()
| |
| Verification run(), sim_verdict() -> passed
| |
| Failure Analysis triage()
| |
+--- Iteration feedback, budget check -> budget_exceeded
An arrow on the right names the run status recorded when the run stops at that stage.
Stages
Each stage maps to the modules below.
Stage |
Module |
Role |
|---|---|---|
Requirement |
|
|
Planning |
|
|
Task Decomposition |
|
|
Parallel Execution |
|
|
RTL/System Integration |
|
|
Verification |
|
|
Failure Analysis |
|
|
Iteration |
|
|
mace/metrics.py records runs, iterations, tasks, failures, and post-mortems in SQLite.
mace/report.py writes a post-mortem for a run that ends with failed or budget_exceeded.
mace/replay.py builds replay tags and turns on CHIA’s cache and bypass.
Control Flow
run_mace_loop(piton_roots, spec, llm, db, tools=(), on_iteration=None, on_task_progress=None, labels=None, options=None, plan_hook=None) records the run as running and checks the C programs in mace/workloads/ against CHECKSUMS.
Each iteration then checks the wall-clock and USD limits, calls plan() with the feedback gathered so far, checks the plan (see Fixed Checks), and hands the task DAG to integrate_parallel().
The orchestrator opens one OpenPitonWorkspaceNode per checkout when the first iteration reaches execution, reuses the nodes in later iterations, and closes them after the loop.
record_iteration() stores each iteration’s results, and the optional on_iteration(iteration, results) callback reports them to the caller.
When every task passed, or one task’s design passed every gate workload (gate_pass_ends_run), the run ends with passed.
Otherwise the orchestrator narrows the first failed task, triage() diagnoses it when narrowing settles nothing, and record_failure() stores the diagnosis for later plans (see Failure Analysis and Fixed Checks).
Budget limits end the run with budget_exceeded (see Budgets and Replay).
mace/loop.py also holds run_mace_step(), which runs a single task without the planner.
integrate() in mace/integrator.py applies tasks serially on one checkout, and the orchestrator does not call it.
plan_hook, when given, replaces each iteration’s planned tasks with what it returns; the seeded-failure runs use it to break the first plan.
labels, a mace.metrics.RunLabels, records which method, suite task, repeat, and seed a run was, with its environment as JSON; see Results and Metrics.
Loop Options
options, a mace.spec.LoopOptions, turns off one part of the loop for a baseline or an ablation.
The defaults are the full loop.
Field |
Default |
Other values |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The most thinking tokens one planner call may spend, set on the Vertex request. |
|
|
|
|
|
|
Package Boundary
mace imports chia_openpiton, and chia_openpiton imports nothing from mace, so the adapter can move into CHIA as chia/openpiton/ unchanged.
CI checks the boundary on every push.