diff --git a/configs/game_benchmarks.toml b/configs/game_benchmarks.toml index 8f77b59..6027faf 100644 --- a/configs/game_benchmarks.toml +++ b/configs/game_benchmarks.toml @@ -14,3 +14,6 @@ schema = "game_first_exam/benchmarks/babaisai/instance_schema.py" [benchmarks.minihack] schema = "game_first_exam/benchmarks/minihack/instance_schema.py" + +[benchmarks.vgc] +schema = "game_first_exam/benchmarks/vgc/instance_schema.py" diff --git a/configs/game_suites/vgc.toml b/configs/game_suites/vgc.toml new file mode 100644 index 0000000..2f15c6b --- /dev/null +++ b/configs/game_suites/vgc.toml @@ -0,0 +1,25 @@ +schema_version = "game-suite/2.1" +version = "0.1.0" +tier = "smoke" +name = "games-vgc-native-smoke-v0.1.0" +files_images = ["connection-files", "game-files", "vgc-files"] + +[[tasks]] +name = "vgc-vs-random-i01-standard" +benchmark = "vgc" +family = "vs-random" + +[[tasks]] +name = "vgc-vs-maxbasepower-i01-standard" +benchmark = "vgc" +family = "vs-max-base-power" + +[[tasks]] +name = "vgc-vs-simpleheuristics-i01-standard" +benchmark = "vgc" +family = "vs-simple-heuristics" + +[[tasks]] +name = "vgc-vs-bc-i01-standard" +benchmark = "vgc" +family = "vs-bc" diff --git a/game_first_exam/benchmarks/vgc/SOURCE.json b/game_first_exam/benchmarks/vgc/SOURCE.json new file mode 100644 index 0000000..728d9fe --- /dev/null +++ b/game_first_exam/benchmarks/vgc/SOURCE.json @@ -0,0 +1,26 @@ +{ + "benchmark": "vgc-bench", + "repository": "https://github.com/cameronangliss/vgc-bench", + "paper": "https://arxiv.org/abs/2506.10326", + "environment": { + "library": "poke-env", + "repository": "https://github.com/cameronangliss/poke-env", + "branch": "vgc-bench", + "commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "version": "0.15.0", + "modifications": "none" + }, + "simulator": { + "library": "pokemon-showdown", + "repository": "https://github.com/cameronangliss/pokemon-showdown", + "branch": "vgc-bench", + "commit": "913da3602a3aa1db79f9fdc5d5222eaf8d39569d", + "modifications": "none" + }, + "team_source": { + "repository": "https://github.com/cameronangliss/vgc-bench", + "path": "teams/reg_ma", + "license_note": "Team text files are redistributed research data; verify upstream license before publication." + }, + "note": "Only the native battle environment (poke-env + Pokemon Showdown) is reused. VGC-Bench RL/BC training, LLM agent and evaluation tools are not migrated." +} diff --git a/game_first_exam/benchmarks/vgc/adapter.py b/game_first_exam/benchmarks/vgc/adapter.py new file mode 100644 index 0000000..df64347 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/adapter.py @@ -0,0 +1,304 @@ +"""Thin VGC adapter: one frozen battle against a fixed native opponent. + +The native battle engine (poke-env fork + Pokemon Showdown) is kept unmodified. The +opponent is fixed at construction so the two-player game becomes a single-agent +episode: the agent submits one native action index at a time (one per active slot, +two per turn) and the adapter applies the opponent's reply in the same native turn. + +The agent sees only the serialized observation returned by `observe()`; the native +battle object and the Showdown websocket stay inside the trusted sim. +""" +import importlib.metadata +import os +import re +import sys +import textwrap + +import numpy as np +from PIL import Image, ImageDraw + +from contracts import Capabilities, Transition +from encoding import state_hash + +# One action per decision point: a single native action index (0-based) for the +# slot named in the observation (`slot`: 0 or 1). A full turn is two submissions. +ACTION_PATTERN = r"^\d{1,3}$" + + +_BENCH_DIR = os.path.dirname(os.path.abspath(__file__)) + + +def _make_opponent(policy, *, battle_format, team, server_configuration): + from poke_env.player import MaxBasePowerPlayer, RandomPlayer, SimpleHeuristicsPlayer + + common = dict( + battle_format=battle_format, + team=team, + server_configuration=server_configuration, + ) + if policy == "random": + return RandomPlayer(**common) + if policy == "max_base_power": + return MaxBasePowerPlayer(**common) + if policy == "simple_heuristics": + return SimpleHeuristicsPlayer(**common) + if policy == "bc": + # Vendored vgc-bench policy code + checkpoint (see vgc_bench/ and models/). + sys.path.insert(0, _BENCH_DIR) + import torch + from stable_baselines3 import PPO + + from vgc_bench.src.policy_player import PolicyPlayer + + opponent = PolicyPlayer( + **common, + accept_open_team_sheet=True, + open_timeout=None, + deterministic=True, + ) + checkpoint = os.path.join(_BENCH_DIR, "models", "bc_100.zip") + opponent.policy = PPO.load(checkpoint, device=torch.device("cpu")).policy + return opponent + raise ValueError(f"unknown opponent_policy: {policy}") + + +class Adapter: + def __init__(self, instance, assets=None): + self.instance = instance + for name, version in instance["engine_versions"].items(): + if importlib.metadata.version(name) != version: + raise ValueError(f"engine version mismatch: {name}") + + from gymnasium.spaces import Box + from poke_env.environment import DoublesEnv, SingleAgentWrapper + from poke_env.ps_client import ServerConfiguration + + # Showdown runs in the same container on loopback; the agent cannot reach it. + server = ServerConfiguration( + "ws://127.0.0.1:7200/showdown/websocket", + "https://play.pokemonshowdown.com/action.php?", + ) + env = DoublesEnv( + server_configuration=server, + battle_format=instance["battle_format"], + accept_open_team_sheet=True, + team=instance["team1"], + choose_on_teampreview=False, # random auto team-preview; the agent only decides battle turns + strict=False, # an incompatible joint order falls back to a random legal order instead of faulting the episode + open_timeout=None, # the Showdown server warms up asynchronously; do not time out the websocket open + challenge_timeout=180.0, # generous battle-setup window for the first connection + save_replays="/data/replays", # poke-env writes a self-contained HTML replay when the battle ends + ) + opponent = _make_opponent( + instance["opponent_policy"], + battle_format=instance["battle_format"], + team=instance["team2"], + server_configuration=server, + ) + # poke-env's SingleAgentWrapper reads the PettingZoo-style dict that + # vgc-bench's ShowdownEnv adds on top of DoublesEnv; supply a real Box + # space for each agent (the adapter serves its own JSON observation). + env.observation_spaces = { + agent: Box(0, 1, shape=(1,), dtype=np.float32) + for agent in env.possible_agents + } + self.env = SingleAgentWrapper(env, opponent) + self.obs, self.info = self.env.reset(seed=instance["seed"]) + self.battle = self.env.env.battle1 + self._DoublesEnv = DoublesEnv + self._slot = 0 # which active slot is being decided (0 or 1) + self._pending = [] # actions already chosen for this turn + self.return_ = 0.0 + self.steps = 0 + self.ended = False + # Deterministic frozen identity: the two team texts (which fully specify + # species, items, abilities, moves, EVs, natures and tera types) plus the + # frozen opponent policy and seed. The engine-parsed battle state is excluded: + # HP, status, item-reveal and team-preview selection are async and not + # reproducible from Python. + self._fingerprint = state_hash({ + "team1": self.instance["team1"], + "team2": self.instance["team2"], + "opponent_policy": self.instance["opponent_policy"], + "seed": self.instance["seed"], + }) + self._wait_for_battle() + + def _wait_for_battle(self, timeout: float = 60.0): + # The random team preview (choose_on_teampreview=False) resolves on the + # poke-env loop asynchronously; block until the battle is past it so the + # first observation shows active Pokemon and legal actions. + import time + deadline = time.time() + timeout + while time.time() < deadline and self.battle.teampreview: + time.sleep(0.2) + + def spec(self): + return { + "adapter_version": "1.0.0", + "capabilities": Capabilities(images=False, action_mode="text", native_truncation=False).to_dict(), + "action_schema": {"type": "string", "max_length": 4, "pattern": ACTION_PATTERN}, + "observation": "native VGC battle state serialized as JSON; see instruction.md", + "opponent": self.instance["opponent_policy"], + "format": self.instance["battle_format"], + } + + # ------------------------------------------------------------- native action surface + + def _legal_actions(self): + mask = self._DoublesEnv.get_action_mask_individual(self.battle, self._slot) + return [i for i, v in enumerate(mask) if v] + + def _describe_action(self, index): + try: + order = self._DoublesEnv._action_to_order_individual( + np.int64(index), self.battle, False, self._slot + ) + return str(order) + except ValueError: + return f"action {index}" + + def observe(self): + return {"step": self.steps, "done": self.ended, "observation": self._state()} + + def step(self, action): + if self.ended: + raise ValueError("episode closed") + if not re.fullmatch(ACTION_PATTERN, action): + raise ValueError("action must be a single action index") + index = int(action) + legal = self._legal_actions() + if index not in legal: + raise ValueError(f"illegal action index {index} for slot {self._slot}") + self._pending.append(index) + if len(self._pending) < 2: + # first slot decided; ask for the second slot without advancing the game + self._slot = 1 + return Transition(0.0, False, False) + joint = np.array(self._pending, dtype=np.int64) + self._pending = [] + self._slot = 0 + self.obs, reward, terminated, truncated, self.info = self.env.step(joint) + self.steps += 1 + reward = float(reward) if reward is not None else 0.0 + self.return_ += reward + self.ended = bool(terminated or truncated) + return Transition(reward, bool(terminated), bool(truncated)) + + def success(self): + return bool(self.battle.won) + + def metrics(self): + # Called from finalize(), before Harbor collects artifacts, so the replay + # log is captured even though close() runs after the SIGTERM collection. + self._write_replay_log() + win = int(self.success()) + return { + "win": win, + "completion_score": 100 * win, + "native_return": self.return_, + "native_steps": self.steps, + } + + def fingerprint(self): + # Captured at construction, before the auto team preview: both teams' + # species, moves, items, abilities, types and tera types, plus + # turn/weather/fields. The Showdown engine PRNG and the opponent's random + # team-preview selection are excluded (not seedable from Python). + return self._fingerprint + + def frame(self): + """Audit-video transcript of the battle state; not an added observation.""" + state = self._state() + + def pkmn(p): + if p is None: + return "?" + hp = f"{p['hp_fraction'] * 100:.0f}%" if p.get("hp_fraction") is not None else "?%" + status = f" [{p['status']}]" if p.get("status") else "" + item = p.get("item") or "no item" + moves = "/".join(p.get("moves") or []) or "no moves" + return f"{p['species']} {hp}{status} | {item} | {moves}" + + lines = [f"VGC | {self.instance['battle_format']} | turn {state['turn']} | step {self.steps}"] + if state.get("won") is True: + lines.append("RESULT: WON") + elif state.get("lost") is True: + lines.append("RESULT: LOST") + if state.get("weather"): + lines.append("Weather: " + ", ".join(state["weather"])) + if state.get("fields"): + lines.append("Fields: " + ", ".join(state["fields"])) + lines += ["", "== YOUR ACTIVE =="] + [pkmn(p) for p in state["active"]] + lines += ["", "== OPPONENT ACTIVE =="] + [pkmn(p) for p in state["opponent_active"]] + lines += ["", "== YOUR TEAM =="] + [pkmn(p) for p in state["team"]] + lines += ["", "== OPPONENT TEAM =="] + [pkmn(p) for p in state["opponent_team"]] + + text = re.sub(r"[^\x20-\x7e\n]", "?", "\n".join(lines)) + canvas = Image.new("RGB", (960, 640), (245, 246, 248)) + draw = ImageDraw.Draw(canvas) + wrapped = [] + for line in text.splitlines(): + wrapped.extend(textwrap.wrap(line, width=130) or [""]) + draw.multiline_text((20, 18), "\n".join(wrapped[:46]), fill=(20, 25, 35), spacing=3) + return np.asarray(canvas) + + def close(self): + self._write_replay_log() + self.env.close() + + def _write_replay_log(self): + # Best-effort evidence: the raw Showdown protocol log, which the official + # replay viewer renders as an interactive HTML battle page. + try: + from pathlib import Path + Path("/data").mkdir(parents=True, exist_ok=True) + Path("/data/replay.log").write_text(self.battle._build_replay_log() + "\n") + except Exception: + pass + + # ------------------------------------------------------------------ serialization + + def _pokemon(self, p): + if p is None: + return None + return { + "species": p.base_species, + "hp_fraction": round(float(p.current_hp_fraction), 4), + "status": p.status.name if p.status is not None else None, + "ability": p.ability, + "item": p.item, + "moves": sorted(m.id for m in p.moves.values()), + "types": sorted(t.name for t in p.types), + "tera_type": p.tera_type.name if p.tera_type is not None else None, + "fainted": bool(p.fainted), + } + + def _team(self, team): + states = [self._pokemon(p) for p in team.values() if p is not None] + return sorted(states, key=lambda s: s["species"]) + + def _battle_state(self): + b = self.battle + return { + "turn": int(b.turn), + "team": self._team(b.team), + "opponent_team": self._team(b.opponent_team), + "weather": sorted(w.name for w in b.weather), + "fields": sorted(f.name for f in b.fields), + "active": [self._pokemon(p) for p in b.active_pokemon], + "opponent_active": [self._pokemon(p) for p in b.opponent_active_pokemon], + } + + def _state(self): + """Player-visible battle state plus the numbered legal actions for the + current decision slot.""" + b = self.battle + state = self._battle_state() + state["won"] = b.won + state["lost"] = b.lost + state["slot"] = self._slot + state["available_actions"] = [ + f"{i}: {self._describe_action(i)}" for i in self._legal_actions() + ] + return state diff --git a/game_first_exam/benchmarks/vgc/data/abilities.json b/game_first_exam/benchmarks/vgc/data/abilities.json new file mode 100644 index 0000000..68d4a8c --- /dev/null +++ b/game_first_exam/benchmarks/vgc/data/abilities.json @@ -0,0 +1 @@ +["null", "", "noability", "adaptability", "aerilate", "aftermath", "airlock", "analytic", "angerpoint", "angershell", "anticipation", "arenatrap", "armortail", "aromaveil", "asoneglastrier", "asonespectrier", "aurabreak", "baddreams", "ballfetch", "battery", "battlearmor", "battlebond", "beadsofruin", "beastboost", "berserk", "bigpecks", "blaze", "bulletproof", "cheekpouch", "chillingneigh", "chlorophyll", "clearbody", "cloudnine", "colorchange", "comatose", "commander", "competitive", "compoundeyes", "contrary", "corrosion", "costar", "cottondown", "cudchew", "curiousmedicine", "cursedbody", "cutecharm", "damp", "dancer", "darkaura", "dauntlessshield", "dazzling", "defeatist", "defiant", "deltastream", "desolateland", "disguise", "download", "dragonize", "dragonsmaw", "drizzle", "drought", "dryskin", "earlybird", "eartheater", "eelevate", "effectspore", "electricsurge", "electromorphosis", "embodyaspectcornerstone", "embodyaspecthearthflame", "embodyaspectteal", "embodyaspectwellspring", "emergencyexit", "fairyaura", "filter", "firemane", "flamebody", "flareboost", "flashfire", "flowergift", "flowerveil", "fluffy", "forecast", "forewarn", "friendguard", "frisk", "fullmetalbody", "furcoat", "galewings", "galvanize", "gluttony", "goodasgold", "gooey", "gorillatactics", "grasspelt", "grassysurge", "grimneigh", "guarddog", "gulpmissile", "guts", "hadronengine", "harvest", "healer", "heatproof", "heavymetal", "honeygather", "hospitality", "hugepower", "hungerswitch", "hustle", "hydration", "hypercutter", "icebody", "iceface", "icescales", "illuminate", "illusion", "immunity", "imposter", "infiltrator", "innardsout", "innerfocus", "insomnia", "intimidate", "intrepidsword", "ironbarbs", "ironfist", "justified", "keeneye", "klutz", "leafguard", "levitate", "libero", "lightmetal", "lightningrod", "limber", "lingeringaroma", "liquidooze", "liquidvoice", "longreach", "magicbounce", "magicguard", "magician", "magmaarmor", "magnetpull", "marvelscale", "megalauncher", "megasol", "merciless", "mimicry", "mindseye", "minus", "mirrorarmor", "mistysurge", "moldbreaker", "moody", "motordrive", "moxie", "multiscale", "multitype", "mummy", "myceliummight", "naturalcure", "neuroforce", "neutralizinggas", "noguard", "normalize", "oblivious", "opportunist", "orichalcumpulse", "overcoat", "overgrow", "owntempo", "parentalbond", "pastelveil", "perishbody", "pickpocket", "pickup", "piercingdrill", "pixilate", "plus", "poisonheal", "poisonpoint", "poisonpuppeteer", "poisontouch", "powerconstruct", "powerofalchemy", "powerspot", "prankster", "pressure", "primordialsea", "prismarmor", "propellertail", "protean", "protosynthesis", "psychicsurge", "punkrock", "purepower", "purifyingsalt", "quarkdrive", "queenlymajesty", "quickdraw", "quickfeet", "raindish", "rattled", "receiver", "reckless", "refrigerate", "regenerator", "ripen", "rivalry", "rkssystem", "rockhead", "rockypayload", "roughskin", "runaway", "sandforce", "sandrush", "sandspit", "sandstream", "sandveil", "sapsipper", "schooling", "scrappy", "screencleaner", "seedsower", "serenegrace", "shadowshield", "shadowtag", "sharpness", "shedskin", "sheerforce", "shellarmor", "shielddust", "shieldsdown", "simple", "skilllink", "slowstart", "slushrush", "sniper", "snowcloak", "snowwarning", "solarpower", "solidrock", "soulheart", "soundproof", "speedboost", "spicyspray", "stakeout", "stall", "stalwart", "stamina", "stancechange", "static", "steadfast", "steamengine", "steelworker", "steelyspirit", "stench", "stickyhold", "stormdrain", "strongjaw", "sturdy", "suctioncups", "superluck", "supersweetsyrup", "supremeoverlord", "surgesurfer", "swarm", "sweetveil", "swiftswim", "swordofruin", "symbiosis", "synchronize", "tabletsofruin", "tangledfeet", "tanglinghair", "technician", "telepathy", "teraformzero", "terashell", "terashift", "teravolt", "thermalexchange", "thickfat", "tintedlens", "torrent", "toughclaws", "toxicboost", "toxicchain", "toxicdebris", "trace", "transistor", "triage", "truant", "turboblaze", "unaware", "unburden", "unnerve", "unseenfist", "vesselofruin", "victorystar", "vitalspirit", "voltabsorb", "wanderingspirit", "waterabsorb", "waterbubble", "watercompaction", "waterveil", "weakarmor", "wellbakedbody", "whitesmoke", "wimpout", "windpower", "windrider", "wonderguard", "wonderskin", "zenmode", "zerotohero", "mountaineer", "rebound", "persistent"] \ No newline at end of file diff --git a/game_first_exam/benchmarks/vgc/data/items.json b/game_first_exam/benchmarks/vgc/data/items.json new file mode 100644 index 0000000..29d2fef --- /dev/null +++ b/game_first_exam/benchmarks/vgc/data/items.json @@ -0,0 +1 @@ +["null", "", "unknown_item", "abilityshield", "abomasite", "absolite", "absolitez", "absorbbulb", "adamantcrystal", "adamantorb", "adrenalineorb", "aerodactylite", "aggronite", "aguavberry", "airballoon", "alakazite", "aloraichiumz", "altarianite", "ampharosite", "apicotberry", "armorfossil", "aspearberry", "assaultvest", "audinite", "auspiciousarmor", "babiriberry", "banettite", "barbaracite", "baxcalibrite", "beastball", "beedrillite", "belueberry", "berryjuice", "berrysweet", "bignugget", "bigroot", "bindingband", "blackbelt", "blackglasses", "blacksludge", "blastoisinite", "blazikenite", "blueorb", "blukberry", "blunderpolicy", "boosterenergy", "bottlecap", "brightpowder", "buggem", "buginiumz", "bugmemory", "burndrive", "cameruptite", "cellbattery", "chandelurite", "charcoal", "charizarditex", "charizarditey", "chartiberry", "cheriberry", "cherishball", "chesnaughtite", "chestoberry", "chilanberry", "chilldrive", "chimechite", "chippedpot", "choiceband", "choicescarf", "choicespecs", "chopleberry", "clawfossil", "clearamulet", "clefablite", "cloversweet", "cobaberry", "colburberry", "cornerstonemask", "cornnberry", "coverfossil", "covertcloak", "crabominite", "crackedpot", "custapberry", "damprock", "darkgem", "darkiniumz", "darkmemory", "darkranite", "dawnstone", "decidiumz", "deepseascale", "deepseatooth", "delphoxite", "destinyknot", "diancite", "diveball", "domefossil", "dousedrive", "dracoplate", "dragalgite", "dragonfang", "dragongem", "dragoninite", "dragoniumz", "dragonmemory", "dragonscale", "drampanite", "dreadplate", "dreamball", "dubiousdisc", "durinberry", "duskball", "duskstone", "earthplate", "eelektrossite", "eeviumz", "ejectbutton", "ejectpack", "electirizer", "electricgem", "electricmemory", "electricseed", "electriumz", "emboarite", "enigmaberry", "eviolite", "excadrite", "expertbelt", "fairiumz", "fairyfeather", "fairygem", "fairymemory", "falinksite", "fastball", "feraligite", "fightinggem", "fightingmemory", "fightiniumz", "figyberry", "firegem", "firememory", "firestone", "firiumz", "fistplate", "flameorb", "flameplate", "floatstone", "floettite", "flowersweet", "flyinggem", "flyingmemory", "flyiniumz", "focusband", "focussash", "fossilizedbird", "fossilizeddino", "fossilizeddrake", "fossilizedfish", "friendball", "froslassite", "fullincense", "galaricacuff", "galaricawreath", "galladite", "ganlonberry", "garchompite", "garchompitez", "gardevoirite", "gengarite", "ghostgem", "ghostiumz", "ghostmemory", "glalitite", "glimmoranite", "goldbottlecap", "golisopite", "golurkite", "grassgem", "grassiumz", "grassmemory", "grassyseed", "greatball", "greninjite", "grepaberry", "gripclaw", "griseouscore", "griseousorb", "groundgem", "groundiumz", "groundmemory", "gyaradosite", "habanberry", "hardstone", "hawluchanite", "healball", "hearthflamemask", "heatranite", "heatrock", "heavyball", "heavydutyboots", "helixfossil", "heracronite", "hondewberry", "houndoominite", "iapapaberry", "icegem", "icememory", "icestone", "icicleplate", "iciumz", "icyrock", "inciniumz", "insectplate", "ironball", "ironplate", "jabocaberry", "jawfossil", "kangaskhanite", "kasibberry", "kebiaberry", "keeberry", "kelpsyberry", "kingsrock", "kommoniumz", "laggingtail", "lansatberry", "latiasite", "latiosite", "laxincense", "leafstone", "leek", "leftovers", "leppaberry", "levelball", "liechiberry", "lifeorb", "lightball", "lightclay", "loadeddice", "lopunnite", "loveball", "lovesweet", "lucarionite", "lucarionitez", "luckypunch", "lumberry", "luminousmoss", "lunaliumz", "lureball", "lustrousglobe", "lustrousorb", "luxuryball", "lycaniumz", "machobrace", "magearnite", "magmarizer", "magnet", "magoberry", "magostberry", "mail", "malamarite", "maliciousarmor", "manectite", "marangaberry", "marshadiumz", "masterball", "masterpieceteacup", "mawilite", "meadowplate", "medichamite", "meganiumite", "mentalherb", "meowsticite", "metagrossite", "metalalloy", "metalcoat", "metalpowder", "metronome", "mewniumz", "mewtwonitex", "mewtwonitey", "micleberry", "mimikiumz", "mindplate", "miracleseed", "mirrorherb", "mistyseed", "moonball", "moonstone", "muscleband", "mysticwater", "nanabberry", "nestball", "netball", "nevermeltice", "nomelberry", "normalgem", "normaliumz", "occaberry", "oddincense", "oldamber", "oranberry", "ovalstone", "pamtreberry", "parkball", "passhoberry", "payapaberry", "pechaberry", "persimberry", "petayaberry", "pidgeotite", "pikaniumz", "pikashuniumz", "pinapberry", "pinsirite", "pixieplate", "plumefossil", "poisonbarb", "poisongem", "poisoniumz", "poisonmemory", "pokeball", "pomegberry", "poweranklet", "powerband", "powerbelt", "powerbracer", "powerherb", "powerlens", "powerweight", "premierball", "prettyfeather", "primariumz", "prismscale", "protectivepads", "protector", "psychicgem", "psychicmemory", "psychicseed", "psychiumz", "punchingglove", "pyroarite", "qualotberry", "quickball", "quickclaw", "quickpowder", "rabutaberry", "raichunitex", "raichunitey", "rarebone", "rawstberry", "razorclaw", "razorfang", "razzberry", "reapercloth", "redcard", "redorb", "repeatball", "ribbonsweet", "rindoberry", "ringtarget", "rockgem", "rockincense", "rockiumz", "rockmemory", "rockyhelmet", "roomservice", "rootfossil", "roseincense", "roseliberry", "rowapberry", "rustedshield", "rustedsword", "sablenite", "sachet", "safariball", "safetygoggles", "sailfossil", "salacberry", "salamencite", "sceptilite", "scizorite", "scolipite", "scopelens", "scovillainite", "scraftinite", "seaincense", "sharpbeak", "sharpedonite", "shedshell", "shellbell", "shinystone", "shockdrive", "shucaberry", "silkscarf", "silverpowder", "sitrusberry", "skarmorite", "skullfossil", "skyplate", "slowbronite", "smoothrock", "snorliumz", "snowball", "softsand", "solganiumz", "souldew", "spelltag", "spelonberry", "splashplate", "spookyplate", "sportball", "staraptite", "starfberry", "starminite", "starsweet", "steelgem", "steeliumz", "steelixite", "steelmemory", "stick", "stickybarb", "stoneplate", "strangeball", "strawberrysweet", "sunstone", "swampertite", "sweetapple", "syrupyapple", "tamatoberry", "tangaberry", "tapuniumz", "tartapple", "tatsugirinite", "terrainextender", "thickclub", "throatspray", "thunderstone", "timerball", "toxicorb", "toxicplate", "tr00", "tr01", "tr02", "tr03", "tr04", "tr05", "tr06", "tr07", "tr08", "tr09", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", "tr16", "tr17", "tr18", "tr19", "tr20", "tr21", "tr22", "tr23", "tr24", "tr25", "tr26", "tr27", "tr28", "tr29", "tr30", "tr31", "tr32", "tr33", "tr34", "tr35", "tr36", "tr37", "tr38", "tr39", "tr40", "tr41", "tr42", "tr43", "tr44", "tr45", "tr46", "tr47", "tr48", "tr49", "tr50", "tr51", "tr52", "tr53", "tr54", "tr55", "tr56", "tr57", "tr58", "tr59", "tr60", "tr61", "tr62", "tr63", "tr64", "tr65", "tr66", "tr67", "tr68", "tr69", "tr70", "tr71", "tr72", "tr73", "tr74", "tr75", "tr76", "tr77", "tr78", "tr79", "tr80", "tr81", "tr82", "tr83", "tr84", "tr85", "tr86", "tr87", "tr88", "tr89", "tr90", "tr91", "tr92", "tr93", "tr94", "tr95", "tr96", "tr97", "tr98", "tr99", "twistedspoon", "tyranitarite", "ultraball", "ultranecroziumz", "unremarkableteacup", "upgrade", "utilityumbrella", "venusaurite", "victreebelite", "wacanberry", "watergem", "wateriumz", "watermemory", "waterstone", "watmelberry", "waveincense", "weaknesspolicy", "wellspringmask", "wepearberry", "whippeddream", "whiteherb", "widelens", "wikiberry", "wiseglasses", "yacheberry", "zapplate", "zeraorite", "zoomlens", "zygardite", "berry", "berserkgene", "bitterberry", "burntberry", "goldberry", "iceberry", "mintberry", "miracleberry", "mysteryberry", "pinkbow", "polkadotbow", "przcureberry", "psncureberry", "crucibellite", "vilevial"] \ No newline at end of file diff --git a/game_first_exam/benchmarks/vgc/data/moves.json b/game_first_exam/benchmarks/vgc/data/moves.json new file mode 100644 index 0000000..2037fe3 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/data/moves.json @@ -0,0 +1 @@ +["no move", "10000000voltthunderbolt", "absorb", "accelerock", "acid", "acidarmor", "aciddownpour", "acidspray", "acrobatics", "acupressure", "aerialace", "aeroblast", "afteryou", "agility", "aircutter", "airslash", "alloutpummeling", "alluringvoice", "allyswitch", "amnesia", "anchorshot", "ancientpower", "appleacid", "aquacutter", "aquajet", "aquaring", "aquastep", "aquatail", "armorcannon", "armthrust", "aromatherapy", "aromaticmist", "assist", "assurance", "astonish", "astralbarrage", "attackorder", "attract", "aurasphere", "aurawheel", "aurorabeam", "auroraveil", "autotomize", "avalanche", "axekick", "babydolleyes", "baddybad", "banefulbunker", "barbbarrage", "barrage", "barrier", "batonpass", "beakblast", "beatup", "behemothbash", "behemothblade", "belch", "bellydrum", "bestow", "bide", "bind", "bite", "bitterblade", "bittermalice", "blackholeeclipse", "blastburn", "blazekick", "blazingtorque", "bleakwindstorm", "blizzard", "block", "bloodmoon", "bloomdoom", "blueflare", "bodypress", "bodyslam", "boltbeak", "boltstrike", "boneclub", "bonemerang", "bonerush", "boomburst", "bounce", "bouncybubble", "branchpoke", "bravebird", "breakingswipe", "breakneckblitz", "brickbreak", "brine", "brutalswing", "bubble", "bubblebeam", "bugbite", "bugbuzz", "bulkup", "bulldoze", "bulletpunch", "bulletseed", "burningbulwark", "burningjealousy", "burnup", "buzzybuzz", "calmmind", "camouflage", "captivate", "catastropika", "ceaselessedge", "celebrate", "charge", "chargebeam", "charm", "chatter", "chillingwater", "chillyreception", "chipaway", "chloroblast", "circlethrow", "clamp", "clangingscales", "clangoroussoul", "clangoroussoulblaze", "clearsmog", "closecombat", "coaching", "coil", "collisioncourse", "combattorque", "cometpunch", "comeuppance", "confide", "confuseray", "confusion", "constrict", "continentalcrush", "conversion", "conversion2", "copycat", "coreenforcer", "corkscrewcrash", "corrosivegas", "cosmicpower", "cottonguard", "cottonspore", "counter", "courtchange", "covet", "crabhammer", "craftyshield", "crosschop", "crosspoison", "crunch", "crushclaw", "crushgrip", "curse", "cut", "darkestlariat", "darkpulse", "darkvoid", "dazzlinggleam", "decorate", "defendorder", "defensecurl", "defog", "destinybond", "detect", "devastatingdrake", "diamondstorm", "dig", "direclaw", "disable", "disarmingvoice", "discharge", "dive", "dizzypunch", "doodle", "doomdesire", "doubleedge", "doublehit", "doubleironbash", "doublekick", "doubleshock", "doubleslap", "doubleteam", "dracometeor", "dragonascent", "dragonbreath", "dragoncheer", "dragonclaw", "dragondance", "dragondarts", "dragonenergy", "dragonhammer", "dragonpulse", "dragonrage", "dragonrush", "dragontail", "drainingkiss", "drainpunch", "dreameater", "drillpeck", "drillrun", "drumbeating", "dualchop", "dualwingbeat", "dynamaxcannon", "dynamicpunch", "earthpower", "earthquake", "echoedvoice", "eerieimpulse", "eeriespell", "eggbomb", "electricterrain", "electrify", "electroball", "electrodrift", "electroshot", "electroweb", "embargo", "ember", "encore", "endeavor", "endure", "energyball", "entrainment", "eruption", "esperwing", "eternabeam", "expandingforce", "explosion", "extrasensory", "extremeevoboost", "extremespeed", "facade", "fairylock", "fairywind", "fakeout", "faketears", "falsesurrender", "falseswipe", "featherdance", "feint", "feintattack", "fellstinger", "ficklebeam", "fierydance", "fierywrath", "filletaway", "finalgambit", "fireblast", "firefang", "firelash", "firepledge", "firepunch", "firespin", "firstimpression", "fishiousrend", "fissure", "flail", "flameburst", "flamecharge", "flamethrower", "flamewheel", "flareblitz", "flash", "flashcannon", "flatter", "fleurcannon", "fling", "flipturn", "floatyfall", "floralhealing", "flowershield", "flowertrick", "fly", "flyingpress", "focusblast", "focusenergy", "focuspunch", "followme", "forcepalm", "foresight", "forestscurse", "foulplay", "freezedry", "freezeshock", "freezingglare", "freezyfrost", "frenzyplant", "frostbreath", "frustration", "furyattack", "furycutter", "furyswipes", "fusionbolt", "fusionflare", "futuresight", "gastroacid", "geargrind", "gearup", "genesissupernova", "geomancy", "gigadrain", "gigaimpact", "gigatonhammer", "gigavolthavoc", "glaciallance", "glaciate", "glaiverush", "glare", "glitzyglow", "gmaxbefuddle", "gmaxcannonade", "gmaxcentiferno", "gmaxchistrike", "gmaxcuddle", "gmaxdepletion", "gmaxdrumsolo", "gmaxfinale", "gmaxfireball", "gmaxfoamburst", "gmaxgoldrush", "gmaxgravitas", "gmaxhydrosnipe", "gmaxmalodor", "gmaxmeltdown", "gmaxoneblow", "gmaxrapidflow", "gmaxreplenish", "gmaxresonance", "gmaxsandblast", "gmaxsmite", "gmaxsnooze", "gmaxsteelsurge", "gmaxstonesurge", "gmaxstunshock", "gmaxsweetness", "gmaxtartness", "gmaxterror", "gmaxvinelash", "gmaxvolcalith", "gmaxvoltcrash", "gmaxwildfire", "gmaxwindrage", "grassknot", "grasspledge", "grasswhistle", "grassyglide", "grassyterrain", "gravapple", "gravity", "growl", "growth", "grudge", "guardianofalola", "guardsplit", "guardswap", "guillotine", "gunkshot", "gust", "gyroball", "hail", "hammerarm", "happyhour", "harden", "hardpress", "haze", "headbutt", "headcharge", "headlongrush", "headsmash", "healbell", "healblock", "healingwish", "healorder", "healpulse", "heartstamp", "heartswap", "heatcrash", "heatwave", "heavyslam", "helpinghand", "hex", "hiddenpower", "hiddenpowerbug", "hiddenpowerdark", "hiddenpowerdragon", "hiddenpowerelectric", "hiddenpowerfighting", "hiddenpowerfire", "hiddenpowerflying", "hiddenpowerghost", "hiddenpowergrass", "hiddenpowerground", "hiddenpowerice", "hiddenpowerpoison", "hiddenpowerpsychic", "hiddenpowerrock", "hiddenpowersteel", "hiddenpowerwater", "highhorsepower", "highjumpkick", "holdback", "holdhands", "honeclaws", "hornattack", "horndrill", "hornleech", "howl", "hurricane", "hydrocannon", "hydropump", "hydrosteam", "hydrovortex", "hyperbeam", "hyperdrill", "hyperfang", "hyperspacefury", "hyperspacehole", "hypervoice", "hypnosis", "iceball", "icebeam", "iceburn", "icefang", "icehammer", "icepunch", "iceshard", "icespinner", "iciclecrash", "iciclespear", "icywind", "imprison", "incinerate", "infernalparade", "inferno", "infernooverdrive", "infestation", "ingrain", "instruct", "iondeluge", "irondefense", "ironhead", "irontail", "ivycudgel", "jawlock", "jetpunch", "judgment", "jumpkick", "junglehealing", "karatechop", "kinesis", "kingsshield", "knockoff", "kowtowcleave", "landswrath", "laserfocus", "lashout", "lastresort", "lastrespects", "lavaplume", "leafage", "leafblade", "leafstorm", "leaftornado", "leechlife", "leechseed", "leer", "letssnuggleforever", "lick", "lifedew", "lightofruin", "lightscreen", "lightthatburnsthesky", "liquidation", "lockon", "lovelykiss", "lowkick", "lowsweep", "luckychant", "luminacrash", "lunarblessing", "lunardance", "lunge", "lusterpurge", "machpunch", "magicalleaf", "magicaltorque", "magiccoat", "magicpowder", "magicroom", "magmastorm", "magnetbomb", "magneticflux", "magnetrise", "magnitude", "makeitrain", "maliciousmoonsault", "malignantchain", "matblock", "matchagotcha", "maxairstream", "maxdarkness", "maxflare", "maxflutterby", "maxgeyser", "maxguard", "maxhailstorm", "maxknuckle", "maxlightning", "maxmindstorm", "maxooze", "maxovergrowth", "maxphantasm", "maxquake", "maxrockfall", "maxstarfall", "maxsteelspike", "maxstrike", "maxwyrmwind", "meanlook", "meditate", "mefirst", "megadrain", "megahorn", "megakick", "megapunch", "memento", "menacingmoonrazemaelstrom", "metalburst", "metalclaw", "metalsound", "meteorassault", "meteorbeam", "meteormash", "metronome", "mightycleave", "milkdrink", "mimic", "mindblown", "mindreader", "minimize", "miracleeye", "mirrorcoat", "mirrormove", "mirrorshot", "mist", "mistball", "mistyexplosion", "mistyterrain", "moonblast", "moongeistbeam", "moonlight", "morningsun", "mortalspin", "mountaingale", "mudbomb", "muddywater", "mudshot", "mudslap", "mudsport", "multiattack", "mysticalfire", "mysticalpower", "nastyplot", "naturalgift", "naturepower", "naturesmadness", "needlearm", "neverendingnightmare", "nightdaze", "nightmare", "nightshade", "nightslash", "nihillight", "nobleroar", "noretreat", "noxioustorque", "nuzzle", "oblivionwing", "obstruct", "oceanicoperetta", "octazooka", "octolock", "odorsleuth", "ominouswind", "orderup", "originpulse", "outrage", "overdrive", "overheat", "painsplit", "paraboliccharge", "partingshot", "payback", "payday", "peck", "perishsong", "petalblizzard", "petaldance", "phantomforce", "photongeyser", "pikapapow", "pinmissile", "plasmafists", "playnice", "playrough", "pluck", "poisonfang", "poisongas", "poisonjab", "poisonpowder", "poisonsting", "poisontail", "pollenpuff", "poltergeist", "populationbomb", "pounce", "pound", "powder", "powdersnow", "powergem", "powershift", "powersplit", "powerswap", "powertrick", "powertrip", "poweruppunch", "powerwhip", "precipiceblades", "present", "prismaticlaser", "protect", "psybeam", "psyblade", "psychic", "psychicfangs", "psychicnoise", "psychicterrain", "psychoboost", "psychocut", "psychoshift", "psychup", "psyshieldbash", "psyshock", "psystrike", "psywave", "pulverizingpancake", "punishment", "purify", "pursuit", "pyroball", "quash", "quickattack", "quickguard", "quiverdance", "rage", "ragefist", "ragepowder", "ragingbull", "ragingfury", "raindance", "rapidspin", "razorleaf", "razorshell", "razorwind", "recover", "recycle", "reflect", "reflecttype", "refresh", "relicsong", "rest", "retaliate", "return", "revelationdance", "revenge", "reversal", "revivalblessing", "risingvoltage", "roar", "roaroftime", "rockblast", "rockclimb", "rockpolish", "rockslide", "rocksmash", "rockthrow", "rocktomb", "rockwrecker", "roleplay", "rollingkick", "rollout", "roost", "rototiller", "round", "ruination", "sacredfire", "sacredsword", "safeguard", "saltcure", "sandattack", "sandsearstorm", "sandstorm", "sandtomb", "sappyseed", "savagespinout", "scald", "scaleshot", "scaryface", "scorchingsands", "scratch", "screech", "searingshot", "searingsunrazesmash", "secretpower", "secretsword", "seedbomb", "seedflare", "seismictoss", "selfdestruct", "shadowball", "shadowbone", "shadowclaw", "shadowforce", "shadowpunch", "shadowsneak", "sharpen", "shatteredpsyche", "shedtail", "sheercold", "shellsidearm", "shellsmash", "shelltrap", "shelter", "shiftgear", "shockwave", "shoreup", "signalbeam", "silktrap", "silverwind", "simplebeam", "sing", "sinisterarrowraid", "sizzlyslide", "sketch", "skillswap", "skittersmack", "skullbash", "skyattack", "skydrop", "skyuppercut", "slackoff", "slam", "slash", "sleeppowder", "sleeptalk", "sludge", "sludgebomb", "sludgewave", "smackdown", "smartstrike", "smellingsalts", "smog", "smokescreen", "snaptrap", "snarl", "snatch", "snipeshot", "snore", "snowscape", "soak", "softboiled", "solarbeam", "solarblade", "sonicboom", "soulstealing7starstrike", "spacialrend", "spark", "sparklingaria", "sparklyswirl", "spectralthief", "speedswap", "spicyextract", "spiderweb", "spikecannon", "spikes", "spikyshield", "spinout", "spiritbreak", "spiritshackle", "spite", "spitup", "splash", "splinteredstormshards", "splishysplash", "spore", "spotlight", "springtidestorm", "stealthrock", "steameruption", "steamroller", "steelbeam", "steelroller", "steelwing", "stickyweb", "stockpile", "stokedsparksurfer", "stomp", "stompingtantrum", "stoneaxe", "stoneedge", "storedpower", "stormthrow", "strangesteam", "strength", "strengthsap", "stringshot", "struggle", "strugglebug", "stuffcheeks", "stunspore", "submission", "substitute", "subzeroslammer", "suckerpunch", "sunnyday", "sunsteelstrike", "supercellslam", "superfang", "superpower", "supersonic", "supersonicskystrike", "surf", "surgingstrikes", "swagger", "swallow", "sweetkiss", "sweetscent", "swift", "switcheroo", "swordsdance", "synchronoise", "synthesis", "syrupbomb", "tachyoncutter", "tackle", "tailglow", "tailslap", "tailwhip", "tailwind", "takedown", "takeheart", "tarshot", "taunt", "tearfullook", "teatime", "technoblast", "tectonicrage", "teeterdance", "telekinesis", "teleport", "temperflare", "terablast", "terastarstorm", "terrainpulse", "thief", "thousandarrows", "thousandwaves", "thrash", "throatchop", "thunder", "thunderbolt", "thundercage", "thunderclap", "thunderfang", "thunderouskick", "thunderpunch", "thundershock", "thunderwave", "tickle", "tidyup", "topsyturvy", "torchsong", "torment", "toxic", "toxicspikes", "toxicthread", "trailblaze", "transform", "triattack", "trick", "trickortreat", "trickroom", "triplearrows", "tripleaxel", "tripledive", "triplekick", "tropkick", "trumpcard", "twinbeam", "twineedle", "twinkletackle", "twister", "upperhand", "uproar", "uturn", "vacuumwave", "vcreate", "veeveevolley", "venomdrench", "venoshock", "victorydance", "vinewhip", "visegrip", "vitalthrow", "voltswitch", "volttackle", "wakeupslap", "waterfall", "watergun", "waterpledge", "waterpulse", "watershuriken", "watersport", "waterspout", "wavecrash", "weatherball", "whirlpool", "whirlwind", "wickedblow", "wickedtorque", "wideguard", "wildboltstorm", "wildcharge", "willowisp", "wingattack", "wish", "withdraw", "wonderroom", "woodhammer", "workup", "worryseed", "wrap", "wringout", "xscissor", "yawn", "zapcannon", "zenheadbutt", "zingzap", "zippyzap", "paleowave", "shadowstrike", "polarflare"] \ No newline at end of file diff --git a/game_first_exam/benchmarks/vgc/instance_schema.py b/game_first_exam/benchmarks/vgc/instance_schema.py new file mode 100644 index 0000000..d285989 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/instance_schema.py @@ -0,0 +1,64 @@ +"""Trusted VGC configuration; no native engine imports. + +The frozen instance pins one regulation, both teams, the fixed opponent policy and +the engine versions. Unknown fields, profiles, opponents or reducers are rejected +before any engine is constructed. +""" +from config_schema import validate_engine_versions + +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vgc' + +# Game-specific instance fields beyond the common set (config_schema.COMMON). +FIELDS = { + 'reg', + 'team1', + 'team2', + 'opponent_policy', + 'engine_versions', + 'engine_commit', + 'battle_format', +} + +METRICS = {'win', 'completion_score', 'native_return', 'native_steps'} + +# One observation profile for now: the native 12-chunk vector, JSON-serialized. +PROFILES = {'native-vector-v1'} + +REDUCERS = {('family_macro', '1.0.0')} + +REGS = {'ma', 'mb'} +OPPONENTS = {'random', 'max_base_power', 'simple_heuristics', 'bc'} +FORMATS = { + 'ma': 'gen9championsvgc2026regma', + 'mb': 'gen9championsvgc2026regmb', +} + +# Pin the poke-env fork and engine. Fill after a clean install (pip freeze / importlib.metadata). +# Expected values are exact strings; see SOURCE.json for the upstream commit. +ENGINE_VERSIONS = { + 'poke-env': '0.15.0', +} +ENGINE_COMMIT = '379a04628e42b2a2c94790c0788204b652f7ae1b' + + +def validate(value): + if value['reg'] not in REGS: + raise ValueError('unsupported VGC regulation') + if value['battle_format'] != FORMATS[value['reg']]: + raise ValueError('battle_format disagrees with regulation') + if value['opponent_policy'] not in OPPONENTS: + raise ValueError('unsupported opponent policy') + for key in ('team1', 'team2'): + if not isinstance(value[key], str) or not value[key].strip(): + raise ValueError(f'{key} must be a nonempty Showdown team string') + if value['team1'].strip() == value['team2'].strip(): + raise ValueError('mirror matchup is not a distinct frozen instance') + validate_engine_versions(value['engine_versions'], ENGINE_VERSIONS) + if value['engine_commit'] != ENGINE_COMMIT: + raise ValueError('unsupported poke-env fork commit') + # standard mode has no public action cap beyond the native battle turn limit. + if value['max_steps'] is not None: + raise ValueError('preserve the native battle limit without an extra action cap') + if value['capabilities']['action_mode'] != 'text': + raise ValueError('VGC joint actions use the text action grammar') diff --git a/game_first_exam/benchmarks/vgc/metric_rules.py b/game_first_exam/benchmarks/vgc/metric_rules.py new file mode 100644 index 0000000..ea9285c --- /dev/null +++ b/game_first_exam/benchmarks/vgc/metric_rules.py @@ -0,0 +1,24 @@ +"""Check VGC win/loss evidence against the trusted live verdict.""" +import math + + +def validate_metrics(final, instance): + metrics = final['metrics'] + win = metrics.get('win') + if type(win) is not int or win not in (0, 1): + raise ValueError('invalid native win flag') + if final['success'] != bool(win): + raise ValueError('inconsistent success flag') + if 'completion_score' in metrics or instance['metric_spec']['primary'] == 'completion_score': + score = metrics.get('completion_score') + if type(score) is not int or score != 100 * win: + raise ValueError('inconsistent completion score') + if type(metrics.get('native_return')) not in (int, float) or not math.isfinite(metrics['native_return']): + raise ValueError('invalid native return') + if metrics['native_return'] != final['return']: + raise ValueError('inconsistent native return') + # Two submissions (slot 0 + slot 1) advance one native turn, so native_steps is + # half the public step count, not equal to it. + if (type(metrics.get('native_steps')) is not int or metrics['native_steps'] < 0 + or metrics['native_steps'] > final['steps']): + raise ValueError('invalid native action count') diff --git a/game_first_exam/benchmarks/vgc/models/bc_100.zip b/game_first_exam/benchmarks/vgc/models/bc_100.zip new file mode 100644 index 0000000..a97d34a Binary files /dev/null and b/game_first_exam/benchmarks/vgc/models/bc_100.zip differ diff --git a/game_first_exam/benchmarks/vgc/requirements.txt b/game_first_exam/benchmarks/vgc/requirements.txt new file mode 100644 index 0000000..dc2afe3 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/requirements.txt @@ -0,0 +1,12 @@ +# VGC adapter runtime dependencies. poke-env 0.15.0 requires numpy>=2.0.2. +# Pin all transitive deps exactly (pip freeze) after a clean install for full +# reproducibility; the fork reference below is pinned to the vgc-bench commit. +# torch is CPU-only: the BC opponent runs inference on the CPU (no CUDA in the sim). +--extra-index-url https://download.pytorch.org/whl/cpu +numpy==2.0.2 +pillow==10.4.0 +imageio==2.37.0 +imageio-ffmpeg==0.6.0 +torch==2.12.0+cpu +stable-baselines3==2.8.0 +poke-env @ git+https://github.com/cameronangliss/poke-env.git@379a04628e42b2a2c94790c0788204b652f7ae1b diff --git a/game_first_exam/benchmarks/vgc/teams/README.md b/game_first_exam/benchmarks/vgc/teams/README.md new file mode 100644 index 0000000..551466c --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/README.md @@ -0,0 +1,17 @@ +# VGC exam team pool + +The 64 "unseen" evaluation teams, frozen from VGC-Bench (`cameronangliss/vgc-bench`). + +## Selection (matches VGC-Bench generalization test) + +- Regulation: `reg_ma` (`gen9championsvgc2026regma`), 752 team files total. +- `random.Random(run_id).shuffle(range(752))` with `run_id = 1`, then take the **last 64** (`take_from_end=True`), exactly as `vgc_bench/src/teams.py RandomTeamBuilder._select_paths` does for the generalization test. +- Format: multi-line Showdown/pokepaste team text (6 Pokémon blocks), parsed by poke-env's `Teambuilder.parse_showdown_team`. + +## Pairing + +Both sides of a battle draw independently from this pool (mirror matches allowed), matching VGC-Bench's `RandomTeamBuilder.yield_team` (`random.choice`). The smoke instance uses `PC363` (team1) vs `PC253` (team2). + +## Source + +- `teams/reg_ma/*.txt` of `https://github.com/cameronangliss/vgc-bench` (commit `d79f9532947ac114dce1dda2456a590afcd375b2`). diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC100.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC100.txt new file mode 100644 index 0000000..3c1512e --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC100.txt @@ -0,0 +1,59 @@ +Clefable @ Sitrus Berry +Ability: Unaware +Level: 50 +EVs: 32 HP / 32 Def / 1 SpD +Bold Nature +- Follow Me +- Moonblast +- Helping Hand +- Protect + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 1 SpD +Adamant Nature +- Kowtow Cleave +- Swords Dance +- Sucker Punch +- Protect + +Sneasler @ Focus Sash +Ability: Unburden +Level: 50 +EVs: 32 Atk / 1 Def / 32 Spe +Jolly Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Dragonite @ Lum Berry +Ability: Multiscale +Level: 50 +EVs: 32 Atk / 1 SpD / 32 Spe +Adamant Nature +- Scale Shot +- Extreme Speed +- Haze +- Protect + +Delphox @ Delphoxite +Ability: Blaze +Level: 50 +EVs: 1 Def / 32 SpA / 32 Spe +Timid Nature +- Heat Wave +- Psychic +- Substitute +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 1 HP / 28 Atk / 4 Def / 1 SpD / 32 Spe +Adamant Nature +- Flip Turn +- Aqua Jet +- Wave Crash +- Last Respects diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1028.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1028.txt new file mode 100644 index 0000000..8e691d7 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1028.txt @@ -0,0 +1,59 @@ +Charizard @ Charizardite Y +Ability: Solar Power +Level: 50 +EVs: 22 HP / 18 Def / 7 SpA / 19 Spe +Modest Nature +- Heat Wave +- Weather Ball +- Solar Beam +- Protect + +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 16 HP / 11 Atk / 1 Def / 6 SpD / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Wide Guard + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 13 HP / 32 Atk / 21 Spe +Jolly Nature +- Dragon Claw +- Earthquake +- Rock Tomb +- Protect + +Basculegion @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Liquidation +- Aqua Jet +- Last Respects +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 29 Atk / 3 Def / 2 Spe +Adamant Nature +- Kowtow Cleave +- Iron Head +- Sucker Punch +- Low Kick + +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 23 HP / 3 Def / 25 SpA / 15 Spe +Modest Nature +- Hyper Voice +- Moonblast +- Quick Attack +- Detect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1072.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1072.txt new file mode 100644 index 0000000..824b74c --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1072.txt @@ -0,0 +1,59 @@ +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 11 HP / 28 Def / 20 SpA / 7 Spe +Modest Nature +- Hyper Voice +- Quick Attack +- Detect +- Hyper Beam + +Dragonite @ Dragoninite +Ability: Inner Focus +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Dragon Pulse +- Heat Wave +- Thunderbolt +- Tailwind + +Kingambit @ Chople Berry +Ability: Supreme Overlord +Level: 50 +EVs: 32 HP / 15 Atk / 19 Spe +Adamant Nature +- Kowtow Cleave +- Sucker Punch +- Iron Head +- Low Kick + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Last Respects +- Liquidation +- Aqua Jet +- Protect + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 19 HP / 10 Atk / 1 Def / 4 SpD / 32 Spe +Adamant Nature +- Earthquake +- Rock Slide +- Outrage +- Poison Jab + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 26 HP / 24 Def / 16 Spe +Adamant Nature +- Close Combat +- Gunk Shot +- Rock Slide +- Fake Out diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1076.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1076.txt new file mode 100644 index 0000000..3f15f74 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1076.txt @@ -0,0 +1,59 @@ +Kleavor @ Choice Scarf +Ability: Sharpness +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Stone Axe +- Close Combat +- Night Slash +- X-Scissor + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 24 SpD / 10 Spe +Timid Nature +- Super Fang +- Feint +- Follow Me +- Protect + +Snorlax @ Leftovers +Ability: Thick Fat +Level: 50 +EVs: 32 HP / 32 Def / 2 SpD +Impish Nature +- Yawn +- Fissure +- Double-Edge +- Protect + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Last Respects +- Liquidation +- Aqua Jet +- Protect + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Dazzling Gleam +- Moonblast +- Light of Ruin +- Protect + +Zoroark-Hisui @ Colbur Berry +Ability: Illusion +Level: 50 +EVs: 1 HP / 22 SpA / 11 SpD / 32 Spe +Timid Nature +- Bitter Malice +- Psychic +- Flamethrower +- Shadow Sneak diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1079.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1079.txt new file mode 100644 index 0000000..d957b99 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1079.txt @@ -0,0 +1,59 @@ +Archaludon @ Leftovers +Ability: Stamina +Level: 50 +EVs: 30 HP / 30 SpD / 6 Spe +Calm Nature +- Electro Shot +- Flash Cannon +- Dragon Pulse +- Protect + +Pelipper @ Sitrus Berry +Ability: Drizzle +Level: 50 +EVs: 32 HP / 14 Def / 20 SpD +Calm Nature +- Hurricane +- Weather Ball +- Wide Guard +- Tailwind + +Sableye @ Roseli Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 5 Def / 29 SpD +Calm Nature +- Disable +- Encore +- Rain Dance +- Light Screen + +Dragonite @ Dragoninite +Ability: Multiscale +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Hurricane +- Draco Meteor +- Tailwind +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn + +Sneasler @ Focus Sash +Ability: Poison Touch +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Fake Out +- Taunt diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1080.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1080.txt new file mode 100644 index 0000000..20dd3b7 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC1080.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 22 HP / 18 Def / 6 SpA / 20 Spe +Timid Nature +- Draining Kiss +- Dazzling Gleam +- Calm Mind +- Protect + +Maushold-Four @ Focus Sash +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 5 Def / 5 SpD / 24 Spe +Jolly Nature +- Super Fang +- Follow Me +- Taunt +- Protect + +Dragonite @ Dragoninite +Ability: Inner Focus +Level: 50 +EVs: 16 HP / 32 SpA / 6 SpD / 12 Spe +Modest Nature +- Dragon Pulse +- Air Slash +- Flamethrower +- Tailwind + +Archaludon @ Choice Scarf +Ability: Sturdy +Level: 50 +EVs: 32 SpA / 2 SpD / 32 Spe +Timid Nature +- Steel Beam +- Draco Meteor +- Aura Sphere +- Thunderbolt + +Basculegion (M) @ Mystic Water +Ability: Adaptability +Level: 50 +EVs: 18 HP / 32 Atk / 11 Def / 5 Spe +Adamant Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 14 HP / 15 Atk / 13 Def / 3 SpD / 21 Spe +Adamant Nature +- Kowtow Cleave +- Low Kick +- Iron Head +- Sucker Punch diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC127.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC127.txt new file mode 100644 index 0000000..857c969 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC127.txt @@ -0,0 +1,58 @@ +Incineroar @ Shuca Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 11 Def / 10 SpD / 13 Spe +Careful Nature +- Fake Out +- Parting Shot +- Flare Blitz +- Will-O-Wisp + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 14 Def / 15 SpA / 5 Spe +Modest Nature +- Protect +- Dazzling Gleam +- Moonblast +- Calm Mind + +Dragonite @ Lum Berry +Ability: Multiscale +Level: 50 +EVs: 1 HP / 32 Atk / 32 Spe +Adamant Nature +- Dragon Cheer +- Earthquake +- Iron Head +- Dragon Dance + +Orthworm @ Sitrus Berry +Ability: Earth Eater +Level: 50 +EVs: 31 HP / 2 Atk / 1 Def / 32 SpD +Careful Nature +- Iron Defense +- Heavy Slam +- Shed Tail +- Body Press + +Sinistcha @ Leftovers +Ability: Hospitality +Level: 50 +EVs: 30 HP / 2 Def / 9 SpA / 25 SpD +- Protect +- Matcha Gotcha +- Rage Powder +- Trick Room + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 9 HP / 32 Atk / 3 Def / 22 Spe +Adamant Nature +- Stomping Tantrum +- Dragon Claw +- Bulldoze +- Rock Slide diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC158.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC158.txt new file mode 100644 index 0000000..ad79e69 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC158.txt @@ -0,0 +1,59 @@ +Tyranitar @ Chople Berry +Ability: Sand Stream +Level: 50 +EVs: 18 HP / 24 Atk / 24 Def +Adamant Nature +- Knock Off +- Ice Punch +- Low Kick +- Rock Slide + +Glimmora @ Glimmoranite +Ability: Toxic Debris +Level: 50 +EVs: 32 SpA / 2 SpD / 32 Spe +Timid Nature +- Spiky Shield +- Power Gem +- Sludge Bomb +- Earth Power + +Excadrill @ Focus Sash +Ability: Sand Rush +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Protect +- Iron Head +- High Horsepower +- Rock Slide + +Sinistcha @ Lum Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 18 Def / 16 SpA +Bold Nature +- Strength Sap +- Rage Powder +- Matcha Gotcha +- Life Dew + +Corviknight @ Leftovers +Ability: Mirror Armor +Level: 50 +EVs: 32 HP / 1 Atk / 32 Def +Impish Nature +- Bulk Up +- Roost +- Brave Bird +- Body Press + +Milotic @ Sitrus Berry +Ability: Competitive +Level: 50 +EVs: 32 HP / 14 Atk / 20 SpA +Modest Nature +- Icy Wind +- Scald +- Protect +- Recover diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC163.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC163.txt new file mode 100644 index 0000000..b55c3a9 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC163.txt @@ -0,0 +1,59 @@ +Archaludon @ Sitrus Berry +Ability: Stamina +Level: 50 +EVs: 9 HP / 11 Def / 32 SpA / 7 SpD / 7 Spe +Modest Nature +- Protect +- Dragon Pulse +- Electro Shot +- Flash Cannon + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 4 HP / 29 Atk / 1 SpD / 32 Spe +Jolly Nature +- Protect +- Fake Out +- Dire Claw +- Close Combat + +Pelipper @ Focus Sash +Ability: Drizzle +Level: 50 +EVs: 32 SpA / 2 SpD / 32 Spe +Timid Nature +- Wide Guard +- Tailwind +- Weather Ball +- Hurricane + +Basculegion (M) @ Mystic Water +Ability: Swift Swim +Level: 50 +EVs: 4 HP / 31 Atk / 16 Def / 15 Spe +Gentle Nature +- Last Respects +- Aqua Jet +- Flip Turn +- Protect + +Incineroar @ Lum Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 2 Def / 32 SpD +Careful Nature +- Parting Shot +- Fake Out +- Flare Blitz +- Will-O-Wisp + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 13 HP / 1 Def / 32 SpA / 20 Spe +Modest Nature +- Protect +- Calm Mind +- Dazzling Gleam +- Moonblast diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC165.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC165.txt new file mode 100644 index 0000000..0fad3d4 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC165.txt @@ -0,0 +1,59 @@ +Excadrill @ Focus Sash +Ability: Sand Rush +Level: 50 +EVs: 32 Atk / 32 Spe +Adamant Nature +- Stomping Tantrum +- Earthquake +- Protect +- Rock Slide + +Corviknight @ Leftovers +Ability: Mirror Armor +Level: 50 +EVs: 32 HP / 18 Def / 15 SpD +Impish Nature +- Iron Head +- Iron Defense +- Body Press +- Roost + +Tyranitar @ Tyranitarite +Ability: Sand Stream +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Rock Slide +- Knock Off +- Low Kick +- Protect + +Milotic @ Wacan Berry +Ability: Competitive +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Modest Nature +- Scald +- Icy Wind +- Draining Kiss +- Protect + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 16 Def / 17 SpD +Impish Nature +- Fake Out +- Flare Blitz +- Throat Chop +- Parting Shot + +Gardevoir @ Choice Scarf +Ability: Telepathy +Level: 50 +EVs: 2 Def / 32 SpA / 32 Spe +Modest Nature +- Moonblast +- Psyshock +- Protect +- Mystical Fire diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC180.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC180.txt new file mode 100644 index 0000000..df2a325 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC180.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 13 Def / 3 SpA / 2 SpD / 16 Spe +Timid Nature +- Dazzling Gleam +- Draining Kiss +- Calm Mind +- Protect + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 31 HP / 21 Def / 1 SpD / 13 Spe +Impish Nature +- Flare Blitz +- Throat Chop +- Parting Shot +- Fake Out + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 12 HP / 30 Atk / 1 Def / 1 SpD / 22 Spe +Adamant Nature +- Earthquake +- Dragon Claw +- Rock Slide +- Stomping Tantrum + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Protect + +Corviknight @ Leftovers +Ability: Mirror Armor +Level: 50 +EVs: 32 HP / 1 Atk / 1 Def / 24 SpD / 8 Spe +Impish Nature +- Body Press +- Iron Head +- Iron Defense +- Roost + +Delphox @ Delphoxite +Ability: Blaze +Level: 50 +EVs: 9 HP / 15 Def / 9 SpA / 1 SpD / 32 Spe +Timid Nature +- Heat Wave +- Psychic +- Encore +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC183.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC183.txt new file mode 100644 index 0000000..4ebc6ad --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC183.txt @@ -0,0 +1,59 @@ +Blastoise @ Blastoisinite +Ability: Rain Dish +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Water Spout +- Aura Sphere +- Dragon Pulse +- Protect + +Typhlosion @ Charcoal +Ability: Flash Fire +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Eruption +- Rock Tomb +- Flamethrower +- Protect + +Whimsicott @ Focus Sash +Ability: Prankster +Level: 50 +EVs: 30 HP / 26 Def / 5 SpA / 1 SpD / 4 Spe +Timid Nature +- Moonblast +- Tailwind +- Encore +- Trick Room + +Glimmora @ Glimmoranite +Ability: Toxic Debris +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Timid Nature +- Power Gem +- Sludge Bomb +- Earth Power +- Spiky Shield + +Tsareena (F) @ Choice Scarf +Ability: Queenly Majesty +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Trop Kick +- Triple Axel +- Low Sweep +- Zen Headbutt + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 31 HP / 12 Def / 23 SpD +Calm Nature +- Matcha Gotcha +- Life Dew +- Rage Powder +- Trick Room diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC198.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC198.txt new file mode 100644 index 0000000..146573b --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC198.txt @@ -0,0 +1,64 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 15 HP / 32 SpA / 19 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Calm Mind +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +Shiny: Yes +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +Tera Type: Rock +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect + +Garchomp @ Soft Sand +Ability: Rough Skin +Level: 50 +Tera Type: Dragon +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Earthquake +- Stomping Tantrum +- Dragon Claw +- Protect + +Rotom-Heat @ Sitrus Berry +Ability: Levitate +Level: 50 +Shiny: Yes +EVs: 31 HP / 2 Def / 25 SpA / 2 SpD / 6 Spe +Modest Nature +- Overheat +- Thunderbolt +- Helping Hand +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +Tera Type: Water +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC249.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC249.txt new file mode 100644 index 0000000..4508e4f --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC249.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Timid Nature +- Light of Ruin +- Moonblast +- Dazzling Gleam +- Protect + +Talonflame @ Sharp Beak +Ability: Gale Wings +Level: 50 +EVs: 22 HP / 32 Atk / 1 SpD / 11 Spe +Adamant Nature +- Dual Wingbeat +- Tailwind +- Feint +- Protect + +Rotom-Wash @ Sitrus Berry +Ability: Levitate +Level: 50 +EVs: 31 HP / 1 Def / 15 SpA / 1 SpD / 18 Spe +Modest Nature +- Hydro Pump +- Thunderbolt +- Electroweb +- Protect + +Garchomp @ Soft Sand +Ability: Rough Skin +Level: 50 +EVs: 8 HP / 32 Atk / 1 Def / 1 SpD / 24 Spe +Adamant Nature +- Stomping Tantrum +- Earthquake +- Rock Slide +- Protect + +Farigiraf @ Colbur Berry +Ability: Armor Tail +Level: 50 +EVs: 12 HP / 3 Def / 20 SpA / 7 SpD / 24 Spe +Modest Nature +- Psychic +- Hyper Voice +- Trick Room +- Helping Hand + +Glimmora @ Glimmoranite +Ability: Toxic Debris +Level: 50 +EVs: 1 HP / 1 Def / 31 SpA / 1 SpD / 32 Spe +Modest Nature +- Sludge Bomb +- Power Gem +- Spiky Shield +- Earth Power diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC253.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC253.txt new file mode 100644 index 0000000..75252ab --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC253.txt @@ -0,0 +1,59 @@ +Victreebel @ Victreebelite +Ability: Chlorophyll +Level: 50 +EVs: 25 HP / 9 Def / 32 SpA +Modest Nature +- Strength Sap +- Sludge Bomb +- Protect +- Energy Ball + +Mamoswine @ Choice Scarf +Ability: Oblivious +Level: 50 +EVs: 29 HP / 32 Atk / 5 Spe +Adamant Nature +- Earthquake +- High Horsepower +- Icicle Crash +- Ice Shard + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Protect +- Dual Wingbeat +- Rock Slide +- Tailwind + +Gyarados @ Lum Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 8 Atk / 16 Def / 10 SpD +Careful Nature +- Waterfall +- Protect +- Ice Fang +- Thunder Wave + +Pelipper @ Sitrus Berry +Ability: Drizzle +Level: 50 +EVs: 32 HP / 20 Def / 6 SpA / 8 SpD +Bold Nature +- Hurricane +- Wide Guard +- Protect +- Weather Ball + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Protect +- Taunt diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC272.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC272.txt new file mode 100644 index 0000000..53cd5a3 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC272.txt @@ -0,0 +1,59 @@ +Tinkaton (F) @ Sitrus Berry +Ability: Own Tempo +Level: 50 +EVs: 31 HP / 15 Atk / 9 Def / 11 Spe +Adamant Nature +- Gigaton Hammer +- Play Rough +- Helping Hand +- Fake Out + +Glimmora @ Glimmoranite +Ability: Toxic Debris +Level: 50 +EVs: 1 HP / 32 SpA / 1 SpD / 32 Spe +Timid Nature +- Sludge Wave +- Power Gem +- Earth Power +- Spiky Shield + +Noivern @ Focus Sash +Ability: Telepathy +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Timid Nature +- Draco Meteor +- Air Slash +- Tailwind +- Protect + +Typhlosion-Hisui @ Charcoal +Ability: Frisk +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Modest Nature +- Eruption +- Heat Wave +- Shadow Ball +- Protect + +Conkeldurr @ Black Belt +Ability: Iron Fist +Level: 50 +EVs: 27 HP / 20 Atk / 19 SpD +Adamant Nature +- Drain Punch +- Mach Punch +- Ice Punch +- Wide Guard + +Rotom-Mow @ Choice Scarf +Ability: Levitate +Level: 50 +EVs: 18 HP / 16 SpA / 32 Spe +Modest Nature +- Thunderbolt +- Leaf Storm +- Electroweb +- Will-O-Wisp diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC279.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC279.txt new file mode 100644 index 0000000..62a7e66 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC279.txt @@ -0,0 +1,59 @@ +Tyranitar @ Tyranitarite +Ability: Sand Stream +Level: 50 +EVs: 26 HP / 16 Atk / 1 Def / 6 SpD / 17 Spe +Adamant Nature +- Rock Slide +- Knock Off +- Protect +- Ice Punch + +Milotic @ Leftovers +Ability: Competitive +Level: 50 +EVs: 29 HP / 9 Def / 1 SpA / 26 SpD / 1 Spe +Calm Nature +- Scald +- Icy Wind +- Protect +- Recover + +Sinistcha @ Coba Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 3 Def / 1 SpA / 30 SpD +Modest Nature +- Matcha Gotcha +- Life Dew +- Rage Powder +- Trick Room + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 1 HP / 30 Atk / 2 Def / 1 SpD / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Protect +- Fake Out + +Rotom-Heat @ Passho Berry +Ability: Levitate +Level: 50 +EVs: 1 Def / 32 SpA / 1 SpD / 32 Spe +Timid Nature +- Overheat +- Protect +- Volt Switch +- Thunderbolt + +Garchomp @ Focus Sash +Ability: Sand Veil +Level: 50 +EVs: 1 HP / 32 Atk / 32 Spe +Jolly Nature +- Earthquake +- Dragon Claw +- Protect +- Rock Slide diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC281.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC281.txt new file mode 100644 index 0000000..b6bad55 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC281.txt @@ -0,0 +1,59 @@ +Gardevoir @ Gardevoirite +Ability: Trace +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Quiet Nature +- Hyper Voice +- Psyshock +- Trick Room +- Protect + +Sneasler @ Focus Sash +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Basculegion (M) @ White Herb +Ability: Adaptability +Level: 50 +EVs: 11 HP / 32 Atk / 23 Def +Brave Nature +- Wave Crash +- Aqua Jet +- Last Respects +- Protect + +Pelipper @ Mystic Water +Ability: Drizzle +Level: 50 +EVs: 32 HP / 32 SpA / 2 SpD +Quiet Nature +- Hurricane +- Weather Ball +- Tailwind +- Protect + +Whimsicott @ Occa Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 17 Def / 17 SpD +Relaxed Nature +- Dazzling Gleam +- Encore +- Trick Room +- Protect + +Conkeldurr @ Black Belt +Ability: Iron Fist +Level: 50 +EVs: 28 HP / 31 Atk / 7 SpD +Brave Nature +- Drain Punch +- Mach Punch +- Knock Off +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC284.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC284.txt new file mode 100644 index 0000000..c985a8a --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC284.txt @@ -0,0 +1,59 @@ +Clefable @ Clefablite +Ability: Magic Guard +Level: 50 +EVs: 30 HP / 4 Def / 32 SpA +Quiet Nature +- Air Slash +- Protect +- Follow Me +- Moonblast + +Garchomp @ Lum Berry +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dragon Claw +- Earthquake +- Iron Head +- Rock Slide + +Gyarados @ Leftovers +Ability: Intimidate +Level: 50 +EVs: 32 HP / 3 Atk / 21 Def / 10 SpD +Impish Nature +- Waterfall +- Taunt +- Thunder Wave +- Protect + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 7 HP / 31 Def / 19 SpA / 9 SpD +Quiet Nature +- Trick Room +- Rage Powder +- Shadow Ball +- Matcha Gotcha + +Rotom-Heat @ Choice Scarf +Ability: Levitate +Level: 50 +EVs: 4 HP / 2 Def / 25 SpA / 9 SpD / 26 Spe +Timid Nature +- Overheat +- Volt Switch +- Discharge +- Thunderbolt + +Tyranitar @ Tyranitarite +Ability: Sand Stream +Level: 50 +EVs: 32 Atk / 2 SpD / 32 Spe +Adamant Nature +- Rock Slide +- Crunch +- Protect +- Low Kick diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC292.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC292.txt new file mode 100644 index 0000000..3b53530 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC292.txt @@ -0,0 +1,59 @@ +Gardevoir @ Gardevoirite +Ability: Trace +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Modest Nature +- Hyper Voice +- Trick Room +- Protect +- Psychic + +Blastoise @ Blastoisinite +Ability: Rain Dish +Level: 50 +EVs: 24 HP / 32 SpA / 10 Spe +Modest Nature +- Water Spout +- Fake Out +- Shell Smash +- Protect + +Pelipper @ Focus Sash +Ability: Drizzle +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Tailwind +- Helping Hand +- Muddy Water +- Hurricane + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 20 HP / 18 Atk / 26 Def / 1 SpD / 1 Spe +Adamant Nature +- Kowtow Cleave +- Iron Head +- Low Kick +- Sucker Punch + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Jolly Nature +- Fake Out +- Dire Claw +- Close Combat +- Rock Tomb + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 1 Def / 1 SpA / 32 SpD +Calm Nature +- Matcha Gotcha +- Shadow Ball +- Trick Room +- Rage Powder diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC294.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC294.txt new file mode 100644 index 0000000..e505c02 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC294.txt @@ -0,0 +1,59 @@ +Glimmora @ Focus Sash +Ability: Toxic Debris +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Spiky Shield +- Power Gem +- Mortal Spin +- Earth Power + +Gyarados @ Choice Scarf +Ability: Intimidate +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Jolly Nature +- Waterfall +- Power Whip +- Stone Edge +- Ice Fang + +Lopunny @ Lopunnite +Ability: Limber +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Protect +- Close Combat +- Triple Axel +- Fake Out + +Aegislash @ Leftovers +Ability: Stance Change +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Quiet Nature +- King's Shield +- Shadow Ball +- Wide Guard +- Shadow Sneak + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 32 HP / 15 Atk / 19 Spe +Adamant Nature +- Earthquake +- Dragon Claw +- Rock Slide +- Protect + +Kingambit @ Chople Berry +Ability: Supreme Overlord +Level: 50 +EVs: 32 HP / 32 Atk / 2 Def +Adamant Nature +- Protect +- Kowtow Cleave +- Low Kick +- Sucker Punch diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC296.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC296.txt new file mode 100644 index 0000000..d7a210b --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC296.txt @@ -0,0 +1,59 @@ +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 21 HP / 25 Atk / 20 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Dragon Dance +- Wide Guard + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 1 HP / 32 Atk / 1 SpD / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Acrobatics +- Fake Out + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 1 Def / 1 SpD +Brave Nature +- Assurance +- Iron Head +- Sucker Punch +- Protect + +Sinistcha @ Mental Herb +Ability: Hospitality +Level: 50 +EVs: 30 HP / 6 Def / 30 SpD +Sassy Nature +- Matcha Gotcha +- Life Dew +- Rage Powder +- Trick Room + +Primarina @ Mystic Water +Ability: Liquid Voice +Level: 50 +EVs: 27 HP / 7 Def / 32 SpA +Quiet Nature +- Hyper Voice +- Moonblast +- Round +- Protect + +Zoroark-Hisui @ Choice Scarf +Ability: Illusion +Level: 50 +EVs: 1 HP / 32 SpA / 1 SpD / 32 Spe +Modest Nature +- Hyper Voice +- Shadow Ball +- Flamethrower +- Round diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC318.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC318.txt new file mode 100644 index 0000000..77d2f2d --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC318.txt @@ -0,0 +1,57 @@ +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 2 SpD +Brave Nature +- Kowtow Cleave +- Iron Head +- Sucker Punch +- Low Kick + +Kangaskhan (F) @ Silk Scarf +Ability: Scrappy +Level: 50 +EVs: 27 HP / 32 Atk / 2 Def / 3 SpD / 2 Spe +Adamant Nature +- Last Resort +- Fake Out + +Blastoise @ Blastoisinite +Ability: Rain Dish +Level: 50 +EVs: 29 HP / 32 SpA / 5 Spe +Modest Nature +- Water Spout +- Water Pulse +- Dark Pulse +- Fake Out + +Sinistcha @ Colbur Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 4 Def / 30 SpD +Bold Nature +- Matcha Gotcha +- Rage Powder +- Life Dew +- Trick Room + +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 16 HP / 18 Atk / 32 Spe +Adamant Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect + +Farigiraf @ Sitrus Berry +Ability: Armor Tail +Level: 50 +EVs: 27 HP / 31 Def / 8 SpD +Bold Nature +- Psychic +- Rain Dance +- Trick Room +- Helping Hand diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC328.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC328.txt new file mode 100644 index 0000000..117a31e --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC328.txt @@ -0,0 +1,59 @@ +Archaludon @ Dragon Fang +Ability: Sturdy +Level: 50 +EVs: 32 SpA / 2 SpD / 32 Spe +Timid Nature +- Electro Shot +- Flash Cannon +- Draco Meteor +- Protect + +Pelipper @ Choice Scarf +Ability: Drizzle +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Hurricane +- Weather Ball +- U-turn +- Icy Wind + +Corviknight @ Leftovers +Ability: Mirror Armor +Level: 50 +EVs: 32 HP / 32 SpD / 2 Spe +Careful Nature +- Bulk Up +- Brave Bird +- Body Press +- Roost + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 1 HP / 32 Atk / 32 Spe +Adamant Nature +- Liquidation +- Last Respects +- Aqua Jet +- Protect + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 11 Def / 15 SpA / 8 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Light of Ruin +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC350.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC350.txt new file mode 100644 index 0000000..403ba82 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC350.txt @@ -0,0 +1,59 @@ +Luxray @ Choice Scarf +Ability: Intimidate +Level: 50 +EVs: 32 HP / 1 Atk / 1 SpD / 32 Spe +Jolly Nature +- Wild Charge +- Psychic Fangs +- Volt Switch +- Electroweb + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 32 Def / 1 SpA +Bold Nature +- Moonblast +- Draining Kiss +- Calm Mind +- Protect + +Sneasler @ Focus Sash +Ability: Unburden +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Protect +- Fake Out + +Sinistcha @ Leftovers +Ability: Hospitality +Level: 50 +EVs: 30 HP / 4 Def / 32 SpD +Bold Nature +- Rage Powder +- Matcha Gotcha +- Life Dew +- Trick Room + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 21 HP / 20 Atk / 1 Def / 5 SpD / 19 Spe +Adamant Nature +- Rock Slide +- Stomping Tantrum +- Protect +- Dragon Claw + +Incineroar @ Chople Berry +Ability: Intimidate +Level: 50 +EVs: 30 HP / 23 Def / 10 SpD / 3 Spe +Impish Nature +- Flare Blitz +- Throat Chop +- Parting Shot +- Fake Out diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC357.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC357.txt new file mode 100644 index 0000000..80f87ed --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC357.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 10 HP / 24 SpA / 32 Spe +Timid Nature +- Calm Mind +- Dazzling Gleam +- Moonblast +- Protect + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 23 HP / 20 Atk / 8 Def / 12 SpD / 3 Spe +Adamant Nature +- Earthquake +- Rock Slide +- Protect +- Dragon Claw + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 9 Def / 25 Spe +Jolly Nature +- Super Fang +- Taunt +- Protect +- Follow Me + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 21 Atk / 7 SpD / 6 Spe +Adamant Nature +- Sucker Punch +- Iron Head +- Protect +- Kowtow Cleave + +Delphox @ Delphoxite +Ability: Blaze +Level: 50 +EVs: 9 HP / 23 Def / 5 SpA / 29 Spe +Timid Nature +- Protect +- Psychic +- Encore +- Heat Wave + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 1 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC363.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC363.txt new file mode 100644 index 0000000..2257898 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC363.txt @@ -0,0 +1,59 @@ +Tyranitar @ Tyranitarite +Ability: Sand Stream +Level: 50 +EVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe +Adamant Nature +- Crunch +- Rock Slide +- Low Kick +- Protect + +Milotic @ Leftovers +Ability: Competitive +Level: 50 +EVs: 22 HP / 31 Def / 13 SpA +Modest Nature +- Scald +- Ice Beam +- Life Dew +- Protect + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe +Bold Nature +- Matcha Gotcha +- Shadow Ball +- Calm Mind +- Protect + +Rotom-Heat @ Choice Scarf +Ability: Levitate +Level: 50 +EVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe +Modest Nature +- Volt Switch +- Overheat +- Electroweb +- Trick + +Tauros-Paldea-Aqua (M) @ White Herb +Ability: Intimidate +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Adamant Nature +- Wave Crash +- Close Combat +- Aqua Jet +- Protect + +Sableye @ Roseli Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 9 Def / 25 SpD +Calm Nature +- Night Shade +- Fake Out +- Disable +- Reflect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC381.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC381.txt new file mode 100644 index 0000000..e76abd8 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC381.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 27 HP / 12 Def / 5 SpA / 22 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Calm Mind +- Protect + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Aerial Ace +- Tailwind +- Wide Guard + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 1 HP / 32 Atk / 1 SpD / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Acrobatics +- Fake Out + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 2 Spe +Adamant Nature +- Assurance +- Iron Head +- Sucker Punch +- Protect + +Sinistcha @ Coba Berry +Ability: Hospitality +Level: 50 +EVs: 30 HP / 6 Def / 30 SpD +Calm Nature +- Matcha Gotcha +- Rage Powder +- Life Dew +- Trick Room + +Arcanine @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 27 HP / 30 Atk / 1 Def / 7 SpD / 1 Spe +Adamant Nature +- Flare Blitz +- Extreme Speed +- Howl +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC398.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC398.txt new file mode 100644 index 0000000..8c4ec88 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC398.txt @@ -0,0 +1,59 @@ +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 5 HP / 32 Atk / 29 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect + +Basculegion (M) @ Kasib Berry +Ability: Adaptability +Level: 50 +EVs: 12 HP / 11 Atk / 32 Def / 1 SpD / 10 Spe +Adamant Nature +- Last Respects +- Wave Crash +- Aqua Jet +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 20 Atk / 2 Def / 1 SpD / 11 Spe +Adamant Nature +- Kowtow Cleave +- Low Kick +- Sucker Punch +- Protect + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 10 HP / 29 Def / 5 SpA / 22 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Light of Ruin +- Protect + +Sneasler @ Focus Sash +Ability: Poison Touch +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 32 HP / 13 Atk / 1 Def / 1 SpD / 19 Spe +Adamant Nature +- Dragon Claw +- Earthquake +- Rock Slide +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC432.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC432.txt new file mode 100644 index 0000000..9a96a54 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC432.txt @@ -0,0 +1,59 @@ +Emboar @ Emboarite +Ability: Blaze +Level: 50 +EVs: 32 HP / 32 Atk / 2 SpD +Adamant Nature +- Flare Blitz +- Close Combat +- Wild Charge +- Protect + +Hatterene (F) @ Focus Sash +Ability: Magic Bounce +Level: 50 +EVs: 32 HP / 32 SpA / 2 SpD +Quiet Nature +- Dazzling Gleam +- Expanding Force +- Psychic Terrain +- Trick Room + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 2 SpD +Adamant Nature +- Sucker Punch +- Iron Head +- Kowtow Cleave +- Protect + +Torkoal @ Charcoal +Ability: Drought +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Quiet Nature +- Eruption +- Heat Wave +- Sunny Day +- Protect + +Kangaskhan (F) @ Silk Scarf +Ability: Scrappy +Level: 50 +EVs: 32 HP / 32 Atk / 2 Def +Adamant Nature +- Fake Out +- Double-Edge +- Low Kick +- Disable + +Farigiraf @ Colbur Berry +Ability: Armor Tail +Level: 50 +EVs: 32 HP / 20 Def / 14 SpD +Modest Nature +- Twin Beam +- Helping Hand +- Trick Room +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC466.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC466.txt new file mode 100644 index 0000000..af2c251 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC466.txt @@ -0,0 +1,59 @@ +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 15 HP / 18 Atk / 1 SpD / 32 Spe +Adamant Nature +- Protect +- Close Combat +- Fake Out +- Dire Claw + +Archaludon @ Choice Scarf +Ability: Sturdy +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Snarl +- Flash Cannon +- Electro Shot +- Draco Meteor + +Basculegion (M) @ Focus Sash +Ability: Swift Swim +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Protect +- Liquidation +- Last Respects +- Aqua Jet + +Scovillain @ Scovillainite +Ability: Chlorophyll +Level: 50 +EVs: 32 HP / 19 Def / 15 SpD +Calm Nature +- Protect +- Overheat +- Leech Seed +- Rage Powder + +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 32 HP / 8 Atk / 26 Spe +Jolly Nature +- Protect +- Dual Wingbeat +- Rock Slide +- Tailwind + +Pelipper @ Sitrus Berry +Ability: Drizzle +Level: 50 +EVs: 32 HP / 10 Def / 10 SpA / 14 SpD +Bold Nature +- Protect +- Hurricane +- Weather Ball +- Wide Guard diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC469.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC469.txt new file mode 100644 index 0000000..1c49abb --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC469.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 26 HP / 3 Def / 25 SpA / 12 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Light of Ruin +- Protect + +Delphox @ Delphoxite +Ability: Blaze +Level: 50 +EVs: 9 HP / 23 Def / 5 SpA / 29 Spe +Timid Nature +- Heat Wave +- Psyshock +- Substitute +- Protect + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect + +Garchomp @ White Herb +Ability: Rough Skin +Level: 50 +EVs: 22 HP / 20 Atk / 24 Spe +Adamant Nature +- Earthquake +- Dragon Claw +- Stomping Tantrum +- Protect + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 24 HP / 9 Def / 1 SpD / 32 Spe +Jolly Nature +- Super Fang +- Follow Me +- Encore +- Protect + +Meowscarada @ Choice Scarf +Ability: Protean +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Flower Trick +- Knock Off +- Low Kick +- Triple Axel diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC477.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC477.txt new file mode 100644 index 0000000..6fd993f --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC477.txt @@ -0,0 +1,59 @@ +Basculegion (M) @ Mystic Water +Ability: Swift Swim +Level: 50 +EVs: 32 Atk / 15 Def / 19 Spe +Adamant Nature +- Wave Crash +- Aqua Jet +- Last Respects +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 32 Atk / 2 SpD / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Pelipper @ Sitrus Berry +Ability: Drizzle +Level: 50 +EVs: 22 HP / 25 SpA / 1 SpD / 18 Spe +Modest Nature +- Weather Ball +- Hurricane +- Tailwind +- Wide Guard + +Tsareena (F) @ Choice Scarf +Ability: Queenly Majesty +Level: 50 +EVs: 4 HP / 32 Atk / 30 Spe +Jolly Nature +- Trop Kick +- Triple Axel +- Zen Headbutt +- U-turn + +Archaludon @ Leftovers +Ability: Stamina +Level: 50 +EVs: 32 HP / 5 SpA / 27 SpD / 2 Spe +Modest Nature +- Electro Shot +- Draco Meteor +- Aura Sphere +- Protect + +Manectric @ Manectite +Ability: Lightning Rod +Level: 50 +EVs: 32 HP / 1 Def / 1 SpD / 32 Spe +Timid Nature +- Thunder +- Volt Switch +- Snarl +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC531.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC531.txt new file mode 100644 index 0000000..48ecbc5 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC531.txt @@ -0,0 +1,59 @@ +Klefki @ Shuca Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 14 Def / 20 SpD +Bold Nature +- Dazzling Gleam +- Rain Dance +- Thunder Wave +- Trick Room + +Feraligatr @ Feraligite +Ability: Sheer Force +Level: 50 +EVs: 32 HP / 20 Atk / 1 Def / 13 SpD +Brave Nature +- Protect +- Facade +- Waterfall +- Swords Dance + +Conkeldurr @ Black Belt +Ability: Guts +Level: 50 +EVs: 23 HP / 10 Atk / 1 Def / 32 SpD +Brave Nature +- Close Combat +- Knock Off +- Poison Jab +- Protect + +Hatterene (F) @ Focus Sash +Ability: Magic Bounce +Level: 50 +EVs: 32 HP / 9 Def / 24 SpA / 1 SpD +Quiet Nature +- Dazzling Gleam +- Protect +- Nuzzle +- Trick Room + +Incineroar @ White Herb +Ability: Intimidate +Level: 50 +EVs: 32 HP / 25 Atk / 2 Def / 7 SpD +Brave Nature +- Darkest Lariat +- Flare Blitz +- Fake Out +- Close Combat + +Basculegion-F (F) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 2 Def / 32 SpA / 32 Spe +Modest Nature +- Flip Turn +- Hex +- Shadow Ball +- Hydro Pump diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC537.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC537.txt new file mode 100644 index 0000000..53e06b1 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC537.txt @@ -0,0 +1,57 @@ +Kangaskhan (F) @ Silk Scarf +Ability: Scrappy +Level: 50 +EVs: 32 HP / 32 Atk / 2 SpD +Brave Nature +- Last Resort +- Fake Out + +Torkoal @ Charcoal +Ability: Drought +Level: 50 +EVs: 32 HP / 32 SpA / 2 SpD +Quiet Nature +- Eruption +- Protect +- Weather Ball +- Helping Hand + +Farigiraf @ Sitrus Berry +Ability: Armor Tail +Level: 50 +EVs: 32 HP / 25 Def / 9 SpD +Relaxed Nature +- Psychic +- Trick Room +- Hyper Voice +- Nasty Plot + +Glimmora @ Choice Scarf +Ability: Toxic Debris +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Acid Armor +- Earth Power +- Power Gem +- Sludge Bomb + +Scovillain @ Focus Sash +Ability: Chlorophyll +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Protect +- Rage Powder +- Overheat +- Leaf Storm + +Dragapult @ White Herb +Ability: Clear Body +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Protect +- Draco Meteor +- Shadow Ball +- Flamethrower diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC549.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC549.txt new file mode 100644 index 0000000..77cf600 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC549.txt @@ -0,0 +1,59 @@ +Sableye @ Roseli Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 8 Def / 26 SpD +Calm Nature +- Foul Play +- Light Screen +- Reflect +- Encore + +Archaludon @ Leftovers +Ability: Stamina +Level: 50 +EVs: 27 HP / 1 Def / 5 SpA / 20 SpD / 13 Spe +Modest Nature +- Flash Cannon +- Dragon Pulse +- Electro Shot +- Protect + +Dragonite @ Dragoninite +Ability: Multiscale +Level: 50 +EVs: 9 HP / 25 SpA / 32 Spe +Modest Nature +- Dragon Pulse +- Hurricane +- Roost +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 4 HP / 20 Atk / 27 Def / 15 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn + +Pelipper @ Focus Sash +Ability: Drizzle +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Modest Nature +- Hurricane +- Weather Ball +- Tailwind +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC553.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC553.txt new file mode 100644 index 0000000..218df87 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC553.txt @@ -0,0 +1,59 @@ +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 16 HP / 18 Def / 21 SpA / 11 Spe +Modest Nature +- Heat Wave +- Weather Ball +- Solar Beam +- Protect + +Froslass (F) @ Froslassite +Ability: Cursed Body +Level: 50 +EVs: 32 HP / 1 Def / 1 SpD / 32 Spe +Modest Nature +- Blizzard +- Shadow Ball +- Aurora Veil +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 4 HP / 20 Atk / 27 Def / 15 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 25 Atk / 9 Def +Adamant Nature +- Kowtow Cleave +- Iron Head +- Sucker Punch +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 25 HP / 30 Atk / 1 Def / 10 Spe +Adamant Nature +- Earthquake +- Dragon Claw +- Rock Slide +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC562.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC562.txt new file mode 100644 index 0000000..26808e0 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC562.txt @@ -0,0 +1,59 @@ +Scovillain @ Scovillainite +Ability: Moody +Level: 50 +EVs: 32 HP / 19 Def / 2 SpA / 13 Spe +Modest Nature +- Overheat +- Giga Drain +- Rage Powder +- Protect + +Corviknight @ Leftovers +Ability: Mirror Armor +Level: 50 +EVs: 32 HP / 13 Atk / 1 Def / 12 SpD / 8 Spe +Adamant Nature +- Brave Bird +- Iron Head +- Bulk Up +- Tailwind + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 3 HP / 10 Atk / 23 Def / 30 Spe +Adamant Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Excadrill @ Focus Sash +Ability: Sand Rush +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- High Horsepower +- Iron Head +- Rock Slide +- Protect + +Tyranitar @ Tyranitarite +Ability: Sand Stream +Level: 50 +EVs: 32 HP / 16 Atk / 18 Spe +Adamant Nature +- Rock Slide +- Knock Off +- Low Kick +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC566.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC566.txt new file mode 100644 index 0000000..6c5c024 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC566.txt @@ -0,0 +1,57 @@ +Victreebel-Mega (M) @ Victreebelite +Ability: Chlorophyll +Level: 50 +EVs: 29 HP / 32 SpA / 5 Spe +Modest Nature +- Sludge Bomb +- Giga Drain +- Weather Ball +- Sleep Powder + +Kangaskhan (F) @ Silk Scarf +Ability: Scrappy +Level: 50 +EVs: 32 HP / 32 Atk / 1 Def / 1 SpD +Brave Nature +- Last Resort +- Fake Out + +Torkoal (M) @ Charcoal +Ability: Drought +Level: 50 +EVs: 32 HP / 2 Def / 32 SpA +Quiet Nature +- Eruption +- Weather Ball +- Earth Power +- Protect + +Garchomp-Mega (M) @ Garchompite +Ability: Rough Skin +Level: 50 +EVs: 27 HP / 32 Atk / 7 Spe +Adamant Nature +- Dragon Claw +- Stomping Tantrum +- Protect +- Swords Dance + +Bellibolt (M) @ Magnet +Ability: Electromorphosis +Level: 50 +EVs: 32 HP / 1 Def / 32 SpA / 1 SpD +Quiet Nature +- Thunderbolt +- Parabolic Charge +- Protect +- Soak + +Farigiraf (F) @ Sitrus Berry +Ability: Armor Tail +Level: 50 +EVs: 29 HP / 20 Def / 1 SpA / 16 SpD +Relaxed Nature +- Psychic +- Hyper Voice +- Helping Hand +- Trick Room diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC585.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC585.txt new file mode 100644 index 0000000..91f3ba8 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC585.txt @@ -0,0 +1,59 @@ +Banette @ Banettite +Ability: Frisk +Level: 50 +EVs: 32 HP / 11 Def / 23 SpD +Careful Nature +- Shadow Sneak +- Destiny Bond +- Encore +- Disable + +Basculegion (M) @ Sitrus Berry +Ability: Adaptability +Level: 50 +EVs: 5 HP / 18 Atk / 32 Def / 11 Spe +Adamant Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Protect + +Sneasler @ Focus Sash +Ability: Poison Touch +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 26 HP / 22 Atk / 18 Def +Adamant Nature +- Kowtow Cleave +- Sucker Punch +- Low Kick +- Protect + +Rotom-Wash @ Leftovers +Ability: Levitate +Level: 50 +EVs: 19 HP / 31 Def / 16 SpA +Bold Nature +- Hydro Pump +- Thunderbolt +- Will-O-Wisp +- Protect + +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 31 HP / 20 Def / 10 SpA / 5 Spe +Modest Nature +- Hyper Voice +- Quick Attack +- Yawn +- Detect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC597.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC597.txt new file mode 100644 index 0000000..4799261 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC597.txt @@ -0,0 +1,59 @@ +Pelipper @ Sitrus Berry +Ability: Drizzle +Level: 50 +EVs: 31 HP / 11 Def / 24 SpD +Bold Nature +- Hurricane +- Weather Ball +- Tailwind +- Wide Guard + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Jolly Nature +- Wave Crash +- Flip Turn +- Last Respects +- Psychic Fangs + +Archaludon @ Leftovers +Ability: Stamina +Level: 50 +EVs: 30 HP / 1 Def / 3 SpA / 29 SpD / 3 Spe +Bold Nature +- Dragon Pulse +- Flash Cannon +- Electro Shot +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 28 HP / 2 Atk / 29 Def / 3 SpD / 4 Spe +Adamant Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 17 Def / 7 SpD / 10 Spe +Timid Nature +- Thunder Wave +- Rain Dance +- Follow Me +- Protect + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 10 HP / 31 Def / 16 SpA / 9 Spe +Modest Nature +- Dazzling Gleam +- Draining Kiss +- Calm Mind +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC610.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC610.txt new file mode 100644 index 0000000..fd528ca --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC610.txt @@ -0,0 +1,59 @@ +Maushold-Four @ Focus Sash +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 10 Def / 24 Spe +Jolly Nature +- Super Fang +- Follow Me +- Taunt +- Protect + +Talonflame @ Leftovers +Ability: Gale Wings +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Adamant Nature +- Brave Bird +- Tailwind +- Flare Blitz +- Quick Guard + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 20 Def / 5 SpA / 9 Spe +Modest Nature +- Dazzling Gleam +- Draining Kiss +- Calm Mind +- Protect + +Incineroar @ Chople Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 32 Atk / 1 Def / 1 SpD +Adamant Nature +- Darkest Lariat +- Fake Out +- Close Combat +- Flare Blitz + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 16 Def / 18 SpD +Bold Nature +- Matcha Gotcha +- Rage Powder +- Life Dew +- Trick Room + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Rock Slide +- Earthquake +- Dragon Claw +- Stomping Tantrum diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC618.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC618.txt new file mode 100644 index 0000000..8ba3ca2 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC618.txt @@ -0,0 +1,59 @@ +Incineroar @ Chople Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 2 Atk / 32 Def +Impish Nature +- Flare Blitz +- Parting Shot +- Helping Hand +- Fake Out + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 10 Def / 24 SpD +Calm Nature +- Matcha Gotcha +- Life Dew +- Rage Powder +- Trick Room + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 15 Def / 15 SpA / 4 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Calm Mind +- Protect + +Talonflame +Ability: Gale Wings +Level: 50 +EVs: 6 HP / 32 Atk / 1 SpD / 27 Spe +Jolly Nature +- Acrobatics +- Will-O-Wisp +- Tailwind +- Quick Guard + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Adamant Nature +- Stomping Tantrum +- Dragon Claw +- Breaking Swipe +- Rock Tomb + +Sneasler @ Focus Sash +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Rock Slide +- Fake Out diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC622.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC622.txt new file mode 100644 index 0000000..5f54501 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC622.txt @@ -0,0 +1,59 @@ +Ariados @ Bright Powder +Ability: Insomnia +Level: 50 +EVs: 30 HP / 30 Def / 6 SpD +Impish Nature +- Sucker Punch +- Protect +- Toxic Thread +- Rage Powder + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 27 HP / 15 Atk / 24 Spe +Adamant Nature +- Flare Blitz +- Throat Chop +- Fake Out +- Protect + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Gardevoir @ Gardevoirite +Ability: Telepathy +Level: 50 +EVs: 22 HP / 31 SpA / 13 Spe +Modest Nature +- Hyper Voice +- Psychic +- Vacuum Wave +- Protect + +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 6 HP / 16 Def / 26 SpA / 18 Spe +Modest Nature +- Heat Wave +- Weather Ball +- Ancient Power +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC629.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC629.txt new file mode 100644 index 0000000..2510cee --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC629.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 14 HP / 22 Def / 5 SpA / 25 Spe +Modest Nature +- Dazzling Gleam +- Moonblast +- Light of Ruin +- Protect + +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Tailwind +- Dual Wingbeat +- Taunt + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 10 Def / 24 Spe +Bold Nature +- Super Fang +- Follow Me +- Taunt +- Protect + +Weavile @ Focus Sash +Ability: Pickpocket +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Icicle Crash +- Psycho Cut +- Knock Off +- Fake Out + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Fake Out +- Close Combat +- Gunk Shot +- Feint + +Basculegion (M) @ Sitrus Berry +Ability: Adaptability +Level: 50 +EVs: 10 HP / 18 Atk / 27 Def / 1 SpD / 10 Spe +Adamant Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC648.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC648.txt new file mode 100644 index 0000000..2626ebd --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC648.txt @@ -0,0 +1,59 @@ +Farigiraf @ Sitrus Berry +Ability: Armor Tail +Level: 50 +EVs: 26 HP / 21 Def / 1 SpA / 14 SpD / 4 Spe +Bold Nature +- Twin Beam +- Protect +- Helping Hand +- Trick Room + +Gardevoir @ Gardevoirite +Ability: Trace +Level: 50 +EVs: 2 Def / 32 SpA / 32 Spe +Modest Nature +- Hyper Voice +- Psyshock +- Protect +- Trick Room + +Torkoal @ Charcoal +Ability: Drought +Level: 50 +EVs: 32 HP / 32 SpA / 2 SpD +Quiet Nature +- Eruption +- Body Press +- Heat Wave +- Earth Power + +Gallade (M) @ Choice Scarf +Ability: Sharpness +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Psycho Cut +- Sacred Sword +- Leaf Blade +- Night Slash + +Greninja @ Focus Sash +Ability: Protean +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Low Kick +- Ice Punch +- Gunk Shot + +Dragonite @ Dragoninite +Ability: Multiscale +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Draco Meteor +- Flamethrower +- Dragon Pulse +- Extreme Speed diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC661.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC661.txt new file mode 100644 index 0000000..89a7bf4 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC661.txt @@ -0,0 +1,59 @@ +Gengar @ Gengarite +Ability: Cursed Body +Level: 50 +EVs: 7 HP / 2 Def / 22 SpA / 3 SpD / 32 Spe +Timid Nature +- Protect +- Sludge Bomb +- Shadow Ball +- Disable + +Tinkaton (F) @ Focus Sash +Ability: Mold Breaker +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Jolly Nature +- Gigaton Hammer +- Fake Out +- Encore +- Protect + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 31 HP / 1 Atk / 20 Def / 14 SpD +Sassy Nature +- Fake Out +- Flare Blitz +- Parting Shot +- Darkest Lariat + +Sableye @ Roseli Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 2 Def / 32 SpD +Careful Nature +- Encore +- Will-O-Wisp +- Light Screen +- Quash + +Meowscarada @ Choice Scarf +Ability: Protean +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Triple Axel +- Flower Trick +- Knock Off +- Low Kick + +Kommo-o @ Leftovers +Ability: Soundproof +Level: 50 +EVs: 1 Def / 32 SpA / 1 SpD / 32 Spe +Modest Nature +- Protect +- Clanging Scales +- Aura Sphere +- Clangorous Soul diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC672.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC672.txt new file mode 100644 index 0000000..3efe67e --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC672.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 18 HP / 22 Def / 10 SpA / 16 Spe +Modest Nature +- Moonblast +- Light of Ruin +- Protect +- Dazzling Gleam + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Wide Guard +- Protect +- Tailwind + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 28 HP / 15 Atk / 1 Def / 22 Spe +Adamant Nature +- Dragon Claw +- Earthquake +- Stomping Tantrum +- Protect + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 20 HP / 25 Atk / 8 Def / 13 Spe +Adamant Nature +- Sucker Punch +- Low Kick +- Kowtow Cleave +- Protect + +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 12 HP / 18 Def / 11 SpA / 25 Spe +Modest Nature +- Heat Wave +- Weather Ball +- Solar Beam +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 24 Atk / 14 Def / 28 Spe +Jolly Nature +- Wave Crash +- Aqua Jet +- Flip Turn +- Last Respects diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC675.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC675.txt new file mode 100644 index 0000000..b71dff7 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC675.txt @@ -0,0 +1,59 @@ +Maushold @ Focus Sash +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 15 Def / 15 SpD / 4 Spe +Careful Nature +- Protect +- Follow Me +- Super Fang +- Feint + +Gardevoir @ Gardevoirite +Ability: Trace +Level: 50 +EVs: 32 HP / 9 Def / 25 SpA +Modest Nature +- Protect +- Trick Room +- Psychic +- Hyper Voice + +Basculegion (M) @ Kasib Berry +Ability: Adaptability +Level: 50 +EVs: 12 HP / 19 Atk / 30 Def / 5 Spe +Adamant Nature +- Wave Crash +- Last Respects +- Substitute +- Aqua Jet + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 2 Def +Brave Nature +- Protect +- Kowtow Cleave +- Low Kick +- Sucker Punch + +Garchomp @ Roseli Berry +Ability: Rough Skin +Level: 50 +EVs: 24 HP / 30 Atk / 12 Spe +Adamant Nature +- Protect +- Earthquake +- Rock Slide +- Stomping Tantrum + +Talonflame +Ability: Gale Wings +Level: 50 +EVs: 31 HP / 29 Atk / 6 Def +Adamant Nature +- Protect +- Tailwind +- Acrobatics +- Flare Blitz diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC698.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC698.txt new file mode 100644 index 0000000..d425e19 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC698.txt @@ -0,0 +1,59 @@ +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 32 HP / 27 Def / 7 SpA +Modest Nature +- Heat Wave +- Weather Ball +- Solar Beam +- Protect + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Earthquake +- Rock Slide +- Breaking Swipe +- Stomping Tantrum + +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 29 HP / 22 Def / 10 SpA / 5 Spe +Modest Nature +- Hyper Voice +- Quick Attack +- Calm Mind +- Detect + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Adamant Nature +- Last Respects +- Liquidation +- Aqua Jet +- Protect + +Aerodactyl @ Aerodactylite +Ability: Unnerve +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Wide Guard +- Tailwind + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 17 Atk / 16 Def / 1 Spe +Adamant Nature +- Sucker Punch +- Iron Head +- Low Kick +- Kowtow Cleave diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC728.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC728.txt new file mode 100644 index 0000000..c02901a --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC728.txt @@ -0,0 +1,59 @@ +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 32 HP / 21 Def / 1 SpA / 12 Spe +Modest Nature +- Heat Wave +- Solar Beam +- Dragon Pulse +- Protect + +Aegislash @ Spell Tag +Ability: Stance Change +Level: 50 +EVs: 30 HP / 30 Atk / 6 Spe +Adamant Nature +- Poltergeist +- Shadow Sneak +- Wide Guard +- King's Shield + +Garchomp @ Sitrus Berry +Ability: Rough Skin +Level: 50 +EVs: 22 HP / 15 Atk / 29 Spe +Adamant Nature +- Dragon Claw +- Earthquake +- Rock Slide +- Protect + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Rock Slide +- Wide Guard +- Tailwind +- Protect + +Rotom-Wash @ Choice Scarf +Ability: Levitate +Level: 50 +EVs: 18 HP / 23 SpA / 25 Spe +Timid Nature +- Thunderbolt +- Volt Switch +- Electroweb +- Hydro Pump + +Incineroar @ Leftovers +Ability: Intimidate +Level: 50 +EVs: 32 HP / 17 Def / 10 SpD / 7 Spe +Careful Nature +- Flare Blitz +- Darkest Lariat +- Fake Out +- Parting Shot diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC743.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC743.txt new file mode 100644 index 0000000..0cd7e18 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC743.txt @@ -0,0 +1,59 @@ +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Jolly Nature +- Rock Slide +- Dual Wingbeat +- Tailwind +- Protect + +Chandelure @ Colbur Berry +Ability: Flash Fire +Level: 50 +EVs: 24 HP / 1 Def / 32 SpA / 1 SpD / 8 Spe +Modest Nature +- Heat Wave +- Shadow Ball +- Will-O-Wisp +- Protect + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 32 HP / 31 SpA / 3 Spe +Modest Nature +- Moonblast +- Dazzling Gleam +- Light of Ruin +- Protect + +Scizor @ Metal Coat +Ability: Technician +Level: 50 +EVs: 22 HP / 31 Atk / 13 Def +Adamant Nature +- Bullet Punch +- Knock Off +- Close Combat +- Protect + +Kommo-o @ Sitrus Berry +Ability: Soundproof +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Clanging Scales +- Aura Sphere +- Clangorous Soul +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 1 Def / 1 SpD / 32 Spe +Jolly Nature +- Wave Crash +- Aqua Jet +- Flip Turn +- Last Respects diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC785.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC785.txt new file mode 100644 index 0000000..d6480a0 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC785.txt @@ -0,0 +1,59 @@ +Froslass (F) @ Froslassite +Ability: Cursed Body +Level: 50 +EVs: 1 Def / 32 SpA / 1 SpD / 32 Spe +Modest Nature +- Blizzard +- Shadow Ball +- Protect +- Aurora Veil + +Arcanine-Hisui @ Chople Berry +Ability: Intimidate +Level: 50 +EVs: 13 HP / 32 Atk / 1 Def / 1 SpD / 19 Spe +Adamant Nature +- Flare Blitz +- Rock Slide +- Protect +- Extreme Speed + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 20 HP / 20 Atk / 10 Def / 16 Spe +Adamant Nature +- Close Combat +- Dire Claw +- Protect +- Fake Out + +Gliscor @ Passho Berry +Ability: Hyper Cutter +Level: 50 +EVs: 14 HP / 25 Atk / 1 Def / 5 SpD / 21 Spe +Adamant Nature +- High Horsepower +- Dual Wingbeat +- Protect +- Tailwind + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 25 Atk / 9 Def +Adamant Nature +- Kowtow Cleave +- Sucker Punch +- Protect +- Iron Head + +Milotic @ Leftovers +Ability: Competitive +Level: 50 +EVs: 22 HP / 31 Def / 1 SpA / 5 SpD / 7 Spe +Calm Nature +- Muddy Water +- Coil +- Recover +- Hypnosis diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC801.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC801.txt new file mode 100644 index 0000000..a45244c --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC801.txt @@ -0,0 +1,59 @@ +Absol @ Absolite +Ability: Super Luck +Level: 50 +EVs: 27 Atk / 9 SpA / 30 Spe +Naive Nature +- Sucker Punch +- Close Combat +- Ice Beam +- Thunderbolt + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Modest Nature +- Dazzling Gleam +- Moonblast +- Light of Ruin +- Protect + +Talonflame +Ability: Gale Wings +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Acrobatics +- Flare Blitz +- Tailwind +- Protect + +Garchomp @ White Herb +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Dragon Claw +- Earthquake +- Rock Tomb +- Protect + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Last Respects +- Liquidation +- Aqua Jet +- Protect + +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Modest Nature +- Hyper Voice +- Hyper Beam +- Quick Attack +- Detect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC84.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC84.txt new file mode 100644 index 0000000..1c854f2 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC84.txt @@ -0,0 +1,59 @@ +Aggron @ Aggronite +Ability: Sturdy +Level: 50 +EVs: 32 HP / 14 Atk / 20 Def +Impish Nature +- Body Press +- Iron Defense +- Heavy Slam +- Protect + +Farigiraf @ Mental Herb +Ability: Armor Tail +Level: 50 +EVs: 31 HP / 17 Def / 10 SpA / 7 SpD / 1 Spe +Modest Nature +- Helping Hand +- Trick Room +- Hyper Voice +- Psychic Noise + +Pelipper @ Focus Sash +Ability: Drizzle +Level: 50 +EVs: 1 HP / 32 SpA / 32 Spe +Timid Nature +- Hurricane +- U-turn +- Weather Ball +- Tailwind + +Camerupt @ Cameruptite +Ability: Solid Rock +Level: 50 +EVs: 32 HP / 32 SpA +Quiet Nature +- Flamethrower +- Earth Power +- Heat Wave +- Eruption + +Araquanid @ Mystic Water +Ability: Water Bubble +Level: 50 +EVs: 32 HP / 32 Atk / 1 SpD +Brave Nature +- Wide Guard +- Liquidation +- Leech Life +- Protect + +Starmie @ Starminite +Ability: Illuminate +Level: 50 +EVs: 1 HP / 32 Atk / 32 Spe +Jolly Nature +- Ice Spinner +- Liquidation +- Zen Headbutt +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC852.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC852.txt new file mode 100644 index 0000000..00ea244 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC852.txt @@ -0,0 +1,59 @@ +Glimmora @ Glimmoranite +Ability: Toxic Debris +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Timid Nature +- Power Gem +- Sludge Bomb +- Earth Power +- Spiky Shield + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Liquidation +- Aqua Jet +- Last Respects +- Protect + +Gallade (M) @ Choice Scarf +Ability: Sharpness +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Sacred Sword +- Psycho Cut +- Leaf Blade +- Icy Wind + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 2 Def +Adamant Nature +- Kowtow Cleave +- Sucker Punch +- Iron Head +- Low Kick + +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 22 HP / 6 Def / 9 SpA / 29 Spe +Modest Nature +- Dazzling Gleam +- Moonblast +- Calm Mind +- Protect + +Talonflame +Ability: Gale Wings +Level: 50 +EVs: 6 HP / 27 Atk / 1 SpD / 32 Spe +Jolly Nature +- Flare Blitz +- Acrobatics +- Tailwind +- Quick Guard diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC895.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC895.txt new file mode 100644 index 0000000..98c03d2 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC895.txt @@ -0,0 +1,59 @@ +Gardevoir @ Gardevoirite +Ability: Trace +Level: 50 +EVs: 16 HP / 8 Def / 31 SpA / 11 Spe +Modest Nature +- Hyper Voice +- Psyshock +- Trick Room +- Protect + +Maushold-Four @ Chople Berry +Ability: Friend Guard +Level: 50 +EVs: 32 HP / 21 Def / 1 SpD / 12 Spe +Timid Nature +- Super Fang +- Encore +- Follow Me +- Protect + +Talonflame @ Sharp Beak +Ability: Gale Wings +Level: 50 +EVs: 17 HP / 32 Atk / 17 Spe +Jolly Nature +- Brave Bird +- Flare Blitz +- Tailwind +- Protect + +Garchomp @ Soft Sand +Ability: Rough Skin +Level: 50 +EVs: 14 HP / 32 Atk / 20 Spe +Jolly Nature +- Earthquake +- Stomping Tantrum +- Rock Slide +- Protect + +Kingambit @ Black Glasses +Ability: Defiant +Level: 50 +EVs: 32 HP / 25 Atk / 9 Spe +Adamant Nature +- Kowtow Cleave +- Iron Head +- Sucker Punch +- Low Kick + +Basculegion (M) @ Focus Sash +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Liquidation +- Last Respects +- Aqua Jet +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC901.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC901.txt new file mode 100644 index 0000000..906483a --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC901.txt @@ -0,0 +1,59 @@ +Scizor @ Scizorite +Ability: Technician +Level: 50 +EVs: 32 HP / 20 Atk / 14 SpD +Adamant Nature +- Bullet Punch +- Bug Bite +- Protect +- Swords Dance + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Wave Crash +- Last Respects +- Aqua Jet +- Flip Turn + +Archaludon @ Leftovers +Ability: Stamina +Level: 50 +EVs: 32 HP / 8 SpA / 20 SpD / 6 Spe +Modest Nature +- Flash Cannon +- Dragon Pulse +- Electro Shot +- Protect + +Sableye @ Roseli Berry +Ability: Prankster +Level: 50 +EVs: 32 HP / 2 Def / 32 SpD +Sassy Nature +- Light Screen +- Rain Dance +- Encore +- Will-O-Wisp + +Pelipper @ Focus Sash +Ability: Drizzle +Level: 50 +EVs: 1 HP / 1 Def / 32 SpA / 32 Spe +Modest Nature +- Hurricane +- Tailwind +- Protect +- Weather Ball + +Dragonite @ Dragoninite +Ability: Inner Focus +Level: 50 +EVs: 21 HP / 32 SpA / 13 Spe +Modest Nature +- Draco Meteor +- Hurricane +- Protect +- Tailwind diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC91.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC91.txt new file mode 100644 index 0000000..77703e7 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC91.txt @@ -0,0 +1,59 @@ +Froslass (F) @ Froslassite +Ability: Cursed Body +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Blizzard +- Shadow Ball +- Aurora Veil +- Protect + +Glaceon @ Never-Melt Ice +Ability: Snow Cloak +Level: 50 +EVs: 32 HP / 32 SpA / 2 Spe +Modest Nature +- Blizzard +- Ice Beam +- Freeze-Dry +- Detect + +Garchomp @ Garchompite +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Earthquake +- Dragon Claw +- Rock Slide +- Protect + +Rotom-Wash @ Sitrus Berry +Ability: Levitate +Level: 50 +EVs: 32 HP / 32 SpA / 2 Spe +Modest Nature +- Thunderbolt +- Hydro Pump +- Will-O-Wisp +- Protect + +Whimsicott @ Focus Sash +Ability: Prankster +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Moonblast +- Tailwind +- Encore +- Endeavor + +Arcanine-Hisui @ White Herb +Ability: Intimidate +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Flare Blitz +- Rock Slide +- Extreme Speed +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC92.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC92.txt new file mode 100644 index 0000000..3926bcd --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC92.txt @@ -0,0 +1,59 @@ +Floette-Eternal (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 4 HP / 30 SpA / 32 Spe +Timid Nature +- Light of Ruin +- Moonblast +- Dazzling Gleam +- Protect + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 31 HP / 1 Atk / 17 Def / 15 SpD / 2 Spe +Careful Nature +- Flare Blitz +- Darkest Lariat +- Parting Shot +- Fake Out + +Dragonite @ White Herb +Ability: Multiscale +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Scale Shot +- Extreme Speed +- Tailwind +- Protect + +Sneasler @ Focus Sash +Ability: Unburden +Level: 50 +EVs: 1 HP / 32 Atk / 1 Def / 32 Spe +Jolly Nature +- Close Combat +- Dire Claw +- Fake Out +- Protect + +Basculegion (M) @ Choice Scarf +Ability: Adaptability +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Jolly Nature +- Wave Crash +- Last Respects +- Flip Turn +- Aqua Jet + +Scizor @ Metal Coat +Ability: Technician +Level: 50 +EVs: 32 HP / 32 Atk / 2 Spe +Adamant Nature +- Bug Bite +- Bullet Punch +- Swords Dance +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC925.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC925.txt new file mode 100644 index 0000000..08697ef --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC925.txt @@ -0,0 +1,59 @@ +Garchomp @ Roseli Berry +Ability: Rough Skin +Level: 50 +EVs: 4 HP / 30 Atk / 32 Spe +Adamant Nature +- Earthquake +- Poison Jab +- Rock Slide +- Dragon Claw + +Dragonite @ Dragoninite +Ability: Multiscale +Level: 50 +EVs: 12 HP / 30 SpA / 24 Spe +Timid Nature +- Dragon Pulse +- Protect +- Thunderbolt +- Heat Wave + +Basculegion (M) @ Sitrus Berry +Ability: Adaptability +Level: 50 +EVs: 6 HP / 18 Atk / 15 Def / 7 SpD / 20 Spe +Adamant Nature +- Protect +- Aqua Jet +- Last Respects +- Wave Crash + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 24 HP / 32 Atk / 1 SpD / 9 Spe +Adamant Nature +- Protect +- Kowtow Cleave +- Sucker Punch +- Iron Head + +Charizard @ Charizardite Y +Ability: Blaze +Level: 50 +EVs: 32 HP / 9 Def / 1 SpA / 24 Spe +Modest Nature +- Protect +- Heat Wave +- Solar Beam +- Weather Ball + +Whimsicott @ Focus Sash +Ability: Prankster +Level: 50 +EVs: 9 HP / 32 SpA / 25 Spe +Modest Nature +- Tailwind +- Encore +- Moonblast +- Protect diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC943.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC943.txt new file mode 100644 index 0000000..d755481 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC943.txt @@ -0,0 +1,59 @@ +Floette-Mega (F) @ Floettite +Ability: Flower Veil +Level: 50 +EVs: 29 HP / 5 SpA / 32 Spe +Modest Nature +- Dazzling Gleam +- Calm Mind +- Moonblast +- Protect + +Sinistcha-Masterpiece @ Kasib Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 7 Def / 27 SpD +Relaxed Nature +- Matcha Gotcha +- Rage Powder +- Trick Room +- Protect + +Incineroar @ Sitrus Berry +Ability: Intimidate +Level: 50 +EVs: 32 HP / 6 Def / 16 SpD / 12 Spe +Bold Nature +- Flare Blitz +- Throat Chop +- Fake Out +- Parting Shot + +Charizard-Mega-Y @ Charizardite Y +Ability: Solar Power +Level: 50 +EVs: 15 HP / 18 Def / 1 SpA / 32 Spe +Modest Nature +- Heat Wave +- Weather Ball +- Solar Beam +- Protect + +Garchomp @ Choice Scarf +Ability: Rough Skin +Level: 50 +EVs: 32 Atk / 2 Def / 32 Spe +Adamant Nature +- Earthquake +- Stomping Tantrum +- Dragon Claw +- Rock Tomb + +Aegislash @ Focus Sash +Ability: Stance Change +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Poltergeist +- Shadow Sneak +- Iron Head +- Wide Guard diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC986.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC986.txt new file mode 100644 index 0000000..6c377b9 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC986.txt @@ -0,0 +1,59 @@ +Morpeko @ Focus Sash +Ability: Hunger Switch +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Protect +- Aura Wheel +- Parting Shot +- Fake Out + +Delphox @ Delphoxite +Ability: Blaze +Level: 50 +EVs: 31 HP / 28 Def / 3 SpA / 4 Spe +Timid Nature +- Protect +- Heat Wave +- Psychic +- Nasty Plot + +Sneasler @ White Herb +Ability: Unburden +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Adamant Nature +- Dire Claw +- Close Combat +- Fake Out +- Protect + +Sinistcha @ Sitrus Berry +Ability: Hospitality +Level: 50 +EVs: 32 HP / 14 Def / 20 SpD +Bold Nature +- Matcha Gotcha +- Rage Powder +- Life Dew +- Protect + +Blastoise @ Blastoisinite +Ability: Rain Dish +Level: 50 +EVs: 16 HP / 32 SpA / 18 Spe +Modest Nature +- Protect +- Water Spout +- Dark Pulse +- Shell Smash + +Ninetales-Alola @ Never-Melt Ice +Ability: Snow Warning +Level: 50 +EVs: 2 HP / 32 SpA / 32 Spe +Timid Nature +- Blizzard +- Icy Wind +- Aurora Veil +- Encore diff --git a/game_first_exam/benchmarks/vgc/teams/reg_ma/PC994.txt b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC994.txt new file mode 100644 index 0000000..77f80f9 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/teams/reg_ma/PC994.txt @@ -0,0 +1,59 @@ +Scovillain @ Scovillainite +Ability: Moody +Level: 50 +EVs: 32 HP / 12 Def / 22 SpD +Calm Nature +- Protect +- Rage Powder +- Super Fang +- Flamethrower + +Aerodactyl @ Focus Sash +Ability: Unnerve +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Protect +- Tailwind +- Dual Wingbeat +- Rock Slide + +Kingambit @ Chople Berry +Ability: Defiant +Level: 50 +EVs: 32 HP / 32 Atk / 1 SpD / 1 Spe +Adamant Nature +- Protect +- Iron Head +- Kowtow Cleave +- Sucker Punch + +Goodra-Hisui @ Leftovers +Ability: Shell Armor +Level: 50 +EVs: 32 HP / 32 Def / 2 SpD +Bold Nature +- Protect +- Shelter +- Body Press +- Thunderbolt + +Sylveon @ Fairy Feather +Ability: Pixilate +Level: 50 +EVs: 32 HP / 9 Def / 20 SpA / 5 Spe +Modest Nature +- Detect +- Calm Mind +- Hyper Voice +- Quick Attack + +Garchomp @ White Herb +Ability: Rough Skin +Level: 50 +EVs: 2 HP / 32 Atk / 32 Spe +Jolly Nature +- Protect +- Scale Shot +- Stomping Tantrum +- Earthquake diff --git a/game_first_exam/benchmarks/vgc/vgc_bench/__init__.py b/game_first_exam/benchmarks/vgc/vgc_bench/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/game_first_exam/benchmarks/vgc/vgc_bench/src/__init__.py b/game_first_exam/benchmarks/vgc/vgc_bench/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/game_first_exam/benchmarks/vgc/vgc_bench/src/policy.py b/game_first_exam/benchmarks/vgc/vgc_bench/src/policy.py new file mode 100644 index 0000000..95841f6 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/vgc_bench/src/policy.py @@ -0,0 +1,291 @@ +""" +Neural network policy module for VGC-Bench. + +Implements the actor-critic policy architecture with attention-based feature +extraction for Pokemon VGC battles. Uses action masking to ensure only legal +moves are selected. +""" + +from typing import Any + +import torch +from gymnasium import Space +from stable_baselines3.common.distributions import MultiCategoricalDistribution +from stable_baselines3.common.policies import ActorCriticPolicy +from stable_baselines3.common.torch_layers import BaseFeaturesExtractor +from stable_baselines3.common.type_aliases import PyTorchObs +from torch import nn + +from vgc_bench.src.utils import ( + abilities, + act_len, + chunk_obs_len, + glob_obs_len, + items, + moves, + side_obs_len, +) + +action_map = ( + ["pass", "switch 1", "switch 2", "switch 3", "switch 4", "switch 5", "switch 6"] + + [f"move {i} target {j}" for i in range(1, 5) for j in range(-2, 3)] + + [f"move {i} target {j} mega" for i in range(1, 5) for j in range(-2, 3)] + + [f"move {i} target {j} zmove" for i in range(1, 5) for j in range(-2, 3)] + + [f"move {i} target {j} dynamax" for i in range(1, 5) for j in range(-2, 3)] + + [f"move {i} target {j} tera" for i in range(1, 5) for j in range(-2, 3)] +) + + +class MaskedActorCriticPolicy(ActorCriticPolicy): + """ + Actor-critic policy with action masking for Pokemon VGC. + + Extends SB3's ActorCriticPolicy with action masking to enforce legal + moves and uses an attention-based feature extractor for processing + Pokemon battle observations. + + Attributes: + choose_on_teampreview: Whether policy controls teampreview decisions. + actor_grad: Whether to compute gradients for actor during evaluation. + debug: Whether to print debug information during forward pass. + """ + + def __init__( + self, *args: Any, d_model: int, choose_on_teampreview: bool, **kwargs: Any + ): + """ + Initialize the masked actor-critic policy. + + Args: + d_model: Hidden size for policy/value networks and attention extractor. + choose_on_teampreview: Whether policy controls teampreview. + *args: Additional arguments for ActorCriticPolicy. + **kwargs: Additional keyword arguments for ActorCriticPolicy. + """ + self.choose_on_teampreview = choose_on_teampreview + self.actor_grad = True + self.debug = False + super().__init__( + *args, + **kwargs, + net_arch=[], + activation_fn=torch.nn.ReLU, + features_extractor_class=AttentionExtractor, + features_extractor_kwargs={ + "d_model": d_model, + "choose_on_teampreview": choose_on_teampreview, + }, + share_features_extractor=False, + ) + + def forward(self, obs: PyTorchObs, deterministic=False): + assert isinstance(obs, dict) + action_logits, value_logits = self.get_logits(obs, actor_grad=True) + distribution = self.get_dist_from_logits(action_logits, obs["action_mask"]) + actions = distribution.get_actions(deterministic=deterministic) + distribution2 = self.get_dist_from_logits( + action_logits, obs["action_mask"], actions[:, :1] + ) + actions2 = distribution2.get_actions(deterministic=deterministic) + distribution.distribution[1] = distribution2.distribution[1] + actions[:, 1] = actions2[:, 1] + if self.debug: + print("value:", value_logits[0][0].item()) + action_dist1 = { + action_map[i]: f"{p.item():.3e}" + for i, p in enumerate(distribution.distribution[0].probs[0]) + if p > 0 + } + action_dist1 = dict( + sorted(action_dist1.items(), key=lambda x: float(x[1]), reverse=True) + ) + print("action1 dist:", action_dist1) + action_dist2 = { + action_map[i]: f"{p.item():.3e}" + for i, p in enumerate(distribution.distribution[1].probs[0]) + if p > 0 + } + action_dist2 = dict( + sorted(action_dist2.items(), key=lambda x: float(x[1]), reverse=True) + ) + print("action2 dist:", action_dist2) + log_prob = distribution.log_prob(actions) + actions = actions.reshape((-1, *self.action_space.shape)) # type: ignore[misc] + return actions, value_logits, log_prob + + def evaluate_actions(self, obs, actions): + assert isinstance(obs, dict) + action_logits, value_logits = self.get_logits(obs, self.actor_grad) + distribution = self.get_dist_from_logits(action_logits, obs["action_mask"]) + distribution2 = self.get_dist_from_logits( + action_logits, obs["action_mask"], actions[:, :1] + ) + distribution.distribution[1] = distribution2.distribution[1] + log_prob = distribution.log_prob(actions) + entropy = distribution.entropy() + return value_logits, log_prob, entropy + + def get_logits( + self, obs: dict[str, torch.Tensor], actor_grad: bool + ) -> tuple[torch.Tensor, torch.Tensor]: + """Extract features and compute action/value logits.""" + actor_context = torch.enable_grad() if actor_grad else torch.no_grad() + features = self.extract_features(obs) + if self.share_features_extractor: + latent_pi, latent_vf = self.mlp_extractor(features) + else: + pi_features, vf_features = features + with actor_context: + latent_pi = self.mlp_extractor.forward_actor(pi_features) + latent_vf = self.mlp_extractor.forward_critic(vf_features) + with actor_context: + action_logits = self.action_net(latent_pi) + value_logits = self.value_net(latent_vf) + return action_logits, value_logits + + def get_dist_from_logits( + self, + action_logits: torch.Tensor, + mask: torch.Tensor, + action: torch.Tensor | None = None, + ) -> MultiCategoricalDistribution: + """Create masked action distribution from logits.""" + if action is not None: + mask = self._update_mask(mask, action) + mask = torch.where(mask == 1, 0, float("-inf")) + distribution = self.action_dist.proba_distribution(action_logits + mask) + assert isinstance(distribution, MultiCategoricalDistribution) + return distribution + + @staticmethod + def _update_mask(mask: torch.Tensor, ally_actions: torch.Tensor) -> torch.Tensor: + """ + Update action mask based on ally's already-chosen action. + + Prevents illegal combinations like both Pokemon switching to the same + slot, both passing when not forced, or both terastallizing. + + Args: + mask: Current action mask tensor of shape (batch, 2*act_len). + ally_actions: Ally's chosen actions of shape (batch, 1). + + Returns: + Updated mask tensor with illegal actions disabled. + """ + indices = ( + torch.arange(act_len, device=ally_actions.device) + .unsqueeze(0) + .expand(len(ally_actions), -1) + ) + ally_passed = ally_actions == 0 + ally_force_passed = ( + (mask[:, 0] == 1) & (mask[:, :act_len].sum(1) == 1) + ).unsqueeze(1) + ally_switched = (1 <= ally_actions) & (ally_actions <= 6) + ally_mega_evolved = (26 < ally_actions) & (ally_actions <= 46) + ally_z_moved = (46 < ally_actions) & (ally_actions <= 66) + ally_dynamaxed = (66 < ally_actions) & (ally_actions <= 86) + ally_terastallized = (86 < ally_actions) & (ally_actions <= 106) + updated_half = mask[:, act_len:] * ~( + ((indices == 0) & ally_passed & ~ally_force_passed) + | ((indices == ally_actions) & ally_switched) + | ((26 < indices) & (indices <= 46) & ally_mega_evolved) + | ((46 < indices) & (indices <= 66) & ally_z_moved) + | ((66 < indices) & (indices <= 86) & ally_dynamaxed) + | ((86 < indices) & (indices <= 106) & ally_terastallized) + ) + return torch.cat([mask[:, :act_len], updated_half], dim=1) + + +class AttentionExtractor(BaseFeaturesExtractor): + """ + Attention-based feature extractor for Pokemon battle observations. + + Processes Pokemon observations using embeddings for abilities, items, and + moves, then applies transformer attention to produce a fixed-size feature + vector. + + Class Attributes: + embed_len: Dimension of embedding vectors for abilities/items/moves. + num_heads: Number of attention heads in transformer layers. + embed_layers: Number of transformer encoder layers. + """ + + embed_len: int = 32 + num_heads: int = 4 + embed_layers: int = 3 + + def __init__( + self, observation_space: Space[Any], d_model: int, choose_on_teampreview: bool + ): + """ + Initialize the attention-based feature extractor. + + Args: + observation_space: Gymnasium observation space specification. + d_model: Hidden size for token projection and transformer layers. + choose_on_teampreview: Whether policy controls teampreview decisions. + """ + super().__init__(observation_space, features_dim=d_model) + self.choose_on_teampreview = choose_on_teampreview + self.ability_embed = nn.Embedding( + len(abilities), self.embed_len, max_norm=self.embed_len**0.5 + ) + self.item_embed = nn.Embedding( + len(items), self.embed_len, max_norm=self.embed_len**0.5 + ) + self.move_embed = nn.Embedding( + len(moves), self.embed_len, max_norm=self.embed_len**0.5 + ) + self.pokemon_proj = nn.Linear(chunk_obs_len + 6 * (self.embed_len - 1), d_model) + self.cls_token = nn.Parameter(torch.randn(1, 1, d_model)) + self.pokemon_encoder = nn.TransformerEncoder( + nn.TransformerEncoderLayer( + d_model=d_model, + nhead=self.num_heads, + dim_feedforward=d_model, + dropout=0, + batch_first=True, + norm_first=True, + ), + num_layers=self.embed_layers, + enable_nested_tensor=False, + ) + + def forward(self, obs_dict: dict[str, torch.Tensor]) -> torch.Tensor: + """ + Extract features from battle observation. + + Embeds Pokemon attributes and applies transformer attention across all + 12 Pokemon (6 per side). + + Args: + x: Dict with an ``"observation"`` key containing a tensor of + shape (batch, 12 * chunk_obs_len). + + Returns: + Feature tensor of shape (batch, d_model). + """ + x = obs_dict["observation"] + batch_size = x.size(0) + pokemon_obs = x.view(batch_size, 12, -1) + # embedding + start = glob_obs_len + side_obs_len + pokemon_obs = torch.cat( + [ + pokemon_obs[:, :, :start], + self.ability_embed(pokemon_obs[:, :, start].long()), + self.item_embed(pokemon_obs[:, :, start + 1].long()), + self.move_embed(pokemon_obs[:, :, start + 2].long()), + self.move_embed(pokemon_obs[:, :, start + 3].long()), + self.move_embed(pokemon_obs[:, :, start + 4].long()), + self.move_embed(pokemon_obs[:, :, start + 5].long()), + pokemon_obs[:, :, start + 6 :], + ], + dim=-1, + ) + # pokemon encoder + pokemon_tokens = self.pokemon_proj(pokemon_obs) + cls_token = self.cls_token.expand(batch_size, -1, -1) + tokens = torch.cat([cls_token, pokemon_tokens], dim=1) + return self.pokemon_encoder(tokens)[:, 0, :] diff --git a/game_first_exam/benchmarks/vgc/vgc_bench/src/policy_player.py b/game_first_exam/benchmarks/vgc/vgc_bench/src/policy_player.py new file mode 100644 index 0000000..d107245 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/vgc_bench/src/policy_player.py @@ -0,0 +1,615 @@ +""" +Policy-based player module for VGC-Bench. + +Provides player implementations that use neural network policies to make +battle decisions, including synchronous and batched asynchronous variants. +Also implements the battle state embedding used for policy observations. +""" + +import asyncio +import io +import json +import zipfile +from dataclasses import dataclass +from pathlib import Path +from typing import Any, Awaitable + +import numpy as np +import numpy.typing as npt +import torch +from poke_env.battle import ( + AbstractBattle, + DoubleBattle, + Effect, + Field, + Move, + MoveCategory, + Pokemon, + PokemonGender, + PokemonType, + SideCondition, + Status, + Target, + Weather, +) +from poke_env.data import to_id_str +from poke_env.environment import DoublesEnv +from poke_env.player import BattleOrder, DefaultBattleOrder, Player +from stable_baselines3 import PPO +from stable_baselines3.common.policies import BasePolicy + +from vgc_bench.src.policy import MaskedActorCriticPolicy +from vgc_bench.src.utils import ( + abilities, + get_reg_from_format, + items, + move_obs_len, + moves, + pokemon_obs_len, +) + + +class PolicyPlayer(Player): + """ + A Pokemon VGC player that uses a neural network policy for decisions. + + Handles battle state embedding and action masking to ensure only legal + moves are selected. + + Attributes: + policy: The neural network policy used for action selection. + """ + + policy: BasePolicy | None + + def __init__( + self, + policy: BasePolicy | None = None, + accept_all_formats: bool = False, + deterministic: bool = False, + invitee: str | None = None, + *args: Any, + **kwargs: Any, + ): + """ + Initialize the policy player. + + Args: + policy: Neural network policy (can be set later via set_policy). + accept_all_formats: If True, accept challenges in any recognized + VGC format instead of only ``battle_format``. Requires the + team builder to be in multi-reg mode (``reg=None``) so the + correct regulation's teams are yielded. + deterministic: If True, always pick the highest-probability action + instead of sampling from the distribution. + *args: Additional arguments for Player base class. + **kwargs: Additional keyword arguments for Player base class. + """ + super().__init__(*args, **kwargs) + self.policy = policy + self._accept_all_formats = accept_all_formats + self.deterministic = deterministic + self.invitee = invitee + + async def _handle_challenge_request(self, split_message: list[str]): + """Accept challenge requests, optionally for any recognized format.""" + if not self._accept_all_formats: + return await super()._handle_challenge_request(split_message) + challenging_player = split_message[2].strip() + if challenging_player != self.username: + if len(split_message) >= 6: + fmt = split_message[5] + if fmt.startswith("gen9championsvgc"): + await self._challenge_queue.put((challenging_player, fmt)) + + async def _update_challenges(self, split_message: list[str]): + """Queue challenges, optionally accepting any recognized format.""" + if not self._accept_all_formats: + return await super()._update_challenges(split_message) + challenges = json.loads(split_message[2]).get("challengesFrom", {}) + for user, fmt in challenges.items(): + if fmt.startswith("gen9championsvgc"): + await self._challenge_queue.put((user, fmt)) + + async def _accept_challenges( + self, + opponent: str | list[str] | None, + n_challenges: int, + packed_team: str | None, + ): + """Accept challenges, setting format and team reg before each.""" + if not self._accept_all_formats: + return await super()._accept_challenges(opponent, n_challenges, packed_team) + if opponent: + if isinstance(opponent, list): + opponent = [to_id_str(o) for o in opponent] + else: + opponent = to_id_str(opponent) + await self.ps_client.logged_in.wait() + + for _ in range(n_challenges): + while True: + username, fmt = await self._challenge_queue.get() + username = to_id_str(username) + if ( + (opponent is None) + or (opponent == username) + or (isinstance(opponent, list) and (username in opponent)) + ): + self._format = fmt + if ( + isinstance(self._team, RandomTeamBuilder) + and self._team.available_regs is not None + ): + self._team.current_reg = get_reg_from_format(fmt) + team = packed_team or self.next_team + await self.ps_client.accept_challenge(username, team) + await self._battle_semaphore.acquire() + break + await self._battle_count_queue.join() + + async def _create_battle(self, split_message: list[str]): + """Create a battle, accepting any recognized format if configured.""" + if not self._accept_all_formats: + battle = await super()._create_battle(split_message) + elif split_message[1].startswith("gen9championsvgc"): + saved = self.format + self._format = split_message[1] + try: + battle = await super()._create_battle(split_message) + finally: + self._format = saved + else: + battle = await super()._create_battle(split_message) + if self.invitee is not None and "bo3" not in self.format: + await self.ps_client.send_message( + f"/invite {self.invitee}", battle.battle_tag + ) + return battle + + async def _handle_bestof_message(self, split_messages): + """Handle best-of series messages, inviting spectator to the lobby.""" + if self.invitee is not None: + game_tag = split_messages[0][0][1:] # strip > + for split_message in split_messages[1:]: + if len(split_message) >= 2 and split_message[1] == "init": + await self.ps_client.send_message( + f"/invite {self.invitee}", room=game_tag + ) + break + await super()._handle_bestof_message(split_messages) + + def set_policy(self, policy_file: str | Path, device: torch.device): + """ + Load or update the policy from a checkpoint file. + + Args: + policy_file: Path to the saved PPO checkpoint. + device: PyTorch device for model placement. + """ + if self.policy is None: + self.policy = PPO.load(policy_file, device=device).policy + else: + # Bypass SB3's leaky set_parameters - load state dict directly from zip + with zipfile.ZipFile(policy_file, "r") as zf: + with zf.open("policy.pth") as f: + state_dict = torch.load( + io.BytesIO(f.read()), map_location=device, weights_only=True + ) + self.policy.load_state_dict(state_dict) + + def choose_move( + self, battle: AbstractBattle + ) -> BattleOrder | Awaitable[BattleOrder]: + """ + Choose the next move using the neural network policy. + + Args: + battle: Current battle state. + + Returns: + The chosen battle order. + """ + assert isinstance(battle, DoubleBattle) + assert isinstance(self.policy, MaskedActorCriticPolicy) + if battle._wait: + return DefaultBattleOrder() + obs = self.embed_battle(battle, fake_rating=2000) + mask = np.array(DoublesEnv.get_action_mask(battle)) + with torch.no_grad(): + obs_dict = { + "observation": torch.as_tensor( + obs, device=self.policy.device + ).unsqueeze(0), + "action_mask": torch.as_tensor( + mask, device=self.policy.device + ).unsqueeze(0), + } + action, _, _ = self.policy.forward( + obs_dict, deterministic=self.deterministic + ) + action = action.cpu().numpy()[0] + return DoublesEnv.action_to_order(action, battle) + + def teampreview(self, battle: AbstractBattle) -> str | Awaitable[str]: + """ + Select Pokemon for teampreview. + + Uses random teampreview when policy-controlled teampreview is disabled. + + Args: + battle: Current battle state during team preview. + + Returns: + Team order string for Pokemon Showdown. + """ + assert isinstance(self.policy, MaskedActorCriticPolicy) + if not self.policy.choose_on_teampreview: + return self.random_teampreview(battle) + assert isinstance(battle, DoubleBattle) + order1 = self.choose_move(battle) + assert not isinstance(order1, Awaitable) + action1 = DoublesEnv.order_to_action(order1, battle) + list(battle.team.values())[action1[0] - 1]._selected_in_teampreview = True + list(battle.team.values())[action1[1] - 1]._selected_in_teampreview = True + order2 = self.choose_move(battle) + assert not isinstance(order2, Awaitable) + action2 = DoublesEnv.order_to_action(order2, battle) + list(battle.team.values())[action2[0] - 1]._selected_in_teampreview = True + list(battle.team.values())[action2[1] - 1]._selected_in_teampreview = True + return f"/team {action1[0]}{action1[1]}{action2[0]}{action2[1]}" + + @staticmethod + def embed_battle( + battle: AbstractBattle, fake_rating: int | None = None + ) -> npt.NDArray[np.float32]: + """ + Convert a battle state to a feature vector observation. + + Creates a fixed-size numpy array encoding the full battle state including + action masks, global effects, side conditions, and all Pokemon information. + + Args: + battle: The battle state to embed. + fake_rating: Optional raw rating override for the player side. + If provided, opponent rating is masked to 0. + + Returns: + Numpy array observation for the policy network. + """ + assert isinstance(battle, DoubleBattle) + glob = PolicyPlayer.embed_global(battle) + side = PolicyPlayer.embed_side(battle, fake_rating) + opp_fake_rating = None if fake_rating is None else 0 + opp_side = PolicyPlayer.embed_side(battle, opp_fake_rating, opp=True) + a1, a2 = battle.active_pokemon + o1, o2 = battle.opponent_active_pokemon + pokemons = [ + PolicyPlayer.embed_pokemon( + p, + i, + from_opponent=False, + active_a=a1 is not None and p.name == a1.name, + active_b=a2 is not None and p.name == a2.name, + ) + for i, p in enumerate(battle.team.values()) + ] + pokemons = pokemons[:6] + pokemons += [np.zeros(pokemon_obs_len, dtype=np.float32)] * (6 - len(pokemons)) + opp_pokemons = [ + PolicyPlayer.embed_pokemon( + p, + i, + from_opponent=True, + active_a=o1 is not None and p.name == o1.name, + active_b=o2 is not None and p.name == o2.name, + ) + for i, p in enumerate(battle.opponent_team.values()) + ] + opp_pokemons = opp_pokemons[:6] + opp_pokemons += [np.zeros(pokemon_obs_len, dtype=np.float32)] * ( + 6 - len(opp_pokemons) + ) + return np.concatenate( + [np.concatenate([glob, side, p]) for p in pokemons] + + [np.concatenate([glob, opp_side, p]) for p in opp_pokemons], + dtype=np.float32, + ) + + @staticmethod + def embed_global(battle: DoubleBattle) -> npt.NDArray[np.float32]: + """Embed global battle state (weather, fields, etc).""" + weather = [ + (min(battle.turn - battle.weather[w], 8) / 8 if w in battle.weather else 0) + for w in Weather + ] + fields = [ + min(battle.turn - battle.fields[f], 8) / 8 if f in battle.fields else 0 + for f in Field + ] + champions_format = float( + battle.format is not None and "champions" in battle.format + ) + teampreview = float(battle.teampreview) + reviving = float(battle.reviving) + commanding = float(battle.commanding) + return np.array( + [*weather, *fields, champions_format, teampreview, reviving, commanding], + dtype=np.float32, + ) + + @staticmethod + def embed_side( + battle: DoubleBattle, fake_rating: int | None, opp: bool = False + ) -> npt.NDArray[np.float32]: + """ + Embed side-specific state (side conditions, gimmick availability, rating). + + Args: + battle: Current doubles battle state. + fake_rating: Optional raw rating override for this side. + If None, read rating from battle player metadata. + opp: Whether to embed the opponent side. + """ + gims = [ + battle.can_mega_evolve[0], + battle.can_z_move[0], + battle.can_dynamax[0], + battle.can_tera[0], + ] + opp_gims = [ + battle.opponent_used_mega_evolve, + battle.opponent_used_z_move, + battle.opponent_used_dynamax, + battle.opponent_used_tera, + ] + side_conds = battle.opponent_side_conditions if opp else battle.side_conditions + side_conditions = [ + ( + 0 + if s not in side_conds + else ( + 1 + if s == SideCondition.STEALTH_ROCK + else ( + side_conds[s] / 2 + if s == SideCondition.TOXIC_SPIKES + else ( + side_conds[s] / 3 + if s == SideCondition.SPIKES + else min(battle.turn - side_conds[s], 8) / 8 + ) + ) + ) + ) + for s in SideCondition + ] + gims = opp_gims if opp else gims + gimmicks = [float(g) for g in gims] + if fake_rating is not None: + rating = fake_rating / 2000 + else: + player = battle.opponent_role if opp else battle.player_role + rat = [p for p in battle._players if p["player"] == player][0].get( + "rating", "0" + ) + rating = int(rat or "0") / 2000 + return np.array([*side_conditions, *gimmicks, rating], dtype=np.float32) + + @staticmethod + def embed_pokemon( + pokemon: Pokemon, pos: int, from_opponent: bool, active_a: bool, active_b: bool + ) -> npt.NDArray[np.float32]: + """Embed a Pokemon's stats, moves, status, and effects.""" + assert from_opponent or not pokemon.revealed or pokemon.selected_in_teampreview + # (mostly) stable fields + ability_id = abilities.index( + "null" if pokemon.ability is None else pokemon.ability + ) + item_id = items.index("null" if pokemon.item is None else pokemon.item) + move_list = list(pokemon.moves.values())[-4:] + move_ids = [moves.index(move.id) for move in move_list] + move_ids += [0] * (4 - len(move_ids)) + move_embeds = [PolicyPlayer.embed_move(move) for move in move_list] + move_embeds += [np.zeros(move_obs_len, dtype=np.float32)] * ( + 4 - len(move_embeds) + ) + move_embeds = np.concatenate(move_embeds) + types = [float(t in pokemon.base_types) for t in PokemonType] + tera_type = [float(t == pokemon.tera_type) for t in PokemonType] + base_stats = [s / 255 for s in pokemon.base_stats.values()] + if from_opponent: + stats = [-1] * 6 + else: + stats = [s / 255 for s in pokemon.stats.values() if s is not None] + assert len(stats) == 6 + gender = [float(g == pokemon.gender) for g in PokemonGender] + weight = pokemon.weight / 1000 + # volatile fields + hp_frac = pokemon.current_hp_fraction + revealed = float(pokemon.revealed) + in_draft = float(pokemon.selected_in_teampreview) + status = [float(s == pokemon.status) for s in Status] + status_counter = pokemon.status_counter / 16 + boosts = [b / 6 for b in pokemon.boosts.values()] + effects = [ + (min(pokemon.effects[e], 8) / 8 if e in pokemon.effects else 0) + for e in Effect + ] + first_turn = float(pokemon.first_turn) + protect_counter = pokemon.protect_counter / 5 + must_recharge = float(pokemon.must_recharge) + preparing = float(pokemon.preparing) + gimmicks = [float(s) for s in [pokemon.is_dynamaxed, pokemon.is_terastallized]] + pos_onehot = [float(pos == i) for i in range(6)] + return np.array( + [ + ability_id, + item_id, + *move_ids, + *move_embeds, + *types, + *tera_type, + *base_stats, + *stats, + *gender, + weight, + hp_frac, + revealed, + in_draft, + *status, + status_counter, + *boosts, + *effects, + first_turn, + protect_counter, + must_recharge, + preparing, + *gimmicks, + float(active_a), + float(active_b), + *pos_onehot, + float(from_opponent), + ], + dtype=np.float32, + ) + + @staticmethod + def embed_move(move: Move) -> npt.NDArray[np.float32]: + """Embed a move's power, accuracy, type, and special properties.""" + power = move.base_power / 250 + acc = move.accuracy / 100 + category = [float(c == move.category) for c in MoveCategory] + target = [float(t == move.target) for t in Target] + priority = (move.priority + 7) / 12 + crit_ratio = move.crit_ratio + drain = move.drain + force_switch = float(move.force_switch) + recoil = move.recoil + self_destruct = float(move.self_destruct is not None) + self_switch = float(move.self_switch is not False) + pp = move.max_pp / 64 + pp_frac = move.current_pp / move.max_pp + is_last_used = float(move.is_last_used) + move_type = [float(t == move.type) for t in PokemonType] + return np.array( + [ + power, + acc, + *category, + *target, + priority, + crit_ratio, + drain, + force_switch, + recoil, + self_destruct, + self_switch, + pp, + pp_frac, + is_last_used, + *move_type, + ] + ) + + +@dataclass +class _BatchReq: + """Internal request object for batched inference.""" + + obs: npt.NDArray[np.float32] + mask: npt.NDArray[np.int64] + event: asyncio.Event + result: npt.NDArray[np.int64] | None = None + + +class BatchPolicyPlayer(PolicyPlayer): + """ + A policy player that batches inference requests for efficiency. + + Collects multiple battle observations and runs them through the policy + network together, improving GPU utilization when managing many concurrent + battles. + """ + + def __init__(self, *args: Any, **kwargs: Any): + """Initialize the batch policy player with an inference queue.""" + super().__init__(*args, **kwargs) + self._q: asyncio.Queue[_BatchReq] = asyncio.Queue() + self._worker_task: asyncio.Task | None = None + + def choose_move(self, battle: AbstractBattle) -> Awaitable[BattleOrder]: + """Return an awaitable that resolves to the chosen battle order.""" + return self._choose_move(battle) + + async def _choose_move(self, battle: AbstractBattle) -> BattleOrder: + """Queue an observation for batched inference and await the result.""" + assert isinstance(battle, DoubleBattle) + if battle._wait: + return DefaultBattleOrder() + obs = self.embed_battle(battle, fake_rating=2000) + mask = np.array(DoublesEnv.get_action_mask(battle)) + if self._worker_task is None: + self._worker_task = asyncio.create_task(self._inference_loop()) + req = _BatchReq(obs=obs, mask=mask, event=asyncio.Event()) + await self._q.put(req) + await req.event.wait() + assert req.result is not None + action = req.result + return DoublesEnv.action_to_order(action, battle) + + def teampreview(self, battle: AbstractBattle) -> Awaitable[str]: + """Return an awaitable that resolves to the team order string.""" + return self._teampreview(battle) + + async def _teampreview(self, battle: AbstractBattle) -> str: + """Async teampreview implementation with random fallback when disabled.""" + assert isinstance(self.policy, MaskedActorCriticPolicy) + if not self.policy.choose_on_teampreview: + return self.random_teampreview(battle) + assert isinstance(battle, DoubleBattle) + order1 = await self.choose_move(battle) + action1 = DoublesEnv.order_to_action(order1, battle) + list(battle.team.values())[action1[0] - 1]._selected_in_teampreview = True + list(battle.team.values())[action1[1] - 1]._selected_in_teampreview = True + order2 = await self.choose_move(battle) + action2 = DoublesEnv.order_to_action(order2, battle) + list(battle.team.values())[action2[0] - 1]._selected_in_teampreview = True + list(battle.team.values())[action2[1] - 1]._selected_in_teampreview = True + return f"/team {action1[0]}{action1[1]}{action2[0]}{action2[1]}" + + async def _inference_loop(self) -> None: + """Background task that batches and processes inference requests.""" + assert isinstance(self.policy, MaskedActorCriticPolicy) + while True: + # gather requests + requests = [await self._q.get()] + just_slept = False + while len(requests) < self._max_concurrent_battles: + try: + req = self._q.get_nowait() + requests.append(req) + just_slept = False + except asyncio.QueueEmpty: + if just_slept: + break + await asyncio.sleep(0.005) + just_slept = True + + # run inference + obs = np.stack([r.obs for r in requests], axis=0) + masks = np.stack([r.mask for r in requests], axis=0) + with torch.no_grad(): + obs_dict = { + "observation": torch.as_tensor(obs, device=self.policy.device), + "action_mask": torch.as_tensor(masks, device=self.policy.device), + } + actions, _, _ = self.policy.forward( + obs_dict, deterministic=self.deterministic + ) + actions = actions.cpu().numpy() + + # dispatch + for req, act in zip(requests, actions): + req.result = act + req.event.set() diff --git a/game_first_exam/benchmarks/vgc/vgc_bench/src/utils.py b/game_first_exam/benchmarks/vgc/vgc_bench/src/utils.py new file mode 100644 index 0000000..d7ea2b6 --- /dev/null +++ b/game_first_exam/benchmarks/vgc/vgc_bench/src/utils.py @@ -0,0 +1,120 @@ +""" +Utility module for VGC-Bench. + +Contains shared constants, enums, and helper functions used throughout the +codebase. Defines observation space dimensions, loads Pokemon game data, +and provides training configuration utilities. +""" + +import json +import os +import random +from enum import Enum, auto, unique + +import numpy as np +import torch +from poke_env.battle import ( + Effect, + Field, + MoveCategory, + PokemonGender, + PokemonType, + SideCondition, + Status, + Target, + Weather, +) + + +@unique +class LearningStyle(Enum): + """ + Training paradigm options for reinforcement learning. + + Defines different self-play and opponent sampling strategies used + during PPO training for Pokemon VGC agents. + + Values: + EXPLOITER: Train against a fixed opponent policy. + PURE_SELF_PLAY: Train against current policy (both players identical). + FICTITIOUS_PLAY: Sample historical checkpoints uniformly as opponents. + DOUBLE_ORACLE: Sample checkpoints based on Nash equilibrium distribution. + """ + + EXPLOITER = auto() + PURE_SELF_PLAY = auto() + FICTITIOUS_PLAY = auto() + DOUBLE_ORACLE = auto() + + @property + def is_self_play(self) -> bool: + """Check if this style involves any form of self-play training.""" + return self in { + LearningStyle.PURE_SELF_PLAY, + LearningStyle.FICTITIOUS_PLAY, + LearningStyle.DOUBLE_ORACLE, + } + + @property + def abbrev(self) -> str: + """Get two-letter abbreviation for logging and file naming.""" + match self: + case LearningStyle.EXPLOITER: + return "ex" + case LearningStyle.PURE_SELF_PLAY: + return "sp" + case LearningStyle.FICTITIOUS_PLAY: + return "fp" + case LearningStyle.DOUBLE_ORACLE: + return "do" + + +def set_global_seed(seed: int) -> None: + """ + Set random seeds for reproducibility across all libraries. + + Args: + seed: Integer seed to use for all random number generators. + """ + random.seed(seed) + np.random.seed(seed) + os.environ["PYTHONHASHSEED"] = str(seed) + torch.manual_seed(seed) + if torch.cuda.is_available(): + torch.cuda.manual_seed_all(seed) + + +# observation length constants +act_len = 107 +glob_obs_len = len(Field) + len(Weather) + 4 +side_obs_len = len(SideCondition) + 5 +move_obs_len = len(MoveCategory) + len(Target) + len(PokemonType) + 12 +pokemon_obs_len = ( + 4 * move_obs_len + + len(Effect) + + len(PokemonGender) + + 2 * len(PokemonType) + + len(Status) + + 45 +) +chunk_obs_len = glob_obs_len + side_obs_len + pokemon_obs_len + +# pokemon data +format_map = {"ma": "gen9championsvgc2026regma", "mb": "gen9championsvgc2026regmb"} + + +def get_reg_from_format(fmt: str) -> str: + """Extract the regulation identifier from a VGC format string""" + assert fmt.startswith("gen9championsvgc"), f"not a valid VGC format: {fmt}" + return fmt.removesuffix("bo3").split("reg")[-1] + + +_DATA_DIR = os.path.join( + os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "data" +) +with open(os.path.join(_DATA_DIR, "abilities.json")) as f: + abilities: list[str] = json.load(f) +with open(os.path.join(_DATA_DIR, "items.json")) as f: + items: list[str] = json.load(f) +with open(os.path.join(_DATA_DIR, "moves.json")) as f: + moves: list[str] = json.load(f) diff --git a/game_first_exam/images/vgc-files/FILES.json b/game_first_exam/images/vgc-files/FILES.json new file mode 100644 index 0000000..7e186a7 --- /dev/null +++ b/game_first_exam/images/vgc-files/FILES.json @@ -0,0 +1,20 @@ +{ + "image": "ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422", + "source": "game_first_exam/benchmarks/vgc", + "files": { + "SOURCE.json": "0378cb3f2e8f2e571834ba15024700a9c3334abcce38dbdd05b9c5ebc0186839", + "adapter.py": "47adf3e79b759f16af79d3aa1589e1968b2702a4f684615d8e1675cf26f38f56", + "data/abilities.json": "c6110d7963365d44d5741b204df8a92aa543db1d2a20a6e96233815c96d09d68", + "data/items.json": "0bdc97131a61608de77cc1de8e4142d39561895d9cfc796d9f6a1fb576624c9b", + "data/moves.json": "f0cb56065ec93cdf028f4ca187df0b9943a25a75812cd8a89d2c90e2ce24373e", + "instance_schema.py": "e77b4fbf2e8031713fdf0cae6518a36397f29da77dcda347925e72c4b1041e7e", + "metric_rules.py": "fc15b284c62c4409270f40a1bc662246d9e1faad095286f999fc881236d5edc9", + "models/bc_100.zip": "57f5edcab415cf6ccc1b6231923c8b66d3b1b7249b6b2562b97531471e4ca60b", + "requirements.txt": "e2239e079d0efafd5bdce5a42bc4301ea194be8dd659452284865249bd723492", + "vgc_bench/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "vgc_bench/src/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "vgc_bench/src/policy.py": "ab8969ebe18f88be955b19d1b9f77157a65ee23f38f9e8d1d5d601ae12f822a4", + "vgc_bench/src/policy_player.py": "5e98451fa45b89e2ec5ddfea665808852743bd17e5b944091c68d621c70c9961", + "vgc_bench/src/utils.py": "810784f02487eeade837ee566d9074328146f5eac3adae33c6abab8cd469d76d" + } +} diff --git a/game_first_exam/images/vgc-files/README.md b/game_first_exam/images/vgc-files/README.md new file mode 100644 index 0000000..df63402 --- /dev/null +++ b/game_first_exam/images/vgc-files/README.md @@ -0,0 +1,7 @@ +# VGC adapter files + +Files-only image for the thin native VGC adapter and its validation. Built from +`game_first_exam/benchmarks/vgc` with `scripts/files_image.py build vgc-files`, +then pinned with `scripts/files_image.py pin vgc-files `. No upstream +engine (poke-env / Pokemon Showdown) is modified; the engine is installed inside +the sim container, not carried in this image. diff --git a/game_first_exam/images/vgc-files/VERSION b/game_first_exam/images/vgc-files/VERSION new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/game_first_exam/images/vgc-files/VERSION @@ -0,0 +1 @@ +0.1.0 diff --git a/game_first_exam/tasks/vgc/README.md b/game_first_exam/tasks/vgc/README.md new file mode 100644 index 0000000..5161acd --- /dev/null +++ b/game_first_exam/tasks/vgc/README.md @@ -0,0 +1,35 @@ +# VGC native smoke integration + +The `vgc` suite contains a frozen Pokémon VGC doubles battle (regulation MA, +`gen9championsvgc2026regma`) against the native random opponent. The native battle +engine is poke-env (the `vgc-bench` fork, unmodified) driving a pinned Pokemon +Showdown simulator. Only the environment is reused; VGC-Bench's RL/BC training, +LLM agent and evaluation tools are not migrated. + +## Native settings and mode differences + +- The two-player battle is reduced to a single-agent standard episode by fixing the + opponent at construction (`opponent_policy`). +- The joint doubles action (two Pokémon) is expressed as one text action per turn. +- The Showdown engine PRNG is not seeded from Python, so a single battle is not + bit-reproducible. `win` is the primary metric; the framework's `mean_primary_score` + (win rate) aggregates frozen instances. +- Isolation: Showdown and the adapter run inside the `sim` container; the agent + reaches the game only through the `server.py` HTTP protocol. + +## Coding-agent interface audit + +| Boundary | Native behavior / public evaluation behavior | +|---|---| +| Environment | poke-env DoublesEnv + pinned Showdown; no engine modification | +| Initialization | Frozen teams, seed, regulation, opponent policy are evaluation conditions | +| Observation | Native battle state serialized as JSON; see the adapter and instruction | +| Action | One text action per turn (the joint doubles order) | +| Feedback | observe/step return observation, step, done, steps_remaining, time_left_s | +| Score | `win` (0/1) per episode; `mean_primary_score` (win rate) aggregates a family | +| Ending | Native win/loss; timeout/agent exit seals the episode without fabricating a win | + +## Task instructions + +The instruction follows the game-standard authoring guide. Compatibility and audit +notes live in this README rather than in the agent prompt. diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/DIGEST b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/DIGEST new file mode 100644 index 0000000..51c6006 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:b13e5c303653110bc5d7bca9d6861f64a2583f29f4c26285893c6fcae727153d diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/README.md b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/README.md new file mode 100644 index 0000000..86741f9 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/README.md @@ -0,0 +1,47 @@ +# vgc-vs-bc-i01-standard + +| | | +|---|---| +| Benchmark | VGC | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: single frozen battle, no privileged replay twin yet) | +| Simulator / robot | `vgc` / `game-agent` | +| Family / instance | `vs-bc` / seed 0 | +| Oracle | `full` | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db` | + +## Task +Win a frozen VGC doubles battle (regulation MA, `gen9championsvgc2026regma`) against the native random opponent. Both teams are frozen in the instance; the opponent policy is `random`. + +## Difficulty +Piloting a doubles team under partial information and stochastic battle mechanics (damage rolls, speed ties), with the opponent policy fixed but its in-battle RNG unseeded. + +## Reference solution +See `solution/`. + +## Verification +The isolated verifier checks the trusted `final.json` (win/loss, native return, action count, instance binding). It does not replay the trajectory or run the engine. + +## Resources +Caps per container (PROTOCOL §6). + +| Container | CPUs | Memory | Processes | GPU memory | Disk | +|---|---|---|---|---|---| +| `main` (the agent's) | 1 | 1 GiB | 256 | no GPU | 2 GiB | +| `sim` | 1 | 2 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Compatibility and deviations +- Only the native battle environment (poke-env fork + Pokemon Showdown) is reused. VGC-Bench's RL/BC training, LLM agent, and evaluation tools are not migrated. +- The two-player battle is reduced to a single-agent episode by fixing the opponent at construction. +- The Showdown engine PRNG is not seeded from Python; single-battle outcomes are therefore not bit-reproducible. `win` is the primary metric; the framework's `mean_primary_score` (win rate over frozen instances) aggregates a family rather than claiming a single-seed binary score. +- Isolation: the Showdown server and the adapter run inside the `sim` container; the agent reaches the game only through the `server.py` HTTP protocol. Showdown must bind loopback only. + +### Remaining before freeze +- Fill `solution/` with a real winning reference trajectory (oracle); the adapter, action grammar, observation and fingerprint are finalized. +- Resolve the loopback binding: the Showdown server currently listens on `0.0.0.0:7200`; bind it to `127.0.0.1` inside the sim container so the agent cannot reach it over the compose network. diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..10dcc84 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +RUN apt-get update && apt-get install -y --no-install-recommends bash curl git nodejs npm ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN npm install -g @openai/codex@0.167.1 && npm cache clean --force +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /game_client.py /app/game_client.py +COPY --from=ghcr.io/mll-lab-nu/efe:connection-files-0.1.0@sha256:6d1002dea6ca507b4148d3196e233838e645b33bcfa9a27ae4a43027ae519999 /service_connection.py /app/service_connection.py +ENV PYTHONUNBUFFERED=1 PYTHONPATH=/app +RUN mkdir -p /app/output +WORKDIR /app diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7f2eab8 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/docker-compose.yaml @@ -0,0 +1,43 @@ +services: + main: + pids_limit: 256 # rcb-monitor + volumes: # rcb-monitor + - rcb_limits:/run/rcb-limits:ro # rcb-monitor + depends_on: [sim] + sim: + cpus: 1 # rcb-monitor + mem_limit: 2048m # rcb-monitor + pids_limit: 128 # rcb-monitor + volumes: # rcb-monitor + - rcb_observe:/run/rcb-observe:ro # rcb-monitor + build: + context: sim + dockerfile: Dockerfile + working_dir: /srv + command: bash -c "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 15; exec python3 /srv/server.py" + environment: + RCB_WALL_CLOCK_S: "600" + # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py) + rcb_monitor: + image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a + pid: host + cgroup: host + network_mode: none + cap_add: [SYS_PTRACE] + cpus: 0.5 + mem_limit: 256m + pids_limit: 64 + restart: on-failure + working_dir: /var/rcb-monitor + volumes: + - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro + - rcb_limits:/run/rcb-limits + - rcb_observe:/run/rcb-observe + environment: + RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0} + RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05} + command: ["python3", "/opt/rcb_monitor/monitor.py", "run"] + # <<< rcb_monitor +volumes: # rcb-monitor + rcb_limits: # rcb-monitor + rcb_observe: # rcb-monitor diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..7accb8f --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/rcb_monitor/limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-bc-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..fc4b776 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,35 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +ENV PYTHONUNBUFFERED=1 MPLBACKEND=Agg +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates nodejs npm \ + && rm -rf /var/lib/apt/lists/* + +# Native poke-env fork (VGC doubles support) and pinned runtime deps. +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir -r /srv/requirements.txt + +# Pin the native Pokemon Showdown simulator to the vgc-bench submodule commit. +# TODO(isolation): ensure Showdown binds 127.0.0.1 only so the agent container cannot +# reach it over the compose network; the exact bind mechanism (config.js `host` or a +# CLI flag) must be confirmed against this pinned commit. +RUN git clone --depth 1 --branch vgc-bench https://github.com/cameronangliss/pokemon-showdown.git /srv/pokemon-showdown \ + && cd /srv/pokemon-showdown \ + && git checkout 913da3602a3aa1db79f9fdc5d5222eaf8d39569d \ + && npm install --no-audit --no-fund + +# Trusted game service and shared runtime files. +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /server.py /srv/server.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /srv/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /srv/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /contracts.py /srv/contracts.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /encoding.py /srv/encoding.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /recording.py /srv/recording.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /srv/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /vgc_bench /srv/vgc_bench +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /data /srv/data +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /models /srv/models +COPY instance.json /srv/instance.json +WORKDIR /srv +# Start the native Showdown server on loopback, wait for it, then run the trusted +# game service (HTTP) that the agent reaches through the compose network. +CMD ["bash", "-c", "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 6; exec python3 /srv/server.py"] diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..b3a734d --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/environment/sim/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-bc", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "1a7709b8c5d833476a872ef108bedb0594e31baf6f61234ede7d058d18783799", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "bc", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/instruction.md b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/instruction.md new file mode 100644 index 0000000..403fc0e --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/instruction.md @@ -0,0 +1,69 @@ +# VGC · gen9championsvgc2026regma + +You pilot one side of a frozen Pokémon VGC doubles battle (two active Pokémon per side). Your opponent is the native **behavior-cloning (BC)** player. Both teams are fixed and revealed (open team sheet). Win the battle. + +**Task.** Use the Python client below to read the battle state and submit one action per active Pokémon (two submissions per turn). Knock out all four of the opponent's brought Pokémon before yours are knocked out. + +## Rules +- **Drive the battle with a program.** Use the Python client to read observations and submit actions. Your program may run many turns in a loop. +- **No reset or undo.** You get one episode. Stop submitting actions when `done` is true. +- **Two actions advance one turn.** Submit one action for slot 0, then one for slot 1; the adapter applies both together and returns the result. +- The service records your live episode and grades it. Leave your main control script at `/app/output/gen.py` for the record. +- **Nothing is put into your context automatically.** Observations come back as JSON in a Python dictionary. What you print, inspect and store is your code's decision. + +## Scoring +You earn **100 points** if your side wins the battle. Any episode that ends without winning earns **0 points**. + +## Client (`/app/game_client.py`) +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings and action grammar +print(spec["action_schema"]) # the accepted action format for this task +print(spec["opponent"]) # the fixed native opponent + +obs = game.observe() # current snapshot without spending a turn +print(obs["step"], obs["done"]) # accepted turns so far and whether the episode ended +if not obs["done"]: + data = obs["observation"] # battle state serialized as JSON + print(data) # inspect the fields you need + +# Submit one action index per active slot. Read `data["slot"]` and +# `data["available_actions"]` (a list of ": " entries) to pick. +# if not obs["done"]: +# obs = game.step("7", expected_step=obs["step"]) # slot 0: move index 7 +# obs = game.step("12", expected_step=obs["step"]) # slot 1: move index 12 (one turn done) +``` + +### Observations +`observation` is the native battle state serialized as JSON with these fields: + +- `active` / `opponent_active`: the Pokémon currently on the field (species, HP fraction, status, ability, item, available moves). +- `team` / `opponent_team`: the six brought Pokémon keyed by slot. +- `weather`: the current weather, if any. +- `slot`: which active slot the next action is for (0 or 1). +- `available_actions`: the legal actions for that slot, each `": "` (moves, switches, terastallize). + +The team preview is handled for you automatically. + +Field names match the adapter's serialization (`game_first_exam/benchmarks/vgc/adapter.py`); the agent receives only these player-visible fields, never hidden engine state. + +### Actions and feedback +Submit a single action index (a number) chosen from `available_actions`. Submitting for slot 0 +returns an updated snapshot asking for slot 1 without advancing the game; submitting for slot 1 +applies both actions, advances one turn, and returns the reward. The action grammar is declared +in `spec["action_schema"]["pattern"]`. `step` counts accepted turns. Pass the current `step` as +`expected_step`; if the step number is stale or a response is lost, call `observe()` before +choosing the next action. + +## External material +The network is open. You may install packages (pip, apt), and you may search for, download and use public tools, robot models and pretrained controllers: finding existing work and adapting it to this task is encouraged. Say in your notes what you used. You may read anything installed in your container, this benchmark's own source code included. The one thing not to look up is a ready-made solution to this exact task, such as this benchmark's reference solutions. This is an honour rule; trials are reviewed. + +## Resources +Your container: **1 CPUs**, **1 GiB of memory**, **256 processes and threads** and **2 GiB** of disk (new files under `/app`, `/tmp` and `/root`). Your container has no GPU. The simulator runs in its own container and does not count against these. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`. + +## Time limit +You have 600 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task. + +This is wall-clock time from the start of your session; the time you wait for the simulator service counts. When it is up you are stopped without warning and the episode is graded as it stands at that moment. The service's `time_left_s` counts the same limit from your first request to the service, so it never runs out before your time does: your real time left is `time_left_s` minus the time you spent before that request. Plan by it. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above). diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/actions.json b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/actions.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/actions.json @@ -0,0 +1 @@ +[] diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/solve.sh b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/solve.sh new file mode 100644 index 0000000..65e8dac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/solution/solve.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +from game_client import GameClient + +client = GameClient() +obs = client.observe() +submissions = 0 +while not obs["done"] and submissions < 400: + state = obs["observation"]["observation"] # the native battle state + acts = state.get("available_actions") or [] # [": ", ...] + if not acts: # battle still settling (team preview) + obs = client.observe() + continue + # Heuristic: prefer the first attacking move (index >= 7), else any legal action. + moves = [a for a in acts if int(a.split(":")[0]) >= 7] + action = moves[0].split(":")[0] if moves else acts[0].split(":")[0] + obs = client.step(action, obs["step"]) # one submission (slot 0, then slot 1) + submissions += 1 +print("episode finished: done", obs["done"], "at public step", obs["step"], + "after", submissions, "submissions") +PYCODE diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/task.toml b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/task.toml new file mode 100644 index 0000000..c84049e --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/task.toml @@ -0,0 +1,60 @@ +schema_version = "1.3" +artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, { source = "/data/final.json", service = "sim" }, + { source = "/data/episode.jsonl", service = "sim" }, + { source = "/data/recording.json", service = "sim" }, + { source = "/data/replay.mp4", service = "sim" }, + { source = "/data/replay.last.png", service = "sim" }, + { source = "/data/replay.log", service = "sim" }, + { source = '/data/replays/', service = 'sim' }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vgc-vs-bc-i01-standard" +description = "Win a frozen VGC doubles battle against the native behavior-cloning (BC) opponent." +keywords = ["game", "vgc", "pokemon", "doubles", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vgc" +robot = "game-agent" +family = "vs-bc" +dynamics = "static" +protocol = "game-standard/2.2" +oracle = "full" +instance_seed = 0 +expert_time_estimate_hours = 0.5 + +[verifier] +timeout_sec = 120.0 +environment_mode = "separate" +network_mode = "no-network" + +# Resources (PROTOCOL §6): seal the monitor's record first. +[[verifier.collect]] +service = "rcb_monitor" +command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90" +timeout_sec = 120 + +[[verifier.collect]] +service = "main" +command = "kill -9 -1 2>/dev/null; exit 0" +timeout_sec = 30 + +[[verifier.collect]] +service = "sim" +command = "kill -USR1 $(cat /data/server.pid); i=0; while [ ! -f /data/collection.ready ] && [ $i -lt 30 ]; do sleep 1; i=$((i+1)); done; test -f /data/collection.ready && test -f /data/final.json" +timeout_sec = 40 + +[agent] +timeout_sec = 600.0 +network_mode = "public" + +[environment] +build_timeout_sec = 1800.0 +cpus = 1 +memory_mb = 1024 +storage_mb = 2048 + +[verifier.env] +RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}" diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..ccaa0ce --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +COPY test.sh instance.json /tests/ +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /grade.py /tests/grade.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /tests/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /tests/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /metric_rules.py /tests/metric_rules.py +RUN chmod +x /tests/test.sh +# resources (PROTOCOL §6) # rcb-monitor +COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py +COPY rcb_limits.json /tests/rcb_limits.json diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/instance.json b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/instance.json new file mode 100644 index 0000000..b3a734d --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-bc", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "1a7709b8c5d833476a872ef108bedb0594e31baf6f61234ede7d058d18783799", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "bc", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..7accb8f --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/rcb_limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-bc-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/test.sh b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/test.sh new file mode 100644 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-bc-i01-standard/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +rm -rf /logs/verifier/* +trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6) +p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1) +mkdir -p /logs/verifier +python3 /tests/grade.py 2>/logs/verifier/grade.log diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/DIGEST b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/DIGEST new file mode 100644 index 0000000..2d7bebe --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:1c70e70d99cc45d1ad76eee564a9097f99ae347abf98616c21d985885b3479be diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/README.md b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/README.md new file mode 100644 index 0000000..d49f064 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/README.md @@ -0,0 +1,47 @@ +# vgc-vs-maxbasepower-i01-standard + +| | | +|---|---| +| Benchmark | VGC | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: single frozen battle, no privileged replay twin yet) | +| Simulator / robot | `vgc` / `game-agent` | +| Family / instance | `vs-max-base-power` / seed 0 | +| Oracle | `full` | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db` | + +## Task +Win a frozen VGC doubles battle (regulation MA, `gen9championsvgc2026regma`) against the native random opponent. Both teams are frozen in the instance; the opponent policy is `random`. + +## Difficulty +Piloting a doubles team under partial information and stochastic battle mechanics (damage rolls, speed ties), with the opponent policy fixed but its in-battle RNG unseeded. + +## Reference solution +See `solution/`. + +## Verification +The isolated verifier checks the trusted `final.json` (win/loss, native return, action count, instance binding). It does not replay the trajectory or run the engine. + +## Resources +Caps per container (PROTOCOL §6). + +| Container | CPUs | Memory | Processes | GPU memory | Disk | +|---|---|---|---|---|---| +| `main` (the agent's) | 1 | 1 GiB | 256 | no GPU | 2 GiB | +| `sim` | 1 | 2 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Compatibility and deviations +- Only the native battle environment (poke-env fork + Pokemon Showdown) is reused. VGC-Bench's RL/BC training, LLM agent, and evaluation tools are not migrated. +- The two-player battle is reduced to a single-agent episode by fixing the opponent at construction. +- The Showdown engine PRNG is not seeded from Python; single-battle outcomes are therefore not bit-reproducible. `win` is the primary metric; the framework's `mean_primary_score` (win rate over frozen instances) aggregates a family rather than claiming a single-seed binary score. +- Isolation: the Showdown server and the adapter run inside the `sim` container; the agent reaches the game only through the `server.py` HTTP protocol. Showdown must bind loopback only. + +### Remaining before freeze +- Fill `solution/` with a real winning reference trajectory (oracle); the adapter, action grammar, observation and fingerprint are finalized. +- Resolve the loopback binding: the Showdown server currently listens on `0.0.0.0:7200`; bind it to `127.0.0.1` inside the sim container so the agent cannot reach it over the compose network. diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..10dcc84 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +RUN apt-get update && apt-get install -y --no-install-recommends bash curl git nodejs npm ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN npm install -g @openai/codex@0.167.1 && npm cache clean --force +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /game_client.py /app/game_client.py +COPY --from=ghcr.io/mll-lab-nu/efe:connection-files-0.1.0@sha256:6d1002dea6ca507b4148d3196e233838e645b33bcfa9a27ae4a43027ae519999 /service_connection.py /app/service_connection.py +ENV PYTHONUNBUFFERED=1 PYTHONPATH=/app +RUN mkdir -p /app/output +WORKDIR /app diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7f2eab8 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/docker-compose.yaml @@ -0,0 +1,43 @@ +services: + main: + pids_limit: 256 # rcb-monitor + volumes: # rcb-monitor + - rcb_limits:/run/rcb-limits:ro # rcb-monitor + depends_on: [sim] + sim: + cpus: 1 # rcb-monitor + mem_limit: 2048m # rcb-monitor + pids_limit: 128 # rcb-monitor + volumes: # rcb-monitor + - rcb_observe:/run/rcb-observe:ro # rcb-monitor + build: + context: sim + dockerfile: Dockerfile + working_dir: /srv + command: bash -c "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 15; exec python3 /srv/server.py" + environment: + RCB_WALL_CLOCK_S: "600" + # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py) + rcb_monitor: + image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a + pid: host + cgroup: host + network_mode: none + cap_add: [SYS_PTRACE] + cpus: 0.5 + mem_limit: 256m + pids_limit: 64 + restart: on-failure + working_dir: /var/rcb-monitor + volumes: + - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro + - rcb_limits:/run/rcb-limits + - rcb_observe:/run/rcb-observe + environment: + RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0} + RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05} + command: ["python3", "/opt/rcb_monitor/monitor.py", "run"] + # <<< rcb_monitor +volumes: # rcb-monitor + rcb_limits: # rcb-monitor + rcb_observe: # rcb-monitor diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..aff1f60 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/rcb_monitor/limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-maxbasepower-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..fc4b776 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,35 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +ENV PYTHONUNBUFFERED=1 MPLBACKEND=Agg +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates nodejs npm \ + && rm -rf /var/lib/apt/lists/* + +# Native poke-env fork (VGC doubles support) and pinned runtime deps. +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir -r /srv/requirements.txt + +# Pin the native Pokemon Showdown simulator to the vgc-bench submodule commit. +# TODO(isolation): ensure Showdown binds 127.0.0.1 only so the agent container cannot +# reach it over the compose network; the exact bind mechanism (config.js `host` or a +# CLI flag) must be confirmed against this pinned commit. +RUN git clone --depth 1 --branch vgc-bench https://github.com/cameronangliss/pokemon-showdown.git /srv/pokemon-showdown \ + && cd /srv/pokemon-showdown \ + && git checkout 913da3602a3aa1db79f9fdc5d5222eaf8d39569d \ + && npm install --no-audit --no-fund + +# Trusted game service and shared runtime files. +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /server.py /srv/server.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /srv/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /srv/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /contracts.py /srv/contracts.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /encoding.py /srv/encoding.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /recording.py /srv/recording.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /srv/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /vgc_bench /srv/vgc_bench +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /data /srv/data +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /models /srv/models +COPY instance.json /srv/instance.json +WORKDIR /srv +# Start the native Showdown server on loopback, wait for it, then run the trusted +# game service (HTTP) that the agent reaches through the compose network. +CMD ["bash", "-c", "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 6; exec python3 /srv/server.py"] diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..1773fac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/environment/sim/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-max-base-power", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3f166f6e9d6af3185ad6306b5a19799b2b683f51e2d745c34331c0b0ba74b64a", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "max_base_power", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/instruction.md b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/instruction.md new file mode 100644 index 0000000..84f57ca --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/instruction.md @@ -0,0 +1,69 @@ +# VGC · gen9championsvgc2026regma + +You pilot one side of a frozen Pokémon VGC doubles battle (two active Pokémon per side). Your opponent is the native **max-base-power** player. Both teams are fixed and revealed (open team sheet). Win the battle. + +**Task.** Use the Python client below to read the battle state and submit one action per active Pokémon (two submissions per turn). Knock out all four of the opponent's brought Pokémon before yours are knocked out. + +## Rules +- **Drive the battle with a program.** Use the Python client to read observations and submit actions. Your program may run many turns in a loop. +- **No reset or undo.** You get one episode. Stop submitting actions when `done` is true. +- **Two actions advance one turn.** Submit one action for slot 0, then one for slot 1; the adapter applies both together and returns the result. +- The service records your live episode and grades it. Leave your main control script at `/app/output/gen.py` for the record. +- **Nothing is put into your context automatically.** Observations come back as JSON in a Python dictionary. What you print, inspect and store is your code's decision. + +## Scoring +You earn **100 points** if your side wins the battle. Any episode that ends without winning earns **0 points**. + +## Client (`/app/game_client.py`) +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings and action grammar +print(spec["action_schema"]) # the accepted action format for this task +print(spec["opponent"]) # the fixed native opponent + +obs = game.observe() # current snapshot without spending a turn +print(obs["step"], obs["done"]) # accepted turns so far and whether the episode ended +if not obs["done"]: + data = obs["observation"] # battle state serialized as JSON + print(data) # inspect the fields you need + +# Submit one action index per active slot. Read `data["slot"]` and +# `data["available_actions"]` (a list of ": " entries) to pick. +# if not obs["done"]: +# obs = game.step("7", expected_step=obs["step"]) # slot 0: move index 7 +# obs = game.step("12", expected_step=obs["step"]) # slot 1: move index 12 (one turn done) +``` + +### Observations +`observation` is the native battle state serialized as JSON with these fields: + +- `active` / `opponent_active`: the Pokémon currently on the field (species, HP fraction, status, ability, item, available moves). +- `team` / `opponent_team`: the six brought Pokémon keyed by slot. +- `weather`: the current weather, if any. +- `slot`: which active slot the next action is for (0 or 1). +- `available_actions`: the legal actions for that slot, each `": "` (moves, switches, terastallize). + +The team preview is handled for you automatically. + +Field names match the adapter's serialization (`game_first_exam/benchmarks/vgc/adapter.py`); the agent receives only these player-visible fields, never hidden engine state. + +### Actions and feedback +Submit a single action index (a number) chosen from `available_actions`. Submitting for slot 0 +returns an updated snapshot asking for slot 1 without advancing the game; submitting for slot 1 +applies both actions, advances one turn, and returns the reward. The action grammar is declared +in `spec["action_schema"]["pattern"]`. `step` counts accepted turns. Pass the current `step` as +`expected_step`; if the step number is stale or a response is lost, call `observe()` before +choosing the next action. + +## External material +The network is open. You may install packages (pip, apt), and you may search for, download and use public tools, robot models and pretrained controllers: finding existing work and adapting it to this task is encouraged. Say in your notes what you used. You may read anything installed in your container, this benchmark's own source code included. The one thing not to look up is a ready-made solution to this exact task, such as this benchmark's reference solutions. This is an honour rule; trials are reviewed. + +## Resources +Your container: **1 CPUs**, **1 GiB of memory**, **256 processes and threads** and **2 GiB** of disk (new files under `/app`, `/tmp` and `/root`). Your container has no GPU. The simulator runs in its own container and does not count against these. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`. + +## Time limit +You have 600 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task. + +This is wall-clock time from the start of your session; the time you wait for the simulator service counts. When it is up you are stopped without warning and the episode is graded as it stands at that moment. The service's `time_left_s` counts the same limit from your first request to the service, so it never runs out before your time does: your real time left is `time_left_s` minus the time you spent before that request. Plan by it. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above). diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/actions.json b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/actions.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/actions.json @@ -0,0 +1 @@ +[] diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/solve.sh b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/solve.sh new file mode 100644 index 0000000..65e8dac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/solution/solve.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +from game_client import GameClient + +client = GameClient() +obs = client.observe() +submissions = 0 +while not obs["done"] and submissions < 400: + state = obs["observation"]["observation"] # the native battle state + acts = state.get("available_actions") or [] # [": ", ...] + if not acts: # battle still settling (team preview) + obs = client.observe() + continue + # Heuristic: prefer the first attacking move (index >= 7), else any legal action. + moves = [a for a in acts if int(a.split(":")[0]) >= 7] + action = moves[0].split(":")[0] if moves else acts[0].split(":")[0] + obs = client.step(action, obs["step"]) # one submission (slot 0, then slot 1) + submissions += 1 +print("episode finished: done", obs["done"], "at public step", obs["step"], + "after", submissions, "submissions") +PYCODE diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/task.toml b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/task.toml new file mode 100644 index 0000000..24614ed --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/task.toml @@ -0,0 +1,60 @@ +schema_version = "1.3" +artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, { source = "/data/final.json", service = "sim" }, + { source = "/data/episode.jsonl", service = "sim" }, + { source = "/data/recording.json", service = "sim" }, + { source = "/data/replay.mp4", service = "sim" }, + { source = "/data/replay.last.png", service = "sim" }, + { source = "/data/replay.log", service = "sim" }, + { source = '/data/replays/', service = 'sim' }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vgc-vs-maxbasepower-i01-standard" +description = "Win a frozen VGC doubles battle against the native random opponent." +keywords = ["game", "vgc", "pokemon", "doubles", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vgc" +robot = "game-agent" +family = "vs-max-base-power" +dynamics = "static" +protocol = "game-standard/2.2" +oracle = "full" +instance_seed = 0 +expert_time_estimate_hours = 0.5 + +[verifier] +timeout_sec = 120.0 +environment_mode = "separate" +network_mode = "no-network" + +# Resources (PROTOCOL §6): seal the monitor's record first. +[[verifier.collect]] +service = "rcb_monitor" +command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90" +timeout_sec = 120 + +[[verifier.collect]] +service = "main" +command = "kill -9 -1 2>/dev/null; exit 0" +timeout_sec = 30 + +[[verifier.collect]] +service = "sim" +command = "kill -USR1 $(cat /data/server.pid); i=0; while [ ! -f /data/collection.ready ] && [ $i -lt 30 ]; do sleep 1; i=$((i+1)); done; test -f /data/collection.ready && test -f /data/final.json" +timeout_sec = 40 + +[agent] +timeout_sec = 600.0 +network_mode = "public" + +[environment] +build_timeout_sec = 1800.0 +cpus = 1 +memory_mb = 1024 +storage_mb = 2048 + +[verifier.env] +RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}" diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..ccaa0ce --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +COPY test.sh instance.json /tests/ +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /grade.py /tests/grade.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /tests/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /tests/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /metric_rules.py /tests/metric_rules.py +RUN chmod +x /tests/test.sh +# resources (PROTOCOL §6) # rcb-monitor +COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py +COPY rcb_limits.json /tests/rcb_limits.json diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/instance.json b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/instance.json new file mode 100644 index 0000000..1773fac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-max-base-power", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3f166f6e9d6af3185ad6306b5a19799b2b683f51e2d745c34331c0b0ba74b64a", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "max_base_power", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..aff1f60 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/rcb_limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-maxbasepower-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/test.sh b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/test.sh new file mode 100644 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-maxbasepower-i01-standard/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +rm -rf /logs/verifier/* +trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6) +p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1) +mkdir -p /logs/verifier +python3 /tests/grade.py 2>/logs/verifier/grade.log diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/DIGEST b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/DIGEST new file mode 100644 index 0000000..8dad92f --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:ffc0eb04b1a67afcf6cbc0531b14ca6acc7020a096e3c0362872c308c7a27d87 diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/README.md b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/README.md new file mode 100644 index 0000000..2aec8b5 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/README.md @@ -0,0 +1,47 @@ +# vgc-vs-random-i01-standard + +| | | +|---|---| +| Benchmark | VGC | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: single frozen battle, no privileged replay twin yet) | +| Simulator / robot | `vgc` / `game-agent` | +| Family / instance | `vs-random` / seed 0 | +| Oracle | `full` | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db` | + +## Task +Win a frozen VGC doubles battle (regulation MA, `gen9championsvgc2026regma`) against the native random opponent. Both teams are frozen in the instance; the opponent policy is `random`. + +## Difficulty +Piloting a doubles team under partial information and stochastic battle mechanics (damage rolls, speed ties), with the opponent policy fixed but its in-battle RNG unseeded. + +## Reference solution +See `solution/`. + +## Verification +The isolated verifier checks the trusted `final.json` (win/loss, native return, action count, instance binding). It does not replay the trajectory or run the engine. + +## Resources +Caps per container (PROTOCOL §6). + +| Container | CPUs | Memory | Processes | GPU memory | Disk | +|---|---|---|---|---|---| +| `main` (the agent's) | 1 | 1 GiB | 256 | no GPU | 2 GiB | +| `sim` | 1 | 2 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Compatibility and deviations +- Only the native battle environment (poke-env fork + Pokemon Showdown) is reused. VGC-Bench's RL/BC training, LLM agent, and evaluation tools are not migrated. +- The two-player battle is reduced to a single-agent episode by fixing the opponent at construction. +- The Showdown engine PRNG is not seeded from Python; single-battle outcomes are therefore not bit-reproducible. `win` is the primary metric; the framework's `mean_primary_score` (win rate over frozen instances) aggregates a family rather than claiming a single-seed binary score. +- Isolation: the Showdown server and the adapter run inside the `sim` container; the agent reaches the game only through the `server.py` HTTP protocol. Showdown must bind loopback only. + +### Remaining before freeze +- Fill `solution/` with a real winning reference trajectory (oracle); the adapter, action grammar, observation and fingerprint are finalized. +- Resolve the loopback binding: the Showdown server currently listens on `0.0.0.0:7200`; bind it to `127.0.0.1` inside the sim container so the agent cannot reach it over the compose network. diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..10dcc84 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +RUN apt-get update && apt-get install -y --no-install-recommends bash curl git nodejs npm ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN npm install -g @openai/codex@0.167.1 && npm cache clean --force +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /game_client.py /app/game_client.py +COPY --from=ghcr.io/mll-lab-nu/efe:connection-files-0.1.0@sha256:6d1002dea6ca507b4148d3196e233838e645b33bcfa9a27ae4a43027ae519999 /service_connection.py /app/service_connection.py +ENV PYTHONUNBUFFERED=1 PYTHONPATH=/app +RUN mkdir -p /app/output +WORKDIR /app diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7f2eab8 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/docker-compose.yaml @@ -0,0 +1,43 @@ +services: + main: + pids_limit: 256 # rcb-monitor + volumes: # rcb-monitor + - rcb_limits:/run/rcb-limits:ro # rcb-monitor + depends_on: [sim] + sim: + cpus: 1 # rcb-monitor + mem_limit: 2048m # rcb-monitor + pids_limit: 128 # rcb-monitor + volumes: # rcb-monitor + - rcb_observe:/run/rcb-observe:ro # rcb-monitor + build: + context: sim + dockerfile: Dockerfile + working_dir: /srv + command: bash -c "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 15; exec python3 /srv/server.py" + environment: + RCB_WALL_CLOCK_S: "600" + # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py) + rcb_monitor: + image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a + pid: host + cgroup: host + network_mode: none + cap_add: [SYS_PTRACE] + cpus: 0.5 + mem_limit: 256m + pids_limit: 64 + restart: on-failure + working_dir: /var/rcb-monitor + volumes: + - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro + - rcb_limits:/run/rcb-limits + - rcb_observe:/run/rcb-observe + environment: + RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0} + RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05} + command: ["python3", "/opt/rcb_monitor/monitor.py", "run"] + # <<< rcb_monitor +volumes: # rcb-monitor + rcb_limits: # rcb-monitor + rcb_observe: # rcb-monitor diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..9a52ddd --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/rcb_monitor/limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-random-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..fc4b776 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,35 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +ENV PYTHONUNBUFFERED=1 MPLBACKEND=Agg +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates nodejs npm \ + && rm -rf /var/lib/apt/lists/* + +# Native poke-env fork (VGC doubles support) and pinned runtime deps. +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir -r /srv/requirements.txt + +# Pin the native Pokemon Showdown simulator to the vgc-bench submodule commit. +# TODO(isolation): ensure Showdown binds 127.0.0.1 only so the agent container cannot +# reach it over the compose network; the exact bind mechanism (config.js `host` or a +# CLI flag) must be confirmed against this pinned commit. +RUN git clone --depth 1 --branch vgc-bench https://github.com/cameronangliss/pokemon-showdown.git /srv/pokemon-showdown \ + && cd /srv/pokemon-showdown \ + && git checkout 913da3602a3aa1db79f9fdc5d5222eaf8d39569d \ + && npm install --no-audit --no-fund + +# Trusted game service and shared runtime files. +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /server.py /srv/server.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /srv/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /srv/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /contracts.py /srv/contracts.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /encoding.py /srv/encoding.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /recording.py /srv/recording.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /srv/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /vgc_bench /srv/vgc_bench +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /data /srv/data +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /models /srv/models +COPY instance.json /srv/instance.json +WORKDIR /srv +# Start the native Showdown server on loopback, wait for it, then run the trusted +# game service (HTTP) that the agent reaches through the compose network. +CMD ["bash", "-c", "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 6; exec python3 /srv/server.py"] diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..7a54b9b --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/environment/sim/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-random", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "ad45d316cb32ada0fd435b495375352a47c40518804376fd3f87198092e42494", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "random", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/instruction.md b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/instruction.md new file mode 100644 index 0000000..5c5005d --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/instruction.md @@ -0,0 +1,69 @@ +# VGC · gen9championsvgc2026regma + +You pilot one side of a frozen Pokémon VGC doubles battle (two active Pokémon per side). Your opponent is the native **random** player. Both teams are fixed and revealed (open team sheet). Win the battle. + +**Task.** Use the Python client below to read the battle state and submit one action per active Pokémon (two submissions per turn). Knock out all four of the opponent's brought Pokémon before yours are knocked out. + +## Rules +- **Drive the battle with a program.** Use the Python client to read observations and submit actions. Your program may run many turns in a loop. +- **No reset or undo.** You get one episode. Stop submitting actions when `done` is true. +- **Two actions advance one turn.** Submit one action for slot 0, then one for slot 1; the adapter applies both together and returns the result. +- The service records your live episode and grades it. Leave your main control script at `/app/output/gen.py` for the record. +- **Nothing is put into your context automatically.** Observations come back as JSON in a Python dictionary. What you print, inspect and store is your code's decision. + +## Scoring +You earn **100 points** if your side wins the battle. Any episode that ends without winning earns **0 points**. + +## Client (`/app/game_client.py`) +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings and action grammar +print(spec["action_schema"]) # the accepted action format for this task +print(spec["opponent"]) # the fixed native opponent + +obs = game.observe() # current snapshot without spending a turn +print(obs["step"], obs["done"]) # accepted turns so far and whether the episode ended +if not obs["done"]: + data = obs["observation"] # battle state serialized as JSON + print(data) # inspect the fields you need + +# Submit one action index per active slot. Read `data["slot"]` and +# `data["available_actions"]` (a list of ": " entries) to pick. +# if not obs["done"]: +# obs = game.step("7", expected_step=obs["step"]) # slot 0: move index 7 +# obs = game.step("12", expected_step=obs["step"]) # slot 1: move index 12 (one turn done) +``` + +### Observations +`observation` is the native battle state serialized as JSON with these fields: + +- `active` / `opponent_active`: the Pokémon currently on the field (species, HP fraction, status, ability, item, available moves). +- `team` / `opponent_team`: the six brought Pokémon keyed by slot. +- `weather`: the current weather, if any. +- `slot`: which active slot the next action is for (0 or 1). +- `available_actions`: the legal actions for that slot, each `": "` (moves, switches, terastallize). + +The team preview is handled for you automatically. + +Field names match the adapter's serialization (`game_first_exam/benchmarks/vgc/adapter.py`); the agent receives only these player-visible fields, never hidden engine state. + +### Actions and feedback +Submit a single action index (a number) chosen from `available_actions`. Submitting for slot 0 +returns an updated snapshot asking for slot 1 without advancing the game; submitting for slot 1 +applies both actions, advances one turn, and returns the reward. The action grammar is declared +in `spec["action_schema"]["pattern"]`. `step` counts accepted turns. Pass the current `step` as +`expected_step`; if the step number is stale or a response is lost, call `observe()` before +choosing the next action. + +## External material +The network is open. You may install packages (pip, apt), and you may search for, download and use public tools, robot models and pretrained controllers: finding existing work and adapting it to this task is encouraged. Say in your notes what you used. You may read anything installed in your container, this benchmark's own source code included. The one thing not to look up is a ready-made solution to this exact task, such as this benchmark's reference solutions. This is an honour rule; trials are reviewed. + +## Resources +Your container: **1 CPUs**, **1 GiB of memory**, **256 processes and threads** and **2 GiB** of disk (new files under `/app`, `/tmp` and `/root`). Your container has no GPU. The simulator runs in its own container and does not count against these. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`. + +## Time limit +You have 600 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task. + +This is wall-clock time from the start of your session; the time you wait for the simulator service counts. When it is up you are stopped without warning and the episode is graded as it stands at that moment. The service's `time_left_s` counts the same limit from your first request to the service, so it never runs out before your time does: your real time left is `time_left_s` minus the time you spent before that request. Plan by it. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above). diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/actions.json b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/actions.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/actions.json @@ -0,0 +1 @@ +[] diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/solve.sh b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/solve.sh new file mode 100644 index 0000000..65e8dac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/solution/solve.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +from game_client import GameClient + +client = GameClient() +obs = client.observe() +submissions = 0 +while not obs["done"] and submissions < 400: + state = obs["observation"]["observation"] # the native battle state + acts = state.get("available_actions") or [] # [": ", ...] + if not acts: # battle still settling (team preview) + obs = client.observe() + continue + # Heuristic: prefer the first attacking move (index >= 7), else any legal action. + moves = [a for a in acts if int(a.split(":")[0]) >= 7] + action = moves[0].split(":")[0] if moves else acts[0].split(":")[0] + obs = client.step(action, obs["step"]) # one submission (slot 0, then slot 1) + submissions += 1 +print("episode finished: done", obs["done"], "at public step", obs["step"], + "after", submissions, "submissions") +PYCODE diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/task.toml b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/task.toml new file mode 100644 index 0000000..47b6d77 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/task.toml @@ -0,0 +1,60 @@ +schema_version = "1.3" +artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, { source = "/data/final.json", service = "sim" }, + { source = "/data/episode.jsonl", service = "sim" }, + { source = "/data/recording.json", service = "sim" }, + { source = "/data/replay.mp4", service = "sim" }, + { source = "/data/replay.last.png", service = "sim" }, + { source = "/data/replay.log", service = "sim" }, + { source = '/data/replays/', service = 'sim' }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vgc-vs-random-i01-standard" +description = "Win a frozen VGC doubles battle against the native random opponent." +keywords = ["game", "vgc", "pokemon", "doubles", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vgc" +robot = "game-agent" +family = "vs-random" +dynamics = "static" +protocol = "game-standard/2.2" +oracle = "full" +instance_seed = 0 +expert_time_estimate_hours = 0.5 + +[verifier] +timeout_sec = 120.0 +environment_mode = "separate" +network_mode = "no-network" + +# Resources (PROTOCOL §6): seal the monitor's record first. +[[verifier.collect]] +service = "rcb_monitor" +command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90" +timeout_sec = 120 + +[[verifier.collect]] +service = "main" +command = "kill -9 -1 2>/dev/null; exit 0" +timeout_sec = 30 + +[[verifier.collect]] +service = "sim" +command = "kill -USR1 $(cat /data/server.pid); i=0; while [ ! -f /data/collection.ready ] && [ $i -lt 30 ]; do sleep 1; i=$((i+1)); done; test -f /data/collection.ready && test -f /data/final.json" +timeout_sec = 40 + +[agent] +timeout_sec = 600.0 +network_mode = "public" + +[environment] +build_timeout_sec = 1800.0 +cpus = 1 +memory_mb = 1024 +storage_mb = 2048 + +[verifier.env] +RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}" diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..ccaa0ce --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +COPY test.sh instance.json /tests/ +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /grade.py /tests/grade.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /tests/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /tests/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /metric_rules.py /tests/metric_rules.py +RUN chmod +x /tests/test.sh +# resources (PROTOCOL §6) # rcb-monitor +COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py +COPY rcb_limits.json /tests/rcb_limits.json diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/instance.json b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/instance.json new file mode 100644 index 0000000..7a54b9b --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-random", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "ad45d316cb32ada0fd435b495375352a47c40518804376fd3f87198092e42494", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "random", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..9a52ddd --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/rcb_limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-random-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/test.sh b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/test.sh new file mode 100644 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-random-i01-standard/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +rm -rf /logs/verifier/* +trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6) +p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1) +mkdir -p /logs/verifier +python3 /tests/grade.py 2>/logs/verifier/grade.log diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/DIGEST b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/DIGEST new file mode 100644 index 0000000..e2e2637 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:f2474d97448b8196d7957ed7bbbc6c7823942423d856b5cb0d4f3a3096ffecf8 diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/README.md b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/README.md new file mode 100644 index 0000000..71b8aa5 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/README.md @@ -0,0 +1,47 @@ +# vgc-vs-simpleheuristics-i01-standard + +| | | +|---|---| +| Benchmark | VGC | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: single frozen battle, no privileged replay twin yet) | +| Simulator / robot | `vgc` / `game-agent` | +| Family / instance | `vs-simple-heuristics` / seed 0 | +| Oracle | `full` | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db` | + +## Task +Win a frozen VGC doubles battle (regulation MA, `gen9championsvgc2026regma`) against the native random opponent. Both teams are frozen in the instance; the opponent policy is `random`. + +## Difficulty +Piloting a doubles team under partial information and stochastic battle mechanics (damage rolls, speed ties), with the opponent policy fixed but its in-battle RNG unseeded. + +## Reference solution +See `solution/`. + +## Verification +The isolated verifier checks the trusted `final.json` (win/loss, native return, action count, instance binding). It does not replay the trajectory or run the engine. + +## Resources +Caps per container (PROTOCOL §6). + +| Container | CPUs | Memory | Processes | GPU memory | Disk | +|---|---|---|---|---|---| +| `main` (the agent's) | 1 | 1 GiB | 256 | no GPU | 2 GiB | +| `sim` | 1 | 2 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Compatibility and deviations +- Only the native battle environment (poke-env fork + Pokemon Showdown) is reused. VGC-Bench's RL/BC training, LLM agent, and evaluation tools are not migrated. +- The two-player battle is reduced to a single-agent episode by fixing the opponent at construction. +- The Showdown engine PRNG is not seeded from Python; single-battle outcomes are therefore not bit-reproducible. `win` is the primary metric; the framework's `mean_primary_score` (win rate over frozen instances) aggregates a family rather than claiming a single-seed binary score. +- Isolation: the Showdown server and the adapter run inside the `sim` container; the agent reaches the game only through the `server.py` HTTP protocol. Showdown must bind loopback only. + +### Remaining before freeze +- Fill `solution/` with a real winning reference trajectory (oracle); the adapter, action grammar, observation and fingerprint are finalized. +- Resolve the loopback binding: the Showdown server currently listens on `0.0.0.0:7200`; bind it to `127.0.0.1` inside the sim container so the agent cannot reach it over the compose network. diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..10dcc84 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/Dockerfile @@ -0,0 +1,9 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +RUN apt-get update && apt-get install -y --no-install-recommends bash curl git nodejs npm ca-certificates \ + && rm -rf /var/lib/apt/lists/* +RUN npm install -g @openai/codex@0.167.1 && npm cache clean --force +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /game_client.py /app/game_client.py +COPY --from=ghcr.io/mll-lab-nu/efe:connection-files-0.1.0@sha256:6d1002dea6ca507b4148d3196e233838e645b33bcfa9a27ae4a43027ae519999 /service_connection.py /app/service_connection.py +ENV PYTHONUNBUFFERED=1 PYTHONPATH=/app +RUN mkdir -p /app/output +WORKDIR /app diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7f2eab8 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/docker-compose.yaml @@ -0,0 +1,43 @@ +services: + main: + pids_limit: 256 # rcb-monitor + volumes: # rcb-monitor + - rcb_limits:/run/rcb-limits:ro # rcb-monitor + depends_on: [sim] + sim: + cpus: 1 # rcb-monitor + mem_limit: 2048m # rcb-monitor + pids_limit: 128 # rcb-monitor + volumes: # rcb-monitor + - rcb_observe:/run/rcb-observe:ro # rcb-monitor + build: + context: sim + dockerfile: Dockerfile + working_dir: /srv + command: bash -c "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 15; exec python3 /srv/server.py" + environment: + RCB_WALL_CLOCK_S: "600" + # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py) + rcb_monitor: + image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a + pid: host + cgroup: host + network_mode: none + cap_add: [SYS_PTRACE] + cpus: 0.5 + mem_limit: 256m + pids_limit: 64 + restart: on-failure + working_dir: /var/rcb-monitor + volumes: + - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro + - rcb_limits:/run/rcb-limits + - rcb_observe:/run/rcb-observe + environment: + RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0} + RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05} + command: ["python3", "/opt/rcb_monitor/monitor.py", "run"] + # <<< rcb_monitor +volumes: # rcb-monitor + rcb_limits: # rcb-monitor + rcb_observe: # rcb-monitor diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..33866b5 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/rcb_monitor/limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-simpleheuristics-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..fc4b776 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,35 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +ENV PYTHONUNBUFFERED=1 MPLBACKEND=Agg +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates nodejs npm \ + && rm -rf /var/lib/apt/lists/* + +# Native poke-env fork (VGC doubles support) and pinned runtime deps. +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir -r /srv/requirements.txt + +# Pin the native Pokemon Showdown simulator to the vgc-bench submodule commit. +# TODO(isolation): ensure Showdown binds 127.0.0.1 only so the agent container cannot +# reach it over the compose network; the exact bind mechanism (config.js `host` or a +# CLI flag) must be confirmed against this pinned commit. +RUN git clone --depth 1 --branch vgc-bench https://github.com/cameronangliss/pokemon-showdown.git /srv/pokemon-showdown \ + && cd /srv/pokemon-showdown \ + && git checkout 913da3602a3aa1db79f9fdc5d5222eaf8d39569d \ + && npm install --no-audit --no-fund + +# Trusted game service and shared runtime files. +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /server.py /srv/server.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /srv/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /srv/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /contracts.py /srv/contracts.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /encoding.py /srv/encoding.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /recording.py /srv/recording.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /srv/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /vgc_bench /srv/vgc_bench +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /data /srv/data +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /models /srv/models +COPY instance.json /srv/instance.json +WORKDIR /srv +# Start the native Showdown server on loopback, wait for it, then run the trusted +# game service (HTTP) that the agent reaches through the compose network. +CMD ["bash", "-c", "cd /srv/pokemon-showdown && node pokemon-showdown start 7200 --no-security & sleep 6; exec python3 /srv/server.py"] diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..baaf36f --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/environment/sim/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-simple-heuristics", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "928aedae87949a9810989681d06758c20018d83eff11d529ec59722fccab32b0", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "simple_heuristics", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/instruction.md b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/instruction.md new file mode 100644 index 0000000..a64cce7 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/instruction.md @@ -0,0 +1,69 @@ +# VGC · gen9championsvgc2026regma + +You pilot one side of a frozen Pokémon VGC doubles battle (two active Pokémon per side). Your opponent is the native **simple-heuristics** player. Both teams are fixed and revealed (open team sheet). Win the battle. + +**Task.** Use the Python client below to read the battle state and submit one action per active Pokémon (two submissions per turn). Knock out all four of the opponent's brought Pokémon before yours are knocked out. + +## Rules +- **Drive the battle with a program.** Use the Python client to read observations and submit actions. Your program may run many turns in a loop. +- **No reset or undo.** You get one episode. Stop submitting actions when `done` is true. +- **Two actions advance one turn.** Submit one action for slot 0, then one for slot 1; the adapter applies both together and returns the result. +- The service records your live episode and grades it. Leave your main control script at `/app/output/gen.py` for the record. +- **Nothing is put into your context automatically.** Observations come back as JSON in a Python dictionary. What you print, inspect and store is your code's decision. + +## Scoring +You earn **100 points** if your side wins the battle. Any episode that ends without winning earns **0 points**. + +## Client (`/app/game_client.py`) +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings and action grammar +print(spec["action_schema"]) # the accepted action format for this task +print(spec["opponent"]) # the fixed native opponent + +obs = game.observe() # current snapshot without spending a turn +print(obs["step"], obs["done"]) # accepted turns so far and whether the episode ended +if not obs["done"]: + data = obs["observation"] # battle state serialized as JSON + print(data) # inspect the fields you need + +# Submit one action index per active slot. Read `data["slot"]` and +# `data["available_actions"]` (a list of ": " entries) to pick. +# if not obs["done"]: +# obs = game.step("7", expected_step=obs["step"]) # slot 0: move index 7 +# obs = game.step("12", expected_step=obs["step"]) # slot 1: move index 12 (one turn done) +``` + +### Observations +`observation` is the native battle state serialized as JSON with these fields: + +- `active` / `opponent_active`: the Pokémon currently on the field (species, HP fraction, status, ability, item, available moves). +- `team` / `opponent_team`: the six brought Pokémon keyed by slot. +- `weather`: the current weather, if any. +- `slot`: which active slot the next action is for (0 or 1). +- `available_actions`: the legal actions for that slot, each `": "` (moves, switches, terastallize). + +The team preview is handled for you automatically. + +Field names match the adapter's serialization (`game_first_exam/benchmarks/vgc/adapter.py`); the agent receives only these player-visible fields, never hidden engine state. + +### Actions and feedback +Submit a single action index (a number) chosen from `available_actions`. Submitting for slot 0 +returns an updated snapshot asking for slot 1 without advancing the game; submitting for slot 1 +applies both actions, advances one turn, and returns the reward. The action grammar is declared +in `spec["action_schema"]["pattern"]`. `step` counts accepted turns. Pass the current `step` as +`expected_step`; if the step number is stale or a response is lost, call `observe()` before +choosing the next action. + +## External material +The network is open. You may install packages (pip, apt), and you may search for, download and use public tools, robot models and pretrained controllers: finding existing work and adapting it to this task is encouraged. Say in your notes what you used. You may read anything installed in your container, this benchmark's own source code included. The one thing not to look up is a ready-made solution to this exact task, such as this benchmark's reference solutions. This is an honour rule; trials are reviewed. + +## Resources +Your container: **1 CPUs**, **1 GiB of memory**, **256 processes and threads** and **2 GiB** of disk (new files under `/app`, `/tmp` and `/root`). Your container has no GPU. The simulator runs in its own container and does not count against these. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`. + +## Time limit +You have 600 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task. + +This is wall-clock time from the start of your session; the time you wait for the simulator service counts. When it is up you are stopped without warning and the episode is graded as it stands at that moment. The service's `time_left_s` counts the same limit from your first request to the service, so it never runs out before your time does: your real time left is `time_left_s` minus the time you spent before that request. Plan by it. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above). diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/actions.json b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/actions.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/actions.json @@ -0,0 +1 @@ +[] diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/solve.sh b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/solve.sh new file mode 100644 index 0000000..65e8dac --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/solution/solve.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +from game_client import GameClient + +client = GameClient() +obs = client.observe() +submissions = 0 +while not obs["done"] and submissions < 400: + state = obs["observation"]["observation"] # the native battle state + acts = state.get("available_actions") or [] # [": ", ...] + if not acts: # battle still settling (team preview) + obs = client.observe() + continue + # Heuristic: prefer the first attacking move (index >= 7), else any legal action. + moves = [a for a in acts if int(a.split(":")[0]) >= 7] + action = moves[0].split(":")[0] if moves else acts[0].split(":")[0] + obs = client.step(action, obs["step"]) # one submission (slot 0, then slot 1) + submissions += 1 +print("episode finished: done", obs["done"], "at public step", obs["step"], + "after", submissions, "submissions") +PYCODE diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/task.toml b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/task.toml new file mode 100644 index 0000000..95c775c --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/task.toml @@ -0,0 +1,60 @@ +schema_version = "1.3" +artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, { source = "/data/final.json", service = "sim" }, + { source = "/data/episode.jsonl", service = "sim" }, + { source = "/data/recording.json", service = "sim" }, + { source = "/data/replay.mp4", service = "sim" }, + { source = "/data/replay.last.png", service = "sim" }, + { source = "/data/replay.log", service = "sim" }, + { source = '/data/replays/', service = 'sim' }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vgc-vs-simpleheuristics-i01-standard" +description = "Win a frozen VGC doubles battle against the native random opponent." +keywords = ["game", "vgc", "pokemon", "doubles", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vgc" +robot = "game-agent" +family = "vs-simple-heuristics" +dynamics = "static" +protocol = "game-standard/2.2" +oracle = "full" +instance_seed = 0 +expert_time_estimate_hours = 0.5 + +[verifier] +timeout_sec = 120.0 +environment_mode = "separate" +network_mode = "no-network" + +# Resources (PROTOCOL §6): seal the monitor's record first. +[[verifier.collect]] +service = "rcb_monitor" +command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90" +timeout_sec = 120 + +[[verifier.collect]] +service = "main" +command = "kill -9 -1 2>/dev/null; exit 0" +timeout_sec = 30 + +[[verifier.collect]] +service = "sim" +command = "kill -USR1 $(cat /data/server.pid); i=0; while [ ! -f /data/collection.ready ] && [ $i -lt 30 ]; do sleep 1; i=$((i+1)); done; test -f /data/collection.ready && test -f /data/final.json" +timeout_sec = 40 + +[agent] +timeout_sec = 600.0 +network_mode = "public" + +[environment] +build_timeout_sec = 1800.0 +cpus = 1 +memory_mb = 1024 +storage_mb = 2048 + +[verifier.env] +RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}" diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..ccaa0ce --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/python:3.12.10-slim-bookworm@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db +COPY test.sh instance.json /tests/ +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /grade.py /tests/grade.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /reducers.py /tests/reducers.py +COPY --from=ghcr.io/mll-lab-nu/efe:game-files-0.6.0@sha256:bfb708928954d5cc194a614ab772a65b1e56f381b49dfeb2227c3d609e5f2ecc /config_schema.py /tests/config_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vgc-files-0.1.0@sha256:ed3c5b7a5a1dd2247d7fa819a6b16834debe7d27facb901be45062e2a9cfb422 /metric_rules.py /tests/metric_rules.py +RUN chmod +x /tests/test.sh +# resources (PROTOCOL §6) # rcb-monitor +COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py +COPY rcb_limits.json /tests/rcb_limits.json diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/instance.json b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/instance.json new file mode 100644 index 0000000..baaf36f --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/instance.json @@ -0,0 +1,33 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "capabilities": { + "images": false, + "action_mode": "text", + "timing": "action-stepped", + "native_truncation": false + }, + "benchmark": "vgc", + "env_id": "gen9championsvgc2026regma", + "family": "vs-simple-heuristics", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "928aedae87949a9810989681d06758c20018d83eff11d529ec59722fccab32b0", + "observation_profile": "native-vector-v1", + "metric_spec": { + "primary": "win", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_battle_won" + }, + "reg": "ma", + "team1": "Tyranitar @ Tyranitarite\nAbility: Sand Stream\nLevel: 50\nEVs: 32 HP / 26 Atk / 3 Def / 2 SpD / 3 Spe\nAdamant Nature\n- Crunch\n- Rock Slide\n- Low Kick\n- Protect\n\nMilotic @ Leftovers\nAbility: Competitive\nLevel: 50\nEVs: 22 HP / 31 Def / 13 SpA\nModest Nature\n- Scald\n- Ice Beam\n- Life Dew\n- Protect\n\nSinistcha @ Sitrus Berry\nAbility: Hospitality\nLevel: 50\nEVs: 30 HP / 24 Def / 7 SpA / 2 SpD / 3 Spe\nBold Nature\n- Matcha Gotcha\n- Shadow Ball\n- Calm Mind\n- Protect\n\nRotom-Heat @ Choice Scarf\nAbility: Levitate\nLevel: 50\nEVs: 7 HP / 1 Def / 25 SpA / 1 SpD / 32 Spe\nModest Nature\n- Volt Switch\n- Overheat\n- Electroweb\n- Trick\n\nTauros-Paldea-Aqua (M) @ White Herb\nAbility: Intimidate\nLevel: 50\nEVs: 1 HP / 32 Atk / 1 Def / 32 Spe\nAdamant Nature\n- Wave Crash\n- Close Combat\n- Aqua Jet\n- Protect\n\nSableye @ Roseli Berry\nAbility: Prankster\nLevel: 50\nEVs: 32 HP / 9 Def / 25 SpD\nCalm Nature\n- Night Shade\n- Fake Out\n- Disable\n- Reflect\n", + "team2": "Victreebel @ Victreebelite\nAbility: Chlorophyll\nLevel: 50\nEVs: 25 HP / 9 Def / 32 SpA\nModest Nature\n- Strength Sap\n- Sludge Bomb\n- Protect\n- Energy Ball\n\nMamoswine @ Choice Scarf\nAbility: Oblivious\nLevel: 50\nEVs: 29 HP / 32 Atk / 5 Spe\nAdamant Nature\n- Earthquake\n- High Horsepower\n- Icicle Crash\n- Ice Shard\n\nAerodactyl @ Focus Sash\nAbility: Unnerve\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Protect\n- Dual Wingbeat\n- Rock Slide\n- Tailwind\n\nGyarados @ Lum Berry\nAbility: Intimidate\nLevel: 50\nEVs: 32 HP / 8 Atk / 16 Def / 10 SpD\nCareful Nature\n- Waterfall\n- Protect\n- Ice Fang\n- Thunder Wave\n\nPelipper @ Sitrus Berry\nAbility: Drizzle\nLevel: 50\nEVs: 32 HP / 20 Def / 6 SpA / 8 SpD\nBold Nature\n- Hurricane\n- Wide Guard\n- Protect\n- Weather Ball\n\nSneasler @ White Herb\nAbility: Unburden\nLevel: 50\nEVs: 2 HP / 32 Atk / 32 Spe\nJolly Nature\n- Dire Claw\n- Close Combat\n- Protect\n- Taunt\n", + "opponent_policy": "simple_heuristics", + "engine_versions": { + "poke-env": "0.15.0" + }, + "engine_commit": "379a04628e42b2a2c94790c0788204b652f7ae1b", + "battle_format": "gen9championsvgc2026regma" +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..33866b5 --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/rcb_limits.json @@ -0,0 +1,26 @@ +{ + "agent_timeout_sec": 600, + "caps": { + "main": { + "cpus": 1.0, + "disk_gb": 2.0, + "memory_gb": 1.0, + "pids": 256 + }, + "sim": { + "cpus": 1.0, + "memory_gb": 2.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vgc-vs-simpleheuristics-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/test.sh b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/test.sh new file mode 100644 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vgc/vgc-vs-simpleheuristics-i01-standard/tests/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +rm -rf /logs/verifier/* +trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6) +p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1) +mkdir -p /logs/verifier +python3 /tests/grade.py 2>/logs/verifier/grade.log diff --git a/scripts/generate_vgc_exam.py b/scripts/generate_vgc_exam.py new file mode 100644 index 0000000..8efbd52 --- /dev/null +++ b/scripts/generate_vgc_exam.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +"""Generate the VGC exam's frozen (team1, team2) pairings from the 64-team pool. + +The pool is game_first_exam/benchmarks/vgc/teams/reg_ma/*.txt (the 64 "unseen" +teams, selected exactly as vgc-bench's RandomTeamBuilder does for the generalization +test). Both sides of a battle draw independently from the pool (mirror matches +allowed), matching VGC-Bench's RandomTeamBuilder.yield_team (random.choice), but +seeded here so the pairing is reproducible. + +Usage: + python scripts/generate_vgc_exam.py [seed] # -> vgc_exam_pairs.json +""" +import json +import random +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +TEAMS_DIR = ROOT / "game_first_exam/benchmarks/vgc/teams/reg_ma" + + +def pool() -> list[str]: + """Sorted team file names, mirroring RandomTeamBuilder.get_team_paths(reg).""" + return sorted(p.stem for p in TEAMS_DIR.glob("*.txt")) + + +def main(argv: list[str]) -> int: + if not argv or not argv[0].isdigit(): + print(__doc__) + return 2 + num_pairs = int(argv[0]) + seed = int(argv[1]) if len(argv) > 1 else 0 + names = pool() + if len(names) < 2: + raise SystemExit(f"need at least 2 teams; found {len(names)}") + rng = random.Random(seed) + pairs = [{"team1": rng.choice(names), "team2": rng.choice(names)} for _ in range(num_pairs)] + out = ROOT / "vgc_exam_pairs.json" + out.write_text(json.dumps({"seed": seed, "pool_size": len(names), "pairs": pairs}, indent=2) + "\n", + encoding="utf-8") + print(f"wrote {num_pairs} pairs (seed {seed}, pool {len(names)}) to {out.relative_to(ROOT)}") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/scripts/stamp_mtimes.py b/scripts/stamp_mtimes.py index 5c6ee24..d7727ab 100644 --- a/scripts/stamp_mtimes.py +++ b/scripts/stamp_mtimes.py @@ -86,7 +86,10 @@ def stamp_tree(t: str, full: bool = False, check: bool = False) -> dict: if check: c["bad"] += 1 continue - os.utime(p, ns=(st.st_atime_ns, want), follow_symlinks=False) + try: + os.utime(p, ns=(st.st_atime_ns, want), follow_symlinks=False) + except NotImplementedError: # Windows: os.utime has no follow_symlinks + os.utime(p, ns=(st.st_atime_ns, want)) c["changed"] += 1 except OSError as e: c["err"] += 1 diff --git a/scripts/task_conventions.py b/scripts/task_conventions.py index 36b7e5c..083b710 100644 --- a/scripts/task_conventions.py +++ b/scripts/task_conventions.py @@ -77,6 +77,7 @@ ("crafter-", "Crafter", "crafter"), ("textworld-", "TextWorld", "textworld"), ("minigrid-", "MiniGrid", "minigrid"), + ("vgc-", "VGC", "vgc"), ] BENCHMARKS = [(p, label) for p, label, _ in BENCHMARK_TABLE] # (directory prefix, label): the first matching prefix wins # Modes (PROTOCOL §3): a benchmark ships any subset of the modes. A standard or realtime diff --git a/scripts/task_resources.toml b/scripts/task_resources.toml index f5e2106..3fd934d 100644 --- a/scripts/task_resources.toml +++ b/scripts/task_resources.toml @@ -21,3 +21,12 @@ match = "^minihack-.*-standard$" main = { cpus = 1, memory_gb = 1, pids = 256, disk_gb = 2 } sim = { cpus = 1, memory_gb = 1, pids = 128 } measured = "Initial CPU-only integration caps; measure during validation" + +# VGC runs the native Pokemon Showdown server (Node.js) plus the Python adapter in one sim. +# The simulator must not be reachable by the agent except through the game protocol. + +[[cap]] +match = "^vgc-.*-standard$" +main = { cpus = 1, memory_gb = 1, pids = 256, disk_gb = 2 } +sim = { cpus = 1, memory_gb = 2, pids = 128 } +measured = "Initial CPU-only integration caps; Showdown Node + Python adapter share the sim"