8b7ed66ffda95d4c29446f491dfb55622b61eafd
Codex deep diagnosis surfaced two real issues in our MCTS pipeline: 1. mcts.pyx::search() hardcoded prepare_simulation_batch(state, traverser, 1) instead of respecting MctsConfig.parallel_simulations. Standalone evals (eval_checkpoint, evaluate_with_mcts sequential path, eval_worker) all use this entry point, so all eval-time MCTS was running 1 sim per batch regardless of the configured 64. Training was unaffected because it goes through interleaved_self_play._run_search_jobs which respects the config. Fix uses min(config.parallel_simulations, sims - completed). 2. use_rollout_value defaulted to True (config.py) but was never set in the YAML. With this, _expand_with_prior returns the heuristic rollout value and discards network_value, so the network value head is trained from final game scores but its outputs are never fed back into MCTS backups. This explains why mcts/value_prediction_error stays high despite training -- learning the value head produces no behavioral change because MCTS never reads it. Now setting use_rollout_value=false in default.yaml so the network value head closes the loop. Combined with the existing Dirichlet root noise + heuristic rollout removal, this should give the network's value learning actual leverage on action selection. Also: updated test_search_visit_counts_match_with_parallel_simulations to test the correct invariant (legal-action set match + total visit count near n_sims) rather than literal visit-count equality, which was only true under the previous bug. Tests: 19/19 passing.
coolrl-lost-cities
Focused Lost Cities extraction from the legacy coolrl repository.
The current implementation starts with the classic two-player card game:
- classic 5-expedition rules by default
- Python/Cython game engine
- env wrapper
- random, discard-only, and safe-heuristic bots
- core rule, scoring, mask, env, canonical-state, bot, and GUI smoke tests
Training code, Deep CFR, learned-policy evaluation, GUI, and web client are intentionally outside the first port.
Development
uv run pytest tests/games/classic
uv run lost-cities-classic
For future GUI work, install the optional GUI dependencies:
uv sync --extra gui
Run the classic pygame GUI:
uv run lost-cities-classic-gui --mode pvc --bot safe-heuristic
The GUI uses the in-process Cython game engine.
Basic Usage
from coolrl_lost_cities.games.classic import GameState, build_bot, classic_config
state = GameState.new_game(classic_config(seed=1))
bot = build_bot("random", seed=1)
while not state.terminal:
state.apply_action(bot.act(state))
print(state.total_score(0), state.total_score(1))
See classic port notes for the current direction.
Languages
Python
73.3%
Cython
21.7%
Julia
4.8%
Shell
0.2%