Repository navigation
Description
Problem
until_coverage_stable is a property of one process. The reached-sometimes set, the shared assertion region, the sometimes_each buckets and the sancov history map all live in the controller's memory. At this rev (0a68199), nothing exports or imports them: assertion_read_all() gives a snapshot, and sancov gives a covered-edge count, not the map.
This caps how a campaign can scale:
- Forked workers (
ExplorationConfig::workers) parallelise only the explored continuations. Root seeds still run one after another in the controller. - Several independent processes, for example several CI jobs, cannot share a plateau. Each must saturate on its own, which multiplies the work instead of dividing it.
Measurements (paros sim-paros-chain, sancov release build, 240 pinned seeds, 4 cores)
| setup | wall time | gates fired | timelines |
|---|---|---|---|
exploration, in-process (workers: 0) |
208 s | 426/430 | 555 |
exploration, workers: 3 |
149 s | 426/430 | 555 |
| no exploration, 1 process | 76 s | 415/421 | 240 |
| exploration, 3 processes × 80 seeds | 118 s | 395–403 each | ~300 each |
| no exploration, 3 processes × 80 seeds | 29 s | 378–384 each | 80 each |
Independent processes scale almost linearly (76 s → 29 s). But no single one of them reaches the full gate set, so none can say whether the campaign as a whole saturated. Forked workers keep one table and the result is exact, but the speedup stops at 1.4× because the root seeds stay serial.
Proposal: a coordinator plus a worker fleet
A coordinator owns everything the controller owns today:
- the seed sequence;
- the frontier of recipes;
- the exemplars;
- the merged assertion, bucket and sancov state;
- the plateau decision.
Workers are separate processes, possibly on separate machines or CI jobs. Each one loops:
- Pull a job from the coordinator: either a fresh root seed, or an exploration job (seed + recipe + anchor).
- Run one timeline, using the same runner path as today.
- Push back what the run produced:
- the discovery journal: each assertion first and new bucket, stamped with its RNG call count, so the coordinator can still anchor expansions;
- the per-slot pass/fail deltas for the assertion table and the bucket hits;
- the sancov counter delta for the instrumented crates;
- the outcome: clean, failure with seed + recipe, or crash.
The coordinator merges every report into a single table and decides novelty itself. The CAS latches move from shared memory into the coordinator. It then:
- enqueues expansions exactly as
Explorer::observe_*does today; - counts the plateau over the merged state;
- stops the fleet once it saturates or hits the cap.
The report is the same SimulationReport a single process would produce.
Design points to settle
- Transport: a pipe or Unix socket for a local fleet first. A file- or HTTP-based exchange would let separate CI jobs join one campaign.
- Determinism: each timeline stays exactly replayable from its seed and recipe. Only the schedule depends on arrival order, as it does with
workers > 0today. - Slot identity: slots are hashes of the assertion message, so tables from different processes running the same binary merge by key. The coordinator should refuse a worker whose binary or slot table differs, for example via a build fingerprint. Sancov maps likewise need the same binary.
- Budget accounting: keep
max_iterationscounting root seeds andmax_runs_per_seedcounting timelines per root, as today, so existing campaigns keep their meaning. - Failure handling: a lost worker's job goes back to the frontier, and a crash is retained as a reproducer, as forked workers do now.
- Single-process mode: the current in-process and forked paths should become this design with an in-process coordinator, not a second implementation.
Why it matters
In paros, the CI sweep's length is set by its rarest gates, which fire on about 0.1% of seeds or fewer. A fleet would turn wall time into "seeds per second × machines" without giving up the single saturation gate.
Activity