0457efdf291094882e4553fca3361f6c72ac39de
The interleaved traversal scheduler's _regret_matching was hard-coded to spread fallback policy uniformly across legal actions, regardless of the configured regret_matching.all_negative_fallback. default.yaml has shipped with all_negative_fallback: argmax_tiebreak since618d5f8based on the 20-iter audit + 1000-iter empirical comparison in docs/archive/deep-cfr-regret-fallback-audit-2026-05-07.md, but the default scheduler was switched to interleaved in09bbe7c, after which the configured fallback mode silently no-op'd. _regret_matching now takes fallback_mode and concentrates policy mass on the lowest-index tied action when "argmax_tiebreak". Tiebreak is deterministic; the Cython recursive traverser randomises ties using its per-traverser RNG, which the batched policy does not have. Behaviour matches the spirit of the recursive path (concentrate on best, do not dilute uniformly). Plumbed through BatchedPolicy, InterleavedTraversalConfig, run_interleaved_traversal_batch, trainer.py, workers.py, and the analyze_first_open_targets.py caller. Two unit tests added. Also bumps default.yaml outcome_sampling_epsilon 0.2 -> 0.05. The 200-iter sweep in docs/plans/deep-cfr-selectivity.md section 1 showed 0.05 produced the best short-run safe_heuristic_strict score diff (-40.01 vs -57.87 for 0.20). Recent experiments already used 0.05; the default now matches actual experimental practice. Neither change targets the diagnosed selection-bias bottleneck. They align config intent with scheduler behaviour and make the default config reproduce known-best knob settings out of the box. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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, passive-discard, 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%