Cython implementation in heuristic_cy.pyx achieves ~2.55× speedup on
opponent_act_seconds (200-game eval: 59.20s → 23.24s). Original Python
implementation preserved verbatim in heuristic_py.py as the equivalence
reference. Action-sequence equivalence is verified by
test_safe_heuristic_equivalence.py against seeded game corpora.
Key implementation notes:
- File-local wraparound=True override required for negative discard
indexing; Cython global wraparound=False would segfault.
- annotation_typing=False preserves verbatim Python semantics.
- _CachedState materializes hands/expeditions/discards/deck once per
act() call — this is the dominant performance win.
Further C-array optimization of _card_value_for_me /
_card_value_for_opponent / _color_commitment / _bonus_potential is
deferred. The current 2.55× delivers most of the dense-eval future
benefit; further work is gated on actually adopting denser eval
schedules (eval_every=5, games=1000).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
맥락:
- GUI 이식 전에 classic 패키지 루트에서 노출할 API 범위를 정리했다.
- Claude Opus 4.7 xhigh 자문에서 root export 축소와 backend builder 이름 단일화를 우선 권장했다.
변경:
- classic package root export를 GameState, config, env, backend, bot registry 중심으로 줄였다.
- backend factory 이름을 build_backend로 단일화하고 README 사용 예시를 갱신했다.
- public API smoke test를 추가하고 pyproject description 및 Cython build failure 처리를 정리했다.
확인:
- uv run pytest tests/games/classic
- uv run lost-cities-classic
맥락:
- 새 레포의 첫 범위를 RL 없는 Lost Cities classic 게임 구현으로 잡았다.
- 기존 tier0-3 실험 축은 제거하고 classic 5-expedition 룰을 기본값으로 둔다.
변경:
- games/classic 아래에 Cython 게임 엔진, env, bots, backend 경계, Rust core와 proto schema를 이식했다.
- setuptools/Cython 빌드 설정과 package data, README, classic port notes를 추가했다.
- 룰, 점수, 마스크, env, canonical state, bot, Rust parity 테스트를 새 경로로 가져왔다.
확인:
- uv run pytest tests/games/classic
- uv run lost-cities-classic