Skip to content

ManakaZero generation loop

ManakaZero is the self-play line: gen0 starts from random weights, and each generation produces games, trains a candidate, measures it, and promotes it only when the configured gates pass.

The implementation is in crates/manaka-{selfplay,train,loop,usi}.

One generation

  1. Self-play — generate games with the current parent on idle cluster CPU cores.
  2. Training — sample from the recent replay window and train the candidate, normally on CUDA.
  3. Parent gate — compare candidate and parent with an SPRT.
  4. External anchor — compare against a fixed reference so the whole lineage cannot drift unnoticed.
  5. Promotion — replace the parent only when the configured checks pass.

The loop writes its ledger under runs/manaka/, so it can resume after interruption.

Data and formats

  • weights: MNW1;
  • self-play records: MNR1;
  • positions are stored packed rather than as architecture-specific features, so old self-play data can be reused after many architecture changes.

The training replay window mixes recent generations instead of using only the latest games.

Manaka uses PUCT search. The normal playing/search budget and the self-play budget are separate settings; do not infer one from the other. Mate-in-one and repetition handling are rule-side fast paths.

Current search throughput belongs in the benchmark.

Running

sh
cargo build --release -p manaka-train --features cuda
cargo build --release -p manaka-selfplay -p manaka-usi -p manaka-loop

build/target/release/manaka-loop probe
build/target/release/manaka-loop run
build/target/release/manaka-loop run --local
build/target/release/manaka-loop watch

For static cluster binaries:

sh
cargo build --release --target x86_64-unknown-linux-musl \
  -p manaka-selfplay -p manaka-usi

watch reads the ledger/progress files and shows generation, phase, node utilization, training status and game-measurement progress. It does not control the loop.

Failure handling

A repeated failure to promote is treated as a signal to inspect the architecture or training procedure rather than retry forever. The loop can emit a stall report and stop after the configured number of failed generations.

The external anchor is important: a candidate can beat its parent while becoming worse against a fixed opponent. Promotion and diagnosis should therefore not rely on internal head-to-head alone.

OpenBench integration

Each generation can be registered as ManakaZero @genN; worker-side configuration resolves the suffix to the static ManakaZero engine command and supplies the generation's EvalFile.

Operational details of SPRT, ladders and worker cleanup are documented in openbench.