6.8 KiB
Deep CFR Legacy Experiment Reproduction Plan
This document tracks what is needed to reproduce the legacy ../coolrl
experiment below with the same intended semantics in this repository:
experiments/lost_cities/deep_cfr_pure_self_play_zero_pit_poc_full_depth_slot_aware_playability
The goal is not to run a similar Deep CFR configuration. The goal is to map the legacy experiment's hyperparameters and feature semantics into this repository's own config schema so that the training run means the same thing.
Exact legacy YAML compatibility is not required. It is acceptable to create a new config file under this repository as long as every relevant legacy hyperparameter is represented explicitly and the differences are documented.
Source Experiment
Legacy config path:
/home/coolguy/dev/coolrl/experiments/lost_cities/deep_cfr_pure_self_play_zero_pit_poc_full_depth_slot_aware_playability/config.yaml
Important legacy settings:
seed: 79max_hours: 4max_iterations: nulldevice: CUDAuse_amp: falserules.tier: tier3encoding.derived_playability: trueencoding.slot_aware_playability: truenetwork.hidden_size: 256network.num_layers: 3network.activation: relutraversal.traversals_per_player: 70traversal.max_depth: nulltraversal.max_nodes_per_traversal: 1000traversal.opponent_policy: self_play_leaguetraversal.outcome_sampling_epsilon: 0.2traversal.outcome_sampling_value_clip: 500traversal.outcome_unsampled_regret: zerooptimization.advantage_batch_size: 1024optimization.strategy_batch_size: 1024optimization.advantage_updates_per_iteration: 256optimization.strategy_updates_per_iteration: 256optimization.learning_rate: 3.0e-5optimization.weight_decay: 1.0e-4optimization.grad_clip: 1.0
Required Reproduction Work
Config
Represent the legacy hyperparameters in this repository's config schema:
- Top-level:
experiment_nameseedmax_iterationsmax_hoursdeviceuse_amp
rules:tier- optional direct
LostCitiesConfigfield overrides
encoding:derived_playabilityslot_aware_playability
network:hidden_sizenum_layersactivation
traversalsemantics:- per-player traversal count
- max nodes per traversal
- traversal worker chunk size
- self-play league settings
optimizationsemantics:- separate advantage and strategy batch sizes
- separate advantage and strategy update counts
weight_decaygrad_clip
evaluation.on_max_stepscheckpoint:save_iteration_intervalsave_latest_onlyprogress_interval_seconds
Encoding
Port the legacy feature semantics:
- Base information-state encoding must remain deterministic.
- Add
derived_playabilitycolor-level features. - Add
slot_aware_playabilityhand-slot action-local features. - Preserve feature order and dimensions from legacy where possible.
- Add tests for input dimension and known-state feature values.
The slot-aware block is the core of the source experiment. Without this block, the reproduction is not meaningful.
Network
Make the MLP configurable:
hidden_sizenum_layersactivation
The legacy experiment uses a 3-layer ReLU MLP with hidden size 256.
Optimization
Match the legacy training knobs:
- Separate advantage and strategy batch sizes.
- Separate advantage and strategy update counts per iteration.
- Adam
weight_decay. - Gradient clipping.
Traversal
Match legacy traversal semantics and metrics:
- Per-player traversal count behavior.
- Full-depth traversal when
max_depth: null. - Max nodes per traversal.
- Self-play league behavior.
- Endpoint depth accounting:
- endpoint depth sum
- endpoint depth buckets
- depth bucket width
- depth bucket max
- Optional worker progress logging.
- Optional hotspot profiling.
Run Loop And Checkpointing
Match legacy runtime behavior:
- Stop by
max_hours. - Stop by
max_iterationswhen set. - Allow
max_iterations: null. - Save every N iterations through
save_iteration_interval. - Support
save_latest_only. - Preserve useful config artifacts in the run directory.
- Keep
metrics.jsonl,runtime_progress.json, andtrain.loguseful for comparing this run against the legacy report. Exact artifact layout compatibility is optional.
Evaluation And Metrics
Match the legacy evaluation configuration:
evaluation.on_max_steps.- Opponent list:
randompassive_discardsafe_heuristicsafe_heuristic_loosesafe_heuristic_strictnoisy_safe
- Metric suffixes used by the legacy analysis scripts, including opening quality, opened-color distribution, discard take rates, expedition quality, policy entropy, and timeout counts.
- Preserve comparable semantics for the legacy experiment's decision criteria.
- Exact metric key/schema compatibility is optional unless legacy
analyze.pyis reused directly. - Confirm whether the current classic evaluator emits every required core metric.
- Add a small adapter or mapping table if this repository keeps different metric names.
Analysis Compatibility
The legacy analyze.py expects specific run artifacts and metric keys. Direct
reuse is optional. The required goal is that the generated run data can be
compared against the legacy report through documented metric semantics:
- Core metric meanings are documented.
- Latest iteration and latest eval iteration can be inferred.
- Endpoint-depth metrics are present or explicitly marked as omitted.
- Evaluation metric prefixes and suffixes are documented when they differ from legacy output.
- If we choose to reuse legacy
analyze.pydirectly, then add a compatibility adapter for keys and artifact layout.
Suggested Commit Breakdown
- Reproduction config schema and mapped experiment preset.
- Configurable network and optimizer knobs.
- Derived and slot-aware encoding.
- Run loop, checkpoint, and evaluation compatibility.
- Traversal endpoint metrics, progress, and profile compatibility.
- Metric semantics and optional analysis adapter pass.
Definition Of Done
The reproduction work is complete when:
- A mapped config exists in this repository for the legacy experiment.
- Every relevant legacy hyperparameter is either represented or explicitly marked as intentionally irrelevant.
- A smoke-sized version of the mapped config runs end to end.
- The full mapped config starts training with the same key semantics.
- The information-state input dimension matches the legacy slot-aware setup for tier3.
- The core training metrics and evaluation metrics are semantically comparable with the legacy experiment report.