Commit Graph
13 Commits
Author SHA1 Message Date
coolguy 9e27f42f27 Add JAX PPO static-opponent trainer 2026-07-04 22:30:16 +09:00
coolguy b37b841eef Record CUDA JAX throughput 2026-07-04 21:56:24 +09:00
coolguy 72893250ec Record full JAX differential verification 2026-07-04 20:39:01 +09:00
coolguy f872204b13 Document JAX engine and benchmark 2026-07-04 19:38:09 +09:00
coolguyandClaude Opus 4.7 004b913a7b Rename bot family, curate analyze plots, tier evaluation cadence
Three coordinated hygiene changes; none target the diagnosed
selection-bias bottleneck. They make the codebase honestly reflect the
pure-self-play stance and reduce dashboard noise.

Bot rename (drop the unhelpful safe_ prefix; suffixes describe behaviour):
- safe_heuristic_loose -> heuristic_aggressive
- safe_heuristic       -> heuristic_balanced
- safe_heuristic_strict -> heuristic_cautious
- noisy_safe           -> heuristic_noisy
- passive_discard      -> discard_only

Class renames in bots/: SafeHeuristicBot -> HeuristicBot,
SafeHeuristicParams -> HeuristicParams, PassiveDiscardBot -> DiscardOnlyBot,
plus loose/strict parameter constants. Backwards compatibility was dropped
intentionally per user instruction; no aliases. Active configs, docs,
scripts, tests updated. Archive directories (configs/archive,
docs/archive, runs/archive) left intact and may still reference old
names per their read-only policy. The src/.../bots/passive.py module was
renamed to discard_only.py via git mv.

Analyze plot curation (deep_cfr/analyze.py):
- Added analysis_00_core.png as the canonical daily dashboard with 10
  heuristic-free metrics (loss/{advantage,strategy}; vs heuristic_cautious:
  avg_score_diff0, win_rate0, avg_opened_colors, positive_expedition_rate,
  bonus_expedition_rate, score_per_opened_color, policy_entropy; vs random:
  win_rate0).
- Removed analysis_05_open_quality.png (bad/weak/good open rates,
  recoverable score) and analysis_07_calibration.png (calibration gap,
  recoverable mean) - both relied on the heuristic recoverable_score
  classifier already dropped from inputs.
- Removed SELECTIVITY_PLOTS and plot_selectivity (heuristic-laden).
- SUMMARY_EVAL_METRICS no longer includes bad_open_rate or
  calibration_gap.
- PlotSpec gained an opponents allowlist so the new core section can pin
  a specific opponent per panel without restructuring plot_section.

Tiered evaluation cadence (EvaluationConfig):
- Added extended_opponents and extended_eval_every (default 0 = disabled).
- opponents_for_iteration(iteration) returns the core list every
  eval_every and appends extended_opponents (de-duplicated) when
  iteration is also a multiple of extended_eval_every.
- default.yaml now uses 3 core opponents (random, discard_only,
  heuristic_cautious) every 5 iterations and 3 extended opponents
  (heuristic_balanced, heuristic_aggressive, heuristic_noisy) every 50
  iterations. random is the floor sanity. discard_only is the
  zero-pit detector / absolute-score reference (its score is always 0,
  so eval/discard_only/avg_score_diff0 directly equals the model's raw
  average score). heuristic_cautious is the ceiling and the
  archive-comparable benchmark used in the prior diagnostic sections.

Net eval cost reduction: roughly 50% (3 opponents x every 5 iter, plus
6 opponents x every 50 iter, vs the prior 6 x every 5).

Documented in docs/plans/deep-cfr-selectivity.md section 9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 15:32:55 +09:00
coolguyandClaude Opus 4.7 b9bbb4fcf7 Bootstrap librarian Stage 1 with lychee link checker
Captures the full librarian design (two-layer architecture, three-stage
pipeline, vendor-agnostic via LIBRARIAN_LLM env, propose-only / no
auto-apply) in docs/plans/librarian.md. Lands the first concrete Stage 1
piece: scripts/librarian_check_links.py, a lychee --offline wrapper
ported from ~/dev/coolrl/src/coolrl/dev/check_doc_links.py.

Also moves the librarian prompt from .claude/agents/ (Claude Code only)
to scripts/librarian-prompt.md so any CLI can load it as a system
prompt later. Fixes one stale README link the new checker caught:
docs/classic-port-notes.md → docs/archive/classic-port-notes.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 23:15:06 +09:00
coolguy 1e5c5509e1 백엔드 제거하고 평가 기반 정리 2026-05-06 20:39:21 +09:00
coolguy b578b38628 Rust 지원 제거
맥락: 클래식 포트를 Python/Cython 구현과 pygame GUI 중심으로 정리한다.

변경: Rust 크레이트, proto 계약, Rust backend shim, 패리티 테스트를 삭제하고 문서와 backend factory를 Python 전용으로 갱신했다.

확인: uv run pre-commit run --all-files; uv run pytest tests/games/classic; uv run lost-cities-classic-gui --help
2026-05-06 20:11:43 +09:00
coolguy a6de79d444 클래식 pygame GUI 이식
맥락:
- classic 게임을 사람이 플레이할 수 있도록 레거시 pygame GUI를 가져온다.
- 현재 GUI는 Python backend와 registry bot만 지원하고 Rust backend와 학습 checkpoint 로딩은 제외한다.

변경:
- pygame_pvp.py를 classic 패키지에 이식하고 tier, backend 선택, Deep CFR checkpoint 옵션을 제거했다.
- lost-cities-classic-gui 엔트리포인트와 README 실행 안내를 추가했다.
- GUI argparse smoke 테스트를 추가했다.

확인:
- uv run pre-commit run --all-files
- uv run pytest tests/games/classic
- uv run lost-cities-classic-gui --help
- SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy uv run python - <<'PY'
from coolrl_lost_cities.games.classic.pygame_pvp import LostCitiesGuiApp
app = LostCitiesGuiApp(mode='pvc', bot_name='random', seed=1, width=1024, height=768)
app.draw()
app.pygame.quit()
print('gui init ok')
PY
2026-05-06 20:08:05 +09:00
coolguy b43bb5917f Rust 크레이트를 루트로 이동
맥락:
- GUI 이식 전에 Rust crate와 proto schema 위치를 Python package 내부에서 분리한다.
- Cargo 작업, IDE 인식, 빌드 산출물 관리를 루트 구조에 맞춘다.

변경:
- rust_core를 rust/lost-cities-core로 이동하고 proto/lost_cities.proto를 루트 proto 디렉터리로 옮겼다.
- Rust build.rs, Python Rust backend, Rust parity 테스트의 경로를 새 위치로 수정했다.
- Python package-data에서 Rust crate와 proto 항목을 제거하고 README/port notes를 갱신했다.

확인:
- uv sync --extra gui --reinstall-package coolrl-lost-cities
- uv run pytest tests/games/classic
- uv run lost-cities-classic
2026-05-06 19:50:32 +09:00
coolguy 73fe7e2c94 GUI 선택 의존성 준비
맥락:
- pygame GUI 이식 전에 core 설치와 GUI 의존성을 분리하고 asset 로딩 경로를 고정한다.

변경:
- pyproject에 gui extra로 pygame과 pygame-gui를 추가했다.
- classic resource helper를 추가해 packaged asset 경로를 importlib.resources 기반으로 읽게 했다.
- theme asset resource 테스트와 README 설치 안내를 추가했다.

확인:
- uv sync --extra gui
- uv run pytest tests/games/classic
- uv run lost-cities-classic
2026-05-06 19:32:07 +09:00
coolguy 361420df7a 클래식 공개 API 정리
맥락:
- 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
2026-05-06 19:21:17 +09:00
coolguy 7df6e42904 로스트 시티 클래식 코어 이식
맥락:
- 새 레포의 첫 범위를 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
2026-05-06 19:07:46 +09:00