Commit Graph
31 Commits
Author SHA1 Message Date
coolguyandClaude Opus 4.7 4014e49168 Profile GPU forward to evaluate batched traversal inference
Measured DeepCFRMLP forward at bs={1,4,16,64,256,1024} on RTX 3090.
Per-state cost drops 232× from bs=1 (80 µs) to bs=256 (0.34 µs) while
per-call latency stays near 90 µs through bs=256. Policy-call supply
from a real run is ~368 states per traversal and ~200k per iteration,
well above the bs=64–256 plateau, so batched inference is not
supply-limited. GPU forward is not the limiter once batching exists.

Verdict: Optimization Priorities #5 (batched traversal inference) is
worth pursuing. End-to-end gain will still be bounded by encoding and
worker-GPU coordination overhead.

- scripts/profile_gpu_forward.py: standalone profiling script
- docs/performance.md: new "GPU forward profiling for batched traversal"
  experiment section with table, supply estimate, and verdict

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 18:35:28 +09:00
coolguyandClaude Opus 4.7 83460fe6e0 Cross-reference torch.compile experiment to batched-traversal priority
Make the link from the failed torch.compile experiment to Optimization
Priorities #5 explicit, so a future revisit happens at the right time
(once compile is on the dominant phase, not just trainer optimization
steps).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 18:21:14 +09:00
coolguyandClaude Opus 4.7 079d9d916a Document torch.compile experiment result (regression)
Wrapping trainer networks with torch.compile produced a 4.8% regression
in iteration time on default.yaml (17.93s → 18.79s). Two causes: (1)
the dominant phase is CPU traversal which bypasses the compiled
wrapper, (2) DeepCFRMLP is too small for compile dispatch overhead to
pay back. Implementation kept on experiments/torch-compile for future
revisits when the trainer model or inference path changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 18:17:46 +09:00
coolguy 1de8e8e2b3 Document Deep CFR performance profile 2026-05-07 17:57:46 +09:00
coolguy 2c96c5ee82 Archive docs markdown files 2026-05-07 15:39:24 +09:00
coolguyandClaude Haiku 4.5 6b8c36ebb2 docs: opponent_policy 비교에 동일 조건 self_play_league run 추가
같은 hyperparameter (512x3, 2x updates, argmax_tiebreak)에 opponent_policy
만 self_play_league로 다른 run과의 iteration별 비교 표 추가. iter 350
시점에서 Random WR 38%p 격차 (network 34% vs league 72%) 확인 — 발산
가설을 실증.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-07 13:56:43 +09:00
coolguyandClaude Haiku 4.5 d0316293e4 Document opponent_policy=network divergence finding
opponent_policy=network 설정으로 1000-iter 실험 두 개 (512x3, 1024x4)를
돌린 결과 두 실험 모두 policy collapse가 발생함을 확인. 큰 capacity는
plateau를 늘리지만 발산 자체를 막지 못함. 향후 학습은 self_play_league
기본값을 유지할 것을 권고.

- 실험에 사용한 config 두 개 추가
- 발견 분석 문서 추가 (원인, 비교, 권고)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-07 13:47:36 +09:00
coolguy 080bff517e Deep CFR regret fallback audit metrics 추가 2026-05-07 05:23:23 +09:00
coolguy 148be6e9a0 Deep CFR evaluation 배칭 및 병렬화 추가 2026-05-07 03:42:00 +09:00
coolguy 54347e1e7f Deep CFR evaluation 프로파일링 메트릭 추가 2026-05-07 03:10:19 +09:00
coolguy 9acf9ed261 Deep CFR advantage memory를 player별로 분리 2026-05-07 02:59:03 +09:00
coolguy e411ea4a15 Deep CFR 프로파일링 메트릭 추가 2026-05-07 02:50:35 +09:00
coolguy ece82fc310 Deep CFR traversal을 Cython 엔진으로 교체 2026-05-07 02:25:33 +09:00
coolguy a76e8fd716 Deep CFR 성능 traversal gap 문서화 2026-05-07 02:12:14 +09:00
coolguy cd3f7cea3b Add test coverage notes 2026-05-07 02:11:16 +09:00
coolguy d29b3d60bb Deep CFR 재현 config 이름 정리 2026-05-07 01:15:34 +09:00
coolguy 898f927cb2 Deep CFR legacy 실험 재현 계획 문서화 2026-05-07 00:41:19 +09:00
coolguy f593a6d910 Deep CFR YAML config 추가 2026-05-07 00:30:42 +09:00
coolguy d86e534ba9 Deep CFR status 문서 갱신 2026-05-07 00:14:51 +09:00
coolguy 573b59545f Deep CFR legacy gap 문서 정리 2026-05-07 00:02:25 +09:00
coolguy 5a9166bf5a Deep CFR gap 문서 최신화 2026-05-06 23:37:43 +09:00
coolguy 966cfa3a13 Deep CFR v0 legacy gap 문서 추가 2026-05-06 23:18:24 +09:00
coolguy ce6c9685da Deep CFR v0 계획 문서 추가 2026-05-06 23:10:46 +09:00
coolguy 91b8846894 정책 인터페이스로 네이밍 정리 2026-05-06 22:52:04 +09:00
coolguy 2629fbdd99 고속 엔진 undo stack 추가 2026-05-06 22:02:04 +09:00
coolguy a349cf34ed 고속 엔진 안전성 보강 2026-05-06 21:56:59 +09:00
coolguy 407d592f5e 미구현 레퍼런스 자리 제거 2026-05-06 20:42:26 +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 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 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