3.6 KiB
3.6 KiB
Deep CFR v0 Status vs Legacy coolrl
This document tracks the Lost Cities Deep CFR functionality in this repository
against the legacy implementation in ../coolrl.
Implemented In This Repository
Traversal
Implemented:
- Recursive
traverse(state, traverser, iteration, depth)logic. - Terminal value handling.
- Traverser vs opponent node behavior.
- Advantage-network-driven policies during traversal.
- Regret matching over legal actions.
- Sampled action recursion with node-value calculation.
- Instantaneous regret collection at traverser nodes.
- Strategy-memory collection.
- Depth and node-budget cutoffs.
- Outcome-sampling epsilon.
- Sampled action probability correction.
- Optional sampled value clipping.
- Unsampled regret modes:
negative_node_valuezero
- Score-diff and rollout-based cutoff values.
- Random and safe-heuristic cutoff rollout policies.
- Deck-draw chance sampling with state restoration.
Training And Memory
Implemented:
- PyTorch advantage networks.
- PyTorch strategy network.
- Legal-mask-aware advantage loss.
- Masked strategy cross-entropy loss.
- Reservoir memory with capacity limits.
- Batch sampling.
- Legal masks stored with samples.
- Single-process traversal.
- Multiprocessing traversal worker batches.
- Worker result merge in the parent trainer process.
Encoding
Implemented information-state features:
- Phase flags.
- Current player.
- Encoded player.
- Deck ratio.
- Player hand slot features.
- Public expedition summaries for both players.
- Public discard summaries.
- Public card counts.
- Total score and score diff features.
- Turn ratio.
- Pending-discard one-hot.
- Legal action mask.
The encoding is still compact compared with the legacy feature set, but it now contains the key public board, discard, score, and legal-action information.
Runtime Operations
Implemented:
- Checkpoint save/load.
- Latest and per-iteration checkpoint files.
- Config stored in checkpoints and
config.json. - Strategy-net policy adapter.
- Evaluation against registered classic bots.
- Training CLI.
- Evaluation CLI.
- Traversal benchmark CLI.
- Local run files:
config.jsonmetrics.jsonlruntime_progress.jsontrain.log
- Traversal benchmark metrics.
- Self-play league snapshots.
- Self-play league opponent selection from stored snapshots.
- Safe-heuristic anchor opponent path.
- Weighted current/recent/older/anchor self-play league buckets.
- Safe-heuristic imitation pretraining.
- Policy-gradient fine-tuning.
- Single-vs-multiprocessing benchmark comparison.
Remaining Differences From Legacy coolrl
The main Deep CFR v0 gaps listed earlier are now implemented. Remaining differences are mostly experiment-system maturity and legacy-specific research extras.
Still smaller than legacy:
- Config is YAML-first and nested through Pydantic, but only one smoke preset
exists under
configs/deep_cfr/. - Multiprocessing exists, but it is intentionally simple:
- no progress callback per worker batch
- no hotspot timing profile
- Metrics logging exists, but no plotting/status command exists yet.
- Checkpoint artifacts are local only; W&B artifact integration is not added.
- Legacy visualization helpers are not ported.
These remaining items are not blockers for running and iterating on Deep CFR v0.
Suggested Next Steps
- Add W&B/JSONL tracker abstraction on top of the existing local run files.
- Add a status/plot command that reads
metrics.jsonl. - Add worker progress logging and hotspot timing profile.
- Add W&B checkpoint artifacts after checkpoint quality is stable.