コンテンツにスキップ

テストマップ

更新日: 2026-07-05

変更内容ごとに実行するテストをまとめる。迷った場合は、最後にpytest -qを実行する。

よく使うコマンド

PYTHONPATH=src uv run python -m py_compile src/pca/search/ismcts/impl.py
PYTHONPATH=src uv run python -m pca.training.selfplay --help
PYTHONPATH=src uv run python -m unittest tests.test_module_boundaries
PYTHONPATH=src uv run python -m unittest discover -s tests

モジュール境界

変更内容 実行するテスト
__all__ / facade / re-export tests.test_module_boundaries
pca.training.dataset compatibility tests.test_module_boundaries, tests.test_training
pca.search.ismcts.types compatibility tests.test_module_boundaries, tests.test_encoder
CLI --help / argparse module --help smoke test

エンコーダー・意思決定

変更内容 実行するテスト
observation tokenization tests.test_encoder
action encoding / selected action tests.test_encoder
PolicyDecision behavior tests.test_encoder
neural policy batch tests.test_encoder
heuristic reranker tests.test_reranker if available, plus tests.test_encoder

探索・ISMCTS

変更内容 実行するテスト
search value profile tests.test_encoder
leaf value / aux prize value tests.test_encoder -k aux_prize or full tests.test_encoder
candidate pruning / visit distribution tests.test_encoder
runtime stats tests.test_encoder, tests.test_selfplay_summary
public-state key tests.test_encoder

自己対戦

変更内容 実行するテスト
record schema / JSONL output tests.test_encoder, tests.test_selfplay_summary, tests.test_training
summary stats / CSV tests.test_selfplay_summary
rule-agent teacher weight tests.test_rule_agents, tests.test_training
CLI defaults python -m pca.training.selfplay --help, tests.test_module_boundaries
parallel stream output targeted self-play smoke if feasible, plus JSONL append tests

学習

変更内容 実行するテスト
JSONL loader / filters tests.test_training
search collate tests.test_training
belief collate tests.test_training
policy/value loss tests.test_training
checkpoint load / model config tests.test_training
metadata cache/table tests.test_training
external Champion adoption tests.test_champion_adoption, tests.test_app_config

評価・提出

変更内容 実行するテスト
evaluation summaries tests.test_module_boundaries, targeted evaluation tests if present
bundle loader bundle smoke if available
submission load path local bundle smoke if available
tournament CLI python -m pca.evaluation.tournament --help

全体確認

リファクタリング、データ構造、公開APIを変更した後:

PYTHONPATH=src uv run python -m unittest discover -s tests

長時間の自己対戦を始める前:

PYTHONPATH=src uv run python -m pca.training.selfplay --help
PYTHONPATH=src uv run python -m unittest tests.test_module_boundaries tests.test_encoder tests.test_selfplay_summary