Skip to content

MochBot/fusion

Repository files navigation

Fusion engine

Rust engine and Python training utilities for TETR.IO replay coaching. The Rust package is direct-cobra-copy; it owns move generation, search, board evaluation, S2 attack, and native/WASM runtime paths. The training/ directory contains policy/value data and Modal training/labeling tools.

Fresh clone setup

Install Rust with rustup and install uv for the Python training environment. From the repository root, use the Cargo environment prefix when your shell does not load it automatically:

source "$HOME/.cargo/env"
CLOUD_EXEC_SKIP=1 cargo metadata --no-deps --format-version 1
CLOUD_EXEC_SKIP=1 cargo test --lib
CLOUD_EXEC_SKIP=1 cargo test --test presim_validation
CLOUD_EXEC_SKIP=1 cargo clippy -- -D warnings

Python setup lives under training/:

cd training
uv sync
uv run pytest tests

Run training scripts from training/ or set PYTHONPATH to the current checkout, not to a machine-specific path:

cd training
PYTHONPATH="$PWD" uv run python -m pytest tests

Optional private resources

Copy .env.example to .env only if you need replay collection, Modal training, or a local override for the policy/value label generator. Normal Rust tests, clippy, and Python unit tests do not require private env vars.

Large generated artifacts are intentionally not tracked. training/training_data_triangle_v1.bin, replay corpora under data/, and generated label sidecars must be staged locally or pulled from the shared artifact store before running full training jobs. Runtime model sidecars are tracked, but the ONNX binaries are not. models/pvc-real-r03.onnx is WIP in this upstream snapshot until the model file is provided; commands that load models/pvc-real-r03.onnx.metadata.json need that ONNX file next to the metadata.

Useful commands

source "$HOME/.cargo/env"
CLOUD_EXEC_SKIP=1 cargo run --bin policy_value_runtime_smoke -- models/pvc-real-r03.onnx.metadata.json
cd training && uv run python scripts/generate_policy_value_labels.py training_data_triangle_v1.bin

The smoke command requires models/pvc-real-r03.onnx. The label command requires the training data and request sidecars described in DATA_INVENTORY.md and training/TRAINING.md.

About

The open-source TETR.IO evaluation engine powering ******

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors