Skip to content

cpu_pearl

diapason.mining.cpu_pearl

CPU-based Pearl mining provider (decoupled from inference).

See spec docs/design/2026-05-05-apple-silicon-pearl-mining-design.md §13 for the full v1 design.

The provider runs Pearl's pure-Rust mine() function via py-pearl-mining and runs Pearl's pearl-gateway as a sibling subprocess. Engine-independent: this provider does not plug into the user's inference stack. The user keeps using whatever engine they want; mining runs alongside on the CPU.

CpuPearlProvider

Bases: MiningProvider

v1 cpu-pearl: decoupled CPU mining via py-pearl-mining + pearl-gateway.

start(config) async

Spawn pearl-gateway and miner-loop subprocesses; write sidecar.

stop() async

SIGTERM both subprocesses; remove sidecar.

ensure_registered()

Idempotently register CpuPearlProvider in MinerRegistry.

Called once at import time from diapason.mining.__init__. Tests that rely on the autouse registry-clear fixture in tests/conftest.py must call this from a fixture or test body to re-register after the clear.