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.
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 warningsPython setup lives under training/:
cd training
uv sync
uv run pytest testsRun 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 testsCopy .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.
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.binThe 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.