Key changes for ISMCTS speed and correctness: - Cython port: HeuristicBot helpers (`heuristic_cy.pyx` + new `.pxd`) and ISMCTS searcher (`mcts.pyx`) now run as cdef. Both share a fast unified-action path through GameState's C interface to avoid Python round-trips on hot rollout/tree-walk paths. - Multi-process self-play and eval: `workers.py`, `eval_worker.py`, `interleaved_self_play.py`, plus trainer wiring with ProcessPoolExecutor + spawn context. Eval inside `evaluate.py` is parallel per opponent. - ISMCTS-specific eval (`evaluate.py`) runs MCTS at decision time so the metric matches deploy mode; `evaluation.eval_with_mcts` flag preserves backwards-compatible policy-only eval when needed. - Trainer logs progress per phase (self-play start/done, eval per opponent), and value loss is now scaled by `value_scale` so policy and value losses sit on comparable magnitudes. - Compact info-set key (`info_set.py`) using packed-struct format and child-key reuse during MCTS descent to cut per-step canonicalization. Tests: 19 ISMCTS suite passing, including parity (Cython-vs-Python sequential, batched-vs-sequential visit counts, push/pop round-trip). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
81 lines
1.7 KiB
TOML
81 lines
1.7 KiB
TOML
[project]
|
|
name = "coolrl-lost-cities"
|
|
version = "0.1.0"
|
|
description = "Focused Lost Cities classic game extraction"
|
|
readme = "README.md"
|
|
authors = [
|
|
{ name = "정시원", email = "sebastianrcnt@gmail.com" }
|
|
]
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"numpy>=1.26.0",
|
|
"matplotlib>=3.8",
|
|
"pydantic>=2.7",
|
|
"PyYAML>=6.0",
|
|
"torch>=2.3.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
gui = [
|
|
"pygame>=2.6.1",
|
|
"pygame-gui>=0.6.14",
|
|
]
|
|
wandb = [
|
|
"wandb>=0.17",
|
|
]
|
|
|
|
[project.scripts]
|
|
lost-cities-classic = "coolrl_lost_cities.games.classic:main"
|
|
lost-cities-eval = "coolrl_lost_cities.games.classic.evaluation:main"
|
|
lost-cities-classic-gui = "coolrl_lost_cities.games.classic.pygame_pvp:main"
|
|
lost-cities-deep-cfr = "coolrl_lost_cities.games.classic.deep_cfr.cli:main"
|
|
lost-cities-ismcts = "coolrl_lost_cities.games.classic.ismcts.cli:main"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"cython>=3.0",
|
|
"pre-commit>=4.0.0",
|
|
"pytest>=9.0.3",
|
|
"ruff>=0.8.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=69", "wheel", "Cython>=3.0", "numpy>=1.26.0"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
include = ["coolrl_lost_cities*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
"coolrl_lost_cities.games.classic" = [
|
|
"assets/*.json",
|
|
"fixtures/*.json",
|
|
"docs/*.md",
|
|
"*.pxd",
|
|
"*.pyx",
|
|
]
|
|
"coolrl_lost_cities.games.classic.deep_cfr" = [
|
|
"*.pxd",
|
|
"*.pyx",
|
|
]
|
|
"coolrl_lost_cities.games.classic.bots" = [
|
|
"*.pxd",
|
|
"*.pyx",
|
|
]
|
|
"coolrl_lost_cities.games.classic.ismcts" = [
|
|
"*.pxd",
|
|
"*.pyx",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py311"
|
|
extend-exclude = [
|
|
"src/coolrl_lost_cities/games/classic/game.pyx",
|
|
]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B"]
|
|
ignore = ["E501"]
|