manabot 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- manabot-0.2.0/PKG-INFO +280 -0
- manabot-0.2.0/README.md +235 -0
- manabot-0.2.0/academy/README.md +213 -0
- manabot-0.2.0/academy/__init__.py +14 -0
- manabot-0.2.0/academy/advice.py +1713 -0
- manabot-0.2.0/academy/advice_identity.py +123 -0
- manabot-0.2.0/academy/attempts.py +571 -0
- manabot-0.2.0/academy/authored_match_parity.py +831 -0
- manabot-0.2.0/academy/authored_match_receipt.py +439 -0
- manabot-0.2.0/academy/bot_decision.py +30 -0
- manabot-0.2.0/academy/curated_pack.py +413 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-explicit-w10.json +1964 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-explicit-w11.json +1964 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-explicit-w9.json +1964 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-w10.json +4483 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-w11.json +4483 -0
- manabot-0.2.0/academy/fixtures/choice-navigation-w9.json +4483 -0
- manabot-0.2.0/academy/fixtures/choice-navigation.json +5058 -0
- manabot-0.2.0/academy/fixtures/learn-demo-explicit-w10.json +434 -0
- manabot-0.2.0/academy/fixtures/learn-demo-explicit-w11.json +434 -0
- manabot-0.2.0/academy/fixtures/learn-demo-explicit-w9.json +433 -0
- manabot-0.2.0/academy/fixtures/learn-demo-w10.json +213 -0
- manabot-0.2.0/academy/fixtures/learn-demo-w11.json +213 -0
- manabot-0.2.0/academy/fixtures/learn-demo-w7.json +213 -0
- manabot-0.2.0/academy/fixtures/learn-demo-w8.json +213 -0
- manabot-0.2.0/academy/fixtures/learn-demo-w9.json +213 -0
- manabot-0.2.0/academy/fixtures/learn-demo.json +213 -0
- manabot-0.2.0/academy/fixtures/precision-demo-w10.json +979 -0
- manabot-0.2.0/academy/fixtures/precision-demo-w11.json +979 -0
- manabot-0.2.0/academy/fixtures/precision-demo-w9.json +979 -0
- manabot-0.2.0/academy/fixtures/precision-mana-demo-w10.json +1064 -0
- manabot-0.2.0/academy/fixtures/precision-mana-demo-w11.json +1064 -0
- manabot-0.2.0/academy/fixtures/precision-mana-demo-w9.json +1064 -0
- manabot-0.2.0/academy/learn_lesson_evidence.py +232 -0
- manabot-0.2.0/academy/live_advice.py +197 -0
- manabot-0.2.0/academy/local_advice.py +74 -0
- manabot-0.2.0/academy/opponent.py +283 -0
- manabot-0.2.0/academy/play_demo.py +77 -0
- manabot-0.2.0/academy/presentation.py +350 -0
- manabot-0.2.0/academy/public_commitment_parity.py +679 -0
- manabot-0.2.0/academy/replay_index.py +783 -0
- manabot-0.2.0/academy/semantic_boundary.py +40 -0
- manabot-0.2.0/academy/server.py +3637 -0
- manabot-0.2.0/academy/shared_table_protocol.py +378 -0
- manabot-0.2.0/academy/study_branch.py +333 -0
- manabot-0.2.0/academy/study_evidence.py +247 -0
- manabot-0.2.0/academy/study_index.py +674 -0
- manabot-0.2.0/academy/study_protocol.py +481 -0
- manabot-0.2.0/academy/study_runtime.py +190 -0
- manabot-0.2.0/academy/trace.py +283 -0
- manabot-0.2.0/academy/ui/src/lib/packs/elemental-world/v1/manifest.json +2467 -0
- manabot-0.2.0/academy/ui/src/lib/packs/elemental-world/v2/manifest.json +2467 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-gw-allies-jeong-vs-ur-lessons/v1/manifest.json +761 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-gw-allies-jeong-vs-ur-lessons/v2/manifest.json +765 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-ur-lessons-vs-gw-allies/v1/NOTICE.md +16 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-ur-lessons-vs-gw-allies/v1/manifest.json +244 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-ur-lessons-vs-gw-allies/v2/NOTICE.md +16 -0
- manabot-0.2.0/academy/ui/src/lib/packs/tla-ur-lessons-vs-gw-allies/v2/manifest.json +248 -0
- manabot-0.2.0/academy/villain.py +209 -0
- manabot-0.2.0/academy/watch.py +306 -0
- manabot-0.2.0/content/semantic/v1/complexity.learning_schema.json +304 -0
- manabot-0.2.0/content/semantic/v1/complexity.source.json +1764 -0
- manabot-0.2.0/content/semantic/v1/coverage.evidence.json +488 -0
- manabot-0.2.0/content/semantic/v1/elemental.fixtures.json +65 -0
- manabot-0.2.0/content/semantic/v1/elemental.source.json +2668 -0
- manabot-0.2.0/content/semantic/v1/elemental_world.fixtures.json +958 -0
- manabot-0.2.0/content/semantic/v1/elemental_world.source.json +6136 -0
- manabot-0.2.0/content/semantic/v1/generated/complexity.coverage.json +461 -0
- manabot-0.2.0/content/semantic/v1/generated/complexity.ir.json +2144 -0
- manabot-0.2.0/content/semantic/v1/generated/coverage-gaps.json +1841 -0
- manabot-0.2.0/content/semantic/v1/generated/elemental.coverage.json +664 -0
- manabot-0.2.0/content/semantic/v1/generated/elemental.ir.json +3240 -0
- manabot-0.2.0/content/semantic/v1/generated/elemental_world.coverage.json +1307 -0
- manabot-0.2.0/content/semantic/v1/generated/elemental_world.ir.json +7333 -0
- manabot-0.2.0/content/semantic/v1/generated/jeong_increment.coverage.json +425 -0
- manabot-0.2.0/content/semantic/v1/generated/jeong_increment.ir.json +1951 -0
- manabot-0.2.0/content/semantic/v1/generated/sacrifice.coverage.json +346 -0
- manabot-0.2.0/content/semantic/v1/generated/sacrifice.ir.json +1730 -0
- manabot-0.2.0/content/semantic/v1/generated/temur.coverage.json +149 -0
- manabot-0.2.0/content/semantic/v1/generated/temur.ir.json +810 -0
- manabot-0.2.0/content/semantic/v1/generated/two_deck.coverage.json +414 -0
- manabot-0.2.0/content/semantic/v1/generated/two_deck.ir.json +1914 -0
- manabot-0.2.0/content/semantic/v1/jeong_increment.fixtures.json +12 -0
- manabot-0.2.0/content/semantic/v1/jeong_increment.source.json +1581 -0
- manabot-0.2.0/content/semantic/v1/learning_schema.json +303 -0
- manabot-0.2.0/content/semantic/v1/sacrifice.fixtures.json +53 -0
- manabot-0.2.0/content/semantic/v1/sacrifice.source.json +1416 -0
- manabot-0.2.0/content/semantic/v1/temur.fixtures.json +130 -0
- manabot-0.2.0/content/semantic/v1/temur.source.json +658 -0
- manabot-0.2.0/content/semantic/v1/two_deck.fixtures.json +30 -0
- manabot-0.2.0/content/semantic/v1/two_deck.source.json +557 -0
- manabot-0.2.0/content/semantic/w10/learning_schema.json +437 -0
- manabot-0.2.0/content/semantic/w11/elemental_world.fixtures.json +959 -0
- manabot-0.2.0/content/semantic/w11/elemental_world.source.json +6144 -0
- manabot-0.2.0/content/semantic/w11/generated/elemental_world.coverage.json +1308 -0
- manabot-0.2.0/content/semantic/w11/generated/elemental_world.ir.json +7342 -0
- manabot-0.2.0/content/semantic/w11/learning_schema.json +441 -0
- manabot-0.2.0/content/semantic/w7/learning_schema.json +402 -0
- manabot-0.2.0/content/semantic/w8/learning_schema.json +426 -0
- manabot-0.2.0/content/semantic/w9/learning_schema.json +433 -0
- manabot-0.2.0/docs/experiment-metrics.md +361 -0
- manabot-0.2.0/manabot/README.md +339 -0
- manabot-0.2.0/manabot/RESEARCH.md +348 -0
- manabot-0.2.0/manabot/__init__.py +0 -0
- manabot-0.2.0/manabot/arena/__init__.py +6 -0
- manabot-0.2.0/manabot/arena/competency.py +129 -0
- manabot-0.2.0/manabot/arena/evaluate.py +447 -0
- manabot-0.2.0/manabot/arena/guidance.py +137 -0
- manabot-0.2.0/manabot/arena/heuristic.py +648 -0
- manabot-0.2.0/manabot/arena/match.py +536 -0
- manabot-0.2.0/manabot/arena/matchup.py +39 -0
- manabot-0.2.0/manabot/arena/models.py +685 -0
- manabot-0.2.0/manabot/arena/players.py +131 -0
- manabot-0.2.0/manabot/arena/profile.py +463 -0
- manabot-0.2.0/manabot/arena/rating.py +277 -0
- manabot-0.2.0/manabot/arena/replay.py +230 -0
- manabot-0.2.0/manabot/belief/__init__.py +63 -0
- manabot-0.2.0/manabot/belief/agent.py +216 -0
- manabot-0.2.0/manabot/belief/audit.py +434 -0
- manabot-0.2.0/manabot/belief/demo.py +215 -0
- manabot-0.2.0/manabot/belief/encoding.py +379 -0
- manabot-0.2.0/manabot/belief/learning.py +885 -0
- manabot-0.2.0/manabot/belief/learning_demo.py +374 -0
- manabot-0.2.0/manabot/belief/likelihood.py +245 -0
- manabot-0.2.0/manabot/belief/player.py +294 -0
- manabot-0.2.0/manabot/belief/range.py +405 -0
- manabot-0.2.0/manabot/belief/runtime.py +189 -0
- manabot-0.2.0/manabot/belief/sampling.py +283 -0
- manabot-0.2.0/manabot/belief/sampling_cohort.py +501 -0
- manabot-0.2.0/manabot/belief/sampling_data.py +396 -0
- manabot-0.2.0/manabot/belief/sampling_fit.py +547 -0
- manabot-0.2.0/manabot/belief/sampling_report.py +330 -0
- manabot-0.2.0/manabot/belief/state.py +336 -0
- manabot-0.2.0/manabot/belief/tracker.py +372 -0
- manabot-0.2.0/manabot/cli.py +313 -0
- manabot-0.2.0/manabot/conf/model/attention.yaml +29 -0
- manabot-0.2.0/manabot/conf/model/local.yaml +29 -0
- manabot-0.2.0/manabot/conf/model/simple.yaml +29 -0
- manabot-0.2.0/manabot/conf/sim/sim.yaml +19 -0
- manabot-0.2.0/manabot/config/__init__.py +1 -0
- manabot-0.2.0/manabot/config/load.py +127 -0
- manabot-0.2.0/manabot/config/presets.py +80 -0
- manabot-0.2.0/manabot/data.py +330 -0
- manabot-0.2.0/manabot/env/__init__.py +23 -0
- manabot-0.2.0/manabot/env/env.py +233 -0
- manabot-0.2.0/manabot/env/match.py +227 -0
- manabot-0.2.0/manabot/env/observation.py +579 -0
- manabot-0.2.0/manabot/env/single_agent_env.py +174 -0
- manabot-0.2.0/manabot/env/target_practice.py +128 -0
- manabot-0.2.0/manabot/env/vector_env.py +350 -0
- manabot-0.2.0/manabot/infra/__init__.py +26 -0
- manabot-0.2.0/manabot/infra/artifacts.py +159 -0
- manabot-0.2.0/manabot/infra/experiment.py +158 -0
- manabot-0.2.0/manabot/infra/hypers.py +282 -0
- manabot-0.2.0/manabot/infra/log.py +29 -0
- manabot-0.2.0/manabot/infra/profiler.py +276 -0
- manabot-0.2.0/manabot/managym/__init__.py +7 -0
- manabot-0.2.0/manabot/managym/__init__.pyi +446 -0
- manabot-0.2.0/manabot/managym/decision.py +274 -0
- manabot-0.2.0/manabot/managym/enums.py +103 -0
- manabot-0.2.0/manabot/managym/experience.py +605 -0
- manabot-0.2.0/manabot/managym/experience_projection.py +445 -0
- manabot-0.2.0/manabot/managym/possible_worlds.py +580 -0
- manabot-0.2.0/manabot/model/__init__.py +8 -0
- manabot-0.2.0/manabot/model/agent.md +193 -0
- manabot-0.2.0/manabot/model/agent.py +754 -0
- manabot-0.2.0/manabot/model/architecture.py +100 -0
- manabot-0.2.0/manabot/model/catalog.py +380 -0
- manabot-0.2.0/manabot/model/compound.py +171 -0
- manabot-0.2.0/manabot/model/inference.py +146 -0
- manabot-0.2.0/manabot/model/policy_distribution.py +184 -0
- manabot-0.2.0/manabot/model/recent_events.py +99 -0
- manabot-0.2.0/manabot/model/semantic_cards.py +171 -0
- manabot-0.2.0/manabot/model/train.py +924 -0
- manabot-0.2.0/manabot/model/training.md +282 -0
- manabot-0.2.0/manabot/model/training_monitoring.md +5 -0
- manabot-0.2.0/manabot/model/world.py +164 -0
- manabot-0.2.0/manabot/remote/__init__.py +1 -0
- manabot-0.2.0/manabot/remote/_legacy.py +122 -0
- manabot-0.2.0/manabot/remote/bundle.py +179 -0
- manabot-0.2.0/manabot/remote/cli.py +336 -0
- manabot-0.2.0/manabot/remote/cohort.py +529 -0
- manabot-0.2.0/manabot/remote/cohort_cli.py +170 -0
- manabot-0.2.0/manabot/remote/cohort_projection.py +382 -0
- manabot-0.2.0/manabot/remote/cohort_service.py +352 -0
- manabot-0.2.0/manabot/remote/continuation.py +101 -0
- manabot-0.2.0/manabot/remote/deploy.py +511 -0
- manabot-0.2.0/manabot/remote/guardian.sh +13 -0
- manabot-0.2.0/manabot/remote/job_client.py +598 -0
- manabot-0.2.0/manabot/remote/job_store.py +317 -0
- manabot-0.2.0/manabot/remote/jobs.py +220 -0
- manabot-0.2.0/manabot/remote/live_evaluation.py +394 -0
- manabot-0.2.0/manabot/remote/plan.py +286 -0
- manabot-0.2.0/manabot/remote/progress.py +99 -0
- manabot-0.2.0/manabot/remote/provider.py +134 -0
- manabot-0.2.0/manabot/remote/snapshots.py +186 -0
- manabot-0.2.0/manabot/remote/supervisor.py +448 -0
- manabot-0.2.0/manabot/remote/transport.py +217 -0
- manabot-0.2.0/manabot/remote/validation.py +203 -0
- manabot-0.2.0/manabot/semantic/__init__.py +51 -0
- manabot-0.2.0/manabot/semantic/compiler.py +1157 -0
- manabot-0.2.0/manabot/semantic/coverage.py +850 -0
- manabot-0.2.0/manabot/semantic/decision_contract.py +86 -0
- manabot-0.2.0/manabot/semantic/learning.py +1300 -0
- manabot-0.2.0/manabot/semantic/policy.py +565 -0
- manabot-0.2.0/manabot/semantic/policy_catalog.py +103 -0
- manabot-0.2.0/manabot/semantic/structural.py +520 -0
- manabot-0.2.0/manabot/semantic/structural_katas.py +1336 -0
- manabot-0.2.0/manabot/semantic/transfer.py +1109 -0
- manabot-0.2.0/manabot/sim/__init__.py +0 -0
- manabot-0.2.0/manabot/sim/compound.py +124 -0
- manabot-0.2.0/manabot/sim/conditional_search.py +1378 -0
- manabot-0.2.0/manabot/sim/distill.py +749 -0
- manabot-0.2.0/manabot/sim/flat_mc.py +749 -0
- manabot-0.2.0/manabot/sim/flat_search.py +71 -0
- manabot-0.2.0/manabot/sim/local_compound.py +435 -0
- manabot-0.2.0/manabot/sim/local_sampling.py +197 -0
- manabot-0.2.0/manabot/sim/local_update.py +1048 -0
- manabot-0.2.0/manabot/sim/mcts.py +750 -0
- manabot-0.2.0/manabot/sim/net_opponent.py +991 -0
- manabot-0.2.0/manabot/sim/player.py +253 -0
- manabot-0.2.0/manabot/sim/pooled_datagen.py +328 -0
- manabot-0.2.0/manabot/sim/producers.py +206 -0
- manabot-0.2.0/manabot/sim/rollout.py +365 -0
- manabot-0.2.0/manabot/sim/search_branch.py +249 -0
- manabot-0.2.0/manabot/sim/search_runtime.py +414 -0
- manabot-0.2.0/manabot/sim/search_supervised.py +597 -0
- manabot-0.2.0/manabot/sim/selected_branchdriver_teacher.py +655 -0
- manabot-0.2.0/manabot/sim/sim.py +764 -0
- manabot-0.2.0/manabot/sim/structured_benchmark.py +757 -0
- manabot-0.2.0/manabot/sim/structured_policy.py +282 -0
- manabot-0.2.0/manabot/sim/teacher1_evidence.py +705 -0
- manabot-0.2.0/manabot/sim/value.py +704 -0
- manabot-0.2.0/manabot/study/README.md +108 -0
- manabot-0.2.0/manabot/study/__init__.py +57 -0
- manabot-0.2.0/manabot/study/allies_lessons/__init__.py +13 -0
- manabot-0.2.0/manabot/study/allies_lessons/__main__.py +100 -0
- manabot-0.2.0/manabot/study/allies_lessons/balance.py +321 -0
- manabot-0.2.0/manabot/study/allies_lessons/config.py +84 -0
- manabot-0.2.0/manabot/study/allies_lessons/matchup.py +117 -0
- manabot-0.2.0/manabot/study/allies_lessons/play-study.ipynb +144 -0
- manabot-0.2.0/manabot/study/allies_lessons/report.py +301 -0
- manabot-0.2.0/manabot/study/allies_lessons/targeting_audit.py +90 -0
- manabot-0.2.0/manabot/study/frames.py +122 -0
- manabot-0.2.0/manabot/study/measures.py +258 -0
- manabot-0.2.0/manabot/study/record.py +364 -0
- manabot-0.2.0/manabot/study/report.py +196 -0
- manabot-0.2.0/manabot/study/targeting.py +92 -0
- manabot-0.2.0/manabot/training/__init__.py +5 -0
- manabot-0.2.0/manabot/training/admission.py +189 -0
- manabot-0.2.0/manabot/training/analysis.py +486 -0
- manabot-0.2.0/manabot/training/artifacts.py +157 -0
- manabot-0.2.0/manabot/training/ataraxos.py +399 -0
- manabot-0.2.0/manabot/training/attack_execution.py +316 -0
- manabot-0.2.0/manabot/training/attacks.py +103 -0
- manabot-0.2.0/manabot/training/baseline.py +169 -0
- manabot-0.2.0/manabot/training/builders.py +266 -0
- manabot-0.2.0/manabot/training/checkpoint_queue.py +537 -0
- manabot-0.2.0/manabot/training/clock.py +88 -0
- manabot-0.2.0/manabot/training/comparison_notebook.py +117 -0
- manabot-0.2.0/manabot/training/compound.py +372 -0
- manabot-0.2.0/manabot/training/etude_evaluation.py +220 -0
- manabot-0.2.0/manabot/training/etude_job.py +158 -0
- manabot-0.2.0/manabot/training/execution.py +1771 -0
- manabot-0.2.0/manabot/training/experiment_execution.py +255 -0
- manabot-0.2.0/manabot/training/experiment_report.py +968 -0
- manabot-0.2.0/manabot/training/experiment_runner.py +488 -0
- manabot-0.2.0/manabot/training/experiments.py +568 -0
- manabot-0.2.0/manabot/training/head_to_head.py +426 -0
- manabot-0.2.0/manabot/training/health.py +163 -0
- manabot-0.2.0/manabot/training/incidents.py +191 -0
- manabot-0.2.0/manabot/training/learning_dashboard.py +562 -0
- manabot-0.2.0/manabot/training/learning_state.py +265 -0
- manabot-0.2.0/manabot/training/local_service.py +243 -0
- manabot-0.2.0/manabot/training/matchups.py +52 -0
- manabot-0.2.0/manabot/training/models.py +1052 -0
- manabot-0.2.0/manabot/training/monitor_checkpoint.py +222 -0
- manabot-0.2.0/manabot/training/monitor_evaluation.py +578 -0
- manabot-0.2.0/manabot/training/monitoring.py +551 -0
- manabot-0.2.0/manabot/training/objectives.py +240 -0
- manabot-0.2.0/manabot/training/paired.py +115 -0
- manabot-0.2.0/manabot/training/presets/ataraxos-mtg-v1.json +159 -0
- manabot-0.2.0/manabot/training/presets.py +20 -0
- manabot-0.2.0/manabot/training/recovery.py +266 -0
- manabot-0.2.0/manabot/training/references.py +22 -0
- manabot-0.2.0/manabot/training/regime_study.ipynb +100 -0
- manabot-0.2.0/manabot/training/regime_study.py +1126 -0
- manabot-0.2.0/manabot/training/report_snapshot.py +88 -0
- manabot-0.2.0/manabot/training/report_study.py +232 -0
- manabot-0.2.0/manabot/training/selection.py +177 -0
- manabot-0.2.0/manabot/training/selection_analysis.py +290 -0
- manabot-0.2.0/manabot/training/selection_data.py +183 -0
- manabot-0.2.0/manabot/training/self_play.py +72 -0
- manabot-0.2.0/manabot/training/self_play_report.py +152 -0
- manabot-0.2.0/manabot/training/source_bundle.py +92 -0
- manabot-0.2.0/manabot/training/time_cohort.html +39 -0
- manabot-0.2.0/manabot/training/time_cohort.js +224 -0
- manabot-0.2.0/manabot/training/time_cohort.py +392 -0
- manabot-0.2.0/manabot/training/time_profile.py +384 -0
- manabot-0.2.0/manabot/training/time_sources.py +412 -0
- manabot-0.2.0/manabot/verify/__init__.py +1 -0
- manabot-0.2.0/manabot/verify/action_cases.py +366 -0
- manabot-0.2.0/manabot/verify/checkpoint_scenarios.py +353 -0
- manabot-0.2.0/manabot/verify/choice_corpus.py +356 -0
- manabot-0.2.0/manabot/verify/competency.py +1305 -0
- manabot-0.2.0/manabot/verify/decision_profile.py +541 -0
- manabot-0.2.0/manabot/verify/first_light.py +639 -0
- manabot-0.2.0/manabot/verify/learnability/__init__.py +1 -0
- manabot-0.2.0/manabot/verify/learnability/__main__.py +127 -0
- manabot-0.2.0/manabot/verify/learnability/capacity.py +196 -0
- manabot-0.2.0/manabot/verify/learnability/historical.py +109 -0
- manabot-0.2.0/manabot/verify/learnability/input_audit.py +140 -0
- manabot-0.2.0/manabot/verify/learnability/publish.py +136 -0
- manabot-0.2.0/manabot/verify/learnability/report.py +55 -0
- manabot-0.2.0/manabot/verify/learnability/schema.py +86 -0
- manabot-0.2.0/manabot/verify/learnability/search.py +276 -0
- manabot-0.2.0/manabot/verify/learning_control.py +154 -0
- manabot-0.2.0/manabot/verify/learning_regression.py +537 -0
- manabot-0.2.0/manabot/verify/report_first_light.py +40 -0
- manabot-0.2.0/manabot/verify/run_exp11_judge.py +148 -0
- manabot-0.2.0/manabot/verify/run_exp11_train.py +130 -0
- manabot-0.2.0/manabot/verify/run_first_light.py +115 -0
- manabot-0.2.0/manabot/verify/scenario_validation.py +350 -0
- manabot-0.2.0/manabot/verify/step0_env_sanity.py +163 -0
- manabot-0.2.0/manabot/verify/step1_trivial_reward.py +73 -0
- manabot-0.2.0/manabot/verify/step2_memorization.py +63 -0
- manabot-0.2.0/manabot/verify/step3_beat_passive.py +137 -0
- manabot-0.2.0/manabot/verify/step4_beat_random.py +58 -0
- manabot-0.2.0/manabot/verify/store.py +661 -0
- manabot-0.2.0/manabot/verify/util.py +781 -0
- manabot-0.2.0/managym/Cargo.lock +527 -0
- manabot-0.2.0/managym/Cargo.toml +30 -0
- manabot-0.2.0/managym/README.md +134 -0
- manabot-0.2.0/managym/__init__.py +16 -0
- manabot-0.2.0/managym/__init__.pyi +2 -0
- manabot-0.2.0/managym/examples/export_canonical_replay.rs +16 -0
- manabot-0.2.0/managym/examples/export_experience_protocol.rs +16 -0
- manabot-0.2.0/managym/examples/export_study_index.rs +10 -0
- manabot-0.2.0/managym/examples/export_study_protocol.rs +16 -0
- manabot-0.2.0/managym/examples/export_study_recorded_decisions.rs +10 -0
- manabot-0.2.0/managym/examples/measure_content_pack.rs +318 -0
- manabot-0.2.0/managym/src/agent/action.rs +188 -0
- manabot-0.2.0/managym/src/agent/behavior_tracker.rs +44 -0
- manabot-0.2.0/managym/src/agent/env.rs +1374 -0
- manabot-0.2.0/managym/src/agent/mod.rs +10 -0
- manabot-0.2.0/managym/src/agent/observation.rs +1212 -0
- manabot-0.2.0/managym/src/agent/observation_encoder.rs +1195 -0
- manabot-0.2.0/managym/src/agent/opponent.rs +18 -0
- manabot-0.2.0/managym/src/agent/policy_history.rs +481 -0
- manabot-0.2.0/managym/src/agent/rollout_pool.rs +378 -0
- manabot-0.2.0/managym/src/agent/structured_offer.rs +1972 -0
- manabot-0.2.0/managym/src/agent/vector_env.rs +725 -0
- manabot-0.2.0/managym/src/benchmark.rs +1275 -0
- manabot-0.2.0/managym/src/bin/branching_bench.rs +94 -0
- manabot-0.2.0/managym/src/bin/semantic_conformance.rs +100 -0
- manabot-0.2.0/managym/src/bin/validate_study_artifact.rs +33 -0
- manabot-0.2.0/managym/src/canonical_replay.rs +426 -0
- manabot-0.2.0/managym/src/cardsets/alpha.rs +490 -0
- manabot-0.2.0/managym/src/cardsets/elemental.rs +968 -0
- manabot-0.2.0/managym/src/cardsets/ice_age.rs +20 -0
- manabot-0.2.0/managym/src/cardsets/mkm.rs +45 -0
- manabot-0.2.0/managym/src/cardsets/mod.rs +9 -0
- manabot-0.2.0/managym/src/cardsets/sacrifice.rs +503 -0
- manabot-0.2.0/managym/src/cardsets/strixhaven.rs +83 -0
- manabot-0.2.0/managym/src/cardsets/temur.rs +185 -0
- manabot-0.2.0/managym/src/cardsets/tla.rs +842 -0
- manabot-0.2.0/managym/src/cardsets/visions.rs +31 -0
- manabot-0.2.0/managym/src/conformance.rs +1242 -0
- manabot-0.2.0/managym/src/decision.rs +809 -0
- manabot-0.2.0/managym/src/decision_context.rs +400 -0
- manabot-0.2.0/managym/src/experience.rs +665 -0
- manabot-0.2.0/managym/src/flow/action.rs +606 -0
- manabot-0.2.0/managym/src/flow/combat.rs +11 -0
- manabot-0.2.0/managym/src/flow/combat_actions.rs +324 -0
- manabot-0.2.0/managym/src/flow/damage.rs +253 -0
- manabot-0.2.0/managym/src/flow/decision.rs +2080 -0
- manabot-0.2.0/managym/src/flow/event.rs +131 -0
- manabot-0.2.0/managym/src/flow/event_log.rs +461 -0
- manabot-0.2.0/managym/src/flow/game.rs +263 -0
- manabot-0.2.0/managym/src/flow/identity.rs +183 -0
- manabot-0.2.0/managym/src/flow/mana.rs +579 -0
- manabot-0.2.0/managym/src/flow/mod.rs +26 -0
- manabot-0.2.0/managym/src/flow/play.rs +1161 -0
- manabot-0.2.0/managym/src/flow/priority.rs +50 -0
- manabot-0.2.0/managym/src/flow/proposed_event.rs +474 -0
- manabot-0.2.0/managym/src/flow/resolution.rs +1148 -0
- manabot-0.2.0/managym/src/flow/sba.rs +185 -0
- manabot-0.2.0/managym/src/flow/scenario.rs +154 -0
- manabot-0.2.0/managym/src/flow/search.rs +183 -0
- manabot-0.2.0/managym/src/flow/setup.rs +155 -0
- manabot-0.2.0/managym/src/flow/stabilization.rs +67 -0
- manabot-0.2.0/managym/src/flow/statics.rs +228 -0
- manabot-0.2.0/managym/src/flow/tick.rs +440 -0
- manabot-0.2.0/managym/src/flow/trigger.rs +53 -0
- manabot-0.2.0/managym/src/flow/triggers.rs +735 -0
- manabot-0.2.0/managym/src/flow/turn.rs +145 -0
- manabot-0.2.0/managym/src/flow/undo.rs +754 -0
- manabot-0.2.0/managym/src/flow/zones.rs +561 -0
- manabot-0.2.0/managym/src/infra/log.rs +19 -0
- manabot-0.2.0/managym/src/infra/mod.rs +2 -0
- manabot-0.2.0/managym/src/infra/profiler.rs +284 -0
- manabot-0.2.0/managym/src/lib.rs +25 -0
- manabot-0.2.0/managym/src/possible_worlds.rs +1351 -0
- manabot-0.2.0/managym/src/python/bindings.rs +3507 -0
- manabot-0.2.0/managym/src/python/convert.rs +86 -0
- manabot-0.2.0/managym/src/python/mod.rs +6 -0
- manabot-0.2.0/managym/src/python/vector_env_bindings.rs +969 -0
- manabot-0.2.0/managym/src/search_state.rs +771 -0
- manabot-0.2.0/managym/src/semantic/content.rs +1374 -0
- manabot-0.2.0/managym/src/semantic/mod.rs +1586 -0
- manabot-0.2.0/managym/src/state/ability.rs +647 -0
- manabot-0.2.0/managym/src/state/card.rs +469 -0
- manabot-0.2.0/managym/src/state/game_object.rs +189 -0
- manabot-0.2.0/managym/src/state/hash.rs +261 -0
- manabot-0.2.0/managym/src/state/mana.rs +469 -0
- manabot-0.2.0/managym/src/state/mod.rs +11 -0
- manabot-0.2.0/managym/src/state/permanent.rs +141 -0
- manabot-0.2.0/managym/src/state/player.rs +77 -0
- manabot-0.2.0/managym/src/state/predicate.rs +123 -0
- manabot-0.2.0/managym/src/state/stack_object.rs +111 -0
- manabot-0.2.0/managym/src/state/target.rs +2 -0
- manabot-0.2.0/managym/src/state/zone.rs +264 -0
- manabot-0.2.0/managym/src/study.rs +690 -0
- manabot-0.2.0/managym/tests/authored_match_tests.rs +250 -0
- manabot-0.2.0/managym/tests/canonical_replay_tests.rs +187 -0
- manabot-0.2.0/managym/tests/conformance_tests.rs +355 -0
- manabot-0.2.0/managym/tests/content_pack_clone_allocations.rs +299 -0
- manabot-0.2.0/managym/tests/content_pack_tests.rs +228 -0
- manabot-0.2.0/managym/tests/elemental_world_tests.rs +99 -0
- manabot-0.2.0/managym/tests/engine_tests.rs +443 -0
- manabot-0.2.0/managym/tests/experience_protocol_tests.rs +151 -0
- manabot-0.2.0/managym/tests/fixtures/scryfall_cards.json +1633 -0
- manabot-0.2.0/managym/tests/fixtures/structured_declare_attackers_offer.json +110 -0
- manabot-0.2.0/managym/tests/fixtures/structured_priority_bolt_offer.json +90 -0
- manabot-0.2.0/managym/tests/learn_setup_tests.rs +108 -0
- manabot-0.2.0/managym/tests/match_state_hash_tests.rs +209 -0
- manabot-0.2.0/managym/tests/possible_worlds_tests.rs +434 -0
- manabot-0.2.0/managym/tests/prepared_possible_worlds_tests.rs +238 -0
- manabot-0.2.0/managym/tests/rules/cr_103_game_start.rs +31 -0
- manabot-0.2.0/managym/tests/rules/cr_106_mana.rs +77 -0
- manabot-0.2.0/managym/tests/rules/cr_117_priority.rs +44 -0
- manabot-0.2.0/managym/tests/rules/cr_305_lands.rs +60 -0
- manabot-0.2.0/managym/tests/rules/cr_400_identity.rs +202 -0
- manabot-0.2.0/managym/tests/rules/cr_405_stack.rs +98 -0
- manabot-0.2.0/managym/tests/rules/cr_508_attackers.rs +60 -0
- manabot-0.2.0/managym/tests/rules/cr_509_blockers.rs +56 -0
- manabot-0.2.0/managym/tests/rules/cr_510_combat_damage.rs +48 -0
- manabot-0.2.0/managym/tests/rules/cr_514_cleanup.rs +77 -0
- manabot-0.2.0/managym/tests/rules/cr_601_casting.rs +83 -0
- manabot-0.2.0/managym/tests/rules/cr_602_activated_abilities.rs +244 -0
- manabot-0.2.0/managym/tests/rules/cr_603_triggers.rs +279 -0
- manabot-0.2.0/managym/tests/rules/cr_614_replacement.rs +205 -0
- manabot-0.2.0/managym/tests/rules/cr_702_keywords.rs +530 -0
- manabot-0.2.0/managym/tests/rules/cr_704_sba.rs +354 -0
- manabot-0.2.0/managym/tests/rules/elemental_cards.rs +1507 -0
- manabot-0.2.0/managym/tests/rules/event_log.rs +126 -0
- manabot-0.2.0/managym/tests/rules/event_observations.rs +171 -0
- manabot-0.2.0/managym/tests/rules/helpers.rs +591 -0
- manabot-0.2.0/managym/tests/rules/interaction_spells.rs +148 -0
- manabot-0.2.0/managym/tests/rules/mod.rs +32 -0
- manabot-0.2.0/managym/tests/rules/presentation_events.rs +101 -0
- manabot-0.2.0/managym/tests/rules/sacrifice_cards.rs +606 -0
- manabot-0.2.0/managym/tests/rules/stage2_cards.rs +1101 -0
- manabot-0.2.0/managym/tests/rules/stage3_cards.rs +1214 -0
- manabot-0.2.0/managym/tests/rules/structured_attacker_offers.rs +640 -0
- manabot-0.2.0/managym/tests/rules/structured_offers.rs +696 -0
- manabot-0.2.0/managym/tests/rules/temur_cards.rs +578 -0
- manabot-0.2.0/managym/tests/rules/tla_cards.rs +1031 -0
- manabot-0.2.0/managym/tests/rules/ur_lessons_increment.rs +631 -0
- manabot-0.2.0/managym/tests/rules_tests.rs +1 -0
- manabot-0.2.0/managym/tests/scenario_tests.rs +315 -0
- manabot-0.2.0/managym/tests/search_state_contract.rs +535 -0
- manabot-0.2.0/managym/tests/search_tests.rs +490 -0
- manabot-0.2.0/managym/tests/semantic_conformance_tests.rs +75 -0
- manabot-0.2.0/managym/tests/semantic_interpreter_tests.rs +436 -0
- manabot-0.2.0/managym/tests/semantic_ir_tests.rs +275 -0
- manabot-0.2.0/managym/tests/study_index_protocol_tests.rs +163 -0
- manabot-0.2.0/managym/tests/study_protocol_tests.rs +122 -0
- manabot-0.2.0/managym/uv.lock +206 -0
- manabot-0.2.0/pyproject.toml +166 -0
manabot-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: manabot
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Requires-Dist: torch==2.10.0
|
|
5
|
+
Requires-Dist: numpy>=1.24.0
|
|
6
|
+
Requires-Dist: pandas>=2.0.0
|
|
7
|
+
Requires-Dist: nbformat>=5.10.0
|
|
8
|
+
Requires-Dist: gymnasium>=1.0.0
|
|
9
|
+
Requires-Dist: pydantic>=2.12.0
|
|
10
|
+
Requires-Dist: typer>=0.12.5
|
|
11
|
+
Requires-Dist: wandb>=0.18.7
|
|
12
|
+
Requires-Dist: psutil>=5.9.0
|
|
13
|
+
Requires-Dist: etude-sdk==0.2.0
|
|
14
|
+
Requires-Dist: fastapi>=0.116.0 ; extra == 'academy'
|
|
15
|
+
Requires-Dist: uvicorn[standard]>=0.34.0 ; extra == 'academy'
|
|
16
|
+
Requires-Dist: boto3>=1.35.0 ; extra == 'artifacts'
|
|
17
|
+
Requires-Dist: fastapi>=0.116.0 ; extra == 'dev'
|
|
18
|
+
Requires-Dist: uvicorn[standard]>=0.34.0 ; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest>=7.0.0 ; extra == 'dev'
|
|
20
|
+
Requires-Dist: httpx>=0.28.0 ; extra == 'dev'
|
|
21
|
+
Requires-Dist: jsonschema>=4.23.0 ; extra == 'dev'
|
|
22
|
+
Requires-Dist: ruff>=0.9.0 ; extra == 'dev'
|
|
23
|
+
Requires-Dist: etude-sdk[eval]==0.2.0 ; extra == 'evaluation'
|
|
24
|
+
Requires-Dist: matplotlib>=3.9 ; extra == 'evaluation'
|
|
25
|
+
Requires-Dist: jupyterlab>=4.0 ; extra == 'notebook'
|
|
26
|
+
Requires-Dist: nbclient>=0.10 ; extra == 'notebook'
|
|
27
|
+
Requires-Dist: matplotlib>=3.9 ; extra == 'notebook'
|
|
28
|
+
Requires-Dist: wandb-workspaces>=0.4.13 ; extra == 'notebook'
|
|
29
|
+
Requires-Dist: maturin>=1.5,<2.0 ; extra == 'play'
|
|
30
|
+
Requires-Dist: etude-sdk[s3]==0.2.0 ; python_full_version >= '3.12' and extra == 'reports'
|
|
31
|
+
Requires-Dist: matplotlib>=3.9 ; extra == 'reports'
|
|
32
|
+
Provides-Extra: academy
|
|
33
|
+
Provides-Extra: artifacts
|
|
34
|
+
Provides-Extra: dev
|
|
35
|
+
Provides-Extra: evaluation
|
|
36
|
+
Provides-Extra: notebook
|
|
37
|
+
Provides-Extra: play
|
|
38
|
+
Provides-Extra: reports
|
|
39
|
+
Summary: The trainable Magic: The Gathering agent for Manabot
|
|
40
|
+
Requires-Python: >=3.12, <3.13
|
|
41
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
42
|
+
Project-URL: Homepage, https://manabot.gg
|
|
43
|
+
Project-URL: Repository, https://github.com/loopflowstudio/manabot
|
|
44
|
+
|
|
45
|
+
# Manabot
|
|
46
|
+
|
|
47
|
+
Manabot is a project to train superhuman
|
|
48
|
+
[Magic: The Gathering](https://magic.wizards.com/) bots.
|
|
49
|
+
|
|
50
|
+
It has two halves:
|
|
51
|
+
|
|
52
|
+
- **managym** (Rust): a deterministic rules engine built for learning. It
|
|
53
|
+
handles fast batched stepping, exact clone/fork for search, replay, and
|
|
54
|
+
per-player observations that keep hidden information hidden. Python bindings
|
|
55
|
+
come through PyO3.
|
|
56
|
+
- **manabot** (Python): the agents. It includes self-play training, search,
|
|
57
|
+
belief models over hidden cards, and an arena for evaluating checkpoints
|
|
58
|
+
against fixed opponents.
|
|
59
|
+
|
|
60
|
+
We are currently focusing on a very small but fairly complicated set of decks:
|
|
61
|
+
[UR Lessons versus GW Allies](content/DECKS.md), from the *Avatar: The Last
|
|
62
|
+
Airbender* set.
|
|
63
|
+
|
|
64
|
+
> **Built with two companion projects from Loopflow Studio:**
|
|
65
|
+
>
|
|
66
|
+
> - **[Loopflow](https://github.com/loopflowstudio/loopflow)** is how
|
|
67
|
+
> coding agents are coordinated to write the code.
|
|
68
|
+
> - **[Etude](https://github.com/loopflowstudio/etude)** launches training and evaluation
|
|
69
|
+
> runs and tracks what they record.
|
|
70
|
+
|
|
71
|
+
## Technical approach
|
|
72
|
+
|
|
73
|
+
**A rules engine built for learning.** managym runs a full game of Magic:
|
|
74
|
+
priority, the stack, combat, triggers, and state-based actions. It is
|
|
75
|
+
deterministic given a seed, steps many games in lockstep, and can clone a game
|
|
76
|
+
state exactly. That makes batched self-play, search over possible futures,
|
|
77
|
+
and replay verification cheap. At every decision it gives each player an
|
|
78
|
+
observation of only what that player can see: players, cards, and permanents
|
|
79
|
+
as typed objects, plus the list of legal actions with the objects each one
|
|
80
|
+
targets.
|
|
81
|
+
|
|
82
|
+
**Cards as typed programs.** Cards are not parsed from Oracle text and not
|
|
83
|
+
hand-coded per card name. Each card is authored as a typed program
|
|
84
|
+
([content/semantic/](content/semantic/README.md)), compiled to an IR, and run
|
|
85
|
+
by a generic interpreter that rejects anything it cannot execute. The model can
|
|
86
|
+
embed what a card *does* as well as its name, and most new cards are content
|
|
87
|
+
changes rather than engine changes. Rules behavior is pinned by conformance
|
|
88
|
+
fixtures ([conformance/](conformance/)).
|
|
89
|
+
|
|
90
|
+
**Versioned worlds.** The observation and action encoding is versioned as a
|
|
91
|
+
*world* ([WORLDS.md](WORLDS.md)). Checkpoints only load in the world they were
|
|
92
|
+
trained in, and a nightly learnability check catches encodings that make two
|
|
93
|
+
different choices look identical.
|
|
94
|
+
|
|
95
|
+
**One network, one action head.** One network encodes every visible object,
|
|
96
|
+
mixes them with attention, and scores each legal action together with its
|
|
97
|
+
focus objects. A value head predicts the game outcome. Every decision, from
|
|
98
|
+
casting and targeting to attacking, blocking, and paying costs, goes through
|
|
99
|
+
that single action head.
|
|
100
|
+
|
|
101
|
+
**Self-play from terminal reward.** The agent plays both decks against current
|
|
102
|
+
copies of itself, and many games step in lockstep so that inference is
|
|
103
|
+
batched. The update is a clipped policy gradient, regularized toward both the
|
|
104
|
+
collection policy and a fixed reference policy, with advantage filtering,
|
|
105
|
+
annealed step sizes, and an EMA of the weights for evaluation. Those choices
|
|
106
|
+
follow [Ataraxos](https://doi.org/10.1038/s41586-026-11036-y) (Sokota et al.,
|
|
107
|
+
2026), and each one is a separate switch that we test on Magic rather than
|
|
108
|
+
adopt on the paper's authority ([research program](manabot/RESEARCH.md)).
|
|
109
|
+
Reward is win or loss only: our shaped rewards lost to it
|
|
110
|
+
([exp-04](experiments/exp-04-potential-shaping.md)).
|
|
111
|
+
|
|
112
|
+
**Hidden information and search.** Belief samplers learn a distribution over
|
|
113
|
+
the opponent's hidden cards from a frozen policy's own games
|
|
114
|
+
([belief sampler](docs/belief-sampler.md)). Search samples hands from that
|
|
115
|
+
belief, uses the frozen policy for continuations, and distills its choices
|
|
116
|
+
back into the policy ([local policy search](docs/local-policy-search.md)).
|
|
117
|
+
This runs end to end but has not yet shown a strength gain over the policy
|
|
118
|
+
alone.
|
|
119
|
+
|
|
120
|
+
**Evaluation by head-to-head play.** Trained agents play each other. A
|
|
121
|
+
*Tournament* file names a roster of checkpoints and fixed opponents, and the
|
|
122
|
+
runner plays every pairing on the same held-out deals, with both decks and
|
|
123
|
+
both seats ([head-to-head](experiments/head-to-head.md)). The arena fits
|
|
124
|
+
ratings across the whole population (`manabot/arena/`), and a rule-based
|
|
125
|
+
`heuristic` bot gives a stable reference point across runs. Every game is
|
|
126
|
+
replay-verified.
|
|
127
|
+
|
|
128
|
+
**Preregistered experiments.** The question, numeric prediction, kill
|
|
129
|
+
criteria, and cost cap are committed to git before a run; without that commit
|
|
130
|
+
a result is exploratory, not evidence. Frozen contracts record the hashes of
|
|
131
|
+
their inputs, claims about a training method need independent training seeds,
|
|
132
|
+
and refutations stay on the record ([experiments/](experiments/README.md)).
|
|
133
|
+
|
|
134
|
+
Right now the main open question is the training curriculum: which matchups,
|
|
135
|
+
opponents, and mix of self-play the agent should learn from (for example,
|
|
136
|
+
mirror matches versus balanced cross-deck play). Evaluation is kept narrow,
|
|
137
|
+
just enough to compare curricula, rather than testing current agents across a
|
|
138
|
+
wide range of environments.
|
|
139
|
+
|
|
140
|
+
## Versioned installs
|
|
141
|
+
|
|
142
|
+
Versioned PyPI release preparation, platform support, CPU/CUDA installation and
|
|
143
|
+
maintainer publishing are described in [the release guide](docs/releases.md).
|
|
144
|
+
The first planned release is 0.2.0; the source workflow below remains available.
|
|
145
|
+
|
|
146
|
+
## Quickstart
|
|
147
|
+
|
|
148
|
+
You need [uv](https://docs.astral.sh/uv/) and a Rust toolchain.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
git clone git@github.com:loopflowstudio/manabot.git
|
|
152
|
+
cd manabot
|
|
153
|
+
uv sync --python 3.12 --extra dev
|
|
154
|
+
uv run --extra play maturin develop --release \
|
|
155
|
+
--manifest-path managym/Cargo.toml --features python
|
|
156
|
+
|
|
157
|
+
uv run manabot train # small CPU training run, under a minute, no W&B
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`uv run manabot train` trains a small agent and saves checkpoints to
|
|
161
|
+
`.runs/local/`. Training recipes are typed *regimes* composed in Python, one module per
|
|
162
|
+
current experiment in [experiments/](experiments/), from reusable parts in
|
|
163
|
+
[manabot/training/builders.py](manabot/training/builders.py). The current GPU
|
|
164
|
+
baseline is
|
|
165
|
+
`uv run manabot train --regime-name batched_baseline --out .runs/batched/run`.
|
|
166
|
+
[manabot/README.md](manabot/README.md) covers presets, remote GPU runs,
|
|
167
|
+
simulation, and evaluation.
|
|
168
|
+
|
|
169
|
+
There is also a local browser table (`./scripts/play`, needs Node) for playing
|
|
170
|
+
one game against a checkpoint or stepping through a replay. It is for
|
|
171
|
+
inspecting what a bot does, not a way to play Magic.
|
|
172
|
+
|
|
173
|
+
## Scale
|
|
174
|
+
|
|
175
|
+
Training scale per agent, measured in **learner decisions**: the decisions
|
|
176
|
+
the learning policy made and trained on. Decisions with a single legal action
|
|
177
|
+
are played automatically and not counted, and neither are the opponent seat's
|
|
178
|
+
decisions in self-play. This unit does not depend on model size or batching,
|
|
179
|
+
unlike iterations or Adam steps, and does not depend on hardware, unlike
|
|
180
|
+
dollars or hours. We add a row when a run sets a new high.
|
|
181
|
+
|
|
182
|
+
| Agent | Date | Model | Learner decisions | Decisions per iteration × iterations | Hardware |
|
|
183
|
+
|---|---|---|---:|---:|---|
|
|
184
|
+
| first-light PPO ([report](experiments/first-light-run-1.md)) | 2026-03 | width 64 | 262k | 512 × 512 | CPU |
|
|
185
|
+
| matched-cost PPO ([exp-03](experiments/exp-03-distillation.md)) | 2026-07 | 100k params | 5.8M | 2,048 × 2,850 | M4 Max |
|
|
186
|
+
| `small-26k` ([capacity](experiments/model-capacity.md)) | 2026-10 | 64×2, 188k params | 13.3M | 512 × 26,000 | 1× L4 |
|
|
187
|
+
| `small-63k`, continued | 2026-10 | 64×2 | 32.3M | 512 × 63,000 | 1× L4 |
|
|
188
|
+
| `small-100k`, continued | 2026-10 | 64×2 | 51.2M | 512 × 100,000 | 1× L4 |
|
|
189
|
+
| scale ladder v1, one seat ([ladder](experiments/scale-ladder.md)) | 2026-10 | 64×2 | 196.6M | 16,384 × 12,000 | 1× L4, $13.34 |
|
|
190
|
+
|
|
191
|
+
The first two rows predate the current world and encoding, so they record
|
|
192
|
+
scale only. The ladder run's $10 checkpoint (151.6M decisions) scored 0.69
|
|
193
|
+
against the `heuristic` anchor across the four deck matchups, and 0.70 as
|
|
194
|
+
Lessons against Allies. The run was closed before its $50 tier, once
|
|
195
|
+
self-play moved to learning from both seats.
|
|
196
|
+
|
|
197
|
+
Learning-rate schedules currently count iterations, not decisions. The same
|
|
198
|
+
recipe run at a different batch size therefore decays at a different number
|
|
199
|
+
of decisions: about 18M for `small-100k` versus about 575M for the ladder recipe.
|
|
200
|
+
|
|
201
|
+
## Earlier results
|
|
202
|
+
|
|
203
|
+
Before self-play became the main loop, the project leaned on search. These
|
|
204
|
+
results come from that period and from earlier encodings, so their numbers are
|
|
205
|
+
not comparable with today's checkpoints:
|
|
206
|
+
|
|
207
|
+
- **Search was strong and cheap.** Flat determinized Monte Carlo with 256
|
|
208
|
+
rollouts beat random 99% of the time. Every early trained policy was weaker
|
|
209
|
+
than 16-rollout search ([exp-02](experiments/exp-02-flat-mc.md)).
|
|
210
|
+
- **Distillation beat PPO at equal cost**, 90.5% versus 52.7% against random
|
|
211
|
+
([exp-03](experiments/exp-03-distillation.md)). Naive expert iteration did
|
|
212
|
+
not compound: round 1 lost 74–26 to round 0
|
|
213
|
+
([exp-07](experiments/exp-07-expert-iteration.md)).
|
|
214
|
+
- **Reward shaping hurt.** Terminal-only reward beat our shaped rewards by
|
|
215
|
+
about 15 points ([exp-04](experiments/exp-04-potential-shaping.md)).
|
|
216
|
+
- **Win rate hid incompetence.** The search pilot could not play a control
|
|
217
|
+
deck: it found the right line at most 39% of the time in competency
|
|
218
|
+
scenarios, and random beat it in 3 of 5
|
|
219
|
+
([exp-09](experiments/exp-09-control-competency.md)). Matchup tables mostly
|
|
220
|
+
measured the pilot and card quality
|
|
221
|
+
([exp-08b](experiments/exp-08b-ancestral-dose.md)).
|
|
222
|
+
|
|
223
|
+
## Not built yet
|
|
224
|
+
|
|
225
|
+
- **More cards.** Because cards are typed programs, most new cards can be
|
|
226
|
+
added as content without engine changes, but the pool is still two decks.
|
|
227
|
+
- **Limited.** The long-term target is sealed and draft play: building decks
|
|
228
|
+
from a pool, then piloting them. Nothing in the repository drafts or builds
|
|
229
|
+
decks yet.
|
|
230
|
+
|
|
231
|
+
## Map of the repository
|
|
232
|
+
|
|
233
|
+
| Path | What it is |
|
|
234
|
+
|---|---|
|
|
235
|
+
| `managym/` | Rust rules engine, vectorized env, and PyO3 bindings ([README](managym/README.md)) |
|
|
236
|
+
| `manabot/` | Agents: models, training, search, beliefs, arena, verification ([README](manabot/README.md)) |
|
|
237
|
+
| `experiments/` | Preregistered experiment reports, protocols, and data |
|
|
238
|
+
| `content/` | Card and deck definitions compiled to a typed IR |
|
|
239
|
+
| `conformance/` | Rules conformance fixtures |
|
|
240
|
+
| `docs/` | Architecture, training operations, rules, and research notes ([index](docs/README.md)) |
|
|
241
|
+
| `paper/` | A working paper draft |
|
|
242
|
+
| `ops/`, `deploy/` | Remote training hardware and deployment |
|
|
243
|
+
| `academy/`, `academy/ui/`, `protocol/` | Local browser UI for testing a bot by hand and reviewing replays |
|
|
244
|
+
| `wave/`, `.lf/` | Loopflow Waves, Flows, and skills that organize agent work |
|
|
245
|
+
|
|
246
|
+
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) has the full system design. In
|
|
247
|
+
short, managym owns the rules and legality, manabot owns inference and
|
|
248
|
+
decisions, and the play UI only displays what managym allows the viewer to
|
|
249
|
+
see.
|
|
250
|
+
|
|
251
|
+
## Development
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Rust (CI runs cargo test in debug, so validate in debug before landing)
|
|
255
|
+
cd managym && cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings && cargo test && cd ..
|
|
256
|
+
|
|
257
|
+
# Python
|
|
258
|
+
uv run --extra dev pytest tests/
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Contributor and agent conventions are in [AGENTS.md](AGENTS.md). Package style
|
|
262
|
+
guides are in each package README.
|
|
263
|
+
|
|
264
|
+
## Names
|
|
265
|
+
|
|
266
|
+
- **manabot**: the bot and the Python library. You train *a* manabot.
|
|
267
|
+
- **managym**: the rules environment the bot lives in.
|
|
268
|
+
- **Academy**: the local bot-testing UI (`academy/`, `academy/ui/`).
|
|
269
|
+
- **Etude**: the separate system that launches and records experiments
|
|
270
|
+
([`loopflowstudio/etude`](https://github.com/loopflowstudio/etude)). Older
|
|
271
|
+
documents also use *Etude* and *Fantasia* for this project.
|
|
272
|
+
- **Loopflow**: the agent development tool
|
|
273
|
+
([`loopflowstudio/loopflow`](https://github.com/loopflowstudio/loopflow)).
|
|
274
|
+
|
|
275
|
+
Manabot is an independent research project and unofficial Fan Content
|
|
276
|
+
permitted under the Wizards of the Coast
|
|
277
|
+
[Fan Content Policy](https://company.wizards.com/en/legal/fancontentpolicy).
|
|
278
|
+
Not approved or endorsed by Wizards. Magic: The Gathering and its card names
|
|
279
|
+
are property of Wizards of the Coast LLC.
|
|
280
|
+
|
manabot-0.2.0/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Manabot
|
|
2
|
+
|
|
3
|
+
Manabot is a project to train superhuman
|
|
4
|
+
[Magic: The Gathering](https://magic.wizards.com/) bots.
|
|
5
|
+
|
|
6
|
+
It has two halves:
|
|
7
|
+
|
|
8
|
+
- **managym** (Rust): a deterministic rules engine built for learning. It
|
|
9
|
+
handles fast batched stepping, exact clone/fork for search, replay, and
|
|
10
|
+
per-player observations that keep hidden information hidden. Python bindings
|
|
11
|
+
come through PyO3.
|
|
12
|
+
- **manabot** (Python): the agents. It includes self-play training, search,
|
|
13
|
+
belief models over hidden cards, and an arena for evaluating checkpoints
|
|
14
|
+
against fixed opponents.
|
|
15
|
+
|
|
16
|
+
We are currently focusing on a very small but fairly complicated set of decks:
|
|
17
|
+
[UR Lessons versus GW Allies](content/DECKS.md), from the *Avatar: The Last
|
|
18
|
+
Airbender* set.
|
|
19
|
+
|
|
20
|
+
> **Built with two companion projects from Loopflow Studio:**
|
|
21
|
+
>
|
|
22
|
+
> - **[Loopflow](https://github.com/loopflowstudio/loopflow)** is how
|
|
23
|
+
> coding agents are coordinated to write the code.
|
|
24
|
+
> - **[Etude](https://github.com/loopflowstudio/etude)** launches training and evaluation
|
|
25
|
+
> runs and tracks what they record.
|
|
26
|
+
|
|
27
|
+
## Technical approach
|
|
28
|
+
|
|
29
|
+
**A rules engine built for learning.** managym runs a full game of Magic:
|
|
30
|
+
priority, the stack, combat, triggers, and state-based actions. It is
|
|
31
|
+
deterministic given a seed, steps many games in lockstep, and can clone a game
|
|
32
|
+
state exactly. That makes batched self-play, search over possible futures,
|
|
33
|
+
and replay verification cheap. At every decision it gives each player an
|
|
34
|
+
observation of only what that player can see: players, cards, and permanents
|
|
35
|
+
as typed objects, plus the list of legal actions with the objects each one
|
|
36
|
+
targets.
|
|
37
|
+
|
|
38
|
+
**Cards as typed programs.** Cards are not parsed from Oracle text and not
|
|
39
|
+
hand-coded per card name. Each card is authored as a typed program
|
|
40
|
+
([content/semantic/](content/semantic/README.md)), compiled to an IR, and run
|
|
41
|
+
by a generic interpreter that rejects anything it cannot execute. The model can
|
|
42
|
+
embed what a card *does* as well as its name, and most new cards are content
|
|
43
|
+
changes rather than engine changes. Rules behavior is pinned by conformance
|
|
44
|
+
fixtures ([conformance/](conformance/)).
|
|
45
|
+
|
|
46
|
+
**Versioned worlds.** The observation and action encoding is versioned as a
|
|
47
|
+
*world* ([WORLDS.md](WORLDS.md)). Checkpoints only load in the world they were
|
|
48
|
+
trained in, and a nightly learnability check catches encodings that make two
|
|
49
|
+
different choices look identical.
|
|
50
|
+
|
|
51
|
+
**One network, one action head.** One network encodes every visible object,
|
|
52
|
+
mixes them with attention, and scores each legal action together with its
|
|
53
|
+
focus objects. A value head predicts the game outcome. Every decision, from
|
|
54
|
+
casting and targeting to attacking, blocking, and paying costs, goes through
|
|
55
|
+
that single action head.
|
|
56
|
+
|
|
57
|
+
**Self-play from terminal reward.** The agent plays both decks against current
|
|
58
|
+
copies of itself, and many games step in lockstep so that inference is
|
|
59
|
+
batched. The update is a clipped policy gradient, regularized toward both the
|
|
60
|
+
collection policy and a fixed reference policy, with advantage filtering,
|
|
61
|
+
annealed step sizes, and an EMA of the weights for evaluation. Those choices
|
|
62
|
+
follow [Ataraxos](https://doi.org/10.1038/s41586-026-11036-y) (Sokota et al.,
|
|
63
|
+
2026), and each one is a separate switch that we test on Magic rather than
|
|
64
|
+
adopt on the paper's authority ([research program](manabot/RESEARCH.md)).
|
|
65
|
+
Reward is win or loss only: our shaped rewards lost to it
|
|
66
|
+
([exp-04](experiments/exp-04-potential-shaping.md)).
|
|
67
|
+
|
|
68
|
+
**Hidden information and search.** Belief samplers learn a distribution over
|
|
69
|
+
the opponent's hidden cards from a frozen policy's own games
|
|
70
|
+
([belief sampler](docs/belief-sampler.md)). Search samples hands from that
|
|
71
|
+
belief, uses the frozen policy for continuations, and distills its choices
|
|
72
|
+
back into the policy ([local policy search](docs/local-policy-search.md)).
|
|
73
|
+
This runs end to end but has not yet shown a strength gain over the policy
|
|
74
|
+
alone.
|
|
75
|
+
|
|
76
|
+
**Evaluation by head-to-head play.** Trained agents play each other. A
|
|
77
|
+
*Tournament* file names a roster of checkpoints and fixed opponents, and the
|
|
78
|
+
runner plays every pairing on the same held-out deals, with both decks and
|
|
79
|
+
both seats ([head-to-head](experiments/head-to-head.md)). The arena fits
|
|
80
|
+
ratings across the whole population (`manabot/arena/`), and a rule-based
|
|
81
|
+
`heuristic` bot gives a stable reference point across runs. Every game is
|
|
82
|
+
replay-verified.
|
|
83
|
+
|
|
84
|
+
**Preregistered experiments.** The question, numeric prediction, kill
|
|
85
|
+
criteria, and cost cap are committed to git before a run; without that commit
|
|
86
|
+
a result is exploratory, not evidence. Frozen contracts record the hashes of
|
|
87
|
+
their inputs, claims about a training method need independent training seeds,
|
|
88
|
+
and refutations stay on the record ([experiments/](experiments/README.md)).
|
|
89
|
+
|
|
90
|
+
Right now the main open question is the training curriculum: which matchups,
|
|
91
|
+
opponents, and mix of self-play the agent should learn from (for example,
|
|
92
|
+
mirror matches versus balanced cross-deck play). Evaluation is kept narrow,
|
|
93
|
+
just enough to compare curricula, rather than testing current agents across a
|
|
94
|
+
wide range of environments.
|
|
95
|
+
|
|
96
|
+
## Versioned installs
|
|
97
|
+
|
|
98
|
+
Versioned PyPI release preparation, platform support, CPU/CUDA installation and
|
|
99
|
+
maintainer publishing are described in [the release guide](docs/releases.md).
|
|
100
|
+
The first planned release is 0.2.0; the source workflow below remains available.
|
|
101
|
+
|
|
102
|
+
## Quickstart
|
|
103
|
+
|
|
104
|
+
You need [uv](https://docs.astral.sh/uv/) and a Rust toolchain.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone git@github.com:loopflowstudio/manabot.git
|
|
108
|
+
cd manabot
|
|
109
|
+
uv sync --python 3.12 --extra dev
|
|
110
|
+
uv run --extra play maturin develop --release \
|
|
111
|
+
--manifest-path managym/Cargo.toml --features python
|
|
112
|
+
|
|
113
|
+
uv run manabot train # small CPU training run, under a minute, no W&B
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`uv run manabot train` trains a small agent and saves checkpoints to
|
|
117
|
+
`.runs/local/`. Training recipes are typed *regimes* composed in Python, one module per
|
|
118
|
+
current experiment in [experiments/](experiments/), from reusable parts in
|
|
119
|
+
[manabot/training/builders.py](manabot/training/builders.py). The current GPU
|
|
120
|
+
baseline is
|
|
121
|
+
`uv run manabot train --regime-name batched_baseline --out .runs/batched/run`.
|
|
122
|
+
[manabot/README.md](manabot/README.md) covers presets, remote GPU runs,
|
|
123
|
+
simulation, and evaluation.
|
|
124
|
+
|
|
125
|
+
There is also a local browser table (`./scripts/play`, needs Node) for playing
|
|
126
|
+
one game against a checkpoint or stepping through a replay. It is for
|
|
127
|
+
inspecting what a bot does, not a way to play Magic.
|
|
128
|
+
|
|
129
|
+
## Scale
|
|
130
|
+
|
|
131
|
+
Training scale per agent, measured in **learner decisions**: the decisions
|
|
132
|
+
the learning policy made and trained on. Decisions with a single legal action
|
|
133
|
+
are played automatically and not counted, and neither are the opponent seat's
|
|
134
|
+
decisions in self-play. This unit does not depend on model size or batching,
|
|
135
|
+
unlike iterations or Adam steps, and does not depend on hardware, unlike
|
|
136
|
+
dollars or hours. We add a row when a run sets a new high.
|
|
137
|
+
|
|
138
|
+
| Agent | Date | Model | Learner decisions | Decisions per iteration × iterations | Hardware |
|
|
139
|
+
|---|---|---|---:|---:|---|
|
|
140
|
+
| first-light PPO ([report](experiments/first-light-run-1.md)) | 2026-03 | width 64 | 262k | 512 × 512 | CPU |
|
|
141
|
+
| matched-cost PPO ([exp-03](experiments/exp-03-distillation.md)) | 2026-07 | 100k params | 5.8M | 2,048 × 2,850 | M4 Max |
|
|
142
|
+
| `small-26k` ([capacity](experiments/model-capacity.md)) | 2026-10 | 64×2, 188k params | 13.3M | 512 × 26,000 | 1× L4 |
|
|
143
|
+
| `small-63k`, continued | 2026-10 | 64×2 | 32.3M | 512 × 63,000 | 1× L4 |
|
|
144
|
+
| `small-100k`, continued | 2026-10 | 64×2 | 51.2M | 512 × 100,000 | 1× L4 |
|
|
145
|
+
| scale ladder v1, one seat ([ladder](experiments/scale-ladder.md)) | 2026-10 | 64×2 | 196.6M | 16,384 × 12,000 | 1× L4, $13.34 |
|
|
146
|
+
|
|
147
|
+
The first two rows predate the current world and encoding, so they record
|
|
148
|
+
scale only. The ladder run's $10 checkpoint (151.6M decisions) scored 0.69
|
|
149
|
+
against the `heuristic` anchor across the four deck matchups, and 0.70 as
|
|
150
|
+
Lessons against Allies. The run was closed before its $50 tier, once
|
|
151
|
+
self-play moved to learning from both seats.
|
|
152
|
+
|
|
153
|
+
Learning-rate schedules currently count iterations, not decisions. The same
|
|
154
|
+
recipe run at a different batch size therefore decays at a different number
|
|
155
|
+
of decisions: about 18M for `small-100k` versus about 575M for the ladder recipe.
|
|
156
|
+
|
|
157
|
+
## Earlier results
|
|
158
|
+
|
|
159
|
+
Before self-play became the main loop, the project leaned on search. These
|
|
160
|
+
results come from that period and from earlier encodings, so their numbers are
|
|
161
|
+
not comparable with today's checkpoints:
|
|
162
|
+
|
|
163
|
+
- **Search was strong and cheap.** Flat determinized Monte Carlo with 256
|
|
164
|
+
rollouts beat random 99% of the time. Every early trained policy was weaker
|
|
165
|
+
than 16-rollout search ([exp-02](experiments/exp-02-flat-mc.md)).
|
|
166
|
+
- **Distillation beat PPO at equal cost**, 90.5% versus 52.7% against random
|
|
167
|
+
([exp-03](experiments/exp-03-distillation.md)). Naive expert iteration did
|
|
168
|
+
not compound: round 1 lost 74–26 to round 0
|
|
169
|
+
([exp-07](experiments/exp-07-expert-iteration.md)).
|
|
170
|
+
- **Reward shaping hurt.** Terminal-only reward beat our shaped rewards by
|
|
171
|
+
about 15 points ([exp-04](experiments/exp-04-potential-shaping.md)).
|
|
172
|
+
- **Win rate hid incompetence.** The search pilot could not play a control
|
|
173
|
+
deck: it found the right line at most 39% of the time in competency
|
|
174
|
+
scenarios, and random beat it in 3 of 5
|
|
175
|
+
([exp-09](experiments/exp-09-control-competency.md)). Matchup tables mostly
|
|
176
|
+
measured the pilot and card quality
|
|
177
|
+
([exp-08b](experiments/exp-08b-ancestral-dose.md)).
|
|
178
|
+
|
|
179
|
+
## Not built yet
|
|
180
|
+
|
|
181
|
+
- **More cards.** Because cards are typed programs, most new cards can be
|
|
182
|
+
added as content without engine changes, but the pool is still two decks.
|
|
183
|
+
- **Limited.** The long-term target is sealed and draft play: building decks
|
|
184
|
+
from a pool, then piloting them. Nothing in the repository drafts or builds
|
|
185
|
+
decks yet.
|
|
186
|
+
|
|
187
|
+
## Map of the repository
|
|
188
|
+
|
|
189
|
+
| Path | What it is |
|
|
190
|
+
|---|---|
|
|
191
|
+
| `managym/` | Rust rules engine, vectorized env, and PyO3 bindings ([README](managym/README.md)) |
|
|
192
|
+
| `manabot/` | Agents: models, training, search, beliefs, arena, verification ([README](manabot/README.md)) |
|
|
193
|
+
| `experiments/` | Preregistered experiment reports, protocols, and data |
|
|
194
|
+
| `content/` | Card and deck definitions compiled to a typed IR |
|
|
195
|
+
| `conformance/` | Rules conformance fixtures |
|
|
196
|
+
| `docs/` | Architecture, training operations, rules, and research notes ([index](docs/README.md)) |
|
|
197
|
+
| `paper/` | A working paper draft |
|
|
198
|
+
| `ops/`, `deploy/` | Remote training hardware and deployment |
|
|
199
|
+
| `academy/`, `academy/ui/`, `protocol/` | Local browser UI for testing a bot by hand and reviewing replays |
|
|
200
|
+
| `wave/`, `.lf/` | Loopflow Waves, Flows, and skills that organize agent work |
|
|
201
|
+
|
|
202
|
+
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) has the full system design. In
|
|
203
|
+
short, managym owns the rules and legality, manabot owns inference and
|
|
204
|
+
decisions, and the play UI only displays what managym allows the viewer to
|
|
205
|
+
see.
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Rust (CI runs cargo test in debug, so validate in debug before landing)
|
|
211
|
+
cd managym && cargo fmt --check && cargo clippy --all-targets --all-features -- -D warnings && cargo test && cd ..
|
|
212
|
+
|
|
213
|
+
# Python
|
|
214
|
+
uv run --extra dev pytest tests/
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Contributor and agent conventions are in [AGENTS.md](AGENTS.md). Package style
|
|
218
|
+
guides are in each package README.
|
|
219
|
+
|
|
220
|
+
## Names
|
|
221
|
+
|
|
222
|
+
- **manabot**: the bot and the Python library. You train *a* manabot.
|
|
223
|
+
- **managym**: the rules environment the bot lives in.
|
|
224
|
+
- **Academy**: the local bot-testing UI (`academy/`, `academy/ui/`).
|
|
225
|
+
- **Etude**: the separate system that launches and records experiments
|
|
226
|
+
([`loopflowstudio/etude`](https://github.com/loopflowstudio/etude)). Older
|
|
227
|
+
documents also use *Etude* and *Fantasia* for this project.
|
|
228
|
+
- **Loopflow**: the agent development tool
|
|
229
|
+
([`loopflowstudio/loopflow`](https://github.com/loopflowstudio/loopflow)).
|
|
230
|
+
|
|
231
|
+
Manabot is an independent research project and unofficial Fan Content
|
|
232
|
+
permitted under the Wizards of the Coast
|
|
233
|
+
[Fan Content Policy](https://company.wizards.com/en/legal/fancontentpolicy).
|
|
234
|
+
Not approved or endorsed by Wizards. Magic: The Gathering and its card names
|
|
235
|
+
are property of Wizards of the Coast LLC.
|