Commit 83bc21b
feat(meta-controller): Phase 7 — Pareto + Bayesian routing across (prover × coprocessor × aspect)
Closes the architectural loop: 11 coprocessor backends + 100+ provers
existed before this commit but the routing brain only knew about Math
and 3 aspects. Phase 7 wires:
**Full coprocessor registry** — `MetaController::new()` iterates the
known `CoprocessorKind` variants and asks `CoprocessorFactory::native`
for each, registering whatever's available. 10 always-on (Math /
Vector / Tensor / Crypto / Physics / Dsp / Io / Graphics / Audio / Fpga)
+ FlintMath when `--features flint`.
**Broad aspect taxonomy** — 22 aspect → coprocessor-op mappings cover:
- Arithmetic (gcd/lcm/modexp/modinv/primality/factor)
- Polynomial algebra (FLINT)
- Linear algebra (Vector dot/norm, Tensor matmul/det)
- Crypto (sha256/blake3/ed25519-verify)
- Physics (RK4 step, harmonic energy)
- Signal (FFT, Hann window)
- IO (file hash, line count)
- Visualisation (proof-graph SVG)
- Audio (completion chime)
- Hardware (yosys synth)
FLINT-routed aspects gracefully filter to empty when the backend isn't
linked — no failure path; controller routes around.
**Pareto + Bayesian** — `plan_with_pareto(goal, candidates, default_timeout,
default_trust)` builds a `ProofCandidate` per prover, populates predicted
proof_time from the StatisticsTracker mean (or default when absent),
runs `ParetoFrontier::compute`, picks from frontier via weighted_rank
favouring time. Falls back to `plan` when no candidates supplied.
Reuses the existing pareto.rs + statistics.rs surfaces — no new infra
invented.
**Outcome recording** — `record_outcome(plan, goal, outcome, elapsed_ms)`
flows Success/Timeout/Failure back to the StatisticsTracker keyed by
(prover, primary-aspect-as-domain). No-op when stats absent.
**Plan enrichment** — `Plan` now carries:
- `estimated_timeout_ms` (Bayesian per-tuple, falls back to default)
- `rationale` (human-readable diagnostic — pareto vs heuristic vs preferred)
Tests (all green):
- registers_all_native_coprocessors (10 or 11 depending on feature)
- aspect_routing_covers_each_kind_at_least_once (10 spot-checks)
- plan_with_pareto_picks_from_candidates
- plan_with_pareto_falls_back_when_no_candidates
- record_outcome_with_no_stats_is_noop
- record_outcome_updates_stats_when_present (success rate 2/3 verified)
- estimate_timeout_uses_stats_when_present (Bayesian estimate < 5 s after
ten 100 ms successes; was hitting 30 s default before stats)
- flint_aspect_hint_filtered_when_backend_absent
panic-attack assail clean (0 weak points). Pre-existing prover-side
trust pipeline + 700+ lib tests unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 603cda5 commit 83bc21b
2 files changed
Lines changed: 551 additions & 105 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
0 commit comments