diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index ebee4f6..0b45672 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - benchmark: [common, minigrid, crafter, textworld, babaisai, minihack] + benchmark: [common, minigrid, crafter, textworld, babaisai, minihack, vmage] steps: - uses: actions/checkout@v4 with: {persist-credentials: false} @@ -41,6 +41,7 @@ jobs: with: {python-version: '3.12'} - run: python -m pip install -e . - run: harbor run --game-suite minihack-balrog --standard --list + - run: harbor run --game-suite vmage-smoke --standard --list - run: python game_first_exam/tests/test_game_harbor.py fresh-clone-smoke: runs-on: ubuntu-latest @@ -77,8 +78,38 @@ jobs: name: fresh-clone-room-evidence path: jobs/ retention-days: 7 + fresh-clone-vmage-smoke: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: {persist-credentials: false} + - uses: actions/setup-python@v5 + with: {python-version: '3.12'} + # Start without cached game images or a preloaded local files image. + - uses: docker/setup-docker-action@v5 + with: + version: v29.5.2 + set-host: true + daemon-config: '{"features":{"containerd-snapshotter":true}}' + - run: python -m pip install -e . + - name: Run one V-MAGE oracle per game without model or registry credentials + run: | + harbor run --game-suite vmage-smoke --standard \ + -c configs/harbor/oracle.json --plugin game_harbor:GameRecords \ + --jobs-dir "$PWD/jobs" --job-name fresh-clone-vmage -y + - name: Check all five scores, end states, and evidence + run: python ci_checks/check-vmage-smoke-result.py jobs/fresh-clone-vmage + - name: Decode all five replays + run: | + if ! command -v ffmpeg >/dev/null; then + sudo apt-get update && sudo apt-get install -y ffmpeg + fi + for replay in jobs/fresh-clone-vmage/*/artifacts/data/replay.mp4; do + ffmpeg -v error -xerror -i "$replay" -f null - + done invariants: - needs: [static, adapters, harbor, fresh-clone-smoke] + needs: [static, adapters, harbor, fresh-clone-smoke, fresh-clone-vmage-smoke] if: ${{ always() }} runs-on: ubuntu-latest steps: @@ -87,4 +118,7 @@ jobs: ADAPTERS: ${{ needs.adapters.result }} HARBOR: ${{ needs.harbor.result }} SMOKE: ${{ needs.fresh-clone-smoke.result }} - run: test "$STATIC" = success && test "$ADAPTERS" = success && test "$HARBOR" = success && test "$SMOKE" = success + VMAGE_SMOKE: ${{ needs.fresh-clone-vmage-smoke.result }} + run: | + test "$STATIC" = success && test "$ADAPTERS" = success && test "$HARBOR" = success && + test "$SMOKE" = success && test "$VMAGE_SMOKE" = success diff --git a/ci_checks/check-vmage-smoke-result.py b/ci_checks/check-vmage-smoke-result.py new file mode 100644 index 0000000..eda1a96 --- /dev/null +++ b/ci_checks/check-vmage-smoke-result.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +"""Check the five frozen V-MAGE smoke oracle results and their evidence.""" +import argparse +import json +from pathlib import Path + + +# Game, then expected (raw score, accepted decisions). Race reaches a goal; +# the other four traces deliberately end after demonstrating positive scoring. +EXPECTED = { + "vmage-race-l01-i01-standard": (100, 4), + "vmage-flappybird-l01-i01-standard": (1, 40), + "vmage-pong-l01-i01-standard": (1, 29), + "vmage-supermario-l01-i01-standard": (100, 11), + "vmage-tempestrun-l01-i01-standard": (10, 2), +} +RACE = "vmage-race-l01-i01-standard" + + +def read(path): + return json.loads(path.read_text()) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def check(job): + paths = sorted(job.glob("*/result.json")) + require(len(paths) == len(EXPECTED), "expected exactly five completed trials") + require(read(job / "game-provenance.json")["status"] == "complete", "provenance incomplete") + require(read(job / "runtime-images.json")["complete"] is True, "runtime image capture incomplete") + summary = read(job / "game-report/summary.json") + require(summary["complete"] and summary["expected_trials"] == summary["valid_trials"] == len(EXPECTED), + "derived report incomplete") + + evidence = {} + for path in paths: + result = read(path) + task = result["task_name"].rsplit("/", 1)[-1] + require(task in EXPECTED and task not in evidence, f"unexpected or duplicate task: {task}") + score, steps = EXPECTED[task] + require(result.get("exception_info") is None, f"{task}: Harbor trial raised an exception") + agent = result.get("agent_info", {}) + require(agent.get("name") == "oracle" and agent.get("model_info") is None, + f"{task}: smoke must run without a model") + + trial = path.parent + reward = read(trial / "verifier/reward.json") + require(reward.get("result_valid") == 1, f"{task}: invalid result") + for key in ("infra_error", "sim_error", "environment_error"): + require(reward.get(key) == 0, f"{task}: {key} is not zero") + require(reward.get("primary_score") == score and reward.get("steps") == steps, + f"{task}: expected {score} raw points in {steps} actions") + + data = trial / "artifacts/data" + final = read(data / "final.json") + require(final["finalized"] and final["result_valid"], f"{task}: invalid simulator evidence") + require(final["metrics"]["native_score"] == score and final["steps"] == steps, + f"{task}: simulator and verifier disagree") + require(not final["truncated"], f"{task}: unexpected truncation") + if task == RACE: + require(final["terminated"] and final["reason"] == "native_terminated" + and final["metrics"]["native_win"] and final["metrics"]["terminal_cause"] == "native_win" + and final["success"] and reward.get("success") == 1, + f"{task}: oracle did not reach the trophy") + else: + require(not final["terminated"] and final["reason"] == "agent_finished" + and final["metrics"]["terminal_cause"] == "running", + f"{task}: partial reference ended unexpectedly") + + recording = read(data / "recording.json") + require(recording.get("video_source") == "live" and recording.get("render_error") is None, + f"{task}: live recording failed") + for name in ("episode.jsonl", "replay.mp4"): + artifact = data / name + require(artifact.is_file() and artifact.stat().st_size > 0, f"{task}: {name} missing") + # A short run can finish before resource sampling. Preserve those flags. + evidence[task] = dict(score=score, steps=steps, end=final["reason"], + resource_monitor_missing=reward.get("resource_monitor_missing"), + resource_enforced=reward.get("resource_enforced")) + print(json.dumps(evidence, indent=2, sort_keys=True)) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("job", type=Path) + check(parser.parse_args().job) diff --git a/configs/game_benchmarks.toml b/configs/game_benchmarks.toml index 8f77b59..edd5d3d 100644 --- a/configs/game_benchmarks.toml +++ b/configs/game_benchmarks.toml @@ -14,3 +14,33 @@ schema = "game_first_exam/benchmarks/babaisai/instance_schema.py" [benchmarks.minihack] schema = "game_first_exam/benchmarks/minihack/instance_schema.py" + +[benchmarks.vmage_race] +schema = "game_first_exam/benchmarks/vmage/race/instance_schema.py" +adapter = "game_first_exam/benchmarks/vmage/race/adapter.py" +metric_rules = "game_first_exam/benchmarks/vmage/common/metric_rules.py" +runtime_files = { "/srv/vmage_bridge.py" = "game_first_exam/benchmarks/vmage/common/vmage_bridge.py", "/srv/source_loader.py" = "game_first_exam/benchmarks/vmage/common/source_loader.py", "/srv/SOURCE.json" = "game_first_exam/benchmarks/vmage/common/SOURCE.json" } + +[benchmarks.vmage_flappybird] +schema = "game_first_exam/benchmarks/vmage/flappybird/instance_schema.py" +adapter = "game_first_exam/benchmarks/vmage/flappybird/adapter.py" +metric_rules = "game_first_exam/benchmarks/vmage/common/metric_rules.py" +runtime_files = { "/srv/vmage_bridge.py" = "game_first_exam/benchmarks/vmage/common/vmage_bridge.py", "/srv/source_loader.py" = "game_first_exam/benchmarks/vmage/common/source_loader.py", "/srv/SOURCE.json" = "game_first_exam/benchmarks/vmage/common/SOURCE.json" } + +[benchmarks.vmage_pong] +schema = "game_first_exam/benchmarks/vmage/pong/instance_schema.py" +adapter = "game_first_exam/benchmarks/vmage/pong/adapter.py" +metric_rules = "game_first_exam/benchmarks/vmage/common/metric_rules.py" +runtime_files = { "/srv/vmage_bridge.py" = "game_first_exam/benchmarks/vmage/common/vmage_bridge.py", "/srv/source_loader.py" = "game_first_exam/benchmarks/vmage/common/source_loader.py", "/srv/SOURCE.json" = "game_first_exam/benchmarks/vmage/common/SOURCE.json" } + +[benchmarks.vmage_supermario] +schema = "game_first_exam/benchmarks/vmage/supermario/instance_schema.py" +adapter = "game_first_exam/benchmarks/vmage/supermario/adapter.py" +metric_rules = "game_first_exam/benchmarks/vmage/common/metric_rules.py" +runtime_files = { "/srv/vmage_bridge.py" = "game_first_exam/benchmarks/vmage/common/vmage_bridge.py", "/srv/source_loader.py" = "game_first_exam/benchmarks/vmage/common/source_loader.py", "/srv/SOURCE.json" = "game_first_exam/benchmarks/vmage/common/SOURCE.json" } + +[benchmarks.vmage_tempestrun] +schema = "game_first_exam/benchmarks/vmage/tempestrun/instance_schema.py" +adapter = "game_first_exam/benchmarks/vmage/tempestrun/adapter.py" +metric_rules = "game_first_exam/benchmarks/vmage/common/metric_rules.py" +runtime_files = { "/srv/vmage_bridge.py" = "game_first_exam/benchmarks/vmage/common/vmage_bridge.py", "/srv/source_loader.py" = "game_first_exam/benchmarks/vmage/common/source_loader.py", "/srv/SOURCE.json" = "game_first_exam/benchmarks/vmage/common/SOURCE.json" } diff --git a/configs/game_suites/vmage-extra.toml b/configs/game_suites/vmage-extra.toml new file mode 100644 index 0000000..5a69262 --- /dev/null +++ b/configs/game_suites/vmage-extra.toml @@ -0,0 +1,10 @@ +schema_version = "game-suite/2.1" +version = "0.2.4" +tier = "development" +name = "games-vmage-extra-v0.2.4" +files_images = ["connection-files", "game-files", "vmage-files"] + +[[tasks]] +name = "vmage-tempestrun-l05-i01-standard" +benchmark = "vmage_tempestrun" +family = "l05" diff --git a/configs/game_suites/vmage-smoke.toml b/configs/game_suites/vmage-smoke.toml new file mode 100644 index 0000000..cd1372a --- /dev/null +++ b/configs/game_suites/vmage-smoke.toml @@ -0,0 +1,30 @@ +schema_version = "game-suite/2.1" +version = "0.2.4" +tier = "smoke" +name = "games-vmage-smoke-v0.2.4" +files_images = ["connection-files", "game-files", "vmage-files"] + +[[tasks]] +name = "vmage-race-l01-i01-standard" +benchmark = "vmage_race" +family = "l01" + +[[tasks]] +name = "vmage-flappybird-l01-i01-standard" +benchmark = "vmage_flappybird" +family = "l01" + +[[tasks]] +name = "vmage-pong-l01-i01-standard" +benchmark = "vmage_pong" +family = "l01" + +[[tasks]] +name = "vmage-supermario-l01-i01-standard" +benchmark = "vmage_supermario" +family = "l01" + +[[tasks]] +name = "vmage-tempestrun-l01-i01-standard" +benchmark = "vmage_tempestrun" +family = "l01" diff --git a/configs/game_suites/vmage.toml b/configs/game_suites/vmage.toml new file mode 100644 index 0000000..40511ed --- /dev/null +++ b/configs/game_suites/vmage.toml @@ -0,0 +1,170 @@ +schema_version = "game-suite/2.1" +version = "0.2.4" +tier = "development" +name = "games-vmage-v0.2.4" +files_images = ["connection-files", "game-files", "vmage-files"] + +[[tasks]] +name = "vmage-flappybird-l01-i01-standard" +benchmark = "vmage_flappybird" +family = "l01" + +[[tasks]] +name = "vmage-flappybird-l02-i01-standard" +benchmark = "vmage_flappybird" +family = "l02" + +[[tasks]] +name = "vmage-flappybird-l03-i01-standard" +benchmark = "vmage_flappybird" +family = "l03" + +[[tasks]] +name = "vmage-flappybird-l04-i01-standard" +benchmark = "vmage_flappybird" +family = "l04" + +[[tasks]] +name = "vmage-flappybird-l05-i01-standard" +benchmark = "vmage_flappybird" +family = "l05" + +[[tasks]] +name = "vmage-flappybird-l06-i01-standard" +benchmark = "vmage_flappybird" +family = "l06" + +[[tasks]] +name = "vmage-flappybird-l07-i01-standard" +benchmark = "vmage_flappybird" +family = "l07" + +[[tasks]] +name = "vmage-supermario-l01-i01-standard" +benchmark = "vmage_supermario" +family = "l01" + +[[tasks]] +name = "vmage-supermario-l02-i01-standard" +benchmark = "vmage_supermario" +family = "l02" + +[[tasks]] +name = "vmage-supermario-l03-i01-standard" +benchmark = "vmage_supermario" +family = "l03" + +[[tasks]] +name = "vmage-supermario-l04-i01-standard" +benchmark = "vmage_supermario" +family = "l04" + +[[tasks]] +name = "vmage-supermario-l05-i01-standard" +benchmark = "vmage_supermario" +family = "l05" + +[[tasks]] +name = "vmage-supermario-l06-i01-standard" +benchmark = "vmage_supermario" +family = "l06" + +[[tasks]] +name = "vmage-supermario-l07-i01-standard" +benchmark = "vmage_supermario" +family = "l07" + +[[tasks]] +name = "vmage-supermario-l08-i01-standard" +benchmark = "vmage_supermario" +family = "l08" + +[[tasks]] +name = "vmage-supermario-l09-i01-standard" +benchmark = "vmage_supermario" +family = "l09" + +[[tasks]] +name = "vmage-supermario-l00-i01-standard" +benchmark = "vmage_supermario" +family = "l00" + +[[tasks]] +name = "vmage-pong-l01-i01-standard" +benchmark = "vmage_pong" +family = "l01" + +[[tasks]] +name = "vmage-pong-l02-i01-standard" +benchmark = "vmage_pong" +family = "l02" + +[[tasks]] +name = "vmage-pong-l03-i01-standard" +benchmark = "vmage_pong" +family = "l03" + +[[tasks]] +name = "vmage-race-l01-i01-standard" +benchmark = "vmage_race" +family = "l01" + +[[tasks]] +name = "vmage-race-l02-i01-standard" +benchmark = "vmage_race" +family = "l02" + +[[tasks]] +name = "vmage-race-l03-i01-standard" +benchmark = "vmage_race" +family = "l03" + +[[tasks]] +name = "vmage-race-l04-i01-standard" +benchmark = "vmage_race" +family = "l04" + +[[tasks]] +name = "vmage-race-l05-i01-standard" +benchmark = "vmage_race" +family = "l05" + +[[tasks]] +name = "vmage-race-l06-i01-standard" +benchmark = "vmage_race" +family = "l06" + +[[tasks]] +name = "vmage-race-l07-i01-standard" +benchmark = "vmage_race" +family = "l07" + +[[tasks]] +name = "vmage-race-l08-i01-standard" +benchmark = "vmage_race" +family = "l08" + +[[tasks]] +name = "vmage-race-l09-i01-standard" +benchmark = "vmage_race" +family = "l09" + +[[tasks]] +name = "vmage-tempestrun-l01-i01-standard" +benchmark = "vmage_tempestrun" +family = "l01" + +[[tasks]] +name = "vmage-tempestrun-l02-i01-standard" +benchmark = "vmage_tempestrun" +family = "l02" + +[[tasks]] +name = "vmage-tempestrun-l03-i01-standard" +benchmark = "vmage_tempestrun" +family = "l03" + +[[tasks]] +name = "vmage-tempestrun-l04-i01-standard" +benchmark = "vmage_tempestrun" +family = "l04" diff --git a/game_first_exam/benchmarks/vmage/common/README.md b/game_first_exam/benchmarks/vmage/common/README.md new file mode 100644 index 0000000..856a8d5 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/README.md @@ -0,0 +1,44 @@ +# V-MAGE native bridge (internal research) + +The five thin adapters share this bridge. Native code and assets are fetched only +at image build time with `source_loader.py --destination /opt/vmage`. The optional +`--archive` argument accepts an already downloaded copy, but the same pinned +archive SHA256 is always required. SOURCE.json records every selected native file +hash; installation preserves those source and asset bytes without applying patches. +No upstream implementation or asset bytes are vendored in this repository. + +The installer excludes provider/agent/runner code, website material, and histories. +It installs the native game payloads, required utility modules, frozen level +configs, and their original environment configs. Runtime verifies every required +file before copying the selected payload to a private episode working directory. +VMAGE_ROOT is a trusted simulator deployment setting; the default is /opt/vmage. +An instance cannot choose a Python module or source path. + +Exactly one game and one episode may be constructed in a process. Initialization +calls the original init_run including step("None", 0), native capture, history and +ledger append. native_step_calls includes that initialization. The separate +native_frames_advanced counts later native updates only, excluding initialization +and the Race frame-limit precheck that returns without an update. native_frame_count +is exactly len(game_frames); the native first-action/passive-terminal capture +asymmetry is retained and validated by metric rules. Screenshot files are pruned +after cache refresh, while the complete native path ledger/count is retained. + +observe returns the latest original native capture PNG. A terminal passive update +has no new capture in PygameBase, so that PNG remains the preceding captured frame. +frame returns a copy of the cached full-resolution native surface after the final +update. Both methods are pure reads and never call render. The public recorder +samples decisions; it is not a complete native 30 FPS video. + +The strict frozen Python, SDL and engine versions are declared independently in +each stdlib-only schema. requirements.txt also includes imageio-ffmpeg for the +common recorder. The research host resolves native Pong SysFont("Courier") to +/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf with SHA256 +39c29931201f08dd89fdba4129c76288e6baeecf7c94fe4f6a757f2b50718b1b +(Ubuntu fonts-dejavu-core 2.37-2build1). Container font packages must be frozen; +a distro package name alone does not establish byte-identical pixel rendering. +Fingerprints omit resource objects and wall-clock timestamps. They bind explicit +native game state, Python/NumPy RNG state, decisions and counters, and are not +restorable checkpoints. Tempest retains upstream wall-clock explosion/death visuals. + +Licensing remains unresolved for upstream modifications and third-party assets. +This integration does not infer redistribution rights from the Game Exam license. diff --git a/game_first_exam/benchmarks/vmage/common/SOURCE.json b/game_first_exam/benchmarks/vmage/common/SOURCE.json new file mode 100644 index 0000000..73d786b --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/SOURCE.json @@ -0,0 +1,221 @@ +{ + "schema": "vmage-source/1.0", + "upstream_url": "https://github.com/CSU-JPG/V-MAGE", + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "archive_url": "https://codeload.github.com/CSU-JPG/V-MAGE/tar.gz/95d5d4a445bb0b75cce765c93107d87f84613e4d", + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "files": { + "config/env_config/3steps/env_config_flappybird_reasoning_3steps.json": "8602ea7182bd53fbfdbfa05c2e7056dae8b7cd95553e4def4b7e73a456a16dc4", + "config/env_config/3steps/env_config_pong_reasoning_3steps.json": "c7914dc0e9f3a604f0357c0602c72db467999859017f4857d5b09c8c98ffac90", + "config/env_config/3steps/env_config_race_reasoning_3steps.json": "2f78ef4ada1a29e18f680bb2aa9ec43a1a4c60d0ca3440e60726d8cc32e41c41", + "config/env_config/3steps/env_config_supermario_reasoning_3steps.json": "dfe03ef2b38f15d8752bef0bfa5d9c8d8f0b3bdb4d1f4d787035da3fbfc1d7f7", + "config/env_config/3steps/env_config_tempestrun_reasoning_3steps.json": "92390bcc3d3872c47df11f562f8ad64080130e3690b393075217ec9207bf9664", + "config/level_config/flappybirdgame/level1.json": "cd3d8ce00a3725c3113fc2c2efe4e54f7dec8cf05609b93c859b21d0cc0bbbe9", + "config/level_config/flappybirdgame/level2.json": "e1b0fd409cf18c5922248b04d2eeceb3c85cea78c7630daba38f5bcd6478be34", + "config/level_config/flappybirdgame/level3.json": "1eb93f5afd359a79cb6919da1ed2fb0d2f5f042a959b4a47a066a18bad093501", + "config/level_config/flappybirdgame/level4.json": "7298dff24e0453d3aa21f8b403ccdc94eb884124ea8b60880205bf64b374502a", + "config/level_config/flappybirdgame/level5.json": "b3b94e27cc69d1bb41e4e8e55bb45fd445a3ddf116c822f04693d97f1433ca35", + "config/level_config/flappybirdgame/level6.json": "2111389b57832815765dbba253bbb2a2ef2a21dfe22c8f3642ee10146d3abf8d", + "config/level_config/flappybirdgame/level7.json": "3d600dbf9a777f900716949d4830ba2d521eb39cadc2d21cdae020b5c0055bb2", + "config/level_config/ponggame/level1.json": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "config/level_config/ponggame/level2.json": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "config/level_config/ponggame/level3.json": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "config/level_config/racegame/level1.json": "b921de201d2a84449b7cfea344ae355972e925d6cf4652e0949b6493ecdaeded", + "config/level_config/racegame/level2.json": "0711e72387f300d4bd4b6a851e68e2fcaeb9f83c2fe1453f0df4ddb8e62d0699", + "config/level_config/racegame/level3.json": "355cc29339fe4d9eea47dc998f2c420a70fda2c19edc5f82b4bda1e3071b9e1b", + "config/level_config/racegame/level4.json": "1981bb851013ec64f6ac19feda5afaa12d52e713907e11c48c71b7d8ae9ddd69", + "config/level_config/racegame/level5.json": "875e730543be80e2c61977e7ce5fd876c21c5ea2d8467bfb3f5656259aae16b8", + "config/level_config/racegame/level6.json": "373fdc87aee0bd253bd8b4e3162902f3e2582170856f42d08bc1d3bdc4d4f0bb", + "config/level_config/racegame/level7.json": "36675492156bd1003c91f08a80bb179c70a17b0f8c60e80ff3bf9d5341c41b5e", + "config/level_config/racegame/level8.json": "fd90f6f1ac8a443645487a398fc371f5539cb26974946e7433b8016758e80f75", + "config/level_config/racegame/level9.json": "89373304d6b97c75396515eec9fd5271b021ed9c0cbc0a9764ce9dcdf23c8abc", + "config/level_config/supermariogame/level0.json": "58852fd202ad042f99fd73d31c4f1d28e386abfc2f03b45d8cc13812aa751814", + "config/level_config/supermariogame/level1.json": "3e6c984b50cc0f0115dd1e75fe692da15bb7d55acd43562d103e06170e478433", + "config/level_config/supermariogame/level2.json": "9b8cf1291572591e67f49b3020cb036321e9f24ffedbdcd6484cd084506f0468", + "config/level_config/supermariogame/level3.json": "8b462e92bf600b0dc24e7489155852b8e4caa30ba29ef63f0ff955f8f8e79bd4", + "config/level_config/supermariogame/level4.json": "a98f5ce1601c4fa48ecbf2c2088bea837facf5d85316ad00e5307a8b0498d9c9", + "config/level_config/supermariogame/level5.json": "7ae2ef5c7b2ecc7485f524ac24cba739212abdac88c14218a1c071d36abeb6e6", + "config/level_config/supermariogame/level6.json": "ede21fc4c70bfff98980b5661f4e445b0bed30b3909a2a126ed6de47227b2f02", + "config/level_config/supermariogame/level7.json": "7159d04f47a22b4e747940ee4bfffa1406260bc74784bbe62775b36c3dc1b466", + "config/level_config/supermariogame/level8.json": "03160e5334e0efc194f625d9d813f83e56d15b731094e27996da78c2c56a603e", + "config/level_config/supermariogame/level9.json": "51160e3afff1090d8ea148ee40cc4a15ffbc3214a23b6b009367de711a09bf51", + "config/level_config/tempestrungame/level1.json": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "config/level_config/tempestrungame/level2.json": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "config/level_config/tempestrungame/level3.json": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "config/level_config/tempestrungame/level4.json": "aa0266ca102f7ca43e963e1942b2ce67fd62af021cd5844ddf755b710b0af4b0", + "config/level_config/tempestrungame/level5.json": "b21b6c4c5d4833bc356cf9525f5b03568d19bd18575a47a9c16f4ee434477a7b", + "game/Pong/app.png": "3b086144f2e4ee63753b6c18e891add6590674c32621017dc8308bc062ead16b", + "game/Pong/game.py": "5867d149051638832f8bca2063630b5f01d3db84c8989663ebb5d2b409a0788a", + "game/Pong/main.py": "6f627ba67b97ee95f6e369705f256913fb4e7f0a61f2cdf3812dedbe49c637c8", + "game/Pong/settings.py": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "game/flappybird/04B_19.ttf": "b25fa5563cc8a2e1e9b3913c3129668fa9084b684b5071de34e80ba79b91e89e", + "game/flappybird/assets/background-day.png": "472c806b3caea5f65e9059e6b2ae1a5bb8728deeab38b65c83eb14e693b56921", + "game/flappybird/assets/background-night.png": "d35cc8c5a9b4efc8d258798b8e5aff94f683b88dc2a347a5f7202c6688f5fc21", + "game/flappybird/assets/base.png": "8afccfb7030e32c736c6433fc48990aa5b47332ddf184206e4e570fdc600f083", + "game/flappybird/assets/bluebird-downflap.png": "0f3598235750ab603f0d7384b4b8c54b5c40d9e42b707355d338064df6388a4e", + "game/flappybird/assets/bluebird-midflap.png": "5b64cbbcf81fb53ab09c8865aa5f1098d836f4c3288a31abbb0f642f76beb124", + "game/flappybird/assets/bluebird-upflap.png": "0f7826033544db023eb20d87292241b777378445149cc8c463e7005fa2612f5a", + "game/flappybird/assets/gameover.png": "d9c6bb732e116e9e8f57faf73126fcf11597289a7a08ef8ced6d2c5e5ba606a9", + "game/flappybird/assets/message.png": "3cf1e7d7006e2c03cdbab9743eb81b931941372ba8902b263f0ff30a288e4a5b", + "game/flappybird/assets/pipe-green.png": "8a3fb1ec2fcc5b899a02af626dd6c7e52138faf3dfd64d5dce4b4e028b503edb", + "game/flappybird/assets/pipe-red.png": "79680774c6c172b10e450795ed4ad6658af7828e283fe038585920257e2501d6", + "game/flappybird/assets/redbird-downflap.png": "3e0ea4c3440ed3a1d826ecefbcb83a66550c0d788560414d5c26defc20946201", + "game/flappybird/assets/redbird-midflap.png": "aa32d8e45a6009dd2524635253dfc754ae80ba695174ca9f860f5dc001a9bcbc", + "game/flappybird/assets/redbird-upflap.png": "fc46d921c024d1792b59a674d7af61fd66cdc685c22a6106ec2f203ddce85c38", + "game/flappybird/assets/yellowbird-downflap.png": "9c691e789dcb75158b24642d3d902bf918b7be259c5df6b8e504665b32fef860", + "game/flappybird/assets/yellowbird-midflap.png": "09b80bf4f6f51b4ef421c459fb6140eb0ece14ccb74d637559b50134354c7bbf", + "game/flappybird/assets/yellowbird-upflap.png": "8f0f7372cbfcf5d663077f28377d033807360b33cdfbd2f220bb84fea27a1131", + "game/flappybird/settings.py": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "game/flappybird/utils.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game/flappybird_game.py": "2bbd2ee3adf5db1072ef39f00d0c7b2b9f356b6c293765028e606133c27013cb", + "game/pong_game.py": "97b0208a55f7b11b823b8cdaac16355b10600dc5298513a41a9f2122cd86b7d5", + "game/pygame_base.py": "5f903e17d0b6460292a5034d16bf68f129ba91b1e8d2a12826e41a4541ce3450", + "game/race/images/car.png": "333270bb44a218e555c5e8ab6c0f54ca568ceeccb8a8e6b517947b0b34e5442f", + "game/race/images/car_face.png": "3d51f38637d002d316c37812889ee1a68523dbec0c719285e642eaa723d54cfa", + "game/race/images/collision.png": "49ce372a06bb6c1b5d3bbd1824ecc5fea4f0803f473bdb155c7f351f7e277552", + "game/race/images/crash_screenshot.png": "5368b4a6b9ce657975863b4c37e91003afeae109ba40776466469262b57d7ed4", + "game/race/images/level1_screenshot.png": "d74e9f37100894fc670c1e8a6efaec0c92f5756fbae57a746e1971fae5d42af2", + "game/race/images/main_menu_image.png": "a0c566c7966ca10003023fd2a60289a6567650d27b5579135ca6bcbaef050982", + "game/race/images/race_pads.png": "7427e916ee3cad4e99bb409136e122ebd70976c29f0625a87522f6009b3e3224", + "game/race/images/red_car.png": "7dfda954f3e4c0a96a8dfcf277740f85aa94948b764e70ab40a74908b80ae508", + "game/race/images/small_horizontal.png": "40b66f515c8449614a602a543996131a211b0d70adab576226d35c265394afd7", + "game/race/images/small_vertical.png": "32e79e362c972cf0851b454782c62bbec48b140824a1a8774d9dc25f0758b37f", + "game/race/images/square.png": "b84ee363c7fdc587b36cbf5df9d47d21efe7472207af2b71fd53cb806b425ea2", + "game/race/images/trophy.png": "8a9b4515ca77313611d28b330b89c6f4b0992c86771cd1b9a8401ac31bea2f7e", + "game/race/images/vertical_pads.png": "0f0125ba19fd1717b8c9c6a68d3f6ccb259f22ce7d96fab6903700a4f1d3aa6b", + "game/race/images/white_car.png": "79c1ea07b5bc20d4c5af07c1eea32a74c672971b55305f3619b3231da8a296f4", + "game/race/settings.py": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "game/race/sprites.py": "9b520d9d29f3a6624fc72e119d85a741c0ee45884c352f84bb5fa0d083bf34b9", + "game/race/utils.py": "3438378e693936ea3f5a0898cbb4e93ec8d9cd759ddabcac18e68ed0a8faa3d3", + "game/race_game.py": "e135d7fd91ab7837227c37b9d8a1624ac2312ba06d432b6756515414bf2acc37", + "game/supermario/classes/Animation.py": "1f7a2b5ba5efd2eed99e577f0b3a76b522c6cab860fa89b8593400e97eba63c6", + "game/supermario/classes/Camera.py": "6c221de58e584ae0358a7e697d27e4d7ed265dc50eda5a8b3f51512ebb34c878", + "game/supermario/classes/Collider.py": "7af236250b7f8945cc279b6ac817ee3349c57705200bc6e8b093058ef7122239", + "game/supermario/classes/Dashboard.py": "783e8a70c2a2870c50fd3ca38c28923ce0d18ecc6cf0c295bc83937a35b13342", + "game/supermario/classes/EntityCollider.py": "2744f8a8363d374c88572c169f9fe0e439190d04dedc500e521d72c97908cd88", + "game/supermario/classes/Font.py": "39cc9576c6a3a1d7f26160a06dda5bf842b222c3873f705927a948e30e0d0e53", + "game/supermario/classes/GaussianBlur.py": "d05541f05666b8f78d3e89d28d28b37221e2be1a7b964520fd8e1bab7d957373", + "game/supermario/classes/Input.py": "620b22725a73304fc0c75d1b75a58ab083707d5809fdbe9c78812f2c3bcec416", + "game/supermario/classes/Level.py": "3168974a6a78a3b2df9f8bca2b8896d4b036c0f9d49f022456d59d63ad28246a", + "game/supermario/classes/Maths.py": "cadde65c2b205606627e2f4ef4b9d7effcf7a94c8710f4a5e9794afd0d435956", + "game/supermario/classes/Menu.py": "fa7e9704b80ae7dd019febf042115f8f81751ef179759b9a6a8cc543bb92e294", + "game/supermario/classes/Pause.py": "d3297a81a5be77f250b04073e95a154ef822ac790fb229bc759ec81bd062a08d", + "game/supermario/classes/Sound.py": "49b12f1f72b6e01db74a021d618dfbd541bdc244c06e0d090ac53d04ddc3811f", + "game/supermario/classes/Sprite.py": "896e455265f9948cf2c5ce80be209c99f9e707a772ec773674b99aa5d60f268c", + "game/supermario/classes/Sprites.py": "ad2af5ea2c50c1704b6232535e235178aa17625ebde1dd66086ee8c1137c4f6d", + "game/supermario/classes/Spritesheet.py": "0c4fbf5017644bfd243d9feea60185b4916cecaa92d0aee70746929a3d5b10ad", + "game/supermario/classes/Tile.py": "d395cc23dab5bcfaba2af2624495ec3acaf7114d6760ad120d2dc064922405e4", + "game/supermario/classes/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game/supermario/compile.py": "43d326781ac760a29b44e29bf7e2ac1ab41868f20d0e361d2e192eecff500286", + "game/supermario/entities/Coin.py": "2ad811b764caa0fe521d1018e090b4f638c7ba5a72a224615e452a4d4aef7ca0", + "game/supermario/entities/CoinBox.py": "57695d9794a243f15c6c69118b2e1f15ddaeb93db4e5cec81203b87744256285", + "game/supermario/entities/CoinBrick.py": "4217a5d4be1daf39942d476b891c95d55fae1b9361e8bb327ee905f5e80b250e", + "game/supermario/entities/EntityBase.py": "5509e8bf95f156e4504f3a3d176781966f26de844c23325befbc6213d13a8455", + "game/supermario/entities/Goomba.py": "b44f2f7c85ab7303207f373b29994caf459be11cefef1ef3118537fe2d273bc5", + "game/supermario/entities/Item.py": "2e03150cba8f5e3e24671a0a3006174957ca35aeb04570ffb6994df4c1c43d6a", + "game/supermario/entities/Koopa.py": "414defffa03b7a6a2458e49b9439d3755533def75316e578c94227a9e1e490ea", + "game/supermario/entities/Mario.py": "b22f861462950b5f54ada40d5666697654b9fdc22fcb5569be86dbcf8df1ce29", + "game/supermario/entities/Mushroom.py": "67753f5cbc5c383a3faee620f41b71f44ab12f040606faf8fae6926a84041a32", + "game/supermario/entities/RandomBox.py": "12114a673a42e4644b9ddefe31f49bdb5093fbbb6008039a9589cd4202d3e68b", + "game/supermario/entities/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game/supermario/img/1.PNG": "665fd2951145366ec79206d7b91751235451cc419460414d7a14f289078e90a7", + "game/supermario/img/2.PNG": "7d58ebcea49bfd8a0547c107d1c3eb7741663c837527d9d655afa9c2d859e786", + "game/supermario/img/3.PNG": "dd18ab7d7dae5d45ba5818a6cf9a9d99dbf4a176dc4a59e463e2f675dc21c798", + "game/supermario/img/4.PNG": "42c4a205cc7f917304c31077a5d40396334d4ff1c5b22dc49ac84429951c5e60", + "game/supermario/img/Items.png": "01771f07d8e5a0e8b4941c78a70d6c45467b794e33368ece7902ae9d3c803598", + "game/supermario/img/characters.gif": "802da64a46843df92320a30c082f9611df7f86cd62b8ccb1155c3848a6c4fffa", + "game/supermario/img/font.png": "2864556d230068da436c697891dc2e5b15c04f438f1511a9c08f75c58a7ae0dd", + "game/supermario/img/koopas.png": "9efaa744ca41861bc173c7c2654678c542b40c5f0884de3ad4d999fedf0de1a9", + "game/supermario/img/pics.png": "d2e55130f539f0fe77a6504a4103a742436d3d227f03aec52c88b022a5b06288", + "game/supermario/img/pictures.PNG": "5d336f60bb03a9348c5f02510414ec5c2bbcef55a1617fed9e44d06d863bed96", + "game/supermario/img/tiles.png": "16cf755d4194a9d092e0ae1eaa565d7a175a1ef360429f9d0cdf29dab4fb22a6", + "game/supermario/img/title_screen.png": "293207d12354cd5502f6df5da00bba0be8d58f88a9e05b6a2804b93dc64accf9", + "game/supermario/img/yoshis.png": "9fa22edd89f96822c9365187affbeadab3de6101c2278d038efdf03dd60c78b0", + "game/supermario/levels/Level0.json": "65c11ada248613d4009f75949451226043221c25789c3d45ad503c8e06d7a5f3", + "game/supermario/levels/Level1.json": "41ad181a6967e81835e9dd3237697efc148b30707882f56c2c90c11f6abda1e3", + "game/supermario/levels/Level2.json": "b24154a7e1b8690270103efedceb729770fad7f91792264d758bb3e72c2591db", + "game/supermario/levels/Level3.json": "4ffce9f127a20a61ec736b64f9741413be0feb7d8c3cc2d92f7c70a8c9701400", + "game/supermario/levels/Level4.json": "964607cd56b2c248c93749f73b6056c9691666c37127ee6960ea7b9caadca63d", + "game/supermario/levels/Level5.json": "18370844e0b774b95c37c207283f28885939fb11d7fbd5ea5c77ae6d00f21f4d", + "game/supermario/levels/Level6.json": "b86f12fc9e617961f6568089aa5f6ba6e72f70da31bee35750127de0d7ead276", + "game/supermario/levels/Level7.json": "05284d5ef1bc73da4966c70c56e827bc791e11ae2b03da06dea3df85354fffa9", + "game/supermario/levels/Level8.json": "5f365fd6b952ca697191b2eac81f94a9f6deec1fbddf7b60d3b051a8d561768f", + "game/supermario/levels/Level9.json": "2497fce9e412946981aa063c55996d5e22e177a618a132023fcfac2ac00c0bd0", + "game/supermario/main.py": "453c1bf249ece9834c0d5a0dd13d6426b95d634fb9880677b7a703673e47c2bc", + "game/supermario/requirements.txt": "f4814f2f24759e7b85b1392b07b0ce97ed50f48c9568fd59385a1ddbf71f2ba3", + "game/supermario/sfx/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game/supermario/sfx/brick-bump.ogg": "7b4fa0f6e0fc1729d1aea6e6f06fe5f907b62f5e9187fa8338a7ba869a047643", + "game/supermario/sfx/bump.ogg": "6341b88f0f3e5a34d46fa5dc8fc5f6f1ceee5a9adaab6ca9240969da4f231e4a", + "game/supermario/sfx/coin.ogg": "378a8a188e45421a4592a57fd29e68e6ec0a64b236ed8e9abf46cbf3314f5c6c", + "game/supermario/sfx/death.wav": "9934dbf26c48c4219d3770c5eedd5f1fc1a1e616c98d0413fae0ba9d4533f005", + "game/supermario/sfx/kick.ogg": "a70d27f21289097104a6741cb54a89e8b75b56161a2740e2aabf03fcd307ab00", + "game/supermario/sfx/main_theme.ogg": "157aa0668599958e6d41a0f74b93908debb77407f01069ec79cb998cddc36a6d", + "game/supermario/sfx/pipe.ogg": "058c1c59fd463f94d879fa87aab43ac3094772dc63f08052ccbd4864c36f66ac", + "game/supermario/sfx/powerup.ogg": "e6e09fde8c2b156fdf2283757bcb456a14d21afa98a2538db50a0b1eb21849df", + "game/supermario/sfx/powerup_appears.ogg": "defb39e9c061fe533d7099cd35e837d5503cb45d2ed3d0cafb44afa980a78cc4", + "game/supermario/sfx/small_jump.ogg": "8b22f0244134d546df2fc18485d3555a438c43fb7fc6ddc30f12ce9669d078a0", + "game/supermario/sfx/stomp.ogg": "28d29d6c63c9f8ffec9605cb7560491e3e95092812d7628b4e3181687e0906f5", + "game/supermario/sprites/Animations.json": "90209bf54ef61267fc84daf480bf1a49ef3f3efd82664aefcaa3112010d443ff", + "game/supermario/sprites/BackgroundSprites.json": "03e585f5fa356afeb439d32ff0d253fc2c94f97e7f6ba896d9a88f07e43b98d7", + "game/supermario/sprites/Goomba.json": "c2a7d5326ccc962a6b06f944c0cf0ae4f3d38f979c5b8b50910476c3467b2e3d", + "game/supermario/sprites/ItemAnimations.json": "7630f643f0eb5ec80379eec4f334ff56af7060766b40151692fee780f07542b4", + "game/supermario/sprites/Koopa.json": "2dcd24c18f07bd6b36a95e64c16f9172264e0ee370d3b45c1d5fc0f84f65be18", + "game/supermario/sprites/Mario.json": "1e6ee2447a44b56be75d3dbf58b7f98019ed8c52b63170cb149accb1c78c812a", + "game/supermario/sprites/RedMushroom.json": "0fa26c36c434c0e49f83c068f671842daa10ec96f0bc7b1197f6e2850943c123", + "game/supermario/traits/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "game/supermario/traits/bounce.py": "226902f2946f76bfdebc9329632961c6d2e249f8cba2a1580421575a92130d11", + "game/supermario/traits/go.py": "ff29ebc7f4218e8eb84c9e47526dc9a47c906fe09d1f97bf61529efe6aad99b3", + "game/supermario/traits/jump.py": "d65e54c17a27057ec6a072ab3ef9110fbe32e78d5b2307ee87b76d675d16c21c", + "game/supermario/traits/leftrightwalk.py": "32971913ee91b60be177c2eae45dee667416ee75ba1817337d586a2f5ba2845d", + "game/supermario_game.py": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "game/tempestrun/assets/fonts/CONSOLA.TTF": "423504695a3de1f80c618e3e6ead215a6b891be06c179bf048bb5a80d5d0eda3", + "game/tempestrun/assets/fonts/CONSOLAB.TTF": "73acf8f7f9d16c76829ee5ee801852cd54184a68ac513c1e339487685aa9b732", + "game/tempestrun/assets/fonts/EightBit Atari-Ascprin.ttf": "de6f15adfefbadab9450831089195d82d54249bb9b8d801d55d1ce6a0591e9de", + "game/tempestrun/assets/fonts/VectorBattle.ttf": "d229d6ec481c97abad6b9fcdd4d8e20906ffd898dd5a303bb8da2c61fd6a4ae1", + "game/tempestrun/assets/icon/about.txt": "a81b3c396047fc03f63ade0d81fd55c149aa8ec3a0ae49a0b40475954ce05a19", + "game/tempestrun/assets/icon/icon.ico": "9b6d2a999cf5e6dde1965a314264fd9704adb3cf4d63866dbe98c3aab7722e95", + "game/tempestrun/assets/icon/icon.png": "e5f80355da145e58e20efaf4cda889c3507fab0d956eb128fd9b71c56b6d82fe", + "game/tempestrun/assets/wireframe_models/player/jump/jump1.json": "e715ddaeaf46602c28ed1b00377da983731605417f5e91ee1c54fad6f20b758b", + "game/tempestrun/assets/wireframe_models/player/run/run1.json": "a440a674b460cc0ca3a54b6c1a60e2312b4afe1304ae4c7005581fe4bb5c644b", + "game/tempestrun/assets/wireframe_models/player/slide/slide1.json": "4aa9474400c446ed7b7df2389fe1ca86e838e8eaab089584178a123c48ce1610", + "game/tempestrun/config.py": "b5a025bc1d6a863aa4cc1dc5314b8ab1ddd856764a5192922c402c98a9fb5b09", + "game/tempestrun/gameplay/gamestuff.py": "04b76086c3d626c8c3b67ea979a6bf35e97dbec1af0f84acf4dc48a30f71cb0b", + "game/tempestrun/gameplay/highscores.py": "014bada0904bb62476c3dbba59aff7405d77bb34653c8737b3ba234f64aa4e9c", + "game/tempestrun/gameplay/levels.py": "56cd52e4b8c63c7818a273d52fb9110a22c0e58d5fd0526c81ca416adb4feaaa", + "game/tempestrun/gameplay/player2d.py": "90f2fa304d05bc6c9e67aec8fa47a4c64d44d0512cc112b0894169bf0d9ac32f", + "game/tempestrun/keybinds.py": "06c6ed92f2c0efe32451fb438d9ae30702ebc3ab0b91353d6d7c7d7372a0ed29", + "game/tempestrun/main.py": "2e952bb9aa4c026e40abb1e114be5b72f62e2c534b842d77b3d8ee11bfcbad8f", + "game/tempestrun/make_exe.py": "028d0c27adac7b06fee31d7481947af6a3da3230c9a004dd649ae9d66e8fe0d6", + "game/tempestrun/menus/credits_menu.py": "654ce33920564a09263982b6b872321eaa71f0df89de2dbf5562e35da5d8bc73", + "game/tempestrun/menus/help_menu.py": "7f2a74eb1ee3a75a04e925091dc98904b56e61c8280a7c827d650afe93f14080", + "game/tempestrun/menus/settings_menu.py": "528a199bfe3cc7c192754478f4ba2598d6549387a1fd182f8bf8b8e431d8b4de", + "game/tempestrun/mymain.py": "c7d710fb38c30451ae884273820c41951d05ea7a73bdafedf54ca8d5a93760ba", + "game/tempestrun/rendering/levelbuilder3d.py": "9b6af54ee1f224266486a962c1db7e20da82cd11fcfb1be48ba2933af47cf352", + "game/tempestrun/rendering/neon.py": "75227099409e7c9a5c92efb47e3dfe99909e58d7517e08e17ff826b2d2e1e3d2", + "game/tempestrun/rendering/threedee.py": "01334531abfad1bd649777e43771a55ee8412cae4717227677ec2b2a8fee78a3", + "game/tempestrun/requirements.txt": "c074dfbcc9e15cc23628151ea94bedab3b4da87dfda488ced10f9b16cae831ff", + "game/tempestrun/settings.py": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "game/tempestrun/util/fonts.py": "8b36acdb1a6b95d791f1dcf86f5651a682e003a84fbe32a1838b9876eb12ad99", + "game/tempestrun/util/profiling.py": "0502101a53cdf7c434c26cbc4725c9a910ac11370efd4d94e92a8630baad3764", + "game/tempestrun/util/utility_functions.py": "4e1dc15d471e65cd1beb157225971deb6d6600d23f3509a286f0a218f1ef3a05", + "game/tempestrun_game.py": "bc62b56f8d168cca2cabd33eb326373c3ac9243b4a5f51c61994e1c1ec759377", + "utils/__init__.py": "3d2611b899381f47cf8380acf49a3f4024be297c07d12e199f6c04eef89d1c03", + "utils/config.py": "47b29ab41303278421f60f161c978ef03caa4644522d3f551bcbb82e2dd24d6d", + "utils/dict_utils.py": "fbf68d9a433e4aab6c41d41fb2d40af7e64f6a4cf533930444f2cbed66a1ff46", + "utils/file_utils.py": "f04318939dfd06d79bf497a1a92e84142d3112845745de96c2a3c061650db0f3", + "utils/game_utils.py": "226427a0a24a08740646b329cfd2593d15ac91189c2bc666960868bcbb0d2657", + "utils/json_utils.py": "02dd941a0a93ce661e9342be511d0a7a7a258f08365972641c812484f7ea1402", + "utils/singleton.py": "299d470dde28f9b270f7a1838168c7840bd9c6e27ce040c8c253c58d7c8a00ba", + "utils/string_utils.py": "300bf87ba5a55d3bd2df8b6adb51f783f1fe16799cca0b088f0f9e91de25bd6e" + }, + "patches": [], + "license_status": "Unresolved upstream and third-party rights; internal research only, no redistribution authorization inferred.", + "deviations": [ + "Coding agent action-stepped HTTP track; no original naive-agent history/prompt/parser.", + "Native update/render/init/source bytes unchanged; only cached observations and bounded screenshot storage.", + "Decision-frame RGB recording; native ledger count retained, historical screenshot files pruned.", + "Public illegal actions rejected without native advancement or original three-invalid random fallback.", + "Tempest death/explosion rendering retains upstream wall-clock visual dependence." + ] +} diff --git a/game_first_exam/benchmarks/vmage/common/metric_rules.py b/game_first_exam/benchmarks/vmage/common/metric_rules.py new file mode 100644 index 0000000..6590a25 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/metric_rules.py @@ -0,0 +1,111 @@ +"""Stdlib checks for trusted native V-MAGE evidence; no engine or replay claims.""" +import math + +def _number(value, label, minimum=0): + if type(value) not in (int, float) or not math.isfinite(value) or value < minimum: + raise ValueError('invalid ' + label) + return value + + +def _integer(value, label, minimum=0): + if type(value) is not int or value < minimum: + raise ValueError('invalid ' + label) + return value + + +def validate_metrics(final, instance): + game = instance['native_game'] + m = final['metrics'] + common = {'native_score', 'initial_native_score', 'native_frame_count', 'native_step_calls', + 'native_frames_advanced', 'native_initialization_calls', 'decision_count', + 'native_invalid_action_count', 'native_terminated', 'native_truncated', + 'terminal_cause', 'native_frame_limit', 'visual_wallclock_dependency'} + extra = {'race': {'native_win', 'native_completion_degree'}, + 'flappybird': {'pipe_pair_score', 'counted_live_pipe_halves'}, + 'pong': {'score_a', 'score_b'}, + 'supermario': {'dashboard_points', 'dashboard_coins', 'dashboard_ticks', 'dashboard_time', 'mario_restart'}, + 'tempestrun': {'distance_z', 'player_dead', 'player_mode'}}[game] + if set(m) != common | extra: + raise ValueError('wrong native metric fields') + score = _number(m['native_score'], 'native score') + if type(m['initial_native_score']) not in (int, float) or m['initial_native_score'] != 0: + raise ValueError('nonzero native initialization score') + if not math.isclose(final['return'], score - m['initial_native_score'], rel_tol=1e-12, abs_tol=1e-12): + raise ValueError('score delta does not match public return') + decisions = _integer(m['decision_count'], 'native decisions') + if decisions != final['steps']: + raise ValueError('native/public decision count mismatch') + calls = _integer(m['native_step_calls'], 'native calls', 1) + advanced = _integer(m['native_frames_advanced'], 'native advanced frames') + frames = _integer(m['native_frame_count'], 'native frame ledger', 1) + if type(m['native_initialization_calls']) is not int or m['native_initialization_calls'] != 1: + raise ValueError('native initialization must occur exactly once') + if type(m['native_invalid_action_count']) is not int or m['native_invalid_action_count'] != 0: + raise ValueError('public rejected actions must not enter native fallback') + for name, public in [('native_terminated', 'terminated'), ('native_truncated', 'truncated')]: + if type(m[name]) is not bool or m[name] != final[public]: + raise ValueError('inconsistent native terminal flags') + terminated, truncated = m['native_terminated'], m['native_truncated'] + done = terminated or truncated + sample = instance['frames_per_decision'] + if not decisions: + if calls != 1 or frames != 1 or advanced != 0 or done or score: + raise ValueError('native progress without a decision') + elif done: + if not (decisions - 1) * sample < calls - 1 <= decisions * sample: + raise ValueError('inconsistent final native action fragment') + elif calls != 1 + decisions * sample: + raise ValueError('nonterminal native action fragment is incomplete') + passive_terminal = done and (calls - 2) % sample != 0 + if frames != calls - int(passive_terminal): + raise ValueError('native capture ledger asymmetry mismatch') + if advanced != calls - 1 - int(game == 'race' and truncated): + raise ValueError('inconsistent native update count') + limit = instance['native_frame_limit'] + if m['native_frame_limit'] != limit or (truncated and (limit is None or frames < limit)): + raise ValueError('inconsistent native frame limit') + if type(m['visual_wallclock_dependency']) is not bool or m['visual_wallclock_dependency'] != (game == 'tempestrun'): + raise ValueError('wrong native visual clock declaration') + cause = m['terminal_cause'] + if not done: + if cause != 'running': + raise ValueError('nonterminal native state has a terminal cause') + elif truncated: + expected = 'native_frame_limit+native_death' if terminated else 'native_frame_limit' + if cause != expected or game not in {'race', 'supermario'} or (game == 'race' and terminated): + raise ValueError('wrong native limit terminal cause') + elif cause != ('native_win' if game == 'race' and score == 100 else 'native_collision' if game == 'race' else 'native_missed_paddle' if game == 'pong' else 'native_death'): + raise ValueError('wrong native termination cause') + if game == 'race': + if score not in (0, 100) or type(m['native_win']) is not bool or m['native_win'] != (score == 100): + raise ValueError('inconsistent native Race win/score') + if m['native_win'] and not terminated: + raise ValueError('native Race win without termination') + if _number(m['native_completion_degree'], 'native completion') > 1: + raise ValueError('invalid native Race completion degree') + success = m['native_win'] + else: + success = score > 0 + if final['success'] != success: + raise ValueError('inconsistent native or auxiliary success flag') + if game == 'pong': + a, b = _integer(m['score_a'], 'Pong score A'), _integer(m['score_b'], 'Pong score B') + if score != a + b: + raise ValueError('Pong native score must sum both paddles') + elif game == 'flappybird': + halves = _integer(m['counted_live_pipe_halves'], 'counted live pipe halves') + if m['pipe_pair_score'] != score or score * 2 != int(score * 2) or halves > score * 2 or halves % 2: + raise ValueError('inconsistent Flappy pipe score') + elif game == 'supermario': + points = _integer(m['dashboard_points'], 'Mario points') + _integer(m['dashboard_coins'], 'Mario coins') + if points != score or _integer(m['dashboard_ticks'], 'Mario dashboard ticks') != calls % 60 or _integer(m['dashboard_time'], 'Mario dashboard time') != calls // 60: + raise ValueError('inconsistent Mario dashboard score/ticks') + if type(m['mario_restart']) is not bool or m['mario_restart'] != terminated: + raise ValueError('inconsistent native Mario restart') + elif game == 'tempestrun': + z = _number(m['distance_z'], 'Tempest distance') + if score != int(z / 10) * 10: + raise ValueError('Tempest score is quantized native distance') + if type(m['player_dead']) is not bool or m['player_dead'] != terminated or m['player_mode'] not in {'run', 'jump', 'slide', 'dead'} or m['player_dead'] != (m['player_mode'] == 'dead'): + raise ValueError('inconsistent Tempest native player mode') diff --git a/game_first_exam/benchmarks/vmage/common/requirements.txt b/game_first_exam/benchmarks/vmage/common/requirements.txt new file mode 100644 index 0000000..62c372e --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/requirements.txt @@ -0,0 +1,8 @@ +imageio==2.36.0 +imageio-ffmpeg==0.6.0 +numpy==2.2.4 +opencv-python==4.11.0.86 +pillow==10.4.0 +pygame==2.6.1 +scipy==1.15.1 +tqdm==4.67.1 diff --git a/game_first_exam/benchmarks/vmage/common/source_loader.py b/game_first_exam/benchmarks/vmage/common/source_loader.py new file mode 100644 index 0000000..4de6677 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/source_loader.py @@ -0,0 +1,78 @@ +"""Stdlib installer and verifier for the pinned, externally fetched native payload. + +No V-MAGE implementation or asset bytes are distributed by this module. +""" +import argparse +import hashlib +import io +import json +from pathlib import Path, PurePosixPath +import tarfile +import urllib.request + +COMMIT = '95d5d4a445bb0b75cce765c93107d87f84613e4d' +ARCHIVE_SHA256 = '1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919' +URL = 'https://codeload.github.com/CSU-JPG/V-MAGE/tar.gz/' + COMMIT + + +def manifest(path=None): + return json.loads(Path(path or Path(__file__).with_name('SOURCE.json')).read_text()) + + +def manifest_digest(value): + return hashlib.sha256(json.dumps(value['files'], sort_keys=True, separators=(',', ':')).encode()).hexdigest() + + +def verify_source(root, metadata=None): + root = Path(root).resolve() + metadata = metadata or manifest() + if metadata['upstream_commit'] != COMMIT or metadata['archive_sha256'] != ARCHIVE_SHA256: + raise ValueError('untrusted V-MAGE provenance') + if manifest_digest(metadata) != metadata['source_manifest_sha256']: + raise ValueError('V-MAGE manifest mismatch') + for relative, expected in metadata['files'].items(): + p = PurePosixPath(relative) + if p.is_absolute() or '..' in p.parts: + raise ValueError('unsafe native manifest path') + path = root.joinpath(*p.parts) + if not path.is_file() or hashlib.sha256(path.read_bytes()).hexdigest() != expected: + raise ValueError('native source/asset mismatch: ' + relative) + return metadata + + +def install(destination, archive=None): + metadata = manifest() + if archive: + data = Path(archive).read_bytes() + else: + with urllib.request.urlopen(URL, timeout=180) as response: + data = response.read() + if hashlib.sha256(data).hexdigest() != ARCHIVE_SHA256: + raise ValueError('V-MAGE archive hash mismatch') + destination = Path(destination) + if destination.exists() and any(destination.iterdir()): + raise ValueError('native destination must be empty') + destination.mkdir(parents=True, exist_ok=True) + with tarfile.open(fileobj=io.BytesIO(data), mode='r:gz') as tar: + prefix = 'V-MAGE-' + COMMIT + '/' + for relative, digest in metadata['files'].items(): + member = tar.getmember(prefix + relative) + if not member.isfile(): + raise ValueError('native runtime payload must contain regular files') + content = tar.extractfile(member).read() + if hashlib.sha256(content).hexdigest() != digest: + raise ValueError('archive member hash mismatch: ' + relative) + path = destination / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(content) + path.chmod(0o644) + verify_source(destination, metadata) + return destination + + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--destination', required=True) + parser.add_argument('--archive', help='Optional fixed archive for offline builds') + args = parser.parse_args() + install(args.destination, args.archive) diff --git a/game_first_exam/benchmarks/vmage/common/vmage_bridge.py b/game_first_exam/benchmarks/vmage/common/vmage_bridge.py new file mode 100644 index 0000000..b91985c --- /dev/null +++ b/game_first_exam/benchmarks/vmage/common/vmage_bridge.py @@ -0,0 +1,274 @@ +"""Single-episode bridge to unmodified V-MAGE native games. + +Only the action loop is driven here. Native construction, init_run, physics, +rendering, scoring and frame-limit tests remain in externally installed source. +""" +import base64 +import hashlib +import importlib +import importlib.metadata +import json +import os +from pathlib import Path +import platform +import random +import shutil +import sys +import tempfile + +from contracts import Capabilities, Transition + +try: + from .source_loader import verify_source +except ImportError: + from source_loader import verify_source + +_CONSTRUCTED = False +CLASSES = {'race': 'RaceGame', 'flappybird': 'FlappyBirdGame', 'pong': 'PongGame', + 'supermario': 'SuperMarioGame', 'tempestrun': 'TempestRunGame'} + + +def _digest(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(',', ':'), allow_nan=False).encode()).hexdigest() + + +class NativeAdapter: + GAME = None + + def __init__(self, instance, assets=None): + global _CONSTRUCTED + if _CONSTRUCTED or 'utils.config' in sys.modules or 'game.pygame_base' in sys.modules: + raise RuntimeError('V-MAGE requires exactly one native game construction per process') + self.instance = instance + if instance.get('native_game') != self.GAME: + raise ValueError('native game identity mismatch') + self.SCHEMA.validate(instance) + if platform.python_version() != instance['python_version']: + raise ValueError('native Python version mismatch') + for name, expected in instance['engine_versions'].items(): + if importlib.metadata.version(name) != expected: + raise ValueError('native dependency mismatch: ' + name) + source = Path(os.environ.get('VMAGE_ROOT', '/opt/vmage')).resolve() + metadata = verify_source(source) + if metadata['source_manifest_sha256'] != instance['source_manifest_sha256']: + raise ValueError('native manifest does not match frozen instance') + # A private writable copy retains native relative paths without sharing + # highscore/config or temporary screenshot files across episodes. + self._previous_cwd = Path.cwd() + self._temporary = tempfile.TemporaryDirectory(prefix='vmage-') + self.root = Path(self._temporary.name) + for relative in metadata['files']: + dst = self.root / relative + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source / relative, dst) + os.chdir(self.root) + sys.path.insert(0, str(self.root)) + if self.GAME == 'supermario': + sys.path.append(str(self.root / 'game/supermario')) + os.environ.update(SDL_VIDEODRIVER='dummy', SDL_AUDIODRIVER='dummy', PYGAME_HIDE_SUPPORT_PROMPT='1') + random.seed(instance['seed']) + import numpy as np + import pygame + self.np, self.pygame = np, pygame + np.random.seed(instance['seed']) + pygame.init() + pygame.display.set_mode((1, 1)) + if '.'.join(map(str, pygame.get_sdl_version())) != instance['sdl_version']: + raise ValueError('native SDL version mismatch') + from utils.config import Config + config = Config() + config.load_env_config(str(self.root / f'config/env_config/3steps/env_config_{self.GAME}_reasoning_3steps.json')) + config.load_level_config(str(self.root / f"config/level_config/{self.GAME}game/level{instance['native_level']}.json")) + config.FPS = instance['fps'] + self._output = self.root / 'frames' + self._output.mkdir() + cls = getattr(importlib.import_module('game.' + self.GAME + '_game'), CLASSES[self.GAME]) + _CONSTRUCTED = True + self.env = cls(str(self._output)) + if self.env.sample_frames != instance['frames_per_decision'] or self.env.action_in_sample_frames != instance['passive_action']: + raise ValueError('effective native action sampling mismatch') + if list(self.env.valid_actions) != instance['native_actions']: + raise ValueError('native action inventory mismatch') + if list(self.env.screen.get_size()) != instance['surface_size']: + raise ValueError('native surface size mismatch') + effective_limit = getattr(self.env, 'max_rounds', getattr(self.env, 'max_round', None)) + if effective_limit == -1: + effective_limit = None + if effective_limit != instance['native_frame_limit']: + raise ValueError('native frame limit mismatch') + self.decisions = 0 + self.native_step_calls = 1 + self.native_frames_advanced = 0 + self.terminated = self.truncated = False + self.terminal_cause = 'running' + self._closed = False + self.env.init_run() # Native step('None', 0), capture, frame ledger and history. + if self.env.over or float(self.env.score) != 0 or len(self.env.game_frames) != 1: + raise ValueError('unsupported nonzero or terminal initialization') + self.initial_score = float(self.env.score) + self._cache() + + def _cache(self): + # No render call: native render mutates Race collisions and Tempest RNG. + self._image_png = self.env.last_frame_base64 + self._frame = self.pygame.surfarray.array3d(self.env.screen).transpose(1, 0, 2).copy() + self._frame.setflags(write=False) + # Keep the native list and count, but bound actual screenshot disk usage. + for path in self._output.glob('*.png'): + path.unlink() + + def _capture(self): + from utils.game_utils import capture + path, encoded = capture(self.env.screen, self.env.output_dir) + self.env.last_frame_path = path + self.env.last_frame_base64 = encoded + self.env.game_frames.append(path) + + def spec(self): + return {'adapter_version': '1.0.0', + 'capabilities': Capabilities(images=True, action_mode='enum', native_truncation=self.GAME in {'race', 'supermario'}).to_dict(), + 'action_schema': {'type': 'string', 'enum': list(self.env.valid_actions)}, + 'observation': 'Cached native screenshot, pygame.transform.scale to height 360; PNG only.', + 'frames_per_decision': self.env.sample_frames, 'passive_action': self.env.action_in_sample_frames, + 'native_dt': 0.033, 'native_fps': 30, + 'recording': 'Decision-frame samples of cached native RGB; not a complete 30 FPS replay.'} + + def observe(self): + return {'image_png_base64': self._image_png} + + def step(self, action): + if self._closed or self.env.over: + raise ValueError('native episode is closed or terminal') + if action not in self.env.valid_actions: + raise ValueError('invalid native action') + before = float(self.env.score) + self.decisions += 1 + for frame in range(self.env.sample_frames): + self.env.clock.tick(30) + step_action = action if frame == 0 or self.env.action_in_sample_frames is None else self.env.action_in_sample_frames + ledger_before = len(self.env.game_frames) + limit = self.instance['native_frame_limit'] + hit_limit = limit is not None and ledger_before >= limit + done, info = self.env.step(step_action, 0.033) + self.native_step_calls += 1 + # Race checks its cap before any state update. Mario checks after. + if not (self.GAME == 'race' and hit_limit): + self.native_frames_advanced += 1 + if self.GAME == 'race': + terminal = bool(done and not hit_limit) + cause = 'native_win' if self.env.win_condition else 'native_collision' + elif self.GAME == 'supermario': + terminal = bool(self.env.mario.restart) + cause = 'native_death' + else: + terminal = bool(done) + cause = 'native_death' if self.GAME != 'pong' else 'native_missed_paddle' + if done: + self.terminated = terminal + self.truncated = bool(hit_limit) + self.terminal_cause = ('native_frame_limit+' + cause if hit_limit and terminal else 'native_frame_limit' if hit_limit else cause) + # PygameBase captures even terminal first actions. Passive terminal + # frames break BEFORE capture; this asymmetry affects native caps. + if frame == 0: + self.env.history_frame_base64 = self.env.last_frame_base64 + self.env.history_action = action + self.env.history_valid_action = action + self.env.history_action_info = info + self._capture() + elif not done: + self.env.history_action_info = info + self._capture() + if done: + break + self._cache() + return Transition(float(self.env.score) - before, self.terminated, self.truncated) + + def success(self): + return bool(self.env.win_condition) if self.GAME == 'race' else bool(self.env.score > 0) + + def metrics(self): + score = float(self.env.score) + result = {'native_score': score, 'initial_native_score': self.initial_score, + 'native_frame_count': len(self.env.game_frames), + 'native_step_calls': self.native_step_calls, + 'native_frames_advanced': self.native_frames_advanced, + 'native_initialization_calls': 1, 'decision_count': self.decisions, + 'native_invalid_action_count': int(self.env.invalid_action_count), + 'native_terminated': self.terminated, 'native_truncated': self.truncated, + 'terminal_cause': self.terminal_cause, + 'native_frame_limit': self.instance['native_frame_limit'], + 'visual_wallclock_dependency': self.GAME == 'tempestrun'} + if self.GAME == 'race': + from game.race.utils import get_distance + result.update(native_win=bool(self.env.win_condition), native_completion_degree=max(0, self.env.origin_distance - get_distance(self.env.car, self.env.trophy)) / self.env.origin_distance) + elif self.GAME == 'pong': + result.update(score_a=self.env.scoreA, score_b=self.env.scoreB) + elif self.GAME == 'flappybird': + result.update(pipe_pair_score=score, counted_live_pipe_halves=sum(int(p['counted']) for p in self.env.pipe_list)) + elif self.GAME == 'supermario': + result.update(dashboard_points=self.env.dashboard.points, dashboard_coins=self.env.dashboard.coins, dashboard_ticks=self.env.dashboard.ticks, dashboard_time=self.env.dashboard.time, mario_restart=bool(self.env.mario.restart)) + else: + player = self.env.current_mode.player + result.update(distance_z=player.z, player_dead=bool(player.is_dead()), player_mode=player.current_mode) + return result + + def _freeze(self, value, seen=None, path='state'): + """Serialize native state fields, excluding resources and visual timestamps. + + Stable graph paths replace references; no repr, address, event, or clock is + admitted. This audit snapshot is not a restorable engine checkpoint. + """ + seen = {} if seen is None else seen + if value is None or type(value) in (str, int, float, bool): + return value + if isinstance(value, self.np.ndarray): + return value.tolist() + if isinstance(value, self.np.generic): + return value.item() + if isinstance(value, (self.pygame.Rect, self.pygame.Vector2, self.pygame.Vector3, self.pygame.Color)): + return list(value) + if isinstance(value, (list, tuple)): + return [self._freeze(v, seen, path + '/' + str(i)) for i, v in enumerate(value)] + if isinstance(value, dict): + return [[self._freeze(k, seen, path + '/key'), self._freeze(v, seen, path + '/' + str(i))] for i, (k, v) in enumerate(sorted(value.items(), key=lambda item: str(item[0])))] + if isinstance(value, self.pygame.sprite.AbstractGroup): + return self._freeze(value.sprites(), seen, path) + module = type(value).__module__ + if not hasattr(value, '__dict__') or not (module.startswith(('game.', 'classes.', 'entities.', 'traits.', 'gameplay.', 'rendering.'))): + return {'resource_type': type(value).__name__} + if id(value) in seen: + return {'native_reference': seen[id(value)]} + seen[id(value)] = path + excluded = {'_dead_since', '_cached_3d_model', 'loop', 'screen', 'sound', 'font', 'score_font', 'neon_renderer', 'spriteCollection', 'image', 'src_image', 'normal', 'frames', 'pauseObj', 'input', 'collision', 'EntityCollider', '_Sprite__g', 'camera'} + fields = {k: self._freeze(v, seen, path + '/' + k) for k, v in sorted(vars(value).items()) if k not in excluded and not callable(v)} + return {'native_type': module + '.' + type(value).__name__, 'fields': fields} + + def fingerprint(self): + g = self.env + if self.GAME == 'race': + state = {'car': self._freeze(g.car), 'pads': self._freeze(g.pad_group), 'trophy': self._freeze(g.trophy), 'trophy_count': len(g.trophy_group), 'win': g.win_condition, 'origin_distance': g.origin_distance} + elif self.GAME == 'flappybird': + names = ('bird_rect', 'bird_movement', 'bird_index', 'bird_flip_count', 'create_pipe_count', 'floor_x_pos', 'pipe_list') + state = {name: self._freeze(getattr(g, name)) for name in names} + elif self.GAME == 'pong': + state = {name: self._freeze(getattr(g, name)) for name in ('ball', 'ball_dx', 'ball_dy', 'paddleA', 'paddleB', 'scoreA', 'scoreB')} + elif self.GAME == 'supermario': + state = {'mario': self._freeze(g.mario), 'camera': self._freeze(g.mario.camera), 'dashboard': self._freeze(g.dashboard), 'level': self._freeze(g.level)} + else: + m = g.current_mode + state = {'player': self._freeze(m.player), 'level': self._freeze(m.current_level), 'camera': self._freeze(m.camera), 'rotation': m.current_rotation} + return _digest({'game': self.GAME, 'native_state': state, 'score': g.score, 'over': g.over, + 'frame_ledger_count': len(g.game_frames), 'native_step_calls': self.native_step_calls, + 'native_frames_advanced': self.native_frames_advanced, 'decisions': self.decisions, + 'terminal_cause': self.terminal_cause, 'random_state': random.getstate(), + 'numpy_state': self._freeze(self.np.random.get_state())}) + + def frame(self): + return self._frame.copy() + + def close(self): + if not self._closed: + self.pygame.quit() + os.chdir(self._previous_cwd) + self._temporary.cleanup() + self._closed = True diff --git a/game_first_exam/benchmarks/vmage/flappybird/README.md b/game_first_exam/benchmarks/vmage/flappybird/README.md new file mode 100644 index 0000000..eeb6b91 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/flappybird/README.md @@ -0,0 +1,25 @@ +# V-MAGE FlappyBird adapter (internal research) + +This thin adapter runs the unchanged native game at commit `95d5d4a445bb0b75cce765c93107d87f84613e4d`. +`../common/SOURCE.json` binds externally fetched source and asset bytes. +Upstream and third-party licensing remain unresolved; do not publish the +native runtime payload or images without resolving those rights. + +The one-process, one-episode lifecycle calls native `init_run()` exactly once, +including `step("None", 0)`. A decision performs 3 native +frames at literal dt 0.033 with 30 FPS pacing. Later frames repeat the selected action. +Native first-action and passive-terminal capture asymmetry is preserved. +The frozen levels have no native capture-ledger limit. +Native death terminates the episode. + +Observations only return the cached PNG at 202×360 using +native pygame scaling. Queries never render or advance RNG. Native full-size RGB +is cached separately for decision-frame video. Screenshots are pruned after capture +while the native capture ledger is retained. Fingerprints bind explicit game state, +RNG and counters for auditing. + +The primary metric is native_score, and transition reward is its difference. +The success boolean is positive_score_auxiliary, not a native completion claim. +Illegal public actions are rejected without native advancement; the upstream +three-invalid-actions random fallback is intentionally not part of this protocol. +The original naive-agent prompt, parser and three-image history are not reproduced. diff --git a/game_first_exam/benchmarks/vmage/flappybird/adapter.py b/game_first_exam/benchmarks/vmage/flappybird/adapter.py new file mode 100644 index 0000000..5c3d0e2 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/flappybird/adapter.py @@ -0,0 +1,16 @@ +"""Thin trusted entry point for externally installed native V-MAGE FlappyBird.""" +import importlib.util +from pathlib import Path +try: + from ..common.vmage_bridge import NativeAdapter +except ImportError: + from vmage_bridge import NativeAdapter + +_spec = importlib.util.spec_from_file_location('_vmage_flappybird_schema', Path(__file__).with_name('instance_schema.py')) +_schema = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(_schema) +BENCHMARK = 'vmage_flappybird' + +class Adapter(NativeAdapter): + GAME = 'flappybird' + SCHEMA = _schema diff --git a/game_first_exam/benchmarks/vmage/flappybird/instance_schema.py b/game_first_exam/benchmarks/vmage/flappybird/instance_schema.py new file mode 100644 index 0000000..c4677a4 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/flappybird/instance_schema.py @@ -0,0 +1,32 @@ +"""Stdlib-only validation of every frozen native level; no engine imports.""" +import json +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vmage_flappybird' +FROZEN_FIELDS = json.loads('{"archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", "dt": 0.033, "engine_versions": {"Pillow": "10.4.0", "imageio": "2.36.0", "numpy": "2.2.4", "opencv-python": "4.11.0.86", "pygame": "2.6.1", "scipy": "1.15.1", "tqdm": "4.67.1"}, "fps": 30, "frame_ledger": "pygame-base-capture-asymmetry-v1", "initialization": "native-init_run-step-None-dt0-v1", "native_game": "flappybird", "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", "python_version": "3.10.12", "sdl_version": "2.28.4", "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d"}') +LEVEL_FIELDS = json.loads('{"1": {"frames_per_decision": 3, "native_actions": ["UP", "DOWN", "KEEP"], "native_frame_limit": null, "native_level": 1, "native_level_sha256": "cd3d8ce00a3725c3113fc2c2efe4e54f7dec8cf05609b93c859b21d0cc0bbbe9", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "2": {"frames_per_decision": 3, "native_actions": ["UP", "DOWN", "KEEP"], "native_frame_limit": null, "native_level": 2, "native_level_sha256": "e1b0fd409cf18c5922248b04d2eeceb3c85cea78c7630daba38f5bcd6478be34", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "3": {"frames_per_decision": 3, "native_actions": ["UP", "DOWN", "KEEP"], "native_frame_limit": null, "native_level": 3, "native_level_sha256": "1eb93f5afd359a79cb6919da1ed2fb0d2f5f042a959b4a47a066a18bad093501", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "4": {"frames_per_decision": 3, "native_actions": ["UP", "KEEP", "NONE"], "native_frame_limit": null, "native_level": 4, "native_level_sha256": "7298dff24e0453d3aa21f8b403ccdc94eb884124ea8b60880205bf64b374502a", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "5": {"frames_per_decision": 3, "native_actions": ["UP", "KEEP", "NONE"], "native_frame_limit": null, "native_level": 5, "native_level_sha256": "b3b94e27cc69d1bb41e4e8e55bb45fd445a3ddf116c822f04693d97f1433ca35", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "6": {"frames_per_decision": 3, "native_actions": ["UP", "KEEP", "NONE"], "native_frame_limit": null, "native_level": 6, "native_level_sha256": "2111389b57832815765dbba253bbb2a2ef2a21dfe22c8f3642ee10146d3abf8d", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}, "7": {"frames_per_decision": 3, "native_actions": ["UP", "NONE"], "native_frame_limit": null, "native_level": 7, "native_level_sha256": "3d600dbf9a777f900716949d4830ba2d521eb39cadc2d21cdae020b5c0055bb2", "observation_size": [202, 360], "passive_action": null, "surface_size": [576, 1024]}}') +FIELDS = FROZEN_FIELDS.keys() | LEVEL_FIELDS['1'].keys() +METRICS = {'native_score'} +PROFILES = {'vmage-rgb-h360-v1'} +REDUCERS = {('family_macro', '1.0.0')} +COMMON = {'schema_version', 'protocol', 'adapter_version', 'capabilities', 'benchmark', 'env_id', 'family', 'seed', 'max_steps', 'initial_state_sha256', 'observation_profile', 'metric_spec'} + +def validate(value): + if not isinstance(value, dict) or set(value) != COMMON | FIELDS: + raise ValueError('V-MAGE instance fields differ from frozen schema') + level = value.get('native_level') + if type(level) is not int or str(level) not in LEVEL_FIELDS: + raise ValueError('unsupported native V-MAGE level') + expected_fields = FROZEN_FIELDS | LEVEL_FIELDS[str(level)] + for key, expected in expected_fields.items(): + if type(value[key]) is not type(expected) or json.dumps(value[key], sort_keys=True, allow_nan=False) != json.dumps(expected, sort_keys=True, allow_nan=False): + raise ValueError('unsupported frozen V-MAGE field: ' + key) + if value['adapter_version'] != '1.0.0' or value['benchmark'] != BENCHMARK or value['env_id'] != 'V-MAGE-FlappyBird' + '-L' + str(level) + '-v2' or value['family'] != f'l{level:02}': + raise ValueError('unsupported native game identity/version') + if type(value['seed']) is not int or value['seed'] != 0 or value['max_steps'] is not None: + raise ValueError('only seed0 without an extra action cap is frozen') + if value['observation_profile'] != 'vmage-rgb-h360-v1': + raise ValueError('unsupported native observation profile') + if value['capabilities'] != {'images': True, 'action_mode': 'enum', 'timing': 'action-stepped', 'native_truncation': False}: + raise ValueError('unsupported native capabilities') + if value['metric_spec'] != {'primary': 'native_score', 'reducer': 'family_macro', 'reducer_version': '1.0.0', 'success_label': 'positive_score_auxiliary'}: + raise ValueError('unsupported V-MAGE metric specification') diff --git a/game_first_exam/benchmarks/vmage/pong/README.md b/game_first_exam/benchmarks/vmage/pong/README.md new file mode 100644 index 0000000..64b717d --- /dev/null +++ b/game_first_exam/benchmarks/vmage/pong/README.md @@ -0,0 +1,25 @@ +# V-MAGE Pong adapter (internal research) + +This thin adapter runs the unchanged native game at commit `95d5d4a445bb0b75cce765c93107d87f84613e4d`. +`../common/SOURCE.json` binds externally fetched source and asset bytes. +Upstream and third-party licensing remain unresolved; do not publish the +native runtime payload or images without resolving those rights. + +The one-process, one-episode lifecycle calls native `init_run()` exactly once, +including `step("None", 0)`. A decision performs 3 native +frames at literal dt 0.033 with 30 FPS pacing. Later frames repeat the selected action. +Native first-action and passive-terminal capture asymmetry is preserved. +The frozen levels have no native capture-ledger limit. +The episode terminates when the ball passes either paddle. + +Observations only return the cached PNG at 480×360 using +native pygame scaling. Queries never render or advance RNG. Native full-size RGB +is cached separately for decision-frame video. Screenshots are pruned after capture +while the native capture ledger is retained. Fingerprints bind explicit game state, +RNG and counters for auditing. + +The primary metric is native_score, and transition reward is its difference. +The success boolean is positive_score_auxiliary, not a native completion claim. +Illegal public actions are rejected without native advancement; the upstream +three-invalid-actions random fallback is intentionally not part of this protocol. +The original naive-agent prompt, parser and three-image history are not reproduced. diff --git a/game_first_exam/benchmarks/vmage/pong/adapter.py b/game_first_exam/benchmarks/vmage/pong/adapter.py new file mode 100644 index 0000000..e73a14e --- /dev/null +++ b/game_first_exam/benchmarks/vmage/pong/adapter.py @@ -0,0 +1,16 @@ +"""Thin trusted entry point for externally installed native V-MAGE Pong.""" +import importlib.util +from pathlib import Path +try: + from ..common.vmage_bridge import NativeAdapter +except ImportError: + from vmage_bridge import NativeAdapter + +_spec = importlib.util.spec_from_file_location('_vmage_pong_schema', Path(__file__).with_name('instance_schema.py')) +_schema = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(_schema) +BENCHMARK = 'vmage_pong' + +class Adapter(NativeAdapter): + GAME = 'pong' + SCHEMA = _schema diff --git a/game_first_exam/benchmarks/vmage/pong/instance_schema.py b/game_first_exam/benchmarks/vmage/pong/instance_schema.py new file mode 100644 index 0000000..7afaa69 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/pong/instance_schema.py @@ -0,0 +1,32 @@ +"""Stdlib-only validation of every frozen native level; no engine imports.""" +import json +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vmage_pong' +FROZEN_FIELDS = json.loads('{"archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", "dt": 0.033, "engine_versions": {"Pillow": "10.4.0", "imageio": "2.36.0", "numpy": "2.2.4", "opencv-python": "4.11.0.86", "pygame": "2.6.1", "scipy": "1.15.1", "tqdm": "4.67.1"}, "fps": 30, "frame_ledger": "pygame-base-capture-asymmetry-v1", "initialization": "native-init_run-step-None-dt0-v1", "native_game": "pong", "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", "python_version": "3.10.12", "sdl_version": "2.28.4", "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d"}') +LEVEL_FIELDS = json.loads('{"1": {"frames_per_decision": 3, "native_actions": ["LEFTUP", "LEFTDOWN", "RIGHTUP", "RIGHTDOWN", "NONE"], "native_frame_limit": null, "native_level": 1, "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", "observation_size": [480, 360], "passive_action": null, "surface_size": [800, 600]}, "2": {"frames_per_decision": 3, "native_actions": ["LEFTUP", "LEFTDOWN", "RIGHTUP", "RIGHTDOWN", "NONE"], "native_frame_limit": null, "native_level": 2, "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", "observation_size": [480, 360], "passive_action": null, "surface_size": [800, 600]}, "3": {"frames_per_decision": 3, "native_actions": ["LEFTUP", "LEFTDOWN", "RIGHTUP", "RIGHTDOWN", "NONE"], "native_frame_limit": null, "native_level": 3, "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", "observation_size": [480, 360], "passive_action": null, "surface_size": [800, 600]}}') +FIELDS = FROZEN_FIELDS.keys() | LEVEL_FIELDS['1'].keys() +METRICS = {'native_score'} +PROFILES = {'vmage-rgb-h360-v1'} +REDUCERS = {('family_macro', '1.0.0')} +COMMON = {'schema_version', 'protocol', 'adapter_version', 'capabilities', 'benchmark', 'env_id', 'family', 'seed', 'max_steps', 'initial_state_sha256', 'observation_profile', 'metric_spec'} + +def validate(value): + if not isinstance(value, dict) or set(value) != COMMON | FIELDS: + raise ValueError('V-MAGE instance fields differ from frozen schema') + level = value.get('native_level') + if type(level) is not int or str(level) not in LEVEL_FIELDS: + raise ValueError('unsupported native V-MAGE level') + expected_fields = FROZEN_FIELDS | LEVEL_FIELDS[str(level)] + for key, expected in expected_fields.items(): + if type(value[key]) is not type(expected) or json.dumps(value[key], sort_keys=True, allow_nan=False) != json.dumps(expected, sort_keys=True, allow_nan=False): + raise ValueError('unsupported frozen V-MAGE field: ' + key) + if value['adapter_version'] != '1.0.0' or value['benchmark'] != BENCHMARK or value['env_id'] != 'V-MAGE-Pong' + '-L' + str(level) + '-v2' or value['family'] != f'l{level:02}': + raise ValueError('unsupported native game identity/version') + if type(value['seed']) is not int or value['seed'] != 0 or value['max_steps'] is not None: + raise ValueError('only seed0 without an extra action cap is frozen') + if value['observation_profile'] != 'vmage-rgb-h360-v1': + raise ValueError('unsupported native observation profile') + if value['capabilities'] != {'images': True, 'action_mode': 'enum', 'timing': 'action-stepped', 'native_truncation': False}: + raise ValueError('unsupported native capabilities') + if value['metric_spec'] != {'primary': 'native_score', 'reducer': 'family_macro', 'reducer_version': '1.0.0', 'success_label': 'positive_score_auxiliary'}: + raise ValueError('unsupported V-MAGE metric specification') diff --git a/game_first_exam/benchmarks/vmage/race/README.md b/game_first_exam/benchmarks/vmage/race/README.md new file mode 100644 index 0000000..195db68 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/race/README.md @@ -0,0 +1,25 @@ +# V-MAGE Race adapter (internal research) + +This thin adapter runs the unchanged native game at commit `95d5d4a445bb0b75cce765c93107d87f84613e4d`. +`../common/SOURCE.json` binds externally fetched source and asset bytes. +Upstream and third-party licensing remain unresolved; do not publish the +native runtime payload or images without resolving those rights. + +The one-process, one-episode lifecycle calls native `init_run()` exactly once, +including `step("None", 0)`. A decision performs 3 native +frames at literal dt 0.033 with 30 FPS pacing. Later frames repeat the selected action. +Native first-action and passive-terminal capture asymmetry is preserved. +The native capture-ledger limit varies by level. Each frozen instance declares its limit. +A native limit truncates the episode. Native death or victory terminates it. + +Observations only return the cached PNG at 480×360 using +native pygame scaling. Queries never render or advance RNG. Native full-size RGB +is cached separately for decision-frame video. Screenshots are pruned after capture +while the native capture ledger is retained. Fingerprints bind explicit game state, +RNG and counters for auditing. + +The primary metric is native_score, and transition reward is its difference. +Success is the native Race trophy win. +Illegal public actions are rejected without native advancement; the upstream +three-invalid-actions random fallback is intentionally not part of this protocol. +The original naive-agent prompt, parser and three-image history are not reproduced. diff --git a/game_first_exam/benchmarks/vmage/race/adapter.py b/game_first_exam/benchmarks/vmage/race/adapter.py new file mode 100644 index 0000000..67ded44 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/race/adapter.py @@ -0,0 +1,16 @@ +"""Thin trusted entry point for externally installed native V-MAGE Race.""" +import importlib.util +from pathlib import Path +try: + from ..common.vmage_bridge import NativeAdapter +except ImportError: + from vmage_bridge import NativeAdapter + +_spec = importlib.util.spec_from_file_location('_vmage_race_schema', Path(__file__).with_name('instance_schema.py')) +_schema = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(_schema) +BENCHMARK = 'vmage_race' + +class Adapter(NativeAdapter): + GAME = 'race' + SCHEMA = _schema diff --git a/game_first_exam/benchmarks/vmage/race/instance_schema.py b/game_first_exam/benchmarks/vmage/race/instance_schema.py new file mode 100644 index 0000000..db5834b --- /dev/null +++ b/game_first_exam/benchmarks/vmage/race/instance_schema.py @@ -0,0 +1,32 @@ +"""Stdlib-only validation of every frozen native level; no engine imports.""" +import json +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vmage_race' +FROZEN_FIELDS = json.loads('{"archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", "dt": 0.033, "engine_versions": {"Pillow": "10.4.0", "imageio": "2.36.0", "numpy": "2.2.4", "opencv-python": "4.11.0.86", "pygame": "2.6.1", "scipy": "1.15.1", "tqdm": "4.67.1"}, "fps": 30, "frame_ledger": "pygame-base-capture-asymmetry-v1", "initialization": "native-init_run-step-None-dt0-v1", "native_game": "race", "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", "python_version": "3.10.12", "sdl_version": "2.28.4", "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d"}') +LEVEL_FIELDS = json.loads('{"1": {"frames_per_decision": 3, "native_actions": ["LEFT", "RIGHT", "UP", "DOWN"], "native_frame_limit": 100, "native_level": 1, "native_level_sha256": "b921de201d2a84449b7cfea344ae355972e925d6cf4652e0949b6493ecdaeded", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "2": {"frames_per_decision": 3, "native_actions": ["LEFT", "RIGHT", "UP", "DOWN"], "native_frame_limit": 150, "native_level": 2, "native_level_sha256": "0711e72387f300d4bd4b6a851e68e2fcaeb9f83c2fe1453f0df4ddb8e62d0699", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "3": {"frames_per_decision": 3, "native_actions": ["LEFT", "RIGHT", "UP", "DOWN"], "native_frame_limit": 150, "native_level": 3, "native_level_sha256": "355cc29339fe4d9eea47dc998f2c420a70fda2c19edc5f82b4bda1e3071b9e1b", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "4": {"frames_per_decision": 3, "native_actions": ["LEFT", "RIGHT", "FORWARD", "BACKWARD"], "native_frame_limit": 150, "native_level": 4, "native_level_sha256": "1981bb851013ec64f6ac19feda5afaa12d52e713907e11c48c71b7d8ae9ddd69", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "5": {"frames_per_decision": 3, "native_actions": ["LEFT", "RIGHT", "FORWARD", "BACKWARD"], "native_frame_limit": 150, "native_level": 5, "native_level_sha256": "875e730543be80e2c61977e7ce5fd876c21c5ea2d8467bfb3f5656259aae16b8", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "6": {"frames_per_decision": 3, "native_actions": ["FORWARD", "BACKWARD", "LEFT", "RIGHT"], "native_frame_limit": 100, "native_level": 6, "native_level_sha256": "373fdc87aee0bd253bd8b4e3162902f3e2582170856f42d08bc1d3bdc4d4f0bb", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "7": {"frames_per_decision": 3, "native_actions": ["FORWARD", "BACKWARD", "LEFT", "RIGHT"], "native_frame_limit": 100, "native_level": 7, "native_level_sha256": "36675492156bd1003c91f08a80bb179c70a17b0f8c60e80ff3bf9d5341c41b5e", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "8": {"frames_per_decision": 3, "native_actions": ["FORWARD", "BACKWARD", "LEFT", "RIGHT"], "native_frame_limit": 300, "native_level": 8, "native_level_sha256": "fd90f6f1ac8a443645487a398fc371f5539cb26974946e7433b8016758e80f75", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}, "9": {"frames_per_decision": 3, "native_actions": ["FORWARD", "BACKWARD", "LEFT", "RIGHT"], "native_frame_limit": 500, "native_level": 9, "native_level_sha256": "89373304d6b97c75396515eec9fd5271b021ed9c0cbc0a9764ce9dcdf23c8abc", "observation_size": [480, 360], "passive_action": null, "surface_size": [1024, 768]}}') +FIELDS = FROZEN_FIELDS.keys() | LEVEL_FIELDS['1'].keys() +METRICS = {'native_score'} +PROFILES = {'vmage-rgb-h360-v1'} +REDUCERS = {('family_macro', '1.0.0')} +COMMON = {'schema_version', 'protocol', 'adapter_version', 'capabilities', 'benchmark', 'env_id', 'family', 'seed', 'max_steps', 'initial_state_sha256', 'observation_profile', 'metric_spec'} + +def validate(value): + if not isinstance(value, dict) or set(value) != COMMON | FIELDS: + raise ValueError('V-MAGE instance fields differ from frozen schema') + level = value.get('native_level') + if type(level) is not int or str(level) not in LEVEL_FIELDS: + raise ValueError('unsupported native V-MAGE level') + expected_fields = FROZEN_FIELDS | LEVEL_FIELDS[str(level)] + for key, expected in expected_fields.items(): + if type(value[key]) is not type(expected) or json.dumps(value[key], sort_keys=True, allow_nan=False) != json.dumps(expected, sort_keys=True, allow_nan=False): + raise ValueError('unsupported frozen V-MAGE field: ' + key) + if value['adapter_version'] != '1.0.0' or value['benchmark'] != BENCHMARK or value['env_id'] != 'V-MAGE-Race' + '-L' + str(level) + '-v2' or value['family'] != f'l{level:02}': + raise ValueError('unsupported native game identity/version') + if type(value['seed']) is not int or value['seed'] != 0 or value['max_steps'] is not None: + raise ValueError('only seed0 without an extra action cap is frozen') + if value['observation_profile'] != 'vmage-rgb-h360-v1': + raise ValueError('unsupported native observation profile') + if value['capabilities'] != {'images': True, 'action_mode': 'enum', 'timing': 'action-stepped', 'native_truncation': True}: + raise ValueError('unsupported native capabilities') + if value['metric_spec'] != {'primary': 'native_score', 'reducer': 'family_macro', 'reducer_version': '1.0.0', 'success_label': 'native_goal_reached'}: + raise ValueError('unsupported V-MAGE metric specification') diff --git a/game_first_exam/benchmarks/vmage/supermario/README.md b/game_first_exam/benchmarks/vmage/supermario/README.md new file mode 100644 index 0000000..3aab479 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/supermario/README.md @@ -0,0 +1,26 @@ +# V-MAGE SuperMario adapter (internal research) + +This thin adapter runs the unchanged native game at commit `95d5d4a445bb0b75cce765c93107d87f84613e4d`. +`../common/SOURCE.json` binds externally fetched source and asset bytes. +Upstream and third-party licensing remain unresolved; do not publish the +native runtime payload or images without resolving those rights. + +The one-process, one-episode lifecycle calls native `init_run()` exactly once, +including `step("None", 0)`. A decision performs 5 native +frames at literal dt 0.033 with 30 FPS pacing. Later frames repeat the selected action. +Native first-action and passive-terminal capture asymmetry is preserved. +The native capture-ledger limit varies by level. Each frozen instance declares its limit. +Limits are truncations; native death/win is termination, with both flags retained +for simultaneous Mario death and frame exhaustion. + +Observations only return the cached PNG at 480×360 using +native pygame scaling. Queries never render or advance RNG. Native full-size RGB +is cached separately for decision-frame video. Screenshots are pruned after capture +while the native capture ledger is retained. Fingerprints bind explicit game state, +RNG and counters for auditing. + +The primary metric is native_score, and transition reward is its difference. +The success boolean is positive_score_auxiliary, not a native completion claim. +Illegal public actions are rejected without native advancement; the upstream +three-invalid-actions random fallback is intentionally not part of this protocol. +The original naive-agent prompt, parser and three-image history are not reproduced. diff --git a/game_first_exam/benchmarks/vmage/supermario/adapter.py b/game_first_exam/benchmarks/vmage/supermario/adapter.py new file mode 100644 index 0000000..494bafa --- /dev/null +++ b/game_first_exam/benchmarks/vmage/supermario/adapter.py @@ -0,0 +1,16 @@ +"""Thin trusted entry point for externally installed native V-MAGE SuperMario.""" +import importlib.util +from pathlib import Path +try: + from ..common.vmage_bridge import NativeAdapter +except ImportError: + from vmage_bridge import NativeAdapter + +_spec = importlib.util.spec_from_file_location('_vmage_supermario_schema', Path(__file__).with_name('instance_schema.py')) +_schema = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(_schema) +BENCHMARK = 'vmage_supermario' + +class Adapter(NativeAdapter): + GAME = 'supermario' + SCHEMA = _schema diff --git a/game_first_exam/benchmarks/vmage/supermario/instance_schema.py b/game_first_exam/benchmarks/vmage/supermario/instance_schema.py new file mode 100644 index 0000000..ddf2048 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/supermario/instance_schema.py @@ -0,0 +1,32 @@ +"""Stdlib-only validation of every frozen native level; no engine imports.""" +import json +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vmage_supermario' +FROZEN_FIELDS = json.loads('{"archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", "dt": 0.033, "engine_versions": {"Pillow": "10.4.0", "imageio": "2.36.0", "numpy": "2.2.4", "opencv-python": "4.11.0.86", "pygame": "2.6.1", "scipy": "1.15.1", "tqdm": "4.67.1"}, "fps": 30, "frame_ledger": "pygame-base-capture-asymmetry-v1", "initialization": "native-init_run-step-None-dt0-v1", "native_game": "supermario", "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", "python_version": "3.10.12", "sdl_version": "2.28.4", "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d"}') +LEVEL_FIELDS = json.loads('{"0": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 5000, "native_level": 0, "native_level_sha256": "58852fd202ad042f99fd73d31c4f1d28e386abfc2f03b45d8cc13812aa751814", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "1": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 400, "native_level": 1, "native_level_sha256": "3e6c984b50cc0f0115dd1e75fe692da15bb7d55acd43562d103e06170e478433", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "2": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 1000, "native_level": 2, "native_level_sha256": "9b8cf1291572591e67f49b3020cb036321e9f24ffedbdcd6484cd084506f0468", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "3": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 1000, "native_level": 3, "native_level_sha256": "8b462e92bf600b0dc24e7489155852b8e4caa30ba29ef63f0ff955f8f8e79bd4", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "4": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 1000, "native_level": 4, "native_level_sha256": "a98f5ce1601c4fa48ecbf2c2088bea837facf5d85316ad00e5307a8b0498d9c9", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "5": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 300, "native_level": 5, "native_level_sha256": "7ae2ef5c7b2ecc7485f524ac24cba739212abdac88c14218a1c071d36abeb6e6", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "6": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 300, "native_level": 6, "native_level_sha256": "ede21fc4c70bfff98980b5661f4e445b0bed30b3909a2a126ed6de47227b2f02", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "7": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 300, "native_level": 7, "native_level_sha256": "7159d04f47a22b4e747940ee4bfffa1406260bc74784bbe62775b36c3dc1b466", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "8": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 1000, "native_level": 8, "native_level_sha256": "03160e5334e0efc194f625d9d813f83e56d15b731094e27996da78c2c56a603e", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}, "9": {"frames_per_decision": 5, "native_actions": ["UP", "LEFT", "RIGHT", "UP+LEFT", "UP+RIGHT", "NONE"], "native_frame_limit": 1000, "native_level": 9, "native_level_sha256": "51160e3afff1090d8ea148ee40cc4a15ffbc3214a23b6b009367de711a09bf51", "observation_size": [480, 360], "passive_action": null, "surface_size": [640, 480]}}') +FIELDS = FROZEN_FIELDS.keys() | LEVEL_FIELDS['1'].keys() +METRICS = {'native_score'} +PROFILES = {'vmage-rgb-h360-v1'} +REDUCERS = {('family_macro', '1.0.0')} +COMMON = {'schema_version', 'protocol', 'adapter_version', 'capabilities', 'benchmark', 'env_id', 'family', 'seed', 'max_steps', 'initial_state_sha256', 'observation_profile', 'metric_spec'} + +def validate(value): + if not isinstance(value, dict) or set(value) != COMMON | FIELDS: + raise ValueError('V-MAGE instance fields differ from frozen schema') + level = value.get('native_level') + if type(level) is not int or str(level) not in LEVEL_FIELDS: + raise ValueError('unsupported native V-MAGE level') + expected_fields = FROZEN_FIELDS | LEVEL_FIELDS[str(level)] + for key, expected in expected_fields.items(): + if type(value[key]) is not type(expected) or json.dumps(value[key], sort_keys=True, allow_nan=False) != json.dumps(expected, sort_keys=True, allow_nan=False): + raise ValueError('unsupported frozen V-MAGE field: ' + key) + if value['adapter_version'] != '1.0.0' or value['benchmark'] != BENCHMARK or value['env_id'] != 'V-MAGE-SuperMario' + '-L' + str(level) + '-v2' or value['family'] != f'l{level:02}': + raise ValueError('unsupported native game identity/version') + if type(value['seed']) is not int or value['seed'] != 0 or value['max_steps'] is not None: + raise ValueError('only seed0 without an extra action cap is frozen') + if value['observation_profile'] != 'vmage-rgb-h360-v1': + raise ValueError('unsupported native observation profile') + if value['capabilities'] != {'images': True, 'action_mode': 'enum', 'timing': 'action-stepped', 'native_truncation': True}: + raise ValueError('unsupported native capabilities') + if value['metric_spec'] != {'primary': 'native_score', 'reducer': 'family_macro', 'reducer_version': '1.0.0', 'success_label': 'positive_score_auxiliary'}: + raise ValueError('unsupported V-MAGE metric specification') diff --git a/game_first_exam/benchmarks/vmage/tempestrun/README.md b/game_first_exam/benchmarks/vmage/tempestrun/README.md new file mode 100644 index 0000000..17720df --- /dev/null +++ b/game_first_exam/benchmarks/vmage/tempestrun/README.md @@ -0,0 +1,26 @@ +# V-MAGE TempestRun adapter (internal research) + +This thin adapter runs the unchanged native game at commit `95d5d4a445bb0b75cce765c93107d87f84613e4d`. +`../common/SOURCE.json` binds externally fetched source and asset bytes. +Upstream and third-party licensing remain unresolved; do not publish the +native runtime payload or images without resolving those rights. + +The one-process, one-episode lifecycle calls native `init_run()` exactly once, +including `step("None", 0)`. A decision performs 3 native +frames at literal dt 0.033 with 30 FPS pacing. Later frames use NONE. +Native first-action and passive-terminal capture asymmetry is preserved. +The frozen levels have no native capture-ledger limit. +Native death terminates the episode. + +Observations only return the cached PNG at 480×360 using +native pygame scaling. Queries never render or advance RNG. Native full-size RGB +is cached separately for decision-frame video. Screenshots are pruned after capture +while the native capture ledger is retained. Fingerprints bind explicit game state, +RNG and counters; they are audit digests, not restorable checkpoints. Tempest native +explosion/death visuals retain their wall-clock dependence. + +The primary metric is native_score, and transition reward is its difference. +The success boolean is positive_score_auxiliary, not a native completion claim. +Illegal public actions are rejected without native advancement; the upstream +three-invalid-actions random fallback is intentionally not part of this protocol. +The original naive-agent prompt, parser and three-image history are not reproduced. diff --git a/game_first_exam/benchmarks/vmage/tempestrun/adapter.py b/game_first_exam/benchmarks/vmage/tempestrun/adapter.py new file mode 100644 index 0000000..b1681fe --- /dev/null +++ b/game_first_exam/benchmarks/vmage/tempestrun/adapter.py @@ -0,0 +1,16 @@ +"""Thin trusted entry point for externally installed native V-MAGE TempestRun.""" +import importlib.util +from pathlib import Path +try: + from ..common.vmage_bridge import NativeAdapter +except ImportError: + from vmage_bridge import NativeAdapter + +_spec = importlib.util.spec_from_file_location('_vmage_tempestrun_schema', Path(__file__).with_name('instance_schema.py')) +_schema = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(_schema) +BENCHMARK = 'vmage_tempestrun' + +class Adapter(NativeAdapter): + GAME = 'tempestrun' + SCHEMA = _schema diff --git a/game_first_exam/benchmarks/vmage/tempestrun/instance_schema.py b/game_first_exam/benchmarks/vmage/tempestrun/instance_schema.py new file mode 100644 index 0000000..d477799 --- /dev/null +++ b/game_first_exam/benchmarks/vmage/tempestrun/instance_schema.py @@ -0,0 +1,32 @@ +"""Stdlib-only validation of every frozen native level; no engine imports.""" +import json +SCHEMA_VERSION = '1.0.0' +BENCHMARK = 'vmage_tempestrun' +FROZEN_FIELDS = json.loads('{"archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", "dt": 0.033, "engine_versions": {"Pillow": "10.4.0", "imageio": "2.36.0", "numpy": "2.2.4", "opencv-python": "4.11.0.86", "pygame": "2.6.1", "scipy": "1.15.1", "tqdm": "4.67.1"}, "fps": 30, "frame_ledger": "pygame-base-capture-asymmetry-v1", "initialization": "native-init_run-step-None-dt0-v1", "native_game": "tempestrun", "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", "python_version": "3.10.12", "sdl_version": "2.28.4", "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d"}') +LEVEL_FIELDS = json.loads('{"1": {"frames_per_decision": 3, "native_actions": ["JUMP", "LEFT", "RIGHT", "SLIDE", "RISE", "NONE"], "native_frame_limit": null, "native_level": 1, "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", "observation_size": [480, 360], "passive_action": "NONE", "surface_size": [1024, 768]}, "2": {"frames_per_decision": 3, "native_actions": ["JUMP", "LEFT", "RIGHT", "SLIDE", "RISE", "NONE"], "native_frame_limit": null, "native_level": 2, "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", "observation_size": [480, 360], "passive_action": "NONE", "surface_size": [1024, 768]}, "3": {"frames_per_decision": 3, "native_actions": ["JUMP", "LEFT", "RIGHT", "SLIDE", "RISE", "NONE"], "native_frame_limit": null, "native_level": 3, "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", "observation_size": [480, 360], "passive_action": "NONE", "surface_size": [1024, 768]}, "4": {"frames_per_decision": 3, "native_actions": ["JUMP", "LEFT", "RIGHT", "SLIDE", "RISE", "NONE"], "native_frame_limit": null, "native_level": 4, "native_level_sha256": "aa0266ca102f7ca43e963e1942b2ce67fd62af021cd5844ddf755b710b0af4b0", "observation_size": [480, 360], "passive_action": "NONE", "surface_size": [1024, 768]}, "5": {"frames_per_decision": 3, "native_actions": ["JUMP", "LEFT", "RIGHT", "SLIDE", "RISE", "NONE"], "native_frame_limit": null, "native_level": 5, "native_level_sha256": "b21b6c4c5d4833bc356cf9525f5b03568d19bd18575a47a9c16f4ee434477a7b", "observation_size": [480, 360], "passive_action": "NONE", "surface_size": [1024, 768]}}') +FIELDS = FROZEN_FIELDS.keys() | LEVEL_FIELDS['1'].keys() +METRICS = {'native_score'} +PROFILES = {'vmage-rgb-h360-v1'} +REDUCERS = {('family_macro', '1.0.0')} +COMMON = {'schema_version', 'protocol', 'adapter_version', 'capabilities', 'benchmark', 'env_id', 'family', 'seed', 'max_steps', 'initial_state_sha256', 'observation_profile', 'metric_spec'} + +def validate(value): + if not isinstance(value, dict) or set(value) != COMMON | FIELDS: + raise ValueError('V-MAGE instance fields differ from frozen schema') + level = value.get('native_level') + if type(level) is not int or str(level) not in LEVEL_FIELDS: + raise ValueError('unsupported native V-MAGE level') + expected_fields = FROZEN_FIELDS | LEVEL_FIELDS[str(level)] + for key, expected in expected_fields.items(): + if type(value[key]) is not type(expected) or json.dumps(value[key], sort_keys=True, allow_nan=False) != json.dumps(expected, sort_keys=True, allow_nan=False): + raise ValueError('unsupported frozen V-MAGE field: ' + key) + if value['adapter_version'] != '1.0.0' or value['benchmark'] != BENCHMARK or value['env_id'] != 'V-MAGE-TempestRun' + '-L' + str(level) + '-v2' or value['family'] != f'l{level:02}': + raise ValueError('unsupported native game identity/version') + if type(value['seed']) is not int or value['seed'] != 0 or value['max_steps'] is not None: + raise ValueError('only seed0 without an extra action cap is frozen') + if value['observation_profile'] != 'vmage-rgb-h360-v1': + raise ValueError('unsupported native observation profile') + if value['capabilities'] != {'images': True, 'action_mode': 'enum', 'timing': 'action-stepped', 'native_truncation': False}: + raise ValueError('unsupported native capabilities') + if value['metric_spec'] != {'primary': 'native_score', 'reducer': 'family_macro', 'reducer_version': '1.0.0', 'success_label': 'positive_score_auxiliary'}: + raise ValueError('unsupported V-MAGE metric specification') diff --git a/game_first_exam/images/vmage-files/FILES.json b/game_first_exam/images/vmage-files/FILES.json new file mode 100644 index 0000000..b4d7f41 --- /dev/null +++ b/game_first_exam/images/vmage-files/FILES.json @@ -0,0 +1,21 @@ +{ + "image": "ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17", + "source": "game_first_exam/benchmarks/vmage", + "files": { + "common/SOURCE.json": "8e1222100f13554a88177337f444460c80d93dac8f3f086c7a605f1e51bee5d9", + "common/metric_rules.py": "89816067bcd2652d96e88dbccd9d19bd18bbbd77fe878bf7a2548b45f517f698", + "common/requirements.txt": "0fd9964e298d98ea42f99f0e195cae36e2527132280b0bdf1a16a83aa589bb88", + "common/source_loader.py": "9bc07af22bf56009fccc879e637b168806139b30f8e710a97d3ea7d7bcd0d820", + "common/vmage_bridge.py": "6d3f40dfd6a93e3e022877563da8a76881c79951716047e55ce041694cda7168", + "flappybird/adapter.py": "bd928d465a1fcb028efc8778c647f2aba3a22b44518c8836d86e401e3b56174b", + "flappybird/instance_schema.py": "d9e196977ebc1f8af156461bb2d8ca2d17ce5e14a6de785da2222bc657f3c685", + "pong/adapter.py": "759de8185c0c0e228c67a5e2190bc5a9ea5c827935d73ac4cb74375c459b2e2f", + "pong/instance_schema.py": "2e8d65c3e8c037f6e1657a272665665f1ebda4ef2f53eaa793c35f208f5ec13c", + "race/adapter.py": "addf57f843bc3c7410c88dc4b4c84b8fe0029fe174c6d6ff7332a9b388c80089", + "race/instance_schema.py": "e55ec578573fdb613be1d3f1de24649a894118c4f6585f26531889d163d27f10", + "supermario/adapter.py": "dcd61223d574019e7644e5f8de519b46d41ccb04a9791d3a3e9e72b80117b2bc", + "supermario/instance_schema.py": "b23185bd570defcde155e2b34a4e2f4882cb7315a15fe6b1a874301361a1a327", + "tempestrun/adapter.py": "c6a95d08973e0dfc3c7b867aff3b9161d574700e43766f9b3ff0622aa29a2b8f", + "tempestrun/instance_schema.py": "7b315843a07618c81bf32eb3d70cddf4cb5c4d27d145f785dfbc3fdc59312b00" + } +} diff --git a/game_first_exam/images/vmage-files/VERSION b/game_first_exam/images/vmage-files/VERSION new file mode 100644 index 0000000..ee1372d --- /dev/null +++ b/game_first_exam/images/vmage-files/VERSION @@ -0,0 +1 @@ +0.2.2 diff --git a/game_first_exam/tasks/vmage/README.md b/game_first_exam/tasks/vmage/README.md new file mode 100644 index 0000000..b92ace8 --- /dev/null +++ b/game_first_exam/tasks/vmage/README.md @@ -0,0 +1,33 @@ +# V-MAGE standard tasks + +V-MAGE freezes 34 seed-0 levels across RaceGame (9), FlappyBird (7), Pong (3), SuperMario (10), and Tempest Run (5). All five use an isolated standard client, one live episode and no reset. Each game's native raw score is reported separately. No Elo or cross-game raw-score mean is produced. Race success means reaching the trophy; other success fields are positive-score compatibility flags. + +## Suites + +| Harbor suite | Coverage | +| --- | --- | +| `vmage` | The 33 levels in the upstream default suite | +| `vmage-extra` | Tempest Run L5 | +| `vmage-smoke` | One L1 task for each of the five games | + +Use `harbor run --game-suite vmage --standard --list` to inspect the default suite. + +## Native source and packaging + +Source commit: `95d5d4a445bb0b75cce765c93107d87f84613e4d`. Archive SHA256: `1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919`. The selected source/asset manifest and dependencies are recorded under `game_first_exam/benchmarks/vmage/common/` and in each instance. Builds fetch and verify the original selected payload; native implementation and asset bytes are not vendored into this checkout. Source and asset redistribution permission is unresolved: internal research only, with no image publication. + +## Native behavior and adaptations + +The effective upstream sampling is three frames per decision, except Mario's five. Tempest uses NONE in passive frames; the other games repeat the selected action. The native dt is 0.033, paced at 30 FPS. Initialization performs the original step('None', 0) before the first screenshot. The frame ledger preserves upstream capture order, including omitted passive terminal captures. The native limits for Race and SuperMario count capture-ledger entries. Each frozen instance specifies its limit. Native collision and reward logic remains in the original games. Invalid client actions do not advance or capture frames and do not trigger the original runner's random fallback. + +## Visible input and audit frames + +The public input is a native screenshot scaled with pygame.transform.scale to height 360: FlappyBird 202x360, other games 480x360. The authored instruction describes the controls and scoring. Parsed objects, coordinates, hidden parameters and native info are not supplied. The coding agent manages its own image history rather than receiving the original naive agent's fixed history window. Reads use cached images because extra native rendering could change Race collision handling or Tempest obstacle generation. The audit video samples native-resolution decision frames; it is not a complete 30 FPS replay. + +## Scores and limits + +Raw scores are Race 100/0; FlappyBird 0.5 per pipe half, or 1 per pair; Pong total paddle returns; Mario dashboard.points; and Tempest int(z/10)*10. Native caps, death and rewards remain. The frozen agent deadline is 600 seconds per task. Model thinking and tool execution consume wall time while physics waits. Calendar time is not virtualized. Tempest explosion visuals use wall time, so full pixel identity across different delays is not claimed. Fingerprints exclude cosmetic timestamps and provide audit binding rather than restorable checkpoints. Native dependencies, SDL and fonts are frozen for the tested setup. + +## Reference and verification + +The five L1 smoke references check the trophy condition in Race and positive scores in the other four games. Other reference traces exercise the native action and scoring path and may finish with zero points. They are not exposed to the evaluated model. An independent verifier grades trusted live evidence, without trusting agent-written scores or claiming native trajectory replay. Model evaluation and publication are separate actions. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/DIGEST new file mode 100644 index 0000000..365a494 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:e50001de648a68fbc9aa8e9d08dfa5f304402a3edcbc3c414ebb6656a7aac0ce diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/README.md new file mode 100644 index 0000000..f724b51 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l01-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l01` / seed 0 | +| Oracle | `partial` — Frozen actions verify a positive native score only; no full-score or optimal-policy claim. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level1, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Initial native level; smoke integration only. + +## Reference solution +The frozen 40-decision reference verifies a positive native score only; it is a partial reference with the actual 3/5-frame action sampling. It is excluded from the model-facing image and is not a model score or optimality proof. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l01-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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: 1024m # 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: 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/vmage/vmage-flappybird-l01-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..0e16129 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..5d15e18 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "67a642d045c8d9eaf1d831bf24207719078d4143478fd72e49e2d15fffee4e7e", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 1, + "native_level_sha256": "cd3d8ce00a3725c3113fc2c2efe4e54f7dec8cf05609b93c859b21d0cc0bbbe9", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/instruction.md new file mode 100644 index 0000000..70f97f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L1 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is off. `UP` moves up, `DOWN` moves down, and `KEEP` stays at the current height. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/task.toml new file mode 100644 index 0000000..7d85473 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l01-i01-standard" +description = "V-MAGE FlappyBird L1 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l01" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "Frozen actions verify a positive native score only; no full-score or optimal-policy claim." +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 = 1200.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/vmage/vmage-flappybird-l01-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l01-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/instance.json new file mode 100644 index 0000000..5d15e18 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "67a642d045c8d9eaf1d831bf24207719078d4143478fd72e49e2d15fffee4e7e", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 1, + "native_level_sha256": "cd3d8ce00a3725c3113fc2c2efe4e54f7dec8cf05609b93c859b21d0cc0bbbe9", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..0e16129 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l01-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l01-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/vmage/vmage-flappybird-l02-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/DIGEST new file mode 100644 index 0000000..f33b2c3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:60445c63dddf8234287fca10d56181a213d505f5e028a63f201306b03cd3b52e diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/README.md new file mode 100644 index 0000000..2d1691d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l02-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l02` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level2, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 2; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l02-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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: 1024m # 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: 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/vmage/vmage-flappybird-l02-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..4ffbded --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..10a3800 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "5fb49aca89d38d52fd84454406cf0990c999c8e143bce78caa4070c339081045", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 2, + "native_level_sha256": "e1b0fd409cf18c5922248b04d2eeceb3c85cea78c7630daba38f5bcd6478be34", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/instruction.md new file mode 100644 index 0000000..dd5b1fa --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L2 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is off. `UP` moves up, `DOWN` moves down, and `KEEP` stays at the current height. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/task.toml new file mode 100644 index 0000000..35cf592 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l02-i01-standard" +description = "V-MAGE FlappyBird L2 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l02" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l02-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l02-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/instance.json new file mode 100644 index 0000000..10a3800 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "5fb49aca89d38d52fd84454406cf0990c999c8e143bce78caa4070c339081045", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 2, + "native_level_sha256": "e1b0fd409cf18c5922248b04d2eeceb3c85cea78c7630daba38f5bcd6478be34", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..4ffbded --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l02-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l02-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/vmage/vmage-flappybird-l03-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/DIGEST new file mode 100644 index 0000000..c0a440d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:fa6073f9494a30af4a08e8893a068227f8f0017285ab7a0c968943859731f59d diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/README.md new file mode 100644 index 0000000..a7c0982 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l03-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l03` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level3, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 3; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l03-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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: 1024m # 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: 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/vmage/vmage-flappybird-l03-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..94f31c3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..c68e8bb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4ae925affa21f8b297b3d3c67a41ce3bca8e18a70b8652c0965f7ed6a8e7fb78", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 3, + "native_level_sha256": "1eb93f5afd359a79cb6919da1ed2fb0d2f5f042a959b4a47a066a18bad093501", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/instruction.md new file mode 100644 index 0000000..1bc7ec2 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L3 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is off. `UP` moves up, `DOWN` moves down, and `KEEP` stays at the current height. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/task.toml new file mode 100644 index 0000000..86ee69d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l03-i01-standard" +description = "V-MAGE FlappyBird L3 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l03" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l03-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l03-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/instance.json new file mode 100644 index 0000000..c68e8bb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4ae925affa21f8b297b3d3c67a41ce3bca8e18a70b8652c0965f7ed6a8e7fb78", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 3, + "native_level_sha256": "1eb93f5afd359a79cb6919da1ed2fb0d2f5f042a959b4a47a066a18bad093501", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "DOWN", + "KEEP" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..94f31c3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l03-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l03-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/vmage/vmage-flappybird-l04-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/DIGEST new file mode 100644 index 0000000..8952233 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:72f2b1cb736efec2974a35d0584f701d11c52915ea6310d39779ec50749d1128 diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/README.md new file mode 100644 index 0000000..cc55e30 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l04-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l04` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level4, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 4; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l04-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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: 1024m # 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: 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/vmage/vmage-flappybird-l04-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..8ff67aa --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..5eaddeb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 4, + "native_level_sha256": "7298dff24e0453d3aa21f8b403ccdc94eb884124ea8b60880205bf64b374502a", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/instruction.md new file mode 100644 index 0000000..316fa61 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L4 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is active. `UP` moves up, `KEEP` holds height during the action, and `NONE` lets motion continue under gravity. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/task.toml new file mode 100644 index 0000000..39a35f0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l04-i01-standard" +description = "V-MAGE FlappyBird L4 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l04" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l04-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l04-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/instance.json new file mode 100644 index 0000000..5eaddeb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 4, + "native_level_sha256": "7298dff24e0453d3aa21f8b403ccdc94eb884124ea8b60880205bf64b374502a", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..8ff67aa --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l04-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l04-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/vmage/vmage-flappybird-l05-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/DIGEST new file mode 100644 index 0000000..db6a526 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:f6950be5d91d57bcc72c7f07f793af6b0621dddd0aea6c88afc90eed11fde558 diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/README.md new file mode 100644 index 0000000..842164a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l05-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l05` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level5, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 5; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l05-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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: 1024m # 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: 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/vmage/vmage-flappybird-l05-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..39ca4d5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..580416b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 5, + "native_level_sha256": "b3b94e27cc69d1bb41e4e8e55bb45fd445a3ddf116c822f04693d97f1433ca35", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/instruction.md new file mode 100644 index 0000000..b3e1629 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L5 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is active. `UP` moves up, `KEEP` holds height during the action, and `NONE` lets motion continue under gravity. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/task.toml new file mode 100644 index 0000000..b4e59f3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l05-i01-standard" +description = "V-MAGE FlappyBird L5 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l05" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l05-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l05-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/instance.json new file mode 100644 index 0000000..580416b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 5, + "native_level_sha256": "b3b94e27cc69d1bb41e4e8e55bb45fd445a3ddf116c822f04693d97f1433ca35", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..39ca4d5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l05-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l05-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/vmage/vmage-flappybird-l06-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/DIGEST new file mode 100644 index 0000000..c72e45d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:b02dbeaaa06e622bf7b12afdacd29eca8e12455a9dade46b09da0018146d5856 diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/README.md new file mode 100644 index 0000000..b0697b3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l06-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l06` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level6, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 6; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l06-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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: 1024m # 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: 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/vmage/vmage-flappybird-l06-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..303017f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..510c846 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/environment/sim/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 6, + "native_level_sha256": "2111389b57832815765dbba253bbb2a2ef2a21dfe22c8f3642ee10146d3abf8d", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/instruction.md new file mode 100644 index 0000000..3418962 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L6 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is active. `UP` moves up, `KEEP` holds height during the action, and `NONE` lets motion continue under gravity. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/actions.json new file mode 100644 index 0000000..71dca2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP", + "KEEP" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/task.toml new file mode 100644 index 0000000..c0ce89a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l06-i01-standard" +description = "V-MAGE FlappyBird L6 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l06" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l06-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l06-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/instance.json new file mode 100644 index 0000000..510c846 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/instance.json @@ -0,0 +1,62 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "aeb9d7e542d6bc39a5dfced558832c28214723de596003f52029409fc5e1a61b", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 6, + "native_level_sha256": "2111389b57832815765dbba253bbb2a2ef2a21dfe22c8f3642ee10146d3abf8d", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "KEEP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..303017f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l06-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l06-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/vmage/vmage-flappybird-l07-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/DIGEST new file mode 100644 index 0000000..de62c0e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:978ee68dbaa93589b31a482793e5c03dcb7ce5eb2cae2eb34c12fae9e53bcce1 diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/README.md new file mode 100644 index 0000000..aa57838 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-flappybird-l07-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l07` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Guide the bird through as many pipe gaps as possible. Each pair of pipes passed gives 1 point. A collision with pipes or the upper/lower boundary ends the episode. There is no additional action cap; native collisions and the session time limit still apply. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level7, seed0. No reset. Internal score group: vmage_flappybird. + +## Difficulty +Native code level 7; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-flappybird-l07-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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: 1024m # 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: 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/vmage/vmage-flappybird-l07-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..906fdd1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..18104b1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..ffecdcf --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/environment/sim/instance.json @@ -0,0 +1,61 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7c67b4074c3eabfcf8ff4c218507ebe3d9383047f2b0dba34889cc42f863949f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 7, + "native_level_sha256": "3d600dbf9a777f900716949d4830ba2d521eb39cadc2d21cdae020b5c0055bb2", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/instruction.md new file mode 100644 index 0000000..55434bc --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · FlappyBird L7 + +You control a bird in a side view. Pipes scroll toward the bird, with a gap to fly through. + +**Task.** Guide the bird through as many pipe gaps as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a pipe collision or when the bird leaves the allowed vertical range. Follow `done` to detect the end of the episode. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +The game awards **1 point** per pipe pair it registers as passed. Points earned before the episode ends count toward the final score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 202 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +Gravity is active. `UP` moves up and `NONE` lets motion continue under gravity. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/actions.json new file mode 100644 index 0000000..0eec80b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP", + "UP", + "UP", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/task.toml new file mode 100644 index 0000000..d7e0d06 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-flappybird-l07-i01-standard" +description = "V-MAGE FlappyBird L7 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l07" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-flappybird-l07-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5375bea --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /flappybird/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-flappybird-l07-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/instance.json new file mode 100644 index 0000000..ffecdcf --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/instance.json @@ -0,0 +1,61 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_flappybird", + "env_id": "V-MAGE-FlappyBird-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7c67b4074c3eabfcf8ff4c218507ebe3d9383047f2b0dba34889cc42f863949f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "flappybird", + "native_level": 7, + "native_level_sha256": "3d600dbf9a777f900716949d4830ba2d521eb39cadc2d21cdae020b5c0055bb2", + "native_settings_sha256": "6f411925aa489f791e77c02ab5628d9164272488806e6d34960988b35aec9f7a", + "observation_size": [ + 202, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 576, + 1024 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..906fdd1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-flappybird-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-flappybird-l07-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-flappybird-l07-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/vmage/vmage-pong-l01-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/DIGEST new file mode 100644 index 0000000..c750e0a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:daf17b312643f18ec6bf01896d3f54bd5936d0c1d3bf7a43bdea9737676c62de diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/README.md new file mode 100644 index 0000000..082149d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-pong-l01-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l01` / seed 0 | +| Oracle | `partial` — Frozen actions verify a positive native score only; no full-score or optimal-policy claim. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Control both paddles and return the ball as many times as possible. Each successful paddle return gives that side 1 point. The final score is the sum of both sides. Missing either paddle ends the episode. There is no additional action cap; a missed return or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level1, seed0. No reset. Internal score group: vmage_pong. + +## Difficulty +Initial native level; smoke integration only. + +## Reference solution +The frozen 29-decision reference verifies a positive native score only; it is a partial reference with the actual 3/5-frame action sampling. It is excluded from the model-facing image and is not a model score or optimality proof. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-pong-l01-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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: 1024m # 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: 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/vmage/vmage-pong-l01-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..09c9394 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..a1d087b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..d04d212 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/environment/sim/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "d08067733785f6e7607e8a8e7ef63cafbbe0b81d3232c20ceb5428e17cf0b2e8", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 1, + "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/instruction.md new file mode 100644 index 0000000..dd28c1c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Pong L1 + +You control both paddles. Player A is the left paddle and Player B is the right paddle. + +**Task.** Keep the ball in play and return it with either paddle as many times as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the ball gets past either paddle. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Each return registered by the game earns **1 point** for the paddle that hit the ball. Your score is the sum of both counters shown on-screen. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFTUP` and `LEFTDOWN` move the left paddle. `RIGHTUP` and `RIGHTDOWN` move the right paddle. `NONE` leaves both paddles stationary while the ball moves. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/actions.json new file mode 100644 index 0000000..0251507 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/actions.json @@ -0,0 +1,31 @@ +[ + "RIGHTUP", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/task.toml new file mode 100644 index 0000000..33ef528 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-pong-l01-i01-standard" +description = "V-MAGE Pong L1 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l01" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "Frozen actions verify a positive native score only; no full-score or optimal-policy claim." +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 = 1200.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/vmage/vmage-pong-l01-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..d116a40 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-pong-l01-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/instance.json new file mode 100644 index 0000000..d04d212 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "d08067733785f6e7607e8a8e7ef63cafbbe0b81d3232c20ceb5428e17cf0b2e8", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 1, + "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..09c9394 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-pong-l01-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l01-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/vmage/vmage-pong-l02-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/DIGEST new file mode 100644 index 0000000..959a0ec --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:602622dd4b67bad563d3da8c3919181bc4c24bcd56ec02a4a20723c286a77ab1 diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/README.md new file mode 100644 index 0000000..38e6aef --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-pong-l02-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l02` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Control both paddles and return the ball as many times as possible. Each successful paddle return gives that side 1 point. The final score is the sum of both sides. Missing either paddle ends the episode. There is no additional action cap; a missed return or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level2, seed0. No reset. Internal score group: vmage_pong. + +## Difficulty +Native code level 2; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-pong-l02-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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: 1024m # 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: 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/vmage/vmage-pong-l02-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..9dc4415 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..a1d087b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..3e44e06 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/environment/sim/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "6e0659d304ad390a724dda1f332e7d2bc2aeeeb44f362aad2870af1446d72a80", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 2, + "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/instruction.md new file mode 100644 index 0000000..ff2b321 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Pong L2 + +You control both paddles. Player A is the left paddle and Player B is the right paddle. + +**Task.** Keep the ball in play and return it with either paddle as many times as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the ball gets past either paddle. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Each return registered by the game earns **1 point** for the paddle that hit the ball. Your score is the sum of both counters shown on-screen. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFTUP` and `LEFTDOWN` move the left paddle. `RIGHTUP` and `RIGHTDOWN` move the right paddle. `NONE` leaves both paddles stationary while the ball moves. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/actions.json new file mode 100644 index 0000000..ffb6a7e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/actions.json @@ -0,0 +1,60 @@ +[ + "RIGHTUP", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "RIGHTUP", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/task.toml new file mode 100644 index 0000000..431ec93 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-pong-l02-i01-standard" +description = "V-MAGE Pong L2 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l02" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-pong-l02-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..d116a40 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-pong-l02-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/instance.json new file mode 100644 index 0000000..3e44e06 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "6e0659d304ad390a724dda1f332e7d2bc2aeeeb44f362aad2870af1446d72a80", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 2, + "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..9dc4415 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-pong-l02-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l02-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/vmage/vmage-pong-l03-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/DIGEST new file mode 100644 index 0000000..c948758 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:f7cf3b1567ee62d4fea430eb89c7774574f655b51a22371acc64f5143e2ad238 diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/README.md new file mode 100644 index 0000000..bd363d6 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-pong-l03-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l03` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Control both paddles and return the ball as many times as possible. Each successful paddle return gives that side 1 point. The final score is the sum of both sides. Missing either paddle ends the episode. There is no additional action cap; a missed return or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level3, seed0. No reset. Internal score group: vmage_pong. + +## Difficulty +Native code level 3; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-pong-l03-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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: 1024m # 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: 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/vmage/vmage-pong-l03-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..ebeb204 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..a1d087b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..0edd177 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/environment/sim/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "632dae3154b18817cb642811e4c1aceac1e817d31f66b683ec18918273c5a8d3", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 3, + "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/instruction.md new file mode 100644 index 0000000..c75a20b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Pong L3 + +You control both paddles. Player A is the left paddle and Player B is the right paddle. + +**Task.** Keep the ball in play and return it with either paddle as many times as you can. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the ball gets past either paddle. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Each return registered by the game earns **1 point** for the paddle that hit the ball. Your score is the sum of both counters shown on-screen. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFTUP` and `LEFTDOWN` move the left paddle. `RIGHTUP` and `RIGHTDOWN` move the right paddle. `NONE` leaves both paddles stationary while the ball moves. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/actions.json new file mode 100644 index 0000000..ffb6a7e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/actions.json @@ -0,0 +1,60 @@ +[ + "RIGHTUP", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "RIGHTUP", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN", + "NONE", + "NONE", + "RIGHTDOWN", + "NONE", + "RIGHTDOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/task.toml new file mode 100644 index 0000000..f74c4b0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-pong-l03-i01-standard" +description = "V-MAGE Pong L3 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l03" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-pong-l03-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..d116a40 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /pong/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-pong-l03-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/instance.json new file mode 100644 index 0000000..0edd177 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/instance.json @@ -0,0 +1,64 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_pong", + "env_id": "V-MAGE-Pong-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "632dae3154b18817cb642811e4c1aceac1e817d31f66b683ec18918273c5a8d3", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "pong", + "native_level": 3, + "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "native_settings_sha256": "3a132049606e1d5f4c03db318b7b94a28b3aaec2e12183c487971c806f1d2609", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 800, + 600 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFTUP", + "LEFTDOWN", + "RIGHTUP", + "RIGHTDOWN", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..ebeb204 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-pong-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-pong-l03-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-pong-l03-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/vmage/vmage-race-l01-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/DIGEST new file mode 100644 index 0000000..6331a5c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:d33e23cec8529d07be882cab1b1183be061f939a72200b311661fb3f3ae05b60 diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/README.md new file mode 100644 index 0000000..ae6fc53 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l01-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l01` / 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.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 100; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level1, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Initial native level; smoke integration only. + +## Reference solution +The frozen 4-decision reference verifies native target completion with the actual 3/5-frame action sampling. It is excluded from the model-facing image and is not a model score or optimality proof. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l01-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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: 1024m # 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: 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/vmage/vmage-race-l01-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..34dca04 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..c24232c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "74ad6c595fe2592654c761b879edd153080a9e74c2b327a4a528f1425042d0b0", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 1, + "native_level_sha256": "b921de201d2a84449b7cfea344ae355972e925d6cf4652e0949b6493ecdaeded", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/instruction.md new file mode 100644 index 0000000..e7927ad --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L1 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 100, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT`, `RIGHT`, `UP`, and `DOWN` move in screen directions. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/actions.json new file mode 100644 index 0000000..297b5c5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/actions.json @@ -0,0 +1,6 @@ +[ + "RIGHT", + "RIGHT", + "RIGHT", + "DOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/task.toml new file mode 100644 index 0000000..b14b944 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/task.toml @@ -0,0 +1,58 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l01-i01-standard" +description = "V-MAGE Race L1 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l01" +dynamics = "dynamic" +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 = 1200.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/vmage/vmage-race-l01-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l01-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/instance.json new file mode 100644 index 0000000..c24232c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "74ad6c595fe2592654c761b879edd153080a9e74c2b327a4a528f1425042d0b0", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 1, + "native_level_sha256": "b921de201d2a84449b7cfea344ae355972e925d6cf4652e0949b6493ecdaeded", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..34dca04 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l01-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l01-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/vmage/vmage-race-l02-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/DIGEST new file mode 100644 index 0000000..f8bad47 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:297fb53febe8cbd65b1a99cf5736b9e3b8fe64cb1cd72218a9a90edc5e5cd211 diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/README.md new file mode 100644 index 0000000..699fee5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l02-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l02` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 150; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level2, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 2; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l02-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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: 1024m # 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: 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/vmage/vmage-race-l02-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..c9200e2 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..4b08049 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4d96330dce7713e166bff889843a232a88b3a6b1807734fd82c25243c8749497", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 2, + "native_level_sha256": "0711e72387f300d4bd4b6a851e68e2fcaeb9f83c2fe1453f0df4ddb8e62d0699", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/instruction.md new file mode 100644 index 0000000..a4c9240 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L2 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 150, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT`, `RIGHT`, `UP`, and `DOWN` move in screen directions. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/actions.json new file mode 100644 index 0000000..2520b6f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/actions.json @@ -0,0 +1,15 @@ +[ + "RIGHT", + "RIGHT", + "RIGHT", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/task.toml new file mode 100644 index 0000000..1416d8d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l02-i01-standard" +description = "V-MAGE Race L2 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l02" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l02-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l02-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/instance.json new file mode 100644 index 0000000..4b08049 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4d96330dce7713e166bff889843a232a88b3a6b1807734fd82c25243c8749497", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 2, + "native_level_sha256": "0711e72387f300d4bd4b6a851e68e2fcaeb9f83c2fe1453f0df4ddb8e62d0699", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..c9200e2 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l02-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l02-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/vmage/vmage-race-l03-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/DIGEST new file mode 100644 index 0000000..beeb0c2 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:6af8f4d0cdb2f5b1645cf83d023f33cc08f8681a151d003e236f41c729a722ab diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/README.md new file mode 100644 index 0000000..86a930e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l03-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l03` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 150; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level3, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 3; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l03-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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: 1024m # 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: 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/vmage/vmage-race-l03-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..9e0c2c8 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..28ad207 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7eeafddad6fffd3c81eb2fe5fbc67fbf1fa6172ec5ab01af622bccd3ac0078f9", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 3, + "native_level_sha256": "355cc29339fe4d9eea47dc998f2c420a70fda2c19edc5f82b4bda1e3071b9e1b", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/instruction.md new file mode 100644 index 0000000..c31030c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L3 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 150, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT`, `RIGHT`, `UP`, and `DOWN` move in screen directions. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/actions.json new file mode 100644 index 0000000..2520b6f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/actions.json @@ -0,0 +1,15 @@ +[ + "RIGHT", + "RIGHT", + "RIGHT", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN", + "DOWN" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/task.toml new file mode 100644 index 0000000..0141f8f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l03-i01-standard" +description = "V-MAGE Race L3 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l03" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l03-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l03-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/instance.json new file mode 100644 index 0000000..28ad207 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7eeafddad6fffd3c81eb2fe5fbc67fbf1fa6172ec5ab01af622bccd3ac0078f9", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 3, + "native_level_sha256": "355cc29339fe4d9eea47dc998f2c420a70fda2c19edc5f82b4bda1e3071b9e1b", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "UP", + "DOWN" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..9e0c2c8 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l03-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l03-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/vmage/vmage-race-l04-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/DIGEST new file mode 100644 index 0000000..8468d13 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:9fbfafd29c8d9970415596d1913441d0e106e080a7ea23728a22f4a7f5ef90f2 diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/README.md new file mode 100644 index 0000000..2dd7106 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l04-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l04` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 150; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level4, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 4; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l04-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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: 1024m # 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: 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/vmage/vmage-race-l04-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..38b6efe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..cc69c60 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "223919b1922c8d98673a6090a52efd8541a0bbdd8ec77d615791861312949a44", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 4, + "native_level_sha256": "1981bb851013ec64f6ac19feda5afaa12d52e713907e11c48c71b7d8ae9ddd69", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "FORWARD", + "BACKWARD" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/instruction.md new file mode 100644 index 0000000..f82da6f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L4 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 150, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/task.toml new file mode 100644 index 0000000..1f5f0c3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l04-i01-standard" +description = "V-MAGE Race L4 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l04" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l04-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l04-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/instance.json new file mode 100644 index 0000000..cc69c60 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "223919b1922c8d98673a6090a52efd8541a0bbdd8ec77d615791861312949a44", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 4, + "native_level_sha256": "1981bb851013ec64f6ac19feda5afaa12d52e713907e11c48c71b7d8ae9ddd69", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "FORWARD", + "BACKWARD" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..38b6efe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l04-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l04-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/vmage/vmage-race-l05-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/DIGEST new file mode 100644 index 0000000..1f599e3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:9336c181893c5b0d6c344ec4eea7d43fb93cd3694cd06071176c9d9c477a8e11 diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/README.md new file mode 100644 index 0000000..6008266 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l05-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l05` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 150; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level5, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 5; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l05-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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: 1024m # 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: 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/vmage/vmage-race-l05-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..6d3ed77 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..8e117f6 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "0e0eac0b7768ee2178cf762511ef4ebf7a348c2007d881d598923880271b2c0f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 5, + "native_level_sha256": "875e730543be80e2c61977e7ce5fd876c21c5ea2d8467bfb3f5656259aae16b8", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "FORWARD", + "BACKWARD" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/instruction.md new file mode 100644 index 0000000..6e281e7 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L5 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 150, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/task.toml new file mode 100644 index 0000000..2a4d5a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l05-i01-standard" +description = "V-MAGE Race L5 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l05" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l05-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l05-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/instance.json new file mode 100644 index 0000000..8e117f6 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "0e0eac0b7768ee2178cf762511ef4ebf7a348c2007d881d598923880271b2c0f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 150, + "native_game": "race", + "native_level": 5, + "native_level_sha256": "875e730543be80e2c61977e7ce5fd876c21c5ea2d8467bfb3f5656259aae16b8", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "LEFT", + "RIGHT", + "FORWARD", + "BACKWARD" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..6d3ed77 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l05-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l05-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/vmage/vmage-race-l06-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/DIGEST new file mode 100644 index 0000000..125721e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:351d03a197d9e3a26999b00c44f8ebd5c36ac32cdf88a6eec1b45039f04898ae diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/README.md new file mode 100644 index 0000000..ed9f39f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l06-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l06` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 100; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level6, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 6; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l06-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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: 1024m # 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: 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/vmage/vmage-race-l06-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..7b0f0fc --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..c0d3bb1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "2370b3b13d7195bf54e86c23266486e76804c3366f6ff72b0610db0bc0807bff", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 6, + "native_level_sha256": "373fdc87aee0bd253bd8b4e3162902f3e2582170856f42d08bc1d3bdc4d4f0bb", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/instruction.md new file mode 100644 index 0000000..b352ef4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L6 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 100, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/task.toml new file mode 100644 index 0000000..fb7efa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l06-i01-standard" +description = "V-MAGE Race L6 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l06" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l06-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l06-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/instance.json new file mode 100644 index 0000000..c0d3bb1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "2370b3b13d7195bf54e86c23266486e76804c3366f6ff72b0610db0bc0807bff", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 6, + "native_level_sha256": "373fdc87aee0bd253bd8b4e3162902f3e2582170856f42d08bc1d3bdc4d4f0bb", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..7b0f0fc --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l06-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l06-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/vmage/vmage-race-l07-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/DIGEST new file mode 100644 index 0000000..2d57586 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:a04260e428aa90f0ef30398eb4eea648c19b0308ca79ae90b0df885e70bb2a21 diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/README.md new file mode 100644 index 0000000..0cd109f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l07-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l07` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 100; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level7, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 7; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l07-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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: 1024m # 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: 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/vmage/vmage-race-l07-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..6f7a47b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..1faff2f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "2ee73206de92395c2d38b69e9f0369370e7794ba20f4a2ba2b64d031f66467d2", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 7, + "native_level_sha256": "36675492156bd1003c91f08a80bb179c70a17b0f8c60e80ff3bf9d5341c41b5e", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/instruction.md new file mode 100644 index 0000000..143a651 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L7 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 100, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/task.toml new file mode 100644 index 0000000..54b77a9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l07-i01-standard" +description = "V-MAGE Race L7 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l07" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l07-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l07-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/instance.json new file mode 100644 index 0000000..1faff2f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "2ee73206de92395c2d38b69e9f0369370e7794ba20f4a2ba2b64d031f66467d2", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 100, + "native_game": "race", + "native_level": 7, + "native_level_sha256": "36675492156bd1003c91f08a80bb179c70a17b0f8c60e80ff3bf9d5341c41b5e", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..6f7a47b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l07-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l07-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/vmage/vmage-race-l08-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/DIGEST new file mode 100644 index 0000000..b130278 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:9274e218968cc3d30c38b7085393420dc49bca0e61d4116b3f592cb2d9a531d2 diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/README.md new file mode 100644 index 0000000..7dcd385 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l08-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l08` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 300; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level8, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 8; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l08-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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: 1024m # 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: 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/vmage/vmage-race-l08-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..d11e641 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l08-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..6a2ed4b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L8-v2", + "family": "l08", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "cb2313dd210a9ee18c8094eedf1b6fa3e9497a65d3e7e25a166c9203dd276804", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "race", + "native_level": 8, + "native_level_sha256": "fd90f6f1ac8a443645487a398fc371f5539cb26974946e7433b8016758e80f75", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/instruction.md new file mode 100644 index 0000000..ad69ada --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L8 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 300, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/task.toml new file mode 100644 index 0000000..64e42cc --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l08-i01-standard" +description = "V-MAGE Race L8 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l08" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l08-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l08-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/instance.json new file mode 100644 index 0000000..6a2ed4b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L8-v2", + "family": "l08", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "cb2313dd210a9ee18c8094eedf1b6fa3e9497a65d3e7e25a166c9203dd276804", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "race", + "native_level": 8, + "native_level_sha256": "fd90f6f1ac8a443645487a398fc371f5539cb26974946e7433b8016758e80f75", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..d11e641 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l08-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l08-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l08-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/vmage/vmage-race-l09-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/DIGEST new file mode 100644 index 0000000..c3b731f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:941f18b5a7d31399fe14ca72a2a9ae65aa4e8e97b0f085bba022ce26f9a15f9d diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/README.md new file mode 100644 index 0000000..3445aa0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-race-l09-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l09` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Drive the car to the trophy without crashing. Score is 100 for reaching the trophy and 0 otherwise. Collision or the native frame limit ends the episode. The native screenshot counter limit is 500; it includes initialization and is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level9, seed0. No reset. Internal score group: vmage_race. + +## Difficulty +Native code level 9; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-race-l09-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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: 1024m # 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: 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/vmage/vmage-race-l09-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..e36814f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l09-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..29472ba --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..da5667c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/environment/sim/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L9-v2", + "family": "l09", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "681cd488e4b89d4fb37829781c12fb4ad5000dfc34699a9870568db86eaed168", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 500, + "native_game": "race", + "native_level": 9, + "native_level_sha256": "89373304d6b97c75396515eec9fd5271b021ed9c0cbc0a9764ce9dcdf23c8abc", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/instruction.md new file mode 100644 index 0000000..a585ea5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Race L9 + +You control a car in a top-down view. The trophy is your goal. Barriers are obstacles. + +**Task.** Drive to the trophy without crashing. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends when the game registers a trophy win, a crash, or the frame limit. Ignore any on-screen retry prompt. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 500, including the initial frame. Once the counter reaches the limit, the next native frame is blocked before movement. + +## Scoring + +You earn **100 points** when the game registers contact with the trophy. An episode without a trophy win earns **0 points**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` steer the car. `FORWARD` and `BACKWARD` change its speed relative to its heading. Each accepted action repeats for up to 3 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/actions.json new file mode 100644 index 0000000..5977aa1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "FORWARD", + "FORWARD", + "FORWARD", + "RIGHT", + "RIGHT", + "RIGHT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "LEFT", + "LEFT", + "LEFT", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD", + "FORWARD" +] diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/task.toml new file mode 100644 index 0000000..15db36d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-race-l09-i01-standard" +description = "V-MAGE Race L9 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l09" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-race-l09-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..5647871 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /race/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-race-l09-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/instance.json new file mode 100644 index 0000000..da5667c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/instance.json @@ -0,0 +1,63 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_race", + "env_id": "V-MAGE-Race-L9-v2", + "family": "l09", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "681cd488e4b89d4fb37829781c12fb4ad5000dfc34699a9870568db86eaed168", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "native_goal_reached" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 500, + "native_game": "race", + "native_level": 9, + "native_level_sha256": "89373304d6b97c75396515eec9fd5271b021ed9c0cbc0a9764ce9dcdf23c8abc", + "native_settings_sha256": "49793fdafb10c9661dfa8c9b8219a0a84e17d2c4b922d29ed8c96e2d54328aed", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "FORWARD", + "BACKWARD", + "LEFT", + "RIGHT" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..e36814f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-race-l09-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-race-l09-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-race-l09-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/vmage/vmage-supermario-l00-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/DIGEST new file mode 100644 index 0000000..13e9f8d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:5cea2ab1480e710fe0893e07310ec4d8e0db1bdd877acfb9267028219f148ee3 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/README.md new file mode 100644 index 0000000..4ed9cbe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l00-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l00` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 5000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level0, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 0; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l00-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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: 1024m # 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: 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/vmage/vmage-supermario-l00-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..c2cff23 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l00-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..0902ff1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L0-v2", + "family": "l00", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "063dd2045227ccfecbd5e4e9121f171082ca31add2241261079a54ff268b74a6", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 5000, + "native_game": "supermario", + "native_level": 0, + "native_level_sha256": "58852fd202ad042f99fd73d31c4f1d28e386abfc2f03b45d8cc13812aa751814", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/instruction.md new file mode 100644 index 0000000..4ed5182 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L0 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 5000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/task.toml new file mode 100644 index 0000000..0397b9b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l00-i01-standard" +description = "V-MAGE SuperMario L0 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l00" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l00-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l00-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/instance.json new file mode 100644 index 0000000..0902ff1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L0-v2", + "family": "l00", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "063dd2045227ccfecbd5e4e9121f171082ca31add2241261079a54ff268b74a6", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 5000, + "native_game": "supermario", + "native_level": 0, + "native_level_sha256": "58852fd202ad042f99fd73d31c4f1d28e386abfc2f03b45d8cc13812aa751814", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..c2cff23 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l00-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l00-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l00-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/vmage/vmage-supermario-l01-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/DIGEST new file mode 100644 index 0000000..e6b4c50 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:102bd7efb772ce0376743efea9fb069fa2e014a90728c35496b7e0e6340873c7 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/README.md new file mode 100644 index 0000000..07cb968 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l01-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l01` / seed 0 | +| Oracle | `partial` — Frozen actions verify a positive native score only; no full-score or optimal-policy claim. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 400, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level1, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Initial native level; smoke integration only. + +## Reference solution +The frozen 11-decision reference verifies a positive native score only; it is a partial reference with the actual 3/5-frame action sampling. It is excluded from the model-facing image and is not a model score or optimality proof. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l01-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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: 1024m # 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: 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/vmage/vmage-supermario-l01-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..3a1664a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..5db8da0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "93d4515efcf124835a76f223194d420915b8fb354134ca67f8bc8e83d7787b3f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 400, + "native_game": "supermario", + "native_level": 1, + "native_level_sha256": "3e6c984b50cc0f0115dd1e75fe692da15bb7d55acd43562d103e06170e478433", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/instruction.md new file mode 100644 index 0000000..616fc91 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L1 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 400, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/actions.json new file mode 100644 index 0000000..8187c4b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/actions.json @@ -0,0 +1,13 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/task.toml new file mode 100644 index 0000000..40ddb9d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l01-i01-standard" +description = "V-MAGE SuperMario L1 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l01" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "Frozen actions verify a positive native score only; no full-score or optimal-policy claim." +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 = 1200.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/vmage/vmage-supermario-l01-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l01-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/instance.json new file mode 100644 index 0000000..5db8da0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "93d4515efcf124835a76f223194d420915b8fb354134ca67f8bc8e83d7787b3f", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 400, + "native_game": "supermario", + "native_level": 1, + "native_level_sha256": "3e6c984b50cc0f0115dd1e75fe692da15bb7d55acd43562d103e06170e478433", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..3a1664a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l01-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l01-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/vmage/vmage-supermario-l02-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/DIGEST new file mode 100644 index 0000000..ffee003 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:a2d515a8fa6934908e6f0582919f8772e475221ec3b7ae02f70dc471acfd9ce6 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/README.md new file mode 100644 index 0000000..72a67cd --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l02-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l02` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 1000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level2, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 2; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l02-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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: 1024m # 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: 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/vmage/vmage-supermario-l02-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..cad68f4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..58745a0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3d5e06d3d1367e728e2a1a5b1f485078438a7ca0ffc707e6b636e0b09bc9e4ac", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 2, + "native_level_sha256": "9b8cf1291572591e67f49b3020cb036321e9f24ffedbdcd6484cd084506f0468", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/instruction.md new file mode 100644 index 0000000..3587b87 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L2 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 1000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/task.toml new file mode 100644 index 0000000..980a5a8 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l02-i01-standard" +description = "V-MAGE SuperMario L2 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l02" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l02-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l02-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/instance.json new file mode 100644 index 0000000..58745a0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3d5e06d3d1367e728e2a1a5b1f485078438a7ca0ffc707e6b636e0b09bc9e4ac", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 2, + "native_level_sha256": "9b8cf1291572591e67f49b3020cb036321e9f24ffedbdcd6484cd084506f0468", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..cad68f4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l02-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l02-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/vmage/vmage-supermario-l03-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/DIGEST new file mode 100644 index 0000000..1e16668 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:f5e213e39c61bb8157f02c0a6d1818ceff22ef0a0eaa2aeb7373d674f927e17b diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/README.md new file mode 100644 index 0000000..a1914e1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l03-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l03` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 1000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level3, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 3; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l03-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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: 1024m # 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: 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/vmage/vmage-supermario-l03-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..ed579cf --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..c4e0591 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3000c71b12e883fd0b64d833f84380ffaab33c4d8d8a08582e8e94c0e57e8b0c", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 3, + "native_level_sha256": "8b462e92bf600b0dc24e7489155852b8e4caa30ba29ef63f0ff955f8f8e79bd4", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/instruction.md new file mode 100644 index 0000000..18d7c53 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L3 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 1000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/task.toml new file mode 100644 index 0000000..0369009 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l03-i01-standard" +description = "V-MAGE SuperMario L3 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l03" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l03-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l03-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/instance.json new file mode 100644 index 0000000..c4e0591 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3000c71b12e883fd0b64d833f84380ffaab33c4d8d8a08582e8e94c0e57e8b0c", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 3, + "native_level_sha256": "8b462e92bf600b0dc24e7489155852b8e4caa30ba29ef63f0ff955f8f8e79bd4", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..ed579cf --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l03-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l03-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/vmage/vmage-supermario-l04-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/DIGEST new file mode 100644 index 0000000..6e2f934 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:d39dadef19637d1651bb42acde807aece6ea88be27653bde48e223c59d0728ad diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/README.md new file mode 100644 index 0000000..07b20d1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l04-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l04` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 1000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level4, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 4; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l04-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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: 1024m # 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: 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/vmage/vmage-supermario-l04-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..475424b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..02b5bc3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "72358f75b068d146f734df030796a21b639c0a15e8b229c53ca315d2264251b1", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 4, + "native_level_sha256": "a98f5ce1601c4fa48ecbf2c2088bea837facf5d85316ad00e5307a8b0498d9c9", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/instruction.md new file mode 100644 index 0000000..8886319 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L4 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 1000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/task.toml new file mode 100644 index 0000000..0e4103b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l04-i01-standard" +description = "V-MAGE SuperMario L4 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l04" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l04-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l04-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/instance.json new file mode 100644 index 0000000..02b5bc3 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "72358f75b068d146f734df030796a21b639c0a15e8b229c53ca315d2264251b1", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 4, + "native_level_sha256": "a98f5ce1601c4fa48ecbf2c2088bea837facf5d85316ad00e5307a8b0498d9c9", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..475424b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l04-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l04-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/vmage/vmage-supermario-l05-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/DIGEST new file mode 100644 index 0000000..94dd938 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:44c9c40df57c148b9230f27a02b5cb8f86a2ff6dba606e898e6ec7290626f226 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/README.md new file mode 100644 index 0000000..516a1a7 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l05-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l05` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 300, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level5, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 5; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l05-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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: 1024m # 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: 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/vmage/vmage-supermario-l05-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..62335ec --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..5ac910d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "a536eb7db1ded722f7dcddd40f625f2c99524898debebe21902b75d4ffb875e3", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 5, + "native_level_sha256": "7ae2ef5c7b2ecc7485f524ac24cba739212abdac88c14218a1c071d36abeb6e6", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/instruction.md new file mode 100644 index 0000000..f614167 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L5 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 300, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/task.toml new file mode 100644 index 0000000..17881b9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l05-i01-standard" +description = "V-MAGE SuperMario L5 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l05" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l05-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l05-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/instance.json new file mode 100644 index 0000000..5ac910d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "a536eb7db1ded722f7dcddd40f625f2c99524898debebe21902b75d4ffb875e3", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 5, + "native_level_sha256": "7ae2ef5c7b2ecc7485f524ac24cba739212abdac88c14218a1c071d36abeb6e6", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..62335ec --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l05-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l05-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/vmage/vmage-supermario-l06-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/DIGEST new file mode 100644 index 0000000..571384e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:843431168e8bcc76e7a026e1a50abe4a01ca324a7c60f167846c4bdd20b13b28 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/README.md new file mode 100644 index 0000000..9e034ad --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l06-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l06` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 300, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level6, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 6; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l06-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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: 1024m # 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: 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/vmage/vmage-supermario-l06-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..89b75a8 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..f899fed --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7f00edf925e7042733b26540281c4de47369fe0b865303c0073190075db10af4", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 6, + "native_level_sha256": "ede21fc4c70bfff98980b5661f4e445b0bed30b3909a2a126ed6de47227b2f02", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/instruction.md new file mode 100644 index 0000000..7e3d206 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L6 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 300, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/task.toml new file mode 100644 index 0000000..d0beea6 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l06-i01-standard" +description = "V-MAGE SuperMario L6 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l06" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l06-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l06-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/instance.json new file mode 100644 index 0000000..f899fed --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L6-v2", + "family": "l06", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7f00edf925e7042733b26540281c4de47369fe0b865303c0073190075db10af4", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 6, + "native_level_sha256": "ede21fc4c70bfff98980b5661f4e445b0bed30b3909a2a126ed6de47227b2f02", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..89b75a8 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l06-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l06-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l06-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/vmage/vmage-supermario-l07-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/DIGEST new file mode 100644 index 0000000..e9bc362 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:0574ff7800652155f115f74798fc45b62a69db18ea32a9af3ac335fbf9871c96 diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/README.md new file mode 100644 index 0000000..7659066 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l07-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l07` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 300, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level7, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 7; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l07-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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: 1024m # 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: 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/vmage/vmage-supermario-l07-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..fc0cbdb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..0e8bbbe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "fa4059a04d8323c0324b00ee46ee0116d0110f6bfb71f5cdb4ff5524a244b147", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 7, + "native_level_sha256": "7159d04f47a22b4e747940ee4bfffa1406260bc74784bbe62775b36c3dc1b466", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/instruction.md new file mode 100644 index 0000000..f44dbeb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L7 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 300, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/task.toml new file mode 100644 index 0000000..ebbce58 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l07-i01-standard" +description = "V-MAGE SuperMario L7 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l07" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l07-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l07-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/instance.json new file mode 100644 index 0000000..0e8bbbe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L7-v2", + "family": "l07", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "fa4059a04d8323c0324b00ee46ee0116d0110f6bfb71f5cdb4ff5524a244b147", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 300, + "native_game": "supermario", + "native_level": 7, + "native_level_sha256": "7159d04f47a22b4e747940ee4bfffa1406260bc74784bbe62775b36c3dc1b466", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..fc0cbdb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l07-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l07-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l07-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/vmage/vmage-supermario-l08-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/DIGEST new file mode 100644 index 0000000..d5339b5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:9ea60f8e739f3bf7d5325526926bdffd08305fe029a058c44b00739580d5b59d diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/README.md new file mode 100644 index 0000000..21475d6 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l08-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l08` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 1000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level8, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 8; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l08-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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: 1024m # 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: 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/vmage/vmage-supermario-l08-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..814512b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l08-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..df6f668 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L8-v2", + "family": "l08", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "1253552169f70b0646ae53be81ddc5079c249122050b9b1c02f4f4d9a9cec47d", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 8, + "native_level_sha256": "03160e5334e0efc194f625d9d813f83e56d15b731094e27996da78c2c56a603e", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/instruction.md new file mode 100644 index 0000000..ba50364 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L8 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 1000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/task.toml new file mode 100644 index 0000000..6a4861a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l08-i01-standard" +description = "V-MAGE SuperMario L8 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l08" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l08-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l08-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/instance.json new file mode 100644 index 0000000..df6f668 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L8-v2", + "family": "l08", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "1253552169f70b0646ae53be81ddc5079c249122050b9b1c02f4f4d9a9cec47d", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 8, + "native_level_sha256": "03160e5334e0efc194f625d9d813f83e56d15b731094e27996da78c2c56a603e", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..814512b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l08-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l08-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l08-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/vmage/vmage-supermario-l09-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/DIGEST new file mode 100644 index 0000000..9d41487 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:9276c39db31dc5b05b63132afb582e0257196c71dd0f89f4f039b9e1ba8abcee diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/README.md new file mode 100644 index 0000000..50d8251 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-supermario-l09-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l09` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Move and jump to collect coins and defeat enemies while avoiding death. Your score is the native on-screen point counter, including native item and enemy rewards. Death or the native frame limit ends the episode; accumulated points are retained. The native screenshot counter limit is 1000, including initialization. It is not a count of client requests. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level9, seed0. No reset. Internal score group: vmage_supermario. + +## Difficulty +Native code level 9; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 | 1 GiB | 128 | no GPU | — | +| verifier (as `main`) | 1 | 1 GiB | no cap | no GPU | 2 GiB | + +- GPU: not needed. + +## Details + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-supermario-l09-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..7fa17b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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: 1024m # 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: 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/vmage/vmage-supermario-l09-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..f6ec09b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l09-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..8c818cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..ebc19e5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L9-v2", + "family": "l09", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "060f07c49c97eff98ff54ffc5cdd1ac1eae1dcafba9bcdf70f5bbefaf2874a47", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 9, + "native_level_sha256": "51160e3afff1090d8ea148ee40cc4a15ffbc3214a23b6b009367de711a09bf51", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/instruction.md new file mode 100644 index 0000000..a690ceb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · SuperMario L9 + +You control Mario in a side-scrolling view. The scene can contain platforms, coins, and enemies. + +**Task.** Move and jump to earn as many points as you can before the episode ends. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on death, such as a fall or a fatal enemy collision, or when the game applies the frame limit. The episode is also closed at the session time limit. +- **Action limit.** The native frame counter has a limit of 1000, including the initial frame. The game checks the counter after updating Mario, so the last update can still earn points. + +## Scoring + +Each coin collected, coin awarded by a coin box, or enemy defeated earns **100 points**. The grade uses the accumulated game points, including points earned on the final update. The on-screen `TIME` counter follows game updates. Use the separate wall-clock budget in **Time limit**. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` move Mario. `UP` requests a jump. `UP+LEFT` and `UP+RIGHT` jump with direction. `NONE` releases movement and jump input. Mario can still coast or fall. Each accepted action repeats for up to 5 native frames and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/actions.json new file mode 100644 index 0000000..9e21286 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/actions.json @@ -0,0 +1,42 @@ +[ + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT", + "UP+RIGHT" +] diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/task.toml new file mode 100644 index 0000000..7233104 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-supermario-l09-i01-standard" +description = "V-MAGE SuperMario L9 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l09" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-supermario-l09-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..0c11a85 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /supermario/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-supermario-l09-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/instance.json new file mode 100644 index 0000000..ebc19e5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_supermario", + "env_id": "V-MAGE-SuperMario-L9-v2", + "family": "l09", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "060f07c49c97eff98ff54ffc5cdd1ac1eae1dcafba9bcdf70f5bbefaf2874a47", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": true + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 5, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": 1000, + "native_game": "supermario", + "native_level": 9, + "native_level_sha256": "51160e3afff1090d8ea148ee40cc4a15ffbc3214a23b6b009367de711a09bf51", + "native_settings_sha256": "738d0d85b36ee6e8a9ab3d6ad4cbb0396536ec1223e51129ba2ba4d4fbbbde97", + "observation_size": [ + 480, + 360 + ], + "passive_action": null, + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 640, + 480 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "UP", + "LEFT", + "RIGHT", + "UP+LEFT", + "UP+RIGHT", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..f6ec09b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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": 1.0, + "pids": 128 + } + }, + "disk_gb": 2.0, + "disk_tick_sec": 60, + "format": "rcb-limits/2", + "gpu": false, + "mode": "standard", + "scope_services": [ + "main" + ], + "task": "vmage-supermario-l09-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-supermario-l09-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-supermario-l09-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/vmage/vmage-tempestrun-l01-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/DIGEST new file mode 100644 index 0000000..0447d5f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:dc11f0a5c7bc29acfbd3a567d009cd00cee7a3d27919e7ab5c82a01098b0eb8b diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/README.md new file mode 100644 index 0000000..93d220d --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-tempestrun-l01-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l01` / seed 0 | +| Oracle | `partial` — Frozen actions verify a positive native score only; no full-score or optimal-policy claim. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Run as far as possible in the tunnel, avoiding obstacles and handling enemies. The native distance score is int(distance / 10) * 10. Death ends the episode; accumulated points are retained. There is no additional action cap; native death or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level1, seed0. No reset. Internal score group: vmage_tempestrun. + +## Difficulty +Initial native level; smoke integration only. + +## Reference solution +The frozen 2-decision reference verifies a positive native score only; it is a partial reference with the actual 3/5-frame action sampling. It is excluded from the model-facing image and is not a model score or optimality proof. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-tempestrun-l01-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..0fdaaa4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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: 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/vmage/vmage-tempestrun-l01-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..cc6f1b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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": "vmage-tempestrun-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..ce56a42 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..a3a8884 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "b113fa2393bdce437b860d0e89c95e2a035b90f3836ed4081b3a5ea2ac640ae1", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 1, + "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/instruction.md new file mode 100644 index 0000000..53940b9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Tempest Run L1 + +You control a runner who moves forward through a tunnel divided into lanes. + +**Task.** Travel as far as you can by changing lanes and using the appropriate action for obstacles. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a fatal obstacle collision. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Your score is the distance traveled rounded down to a multiple of 10. The distance reached before the episode ends determines the score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` shift one lane. `JUMP` can clear spikes. `SLIDE` can clear green enemies, and `RISE` ends a slide. `NONE` sends no new input, so the runner can still move forward or land. Each accepted action applies your input for one native frame, then up to 2 `NONE` frames, and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/actions.json new file mode 100644 index 0000000..a201fcc --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/actions.json @@ -0,0 +1,4 @@ +[ + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/task.toml new file mode 100644 index 0000000..dd63ea1 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-tempestrun-l01-i01-standard" +description = "V-MAGE TempestRun L1 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l01" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "Frozen actions verify a positive native score only; no full-score or optimal-policy claim." +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 = 1200.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/vmage/vmage-tempestrun-l01-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..12c8331 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-tempestrun-l01-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/instance.json new file mode 100644 index 0000000..a3a8884 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L1-v2", + "family": "l01", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "b113fa2393bdce437b860d0e89c95e2a035b90f3836ed4081b3a5ea2ac640ae1", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 1, + "native_level_sha256": "92198287e5fbfd1b89e9cd0cba5aae9a760974df3d638a3f92ac281ee5cf588e", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..cc6f1b4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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": "vmage-tempestrun-l01-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l01-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/vmage/vmage-tempestrun-l02-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/DIGEST new file mode 100644 index 0000000..e6748aa --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:b00cfcd8d69848e23a0f5fee06e45c46ce405cf0d6af47e6b65028a82a67482b diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/README.md new file mode 100644 index 0000000..afde5d0 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-tempestrun-l02-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l02` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Run as far as possible in the tunnel, avoiding obstacles and handling enemies. The native distance score is int(distance / 10) * 10. Death ends the episode; accumulated points are retained. There is no additional action cap; native death or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level2, seed0. No reset. Internal score group: vmage_tempestrun. + +## Difficulty +Native code level 2; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-tempestrun-l02-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..0fdaaa4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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: 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/vmage/vmage-tempestrun-l02-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..a3191ef --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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": "vmage-tempestrun-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..ce56a42 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..edd2dec --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4de9656e6ae2565a28ed617ab60d40f83cc249beadebec981707b742e809d5f9", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 2, + "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/instruction.md new file mode 100644 index 0000000..a760665 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Tempest Run L2 + +You control a runner who moves forward through a tunnel divided into lanes. + +**Task.** Travel as far as you can by changing lanes and using the appropriate action for obstacles. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a fatal obstacle collision. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Your score is the distance traveled rounded down to a multiple of 10. The distance reached before the episode ends determines the score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` shift one lane. `JUMP` can clear spikes. `SLIDE` can clear green enemies, and `RISE` ends a slide. `NONE` sends no new input, so the runner can still move forward or land. Each accepted action applies your input for one native frame, then up to 2 `NONE` frames, and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/actions.json new file mode 100644 index 0000000..985c966 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/actions.json @@ -0,0 +1,10 @@ +[ + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/task.toml new file mode 100644 index 0000000..4bcd7de --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-tempestrun-l02-i01-standard" +description = "V-MAGE TempestRun L2 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l02" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-tempestrun-l02-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..12c8331 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-tempestrun-l02-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/instance.json new file mode 100644 index 0000000..edd2dec --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L2-v2", + "family": "l02", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "4de9656e6ae2565a28ed617ab60d40f83cc249beadebec981707b742e809d5f9", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 2, + "native_level_sha256": "5c89c899526d1baac1d55c0be14a338666abbf877ce9b78cf4dc162a55a68a95", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..a3191ef --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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": "vmage-tempestrun-l02-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l02-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/vmage/vmage-tempestrun-l03-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/DIGEST new file mode 100644 index 0000000..c307e54 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:2dffc0d848fbbaddf971e713c42ec455c5360241e6d261bab8cb8ede32cde5d0 diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/README.md new file mode 100644 index 0000000..858080f --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-tempestrun-l03-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l03` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Run as far as possible in the tunnel, avoiding obstacles and handling enemies. The native distance score is int(distance / 10) * 10. Death ends the episode; accumulated points are retained. There is no additional action cap; native death or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level3, seed0. No reset. Internal score group: vmage_tempestrun. + +## Difficulty +Native code level 3; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-tempestrun-l03-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..0fdaaa4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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: 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/vmage/vmage-tempestrun-l03-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..c4eb73a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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": "vmage-tempestrun-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..ce56a42 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..d252c2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7c10fcc62cb3c2b806ecfe846d5562da3ffcd98a96068df50e6c3a22c432c706", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 3, + "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/instruction.md new file mode 100644 index 0000000..b809cbe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Tempest Run L3 + +You control a runner who moves forward through a tunnel divided into lanes. + +**Task.** Travel as far as you can by changing lanes and using the appropriate action for obstacles. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a fatal obstacle collision. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Your score is the distance traveled rounded down to a multiple of 10. The distance reached before the episode ends determines the score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` shift one lane. `JUMP` can clear spikes. `SLIDE` can clear green enemies, and `RISE` ends a slide. `NONE` sends no new input, so the runner can still move forward or land. Each accepted action applies your input for one native frame, then up to 2 `NONE` frames, and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/actions.json new file mode 100644 index 0000000..985c966 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/actions.json @@ -0,0 +1,10 @@ +[ + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/task.toml new file mode 100644 index 0000000..6feb653 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-tempestrun-l03-i01-standard" +description = "V-MAGE TempestRun L3 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l03" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-tempestrun-l03-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..12c8331 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-tempestrun-l03-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/instance.json new file mode 100644 index 0000000..d252c2b --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L3-v2", + "family": "l03", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "7c10fcc62cb3c2b806ecfe846d5562da3ffcd98a96068df50e6c3a22c432c706", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 3, + "native_level_sha256": "e5184af55b1af04c56124d5f7da6535c36aa3383f1a561d1edd4f656ea56fc45", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..c4eb73a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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": "vmage-tempestrun-l03-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l03-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/vmage/vmage-tempestrun-l04-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/DIGEST new file mode 100644 index 0000000..28a8f47 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:b0dcf9aeabff04c4abf3ab0ce7058c33c9bd1df8ae7790d8bbea934a45a9cb52 diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/README.md new file mode 100644 index 0000000..50cc7a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-tempestrun-l04-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l04` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Run as far as possible in the tunnel, avoiding obstacles and handling enemies. The native distance score is int(distance / 10) * 10. Death ends the episode; accumulated points are retained. There is no additional action cap; native death or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level4, seed0. No reset. Internal score group: vmage_tempestrun. + +## Difficulty +Native code level 4; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-tempestrun-l04-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..0fdaaa4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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: 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/vmage/vmage-tempestrun-l04-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..394ba4e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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": "vmage-tempestrun-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..ce56a42 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..3f99cfe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "926dcf4d11ce59d5109576bec005c8625802d3f7b5a3c86340291fa86b1434c5", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 4, + "native_level_sha256": "aa0266ca102f7ca43e963e1942b2ce67fd62af021cd5844ddf755b710b0af4b0", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/instruction.md new file mode 100644 index 0000000..43d4196 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Tempest Run L4 + +You control a runner who moves forward through a tunnel divided into lanes. + +**Task.** Travel as far as you can by changing lanes and using the appropriate action for obstacles. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a fatal obstacle collision. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Your score is the distance traveled rounded down to a multiple of 10. The distance reached before the episode ends determines the score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` shift one lane. `JUMP` can clear spikes. `SLIDE` can clear green enemies, and `RISE` ends a slide. `NONE` sends no new input, so the runner can still move forward or land. Each accepted action applies your input for one native frame, then up to 2 `NONE` frames, and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/actions.json new file mode 100644 index 0000000..985c966 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/actions.json @@ -0,0 +1,10 @@ +[ + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/task.toml new file mode 100644 index 0000000..14c6d14 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-tempestrun-l04-i01-standard" +description = "V-MAGE TempestRun L4 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l04" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-tempestrun-l04-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..12c8331 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-tempestrun-l04-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/instance.json new file mode 100644 index 0000000..3f99cfe --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L4-v2", + "family": "l04", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "926dcf4d11ce59d5109576bec005c8625802d3f7b5a3c86340291fa86b1434c5", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 4, + "native_level_sha256": "aa0266ca102f7ca43e963e1942b2ce67fd62af021cd5844ddf755b710b0af4b0", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..394ba4e --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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": "vmage-tempestrun-l04-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l04-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/vmage/vmage-tempestrun-l05-i01-standard/DIGEST b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/DIGEST new file mode 100644 index 0000000..90c6586 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/DIGEST @@ -0,0 +1 @@ +sha256:1eca2aa412e784eb442f494d40dc7035edfdba4bdf4fac6b4f02e7710fdbe4d8 diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/README.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/README.md new file mode 100644 index 0000000..ceff3cb --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/README.md @@ -0,0 +1,40 @@ +# vmage-tempestrun-l05-i01-standard + +| | | +|---|---| +| Benchmark | V-MAGE | +| Mode | standard (`game-standard/2.2`) | +| Twin | — (none: this V-MAGE task exposes only the isolated standard client) | +| Simulator / robot | `vmage` / `game-agent` | +| Family / instance | `l05` / seed 0 | +| Oracle | `partial` — A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. | +| Agent time budget | 600 s; tokens: protocol default (docs/protocol/running.md "Official runs") | +| Base image | `docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2` | + +## Task +Run as far as possible in the tunnel, avoiding obstacles and handling enemies. The native distance score is int(distance / 10) * 10. Death ends the episode; accumulated points are retained. There is no additional action cap; native death or the session time limit ends the episode. Frozen V-MAGE commit 95d5d4a445bb0b75cce765c93107d87f84613e4d, code level5, seed0. No reset. Internal score group: vmage_tempestrun. + +## Difficulty +Native code level 5; frozen integration configuration. + +## Reference solution +A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee. + +## Verification +An isolated verifier validates the trusted live final, instance binding, native score decomposition, counter/terminal consistency, and score differences. It does not replay the native game. Non-Race success is only a positive-score compatibility flag. Audit video samples decision frames and is not a complete native 30 FPS replay. + +## 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 + +### Notes +See [V-MAGE notes](../README.md) for source provenance, native loop/observation adaptations and reproduction boundaries. Original native code and assets are fetched from the hash-pinned archive into the simulator; they are not copied into the agent or stored as vendored sources in this repository. Distribution permission remains unconfirmed; internal research only. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/Dockerfile new file mode 100644 index 0000000..565f2a5 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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 +RUN pip install --no-cache-dir Pillow==10.4.0 numpy==1.26.4 +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/vmage/vmage-tempestrun-l05-i01-standard/environment/docker-compose.yaml b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/docker-compose.yaml new file mode 100644 index 0000000..0fdaaa4 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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: 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/vmage/vmage-tempestrun-l05-i01-standard/environment/rcb_monitor/limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/rcb_monitor/limits.json new file mode 100644 index 0000000..f82776c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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": "vmage-tempestrun-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/Dockerfile new file mode 100644 index 0000000..ce56a42 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/Dockerfile @@ -0,0 +1,22 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/requirements.txt /srv/requirements.txt +RUN pip install --no-cache-dir --no-deps -r /srv/requirements.txt && pip check +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/source_loader.py /srv/source_loader.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/SOURCE.json /srv/SOURCE.json +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/vmage_bridge.py /srv/vmage_bridge.py +RUN python3 /srv/source_loader.py --destination /opt/vmage +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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/adapter.py /srv/adapter.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /srv/instance_schema.py +COPY instance.json /srv/instance.json +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /srv +CMD ["python3", "/srv/server.py"] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/instance.json new file mode 100644 index 0000000..9f44e01 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/environment/sim/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3516c804fd71846d1dfa4e19bfa60f3073770e10bfe4081199db28615de65d69", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 5, + "native_level_sha256": "b21b6c4c5d4833bc356cf9525f5b03568d19bd18575a47a9c16f4ee434477a7b", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/instruction.md b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/instruction.md new file mode 100644 index 0000000..79ca2cd --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/instruction.md @@ -0,0 +1,61 @@ +# V-MAGE · Tempest Run L5 + +You control a runner who moves forward through a tunnel divided into lanes. + +**Task.** Travel as far as you can by changing lanes and using the appropriate action for obstacles. Use the Python client below to act on the screenshots. + +## Rules + +- **Drive the game with a program.** You may call the client repeatedly in a loop. Leave your main control script at `/app/output/gen.py`. +- **One episode.** There is no reset, restart, or undo. Stop submitting actions when `done` is true. +- **End of play.** Play ends on a fatal obstacle collision. The episode is also closed at the session time limit. +- **Action limit.** There is no fixed action or frame cap. + +## Scoring + +Your score is the distance traveled rounded down to a multiple of 10. The distance reached before the episode ends determines the score. + +## Client (`/app/game_client.py`) + +```python +from game_client import GameClient + +game = GameClient() +spec = game.spec() # interface settings, no action +print(spec["action_schema"]["enum"]) # case-sensitive action names +print(game.status()) # accepted step count and done, without fetching an image + +obs = game.observe() # one screenshot, no action +print(obs["step"], obs["done"], obs["time_left_s"]) +game.save_image(obs, "/app/output/view.png") # save the PNG to inspect with your tools + +# Choose an action from the listed names based on the screenshot. +# if not obs["done"]: +# obs = game.step(action, expected_step=obs["step"]) +# game.save_image(obs, "/app/output/view.png") +``` + +### Observations + +`obs["observation"]["image_png_base64"]` holds one 480 × 360 PNG screenshot encoded as base64. Save and inspect the image with your tools, or decode it in your program. Screenshots are returned to your program. Choose which ones to inspect or store. The public observation provides pixels, with no separate object coordinates or score field. + +### Actions and feedback + +`LEFT` and `RIGHT` shift one lane. `JUMP` can clear spikes. `SLIDE` can clear green enemies, and `RISE` ends a slide. `NONE` sends no new input, so the runner can still move forward or land. Each accepted action applies your input for one native frame, then up to 2 `NONE` frames, and returns one screenshot. Game physics pauses between requests. The session wall clock keeps running. + +`observe()` and `step()` both return `observation`, `step`, `done`, `steps_remaining`, and `time_left_s`. `step` counts accepted client actions. `steps_remaining` is `None` because the service adds no separate action cap. A final response can include the last captured screenshot. Use `done` to decide when to stop. + +Pass the current `step` as `expected_step`. An unknown action or stale step raises `ValueError` without advancing play. If an action response is lost or your step number is stale, call `observe()` before choosing the next action. + +## External material +Network access is open. You may consult general documentation and install general-purpose packages. Use the public Python client and its observations for all information about this episode, including any positions or motion you estimate from screenshots. + +Do not obtain or use this exact task’s solutions, reference actions, replays, or hidden level data. This restriction also applies to material available online. Do not inspect the simulator or verifier, read private game files, access hidden state, change the game, or start another episode. + +## 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. + +The wall-clock budget starts with your session and includes service startup, model thinking, waiting and tool execution. The game advances only when an accepted action is executed; waiting does not advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and graded at its current native score. Use `deadline_utc` and `time_left_s` in `/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first `observe()` or accepted action; `spec()` does not start that clock. diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/actions.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/actions.json new file mode 100644 index 0000000..985c966 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/actions.json @@ -0,0 +1,10 @@ +[ + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE", + "NONE" +] diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/solve.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/solve.sh new file mode 100755 index 0000000..a35f8f9 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/solution/solve.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail +python3 - <<'PYCODE' +import json +from game_client import GameClient +client = GameClient() +obs = client.observe() +for action in json.load(open('/solution/actions.json')): + if obs['done']: + break + obs = client.step(action, expected_step=obs['step']) +print('Reference live episode decisions:', obs['step'], 'done:', obs['done']) +PYCODE diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/task.toml b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/task.toml new file mode 100644 index 0000000..8566d72 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/task.toml @@ -0,0 +1,59 @@ +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" }, + "/app/output/", +] + +[task] +name = "embodied-first-exam/vmage-tempestrun-l05-i01-standard" +description = "V-MAGE TempestRun L5 native screenshot episode." +keywords = ["game", "vmage", "navigation", "partial-observation", "standard-mode"] + +[metadata] +task_type = "trajectory" +simulator = "vmage" +robot = "game-agent" +family = "l05" +dynamics = "dynamic" +protocol = "game-standard/2.2" +oracle = "partial" +oracle_evidence = "A fixed legal-action trace checks native equivalence and trusted scoring; no positive-score, completion or optimal-policy guarantee." +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 = 1200.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/vmage/vmage-tempestrun-l05-i01-standard/tests/Dockerfile b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/Dockerfile new file mode 100644 index 0000000..12c8331 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /tempestrun/instance_schema.py /tests/instance_schema.py +COPY --from=ghcr.io/mll-lab-nu/efe:vmage-files-0.2.2@sha256:a87602cb77629f80d55dcfe849bfc1d32527c92ae486a641aafa6ba5755d7b17 /common/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/vmage/vmage-tempestrun-l05-i01-standard/tests/instance.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/instance.json new file mode 100644 index 0000000..9f44e01 --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/instance.json @@ -0,0 +1,65 @@ +{ + "schema_version": "game-instance/2.2", + "protocol": "game-standard/2.2", + "adapter_version": "1.0.0", + "benchmark": "vmage_tempestrun", + "env_id": "V-MAGE-TempestRun-L5-v2", + "family": "l05", + "seed": 0, + "max_steps": null, + "initial_state_sha256": "3516c804fd71846d1dfa4e19bfa60f3073770e10bfe4081199db28615de65d69", + "observation_profile": "vmage-rgb-h360-v1", + "capabilities": { + "images": true, + "action_mode": "enum", + "timing": "action-stepped", + "native_truncation": false + }, + "metric_spec": { + "primary": "native_score", + "reducer": "family_macro", + "reducer_version": "1.0.0", + "success_label": "positive_score_auxiliary" + }, + "archive_sha256": "1047daa50004003eb9848205e1c420679e51d54d9a38acd3155da4aa8680e919", + "dt": 0.033, + "engine_versions": { + "Pillow": "10.4.0", + "imageio": "2.36.0", + "numpy": "2.2.4", + "opencv-python": "4.11.0.86", + "pygame": "2.6.1", + "scipy": "1.15.1", + "tqdm": "4.67.1" + }, + "fps": 30, + "frame_ledger": "pygame-base-capture-asymmetry-v1", + "frames_per_decision": 3, + "initialization": "native-init_run-step-None-dt0-v1", + "native_frame_limit": null, + "native_game": "tempestrun", + "native_level": 5, + "native_level_sha256": "b21b6c4c5d4833bc356cf9525f5b03568d19bd18575a47a9c16f4ee434477a7b", + "native_settings_sha256": "b624c083d02f7c66d6100c143263ac08f0c18a9c2ae89a9c7fa978b98e1e6949", + "observation_size": [ + 480, + 360 + ], + "passive_action": "NONE", + "python_version": "3.10.12", + "sdl_version": "2.28.4", + "source_manifest_sha256": "c78f261627da52a3a64a8381c66ad678553e015482d6c815db645d6df4a6da4d", + "surface_size": [ + 1024, + 768 + ], + "upstream_commit": "95d5d4a445bb0b75cce765c93107d87f84613e4d", + "native_actions": [ + "JUMP", + "LEFT", + "RIGHT", + "SLIDE", + "RISE", + "NONE" + ] +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/rcb_limits.json b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/rcb_limits.json new file mode 100644 index 0000000..f82776c --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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": "vmage-tempestrun-l05-i01-standard", + "tick_sec": 5 +} diff --git a/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/test.sh b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-i01-standard/tests/test.sh new file mode 100755 index 0000000..0cf878a --- /dev/null +++ b/game_first_exam/tasks/vmage/vmage-tempestrun-l05-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/tests/benchmarks/vmage/exported.toml b/game_first_exam/tests/benchmarks/vmage/exported.toml new file mode 100644 index 0000000..ecdf756 --- /dev/null +++ b/game_first_exam/tests/benchmarks/vmage/exported.toml @@ -0,0 +1,172 @@ +[protocols] +standard = ["game-standard/2.2"] + +[[tasks]] +name = "vmage-flappybird-l01-i01-standard" +source_task = "V-MAGE-FlappyBird-L1-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l02-i01-standard" +source_task = "V-MAGE-FlappyBird-L2-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l03-i01-standard" +source_task = "V-MAGE-FlappyBird-L3-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l04-i01-standard" +source_task = "V-MAGE-FlappyBird-L4-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l05-i01-standard" +source_task = "V-MAGE-FlappyBird-L5-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l06-i01-standard" +source_task = "V-MAGE-FlappyBird-L6-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-flappybird-l07-i01-standard" +source_task = "V-MAGE-FlappyBird-L7-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-pong-l01-i01-standard" +source_task = "V-MAGE-Pong-L1-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-pong-l02-i01-standard" +source_task = "V-MAGE-Pong-L2-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-pong-l03-i01-standard" +source_task = "V-MAGE-Pong-L3-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l01-i01-standard" +source_task = "V-MAGE-Race-L1-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l02-i01-standard" +source_task = "V-MAGE-Race-L2-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l03-i01-standard" +source_task = "V-MAGE-Race-L3-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l04-i01-standard" +source_task = "V-MAGE-Race-L4-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l05-i01-standard" +source_task = "V-MAGE-Race-L5-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l06-i01-standard" +source_task = "V-MAGE-Race-L6-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l07-i01-standard" +source_task = "V-MAGE-Race-L7-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l08-i01-standard" +source_task = "V-MAGE-Race-L8-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-race-l09-i01-standard" +source_task = "V-MAGE-Race-L9-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l00-i01-standard" +source_task = "V-MAGE-SuperMario-L0-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l01-i01-standard" +source_task = "V-MAGE-SuperMario-L1-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l02-i01-standard" +source_task = "V-MAGE-SuperMario-L2-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l03-i01-standard" +source_task = "V-MAGE-SuperMario-L3-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l04-i01-standard" +source_task = "V-MAGE-SuperMario-L4-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l05-i01-standard" +source_task = "V-MAGE-SuperMario-L5-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l06-i01-standard" +source_task = "V-MAGE-SuperMario-L6-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l07-i01-standard" +source_task = "V-MAGE-SuperMario-L7-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l08-i01-standard" +source_task = "V-MAGE-SuperMario-L8-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-supermario-l09-i01-standard" +source_task = "V-MAGE-SuperMario-L9-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-tempestrun-l01-i01-standard" +source_task = "V-MAGE-TempestRun-L1-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-tempestrun-l02-i01-standard" +source_task = "V-MAGE-TempestRun-L2-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-tempestrun-l03-i01-standard" +source_task = "V-MAGE-TempestRun-L3-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-tempestrun-l04-i01-standard" +source_task = "V-MAGE-TempestRun-L4-v2" +protocol = "game-standard/2.2" + +[[tasks]] +name = "vmage-tempestrun-l05-i01-standard" +source_task = "V-MAGE-TempestRun-L5-v2" +protocol = "game-standard/2.2" diff --git a/game_first_exam/tests/envs/locks/vmage.txt b/game_first_exam/tests/envs/locks/vmage.txt new file mode 100644 index 0000000..62c372e --- /dev/null +++ b/game_first_exam/tests/envs/locks/vmage.txt @@ -0,0 +1,8 @@ +imageio==2.36.0 +imageio-ffmpeg==0.6.0 +numpy==2.2.4 +opencv-python==4.11.0.86 +pillow==10.4.0 +pygame==2.6.1 +scipy==1.15.1 +tqdm==4.67.1 diff --git a/game_first_exam/tests/envs/vmage.Dockerfile b/game_first_exam/tests/envs/vmage.Dockerfile new file mode 100644 index 0000000..d4d4981 --- /dev/null +++ b/game_first_exam/tests/envs/vmage.Dockerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/python:3.10.12-slim-bookworm@sha256:4d440b214e447deddc0a94de23a3d97d28dfafdf125a8b4bb8073381510c9ee2 +ENV PYTHONUNBUFFERED=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy PYGAME_HIDE_SUPPORT_PROMPT=1 VMAGE_ROOT=/opt/vmage +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libgl1 libglib2.0-0 fonts-dejavu-core=2.37-6 && rm -rf /var/lib/apt/lists/* +COPY game_first_exam/tests/envs/locks/vmage.txt /requirements.txt +RUN pip install --no-cache-dir --no-deps -r /requirements.txt +RUN pip check +COPY game_first_exam/benchmarks/vmage/common/source_loader.py game_first_exam/benchmarks/vmage/common/SOURCE.json /opt/vmage-installer/ +RUN python /opt/vmage-installer/source_loader.py --destination /opt/vmage +# Bound BLAS threads to the simulator PID/CPU quota; native game logic is unchanged. +ENV OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 +WORKDIR /repo diff --git a/game_first_exam/tests/run.sh b/game_first_exam/tests/run.sh index a033e85..449052c 100755 --- a/game_first_exam/tests/run.sh +++ b/game_first_exam/tests/run.sh @@ -8,11 +8,17 @@ case "${1:-common}" in python3 -m unittest discover -s game_first_exam/tests -p 'test_layout.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_game_service.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_game_configuration.py' + python3 -m unittest discover -s game_first_exam/tests -p 'test_game_registry.py' + python3 -m unittest discover -s game_first_exam/tests -p 'test_game_vmage_suites.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_games_runner.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_game_runtime.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_game_connection.py' python3 -m unittest discover -s game_first_exam/tests -p 'test_game_modes.py' ;; + vmage) + python3 game_first_exam/tests/test_vmage_native.py + python3 game_first_exam/tests/test_vmage_levels.py + ;; minihack) export GAME_TEST_BENCHMARK=minihack python3 game_first_exam/tests/test_game_adapters.py diff --git a/game_first_exam/tests/test_game_configuration.py b/game_first_exam/tests/test_game_configuration.py index 37561f9..0af19c4 100644 --- a/game_first_exam/tests/test_game_configuration.py +++ b/game_first_exam/tests/test_game_configuration.py @@ -6,6 +6,7 @@ import sys import tempfile import unittest +import json from pathlib import Path from unittest.mock import patch @@ -21,6 +22,7 @@ from encoding import state_hash from game_preflight import preflight from game_schemas import schema_paths +import task_conventions as tc from grade import grade from run_games import aggregate from server import EnvironmentFault, Game, InvalidAction @@ -31,7 +33,8 @@ class ConfigTests(unittest.TestCase): def test_each_bundled_schema_works_without_repo_or_engine_packages(self): for benchmark, schema in schema_paths().items(): - task = next(p for p in sorted((ROOT / 'game_first_exam/tasks' / benchmark).glob('*-standard')) if '-i00-' not in p.name) + task = next(p for p in tc.iter_tasks() if tc.mode_of(p) == 'standard' and '-i00-' not in p.name + and json.loads((p / 'tests/instance.json').read_text())['benchmark'] == benchmark) with self.subTest(benchmark=benchmark), tempfile.TemporaryDirectory() as tmp: out = Path(tmp) for name in ('config_schema.py', 'reducers.py'): diff --git a/game_first_exam/tests/test_game_harbor.py b/game_first_exam/tests/test_game_harbor.py index e6e71f6..61a2277 100644 --- a/game_first_exam/tests/test_game_harbor.py +++ b/game_first_exam/tests/test_game_harbor.py @@ -27,22 +27,35 @@ from prepare_games import load_suite, prepare, select_tasks import efe import run_games +import task_conventions as tc class GameSelection(unittest.TestCase): def test_game_only_default_and_all_selection_never_launches(self): + all_standard = sum(tc.mode_of(task) == 'standard' for task in tc.iter_tasks()) for flags, expected in ((["--list", "--standard"], 30), - (["--all", "--standard", "--list"], 42)): + (["--all", "--standard", "--list"], all_standard)): with self.subTest(flags=flags), contextlib.redirect_stdout(io.StringIO()) as output, \ patch("efe.harbor") as launch, patch("efe.prepull") as pull: self.assertEqual(efe.run(flags), 0) names = output.getvalue().splitlines() self.assertEqual(len(names), expected) - self.assertTrue(all(name.startswith(("minigrid-", "crafter-", "textworld-", "babaisai-", "minihack-")) + self.assertTrue(all(name.startswith(tuple(prefix for prefix, _ in tc.BENCHMARKS)) for name in names)) launch.assert_not_called() pull.assert_not_called() + def test_vmage_smoke_lists_five_independent_standard_games_without_launching(self): + with contextlib.redirect_stdout(io.StringIO()) as output, \ + patch("efe.harbor") as launch, patch("efe.prepull") as pull: + self.assertEqual(efe.run(["--game-suite", "vmage-smoke", "--standard", "--list"]), 0) + self.assertEqual(set(output.getvalue().splitlines()), { + f'vmage-{game}-l01-i01-standard' + for game in ('race', 'flappybird', 'pong', 'supermario', 'tempestrun') + }) + launch.assert_not_called() + pull.assert_not_called() + def test_checkout_discovery_works_without_upstream_task_tree(self): self.assertTrue(efe.is_tree(ROOT)) self.assertFalse((ROOT / "tasks").exists()) diff --git a/game_first_exam/tests/test_game_registry.py b/game_first_exam/tests/test_game_registry.py new file mode 100644 index 0000000..98879dd --- /dev/null +++ b/game_first_exam/tests/test_game_registry.py @@ -0,0 +1,126 @@ +"""Trusted host registry and extra native runtime binding regressions; no game engines required.""" +import tempfile +import unittest +from pathlib import Path +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[2] +import sys +sys.path[:0] = [str(ROOT / 'scripts'), str(ROOT / 'game_first_exam/runtime')] +import files_image +import game_schemas +import task_conventions as tc +from game_preflight import validate_task + + +class RegistryTests(unittest.TestCase): + def registry(self, text, root): + registry = root / 'registry.toml' + registry.write_text(text) + with patch.object(game_schemas, 'ROOT', root), patch.object(game_schemas, 'REGISTRY', registry): + return game_schemas.registrations() + + def test_schema_only_rows_keep_their_existing_runtime_bindings(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + rows = self.registry('[benchmarks.example]\nschema="game_first_exam/benchmarks/example/instance_schema.py"', root) + self.assertEqual(rows['example']['runtime_files'], {}) + self.assertEqual(rows['example']['schema'], root / 'game_first_exam/benchmarks/example/instance_schema.py') + self.assertEqual(rows['example']['adapter'], root / 'game_first_exam/benchmarks/example/adapter.py') + self.assertEqual(rows['example']['metric_rules'], root / 'game_first_exam/benchmarks/example/metric_rules.py') + + def test_registry_rejects_unknown_fields_and_untrusted_paths(self): + schema = 'schema="game_first_exam/benchmarks/example/instance_schema.py"\n' + invalid = [ + 'unknown=true\n[benchmarks.example]\n' + schema, + '[benchmarks.example]\n' + schema + 'unexpected=true', + '[benchmarks.example]\nruntime_files={}', + '[benchmarks.example]\nschema=123', + '[benchmarks.example]\nschema="/tmp/instance_schema.py"', + '[benchmarks.example]\nschema="game_first_exam/benchmarks/../runtime/instance_schema.py"', + '[benchmarks.example]\n' + schema + 'runtime_files=[]', + '[benchmarks.example]\n' + schema + 'adapter="/tmp/adapter.py"', + '[benchmarks.example]\n' + schema + 'adapter="game_first_exam/benchmarks/example/not_adapter.py"', + '[benchmarks.example]\n' + schema + 'metric_rules="scripts/metric_rules.py"', + '[benchmarks.example]\n' + schema + 'metric_rules="game_first_exam/benchmarks/example/unknown.py"', + ] + for target, source in [ + ('/app/helper.py', 'game_first_exam/benchmarks/common/helper.py'), + ('/srv', 'game_first_exam/benchmarks/common/helper.py'), + ('/srv/../app/helper.py', 'game_first_exam/benchmarks/common/helper.py'), + ('/srv//helper.py', 'game_first_exam/benchmarks/common/helper.py'), + ('/srv/helper.py', '/tmp/helper.py'), + ('/srv/helper.py', 'scripts/helper.py'), + ('/srv/helper.py', 'game_first_exam/benchmarks/../runtime/helper.py'), + ]: + invalid.append('[benchmarks.example]\n' + schema + f'runtime_files={{"{target}"="{source}"}}') + with tempfile.TemporaryDirectory() as tmp: + for text in invalid: + with self.subTest(registry=text), self.assertRaises(ValueError): + self.registry(text, Path(tmp)) + + def test_source_symlink_cannot_leave_trusted_benchmarks(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + benchmarks = root / 'game_first_exam/benchmarks' + benchmarks.mkdir(parents=True) + (root / 'untrusted').mkdir() + (benchmarks / 'example').symlink_to(root / 'untrusted', target_is_directory=True) + with self.assertRaises(ValueError): + self.registry('[benchmarks.example]\nschema="game_first_exam/benchmarks/example/instance_schema.py"', root) + + def test_vmage_has_five_separate_schemas_under_one_task_root(self): + rows = game_schemas.registrations() + for game in ('race', 'flappybird', 'pong', 'supermario', 'tempestrun'): + benchmark = 'vmage_' + game + with self.subTest(benchmark=benchmark): + self.assertEqual(rows[benchmark]['schema'], ROOT / f'game_first_exam/benchmarks/vmage/{game}/instance_schema.py') + self.assertEqual(rows[benchmark]['adapter'], ROOT / f'game_first_exam/benchmarks/vmage/{game}/adapter.py') + self.assertEqual(rows[benchmark]['metric_rules'], ROOT / 'game_first_exam/benchmarks/vmage/common/metric_rules.py') + self.assertEqual(rows[benchmark]['runtime_files'], { + '/srv/' + filename: ROOT / 'game_first_exam/benchmarks/vmage/common' / filename + for filename in ('vmage_bridge.py', 'source_loader.py', 'SOURCE.json') + }) + name = f'vmage-{game}-l01-i01-standard' + self.assertEqual(tc.task_dir(name), ROOT / f'game_first_exam/tasks/vmage/{name}') + + def test_native_test_lock_matches_the_runtime_baseline(self): + self.assertEqual((ROOT / 'game_first_exam/benchmarks/vmage/common/requirements.txt').read_text(), + (ROOT / 'game_first_exam/tests/envs/locks/vmage.txt').read_text()) + + def test_preflight_rejects_missing_or_stale_extra_runtime_bindings(self): + # Reuse an existing frozen task so this exercises the complete Docker COPY inspection. + import tomllib + suite = tomllib.loads((ROOT / 'configs/game_suites/minigrid.toml').read_text()) + row = suite['tasks'][0] + source = ROOT / 'game_first_exam/benchmarks/minigrid/adapter.py' + original = files_image.copied_from + registration = {**game_schemas.benchmark_registration(row['benchmark']), + 'runtime_files': {'/srv/native_helper.py': source}} + for copied_source in (None, ROOT / 'game_first_exam/benchmarks/crafter/adapter.py', source): + def copied(path): + bindings, errors = original(path) + if Path(path).parent.name == 'sim' and copied_source is not None: + bindings['/srv/native_helper.py'] = copied_source + return bindings, errors + with self.subTest(source=copied_source), \ + patch('game_preflight.benchmark_registration', return_value=registration), \ + patch('files_image.copied_from', side_effect=copied): + if copied_source == source: + validate_task(row) + else: + with self.assertRaisesRegex(ValueError, 'missing/stale public service binding'): + validate_task(row) + + def test_extra_runtime_files_cannot_override_core_service_bindings(self): + import tomllib + row = tomllib.loads((ROOT / 'configs/game_suites/minigrid.toml').read_text())['tasks'][0] + registration = {**game_schemas.benchmark_registration(row['benchmark']), + 'runtime_files': {'/srv/server.py': Path('/tmp/evil.py')}} + with patch('game_preflight.benchmark_registration', return_value=registration), \ + self.assertRaisesRegex(ValueError, 'runtime binding conflicts'): + validate_task(row) + + +if __name__ == '__main__': + unittest.main() diff --git a/game_first_exam/tests/test_game_vmage_suites.py b/game_first_exam/tests/test_game_vmage_suites.py new file mode 100644 index 0000000..4a953a4 --- /dev/null +++ b/game_first_exam/tests/test_game_vmage_suites.py @@ -0,0 +1,28 @@ +"""The upstream default selection stays distinct from its extra native level.""" +from pathlib import Path +import sys,unittest +ROOT=Path(__file__).resolve().parents[2] +sys.path.insert(0,str(ROOT/'scripts')) +from prepare_games import load_suite + +class VMageSuiteSelection(unittest.TestCase): + def test_default_extra_and_smoke_coverage(self): + default,dp=load_suite('vmage');extra,ep=load_suite('vmage-extra');smoke,sp=load_suite('vmage-smoke') + self.assertEqual(len(dp),33);self.assertEqual(len(ep),1);self.assertEqual(len(sp),5) + self.assertEqual(set(ep),{'vmage-tempestrun-l05-i01-standard'}) + self.assertFalse(set(dp)&set(ep));self.assertTrue(set(sp)<=set(dp)) + self.assertIn('vmage-supermario-l00-i01-standard',dp) + self.assertEqual(len(set(dp)|set(ep)),34) + + def test_default_order_and_tasks_match_frozen_native_inventory(self): + suite,plans=load_suite('vmage') + names=[r['name'] for r in suite['tasks']] + expected=[] + for game,levels in [('flappybird',range(1,8)),('supermario',[1,2,3,4,5,6,7,8,9,0]),('pong',range(1,4)),('race',range(1,10)),('tempestrun',range(1,5))]: + expected.extend(f'vmage-{game}-l{level:02}-i01-standard' for level in levels) + self.assertEqual(names,expected) + self.assertEqual(len(names),len(set(names))) + self.assertFalse(any('no-history' in n or 'no_history' in n for n in names)) + self.assertEqual({r['benchmark'] for r in suite['tasks']},{'vmage_race','vmage_flappybird','vmage_pong','vmage_supermario','vmage_tempestrun'}) + +if __name__=='__main__':unittest.main() diff --git a/game_first_exam/tests/test_vmage_levels.py b/game_first_exam/tests/test_vmage_levels.py new file mode 100644 index 0000000..2047031 --- /dev/null +++ b/game_first_exam/tests/test_vmage_levels.py @@ -0,0 +1,69 @@ +"""Frozen all-level coverage and independent native-run equivalence.""" +import copy +import json +import os +import sys +import unittest +from unittest.mock import patch + +import test_vmage_native as native + +ROOT=native.ROOT +EXPECTED={'race':set(range(1,10)),'flappybird':set(range(1,8)),'pong':set(range(1,4)),'supermario':set(range(10)),'tempestrun':set(range(1,6))} + +class VMageLevels(unittest.TestCase): + def tasks(self): + return sorted((ROOT/'game_first_exam/tasks/vmage').glob('vmage-*-standard')) + + def test_complete_native_level_inventory(self): + rows=[json.loads((p/'tests/instance.json').read_text()) for p in self.tasks()] + self.assertEqual(len(rows),34) + actual={g:{r['native_level'] for r in rows if r['native_game']==g} for g in EXPECTED} + self.assertEqual(actual,EXPECTED) + limits={r['native_level']:r['native_frame_limit'] for r in rows if r['native_game']=='race'} + self.assertEqual(limits,{1:100,2:150,3:150,4:150,5:150,6:100,7:100,8:300,9:500}) + limits={r['native_level']:r['native_frame_limit'] for r in rows if r['native_game']=='supermario'} + self.assertEqual(limits,{0:5000,1:400,2:1000,3:1000,4:1000,5:300,6:300,7:300,8:1000,9:1000}) + for r in rows: + self.assertEqual(r['family'],f'l{r["native_level"]:02}') + self.assertIsNone(r['max_steps']) + + def test_stdlib_validation_rejects_mixed_level_bindings(self): + sys.path.insert(0,str(native.RUNTIME));native.register_schemas() + from config_schema import validate_instance + for task in self.tasks(): + instance=json.loads((task/'tests/instance.json').read_text()) + with self.subTest(task=task.name): + validate_instance(instance) + for field,value in [('native_level',99),('native_level',True),('native_actions',['UNFROZEN']),('native_level_sha256','0'*64),('native_frame_limit',1),('seed',1),('adapter_version','2.0.0')]: + wrong=copy.deepcopy(instance);wrong[field]=value + with self.assertRaises(ValueError):validate_instance(wrong) + + def test_all_frozen_reference_traces_match_unmodified_native_loop(self): + helper=native.VMageNative() + for task in self.tasks(): + instance=json.loads((task/'tests/instance.json').read_text()) + game=instance['native_game'];level=instance['native_level'] + actions=json.loads((task/'solution/actions.json').read_text()) + # The full L0 map makes repeated purity/audit hashing slower under 1 CPU. + # This is a unittest subprocess guard, not an episode wall-clock budget. + guard='180' if game=='supermario' and level==0 else '90' + with self.subTest(task=task.name),patch.dict(os.environ,{'VMAGE_TEST_LEVEL':str(level),'VMAGE_TEST_PROCESS_TIMEOUT':guard}): + upstream=helper.run_episode('native',game,actions) + bridge=helper.run_episode('bridge',game,actions) + self.assertEqual(bridge['constructed'],1) + self.assertEqual(bridge['initial'],upstream['initial']) + self.assertEqual(len(bridge['calls']),len(upstream['calls'])) + cosmetic=game=='tempestrun' and upstream['final']['over'] + for a,b in zip(bridge['calls'],upstream['calls']): + for field in ['action','dt','result','state']:self.assertEqual(a[field],b[field],task.name+': '+field) + # Native Tempest death visuals depend on wall time; physics and RNG still match. + if not cosmetic or not b['state']['over']:self.assertEqual(a['pixels'],b['pixels']) + self.assertEqual(bridge['final'],upstream['final']) + if not cosmetic: + self.assertEqual(bridge['pixels'],upstream['pixels']) + self.assertEqual(bridge['frame_pixels'],upstream['pixels']) + self.assertEqual(bridge['observation'],upstream['observation']) + print('native-equivalent', task.name, upstream['final']['score'], len(bridge['transitions']), flush=True) + +if __name__=='__main__':unittest.main() diff --git a/game_first_exam/tests/test_vmage_native.py b/game_first_exam/tests/test_vmage_native.py new file mode 100644 index 0000000..32d9e2b --- /dev/null +++ b/game_first_exam/tests/test_vmage_native.py @@ -0,0 +1,537 @@ +"""V-MAGE native-run equivalence; each episode owns a fresh Python process. + +The baseline executes upstream PygameBase.run unchanged. Only its input source +is replaced with frozen legal actions. Native step, render, init_run, screenshot +capture and ledger bookkeeping are exercised independently of the bridge. +""" +import base64 +import copy +import hashlib +import importlib +import importlib.util +import io +import json +import os +from pathlib import Path +import random +import subprocess +import sys +import tempfile +import time +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[2] +RUNTIME = ROOT / 'game_first_exam/runtime' +GAMES = ('race', 'flappybird', 'pong', 'supermario', 'tempestrun') +CLASSES = dict(zip(GAMES, ('RaceGame', 'FlappyBirdGame', 'PongGame', 'SuperMarioGame', 'TempestRunGame'))) +EXPECTED_SCORE = {'race': 100, 'flappybird': 1, 'pong': 1, 'supermario': 100, 'tempestrun': 10} + + +def module(name, path): + spec = importlib.util.spec_from_file_location(name, path) + loaded = importlib.util.module_from_spec(spec) + sys.modules[name] = loaded + spec.loader.exec_module(loaded) + return loaded + + +def register_schemas(): + from config_schema import register_instance_schema, _SCHEMAS + for game in GAMES: + name = 'vmage_' + game + if name not in _SCHEMAS: + register_instance_schema(module('_test_' + name + '_schema', ROOT / f'game_first_exam/benchmarks/vmage/{game}/instance_schema.py')) + + +def task_for(game): + level = int(os.environ.get('VMAGE_TEST_LEVEL', '1')) + tasks = list((ROOT / 'game_first_exam/tasks/vmage').glob(f'vmage-{game}-l{level:02}-i01-standard')) + if len(tasks) != 1: + raise AssertionError('expected one frozen task for ' + game) + return tasks[0] + +def reference_actions(game): + return json.loads((task_for(game) / 'solution/actions.json').read_text()) + + +def digest(value): + return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(',', ':'), allow_nan=False).encode()).hexdigest() + + +def native_state(g, game): + """Explicit physical/RNG state, independent of bridge fingerprint code. + + Tempest's wall-clock explosion timestamps and render caches are deliberately + excluded; its obstacle identities, flags and geometry are included. We do + not claim deterministic explosion pixels across different real-time runs. + """ + import numpy as np + import pygame + state = {'score': g.score, 'over': bool(g.over), 'ledger': len(g.game_frames), + 'python_rng': digest(random.getstate()), + 'numpy_rng': digest([np.random.get_state()[0], np.random.get_state()[1].tolist(), + *np.random.get_state()[2:]])} + if game == 'race': + state['car'] = {k: getattr(g.car, k) for k in ('position', 'speed', 'direction', 'k_left', 'k_right', 'k_up', 'k_down', 'MAX_FORWARD_SPEED', 'MAX_REVERSE_SPEED')} + state.update(car_rect=list(g.car.rect), trophy_rect=list(g.trophy.rect), win=g.win_condition, + trophy_count=len(g.trophy_group), pads=[list(p.rect) for p in g.pad_group]) + elif game == 'flappybird': + state.update(bird=list(g.bird_rect), pipes=[{'rect': list(p['rect']), 'counted': p['counted']} for p in g.pipe_list]) + state['animation'] = {k: getattr(g, k) for k in ('bird_movement', 'create_pipe_count', 'bird_flip_count', 'bird_index', 'floor_x_pos')} + elif game == 'pong': + state.update(ball=list(g.ball), paddleA=list(g.paddleA), paddleB=list(g.paddleB), + dx=g.ball_dx, dy=g.ball_dy, scoreA=g.scoreA, scoreB=g.scoreB) + elif game == 'supermario': + m = g.mario + state.update(mario=list(m.rect), vel=[m.vel.x, m.vel.y], camera=[m.camera.x, m.camera.y], + flags={k: getattr(m, k) for k in ('restart', 'inAir', 'inJump', 'onGround', 'obeyGravity', 'powerUpState', 'invincibilityFrames')}, + dashboard={k: getattr(g.dashboard, k) for k in ('points', 'coins', 'ticks', 'time')}, + entities=[{'type': type(e).__name__, 'rect': list(e.rect), + 'flags': {k: getattr(e, k) for k in ('alive', 'active', 'bouncing', 'triggered') if hasattr(e, k)}} for e in g.level.entityList]) + else: + mode = g.current_mode + level = mode.current_level + state.update(player={k: getattr(mode.player, k) for k in ('x', 'y', 'z', 'lane', 'speed', 'dy', 'last_z_pos', 'current_mode', '_last_mode_before_death')}, + loaded=level._currently_loaded_cell_range, + obstacles=[{'key': list(key), 'type': type(obs).__name__, 'lane': obs.lane, + 'z': obs.z, 'length': obs.length, 'dead': obs._is_dead, + 'jump': obs._can_jump, 'slide': obs._can_slide_through, + 'run': obs._can_run_through} for key, obs in sorted(level._obstacle_grid.items())]) + # JSON round-trip makes tuples/numpy scalar representation uniform. + return json.loads(json.dumps(state, sort_keys=True, allow_nan=False)) + + +def pixels(surface): + import pygame + return hashlib.sha256(pygame.image.tostring(surface, 'RGB')).hexdigest() + + +def screen_from_observation(observation): + from PIL import Image + assert set(observation) == {'image_png_base64'}, observation.keys() + with Image.open(io.BytesIO(base64.b64decode(observation['image_png_base64'], validate=True))) as image: + return {'size': list(image.size), 'pixels': hashlib.sha256(image.convert('RGB').tobytes()).hexdigest()} + + +def baseline_setup(game, scratch): + source = Path(os.environ.get('VMAGE_ROOT', '/opt/vmage')).resolve() + for name in ('game', 'utils', 'config', 'res'): + (scratch / name).symlink_to(source / name, target_is_directory=True) + sys.dont_write_bytecode = True + os.chdir(scratch) + sys.path.insert(0, str(scratch)) + if game == 'supermario': + sys.path.append(str(scratch / 'game/supermario')) + os.environ.update(SDL_VIDEODRIVER='dummy', SDL_AUDIODRIVER='dummy', PYGAME_HIDE_SUPPORT_PROMPT='1') + random.seed(0) + import numpy as np + np.random.seed(0) + import pygame + pygame.init() + pygame.display.set_mode((1, 1)) + from utils.config import Config + c = Config() + c.load_env_config(str(scratch / f'config/env_config/3steps/env_config_{game}_reasoning_3steps.json')) + c.load_level_config(str(scratch / f"config/level_config/{game}game/level{int(os.environ.get('VMAGE_TEST_LEVEL', '1'))}.json")) + class Progress: + def set_postfix(self, **kwargs): + pass + c.pbar = Progress() + c.now_avg_score = 0 + return getattr(importlib.import_module('game.' + game + '_game'), CLASSES[game]) + + +def worker(mode, game, actions, destination): + sys.path.insert(0, str(RUNTIME)) + sys.path.insert(0, str(ROOT / 'game_first_exam/benchmarks/vmage/common')) + register_schemas() + calls = [] + constructed = [] + initial = [] + patched = set() + original_import = importlib.import_module + + def instrument(cls): + if cls in patched: + return + patched.add(cls) + original_init, original_step = cls.__init__, cls.step + def init(self, *a, **kw): + constructed.append(1) + if mode == 'construction-fault': + raise RuntimeError('injected native construction failure') + return original_init(self, *a, **kw) + def step(self, action, dt=None): + if mode == 'step-fault' and action != 'None': + raise RuntimeError('injected native execution failure') + result = original_step(self, action, dt) + calls.append({'action': action, 'dt': dt, 'result': list(result), + 'state': native_state(self, game), 'pixels': pixels(self.screen)}) + return result + cls.__init__, cls.step = init, step + + def importing(name, *a, **kw): + result = original_import(name, *a, **kw) + if name == 'game.' + game + '_game': + instrument(getattr(result, CLASSES[game])) + return result + + with tempfile.TemporaryDirectory(prefix='vmage-test-') as td, patch.object(importlib, 'import_module', importing): + scratch = Path(td) + if mode == 'native': + cls = baseline_setup(game, scratch) + output = scratch / 'screens' + output.mkdir() + g = cls(str(output)) + class Complete(Exception): + pass + queue = iter(actions) + def event_source(): + if not initial: + initial.append({'state': native_state(g, game), 'pixels': pixels(g.screen), + 'observation': screen_from_observation({'image_png_base64': g.last_frame_base64})}) + try: + return [next(queue)] + except StopIteration: + raise Complete() + # Upstream run is unchanged; this only supplies the human input. + g.human_mode_action = lambda event: event + import pygame + with patch.object(pygame.event, 'get', event_source): + try: + g.run(None, human_mode=True) + except Complete: + pass + result = {'constructed': len(constructed), 'calls': calls, 'initial': initial[0], + 'final': native_state(g, game), 'pixels': pixels(g.screen), + 'observation': screen_from_observation({'image_png_base64': g.last_frame_base64})} + pygame.quit() + else: + task = task_for(game) + instance = json.loads((task / 'tests/instance.json').read_text()) + adapter_module = module('tested_vmage_adapter', ROOT / f'game_first_exam/benchmarks/vmage/{game}/adapter.py') + rules = module('tested_vmage_rules', ROOT / 'game_first_exam/benchmarks/vmage/common/metric_rules.py') + if mode == 'construction-fault': + from server import Game + from grade import grade + service = Game.open(adapter_module.Adapter, instance, task / 'environment/sim', scratch / 'fault') + verdict = grade(service.final, instance, rules.validate_metrics) + assert verdict['infra_error'] == 1 and verdict['primary_score'] is None + assert service.final['error']['phase'] == 'construction' + assert len(constructed) == 1 and not calls + Path(destination).write_text(json.dumps(verdict)) + service.close() + return + adapter = adapter_module.Adapter(instance, task / 'environment/sim') + g = adapter.env + initial.append({'state': native_state(g, game), 'pixels': pixels(g.screen), + 'observation': screen_from_observation(adapter.observe())}) + assert len(constructed) == 1, 'observe actual native constructor, not a self-reported counter' + assert len(calls) == 1 and calls[0]['action'] == 'None' and calls[0]['dt'] == 0 + assert len(g.game_frames) == 1 + try: + adapter_module.Adapter(instance, task / 'environment/sim') + raise AssertionError('second native construction accepted') + except RuntimeError: + pass + assert len(constructed) == 1 and len(calls) == 1 + identity = id(g) + def assert_pure(): + before = native_state(g, game) + before_pixels = pixels(g.screen) + before_fingerprint = adapter.fingerprint() + before_calls = len(calls) + observation = adapter.observe() + frame = adapter.frame().copy() + # Native draw/render can mutate collision state or generate RNG. + owner, name = (g.current_mode, 'draw_to_screen') if game == 'tempestrun' else (g, 'render') if game == 'race' else (None, None) + def queries(): + for _ in range(3): + adapter.spec(); adapter.metrics(); adapter.success() + assert adapter.observe() == observation + assert (adapter.frame() == frame).all() + assert adapter.fingerprint() == before_fingerprint + if owner is not None: + with patch.object(owner, name, side_effect=AssertionError('query rendered native game')): + queries() + else: + queries() + leaked_frame = adapter.frame() + leaked_frame[0, 0] ^= 255 + assert (adapter.frame() == frame).all(), 'frame must not expose writable cache' + assert native_state(g, game) == before + assert pixels(g.screen) == before_pixels + assert len(calls) == before_calls + assert_pure() + from server import Game + from grade import grade + service_instance = copy.deepcopy(instance) + assert instance['initial_state_sha256'] == adapter.fingerprint(), 'frozen initial audit hash mismatch' + service = Game(adapter, service_instance, scratch / 'service', wall_clock=600) + assert service.final is None + if mode == 'step-fault': + from server import EnvironmentFault + try: + service.submit({'action': actions[0], 'expected_step': 0, 'request_id': 'fault'}) + raise AssertionError('native failure accepted') + except EnvironmentFault: + pass + verdict = grade(service.final, service_instance, rules.validate_metrics) + assert verdict['infra_error'] == 1 and verdict['primary_score'] is None + assert service.final['error']['phase'] == 'step' + assert service.final['metrics'] is None and service.final['success'] is None + assert len(constructed) == 1 and len(calls) == 1 + Path(destination).write_text(json.dumps(verdict)) + service.close() + return + before = native_state(g, game) + for body in ({'action': 'reset', 'expected_step': 0, 'request_id': 'illegal'}, + {'action': actions[0], 'expected_step': 1, 'request_id': 'stale'}): + try: + service.submit(body) + raise AssertionError('invalid/stale action accepted') + except ValueError: + pass + assert native_state(g, game) == before + transitions = [] + for i, action in enumerate(actions): + if g.over: + break + body = {'action': action, 'expected_step': service.steps, 'request_id': 'native-' + str(i)} + response = service.submit(body) + assert service.final is None or not service.final.get('sim_error'), service.final + transitions.append({'terminated': service.terminated, 'truncated': service.truncated}) + after = native_state(g, game) + assert service.submit(body) == response + assert native_state(g, game) == after, 'retry advanced native state/RNG' + changed = dict(body, action=next(x for x in g.valid_actions if x != action)) + try: + service.submit(changed) + raise AssertionError('request ID collision accepted') + except ValueError: + pass + assert native_state(g, game) == after + assert id(adapter.env) == identity, 'no reconstruction/reset' + assert_pure() + assert adapter.metrics()['native_step_calls'] == len(calls) + assert adapter.metrics()['native_frame_count'] == len(g.game_frames) + assert adapter.metrics()['decision_count'] == service.steps + assert abs(service.reward - g.score) < 1e-9 + assert adapter.success() == (bool(g.win_condition) if game == 'race' else g.score > 0) + result = {'constructed': len(constructed), 'calls': copy.deepcopy(calls), 'initial': initial[0], + 'final': native_state(g, game), 'pixels': pixels(g.screen), + 'observation': screen_from_observation(adapter.observe()), + 'frame_pixels': hashlib.sha256(adapter.frame().tobytes()).hexdigest(), + 'metrics': adapter.metrics(), 'transitions': transitions} + before = native_state(g, game) + if service.final is None: + with patch('server.time.monotonic', return_value=1000.0): + service.started = 399.0 + assert service.observe()['done'] + assert service.final['reason'] == 'time_limit' + assert native_state(g, game) == before + try: + service.submit({'action': actions[0], 'expected_step': service.steps, 'request_id': 'after-final'}) + raise AssertionError('terminal action accepted') + except ValueError: + pass + assert native_state(g, game) == before + if g.over: + try: + adapter.step(actions[0]) + raise AssertionError('terminal native action accepted') + except ValueError: + pass + assert native_state(g, game) == before + if game == 'tempestrun': + cached = adapter.observe() + cached_frame = adapter.frame().copy() + time.sleep(.06) + assert adapter.observe() == cached + assert (adapter.frame() == cached_frame).all() + assert native_state(g, game) == before + valid = grade(service.final, service_instance, rules.validate_metrics) + assert valid['infra_error'] == 0, valid + assert valid['primary_score'] == g.score, valid + mutations = [('native_score', -1), ('native_score', g.score + 1), + ('native_step_calls', 0), ('native_frame_count', -1), + ('native_initialization_calls', 2), ('initial_native_score', 1), + ('decision_count', service.steps + 1)] + decomposition = {'race': ('native_win', not bool(getattr(g, 'win_condition', False))), + 'flappybird': ('pipe_pair_score', g.score + 1), + 'pong': ('score_a', g.score + 1), + 'supermario': ('dashboard_points', g.score + 1), + 'tempestrun': ('distance_z', g.score + 100)}[game] + mutations.append(decomposition) + if game == 'supermario': + mutations.extend([('dashboard_ticks', (g.dashboard.ticks + 1) % 60), + ('dashboard_time', g.dashboard.time + 1)]) + for field, value in mutations: + altered = copy.deepcopy(service.final) + altered['metrics'][field] = value + try: + grade(altered, service_instance, rules.validate_metrics) + raise AssertionError('metric fault accepted: ' + field) + except ValueError: + pass + service.close() + Path(destination).write_text(json.dumps(result, sort_keys=True, allow_nan=False)) + + +class VMageNative(unittest.TestCase): + def run_episode(self, mode, game, actions): + with tempfile.TemporaryDirectory(prefix='vmage-result-') as td: + output = Path(td) / 'result.json' + run = subprocess.run([sys.executable, str(Path(__file__).resolve()), '--worker', mode, game, + json.dumps(actions), str(output)], cwd=ROOT, text=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=int(os.environ.get("VMAGE_TEST_PROCESS_TIMEOUT", "90"))) + self.assertEqual(run.returncode, 0, run.stdout[-2000:] + run.stderr[-6000:]) + return json.loads(output.read_text()) + + def assert_equivalent(self, game, actions, score=None): + native = self.run_episode('native', game, actions) + bridge = self.run_episode('bridge', game, actions) + for key in ('constructed', 'initial', 'calls', 'final', 'pixels', 'observation'): + self.assertEqual(bridge[key], native[key], game + ': ' + key) + self.assertEqual(bridge['constructed'], 1) + self.assertEqual(bridge['frame_pixels'], native['pixels']) + self.assertEqual(native['calls'][0]['dt'], 0) + self.assertTrue(all(c['dt'] == .033 for c in native['calls'][1:])) + if score is not None: + self.assertEqual(bridge['final']['score'], score) + return bridge + + def test_original_native_run_positive_references(self): + for game in GAMES: + with self.subTest(game=game): + result = self.assert_equivalent(game, reference_actions(game), EXPECTED_SCORE[game]) + self.assertEqual(result['initial']['state']['score'], 0) + self.assertEqual(result['initial']['state']['ledger'], 1) + self.assertEqual(result['initial']['observation']['size'], [202 if game == 'flappybird' else 480, 360]) + if game == 'race': + self.assertEqual(result['final']['ledger'], 11) + self.assertEqual(len(result['calls']), 12) + self.assertEqual(result['transitions'][-1], {'terminated': True, 'truncated': False}) + self.assertNotEqual(result['calls'][-1]['pixels'], result['calls'][-2]['pixels']) + else: + self.assertFalse(result['final']['over'], 'positive score is auxiliary, not termination') + + def test_fresh_process_same_seed_preserves_state_rng_and_pixels(self): + for game in GAMES: + with self.subTest(game=game): + first = self.run_episode('bridge', game, reference_actions(game)[:2]) + second = self.run_episode('bridge', game, reference_actions(game)[:2]) + for key in ('initial', 'calls', 'final', 'pixels', 'observation'): + self.assertEqual(first[key], second[key], game + ': ' + key) + + def test_native_screenshot_cap_boundary(self): + for game, actions, ledger, calls in [('race', ['LEFT', 'RIGHT'] * 17, 101, 101), + ('supermario', ['NONE'] * 80, 400, 401)]: + with self.subTest(game=game): + result = self.assert_equivalent(game, actions, 0) + self.assertEqual(result['final']['ledger'], ledger) + self.assertEqual(len(result['calls']), calls) + self.assertEqual(result['transitions'][-1], {'terminated': False, 'truncated': True}) + if game == 'supermario': + self.assertEqual(result['metrics']['dashboard_ticks'], calls % 60) + + def test_native_death_preserves_accumulated_positive_score(self): + result = self.assert_equivalent('flappybird', reference_actions('flappybird') + ['DOWN'] * 30, 1) + self.assertTrue(result['final']['over']) + self.assertEqual(result['transitions'][-1], {'terminated': True, 'truncated': False}) + self.assertGreater(result['metrics']['native_score'], 0) + + def test_tempest_native_death_and_wallclock_cache(self): + actions = ['NONE'] * 100 + native = self.run_episode('native', 'tempestrun', actions) + bridge = self.run_episode('bridge', 'tempestrun', actions) + self.assertTrue(bridge['final']['over']) + self.assertEqual(bridge['final']['player']['current_mode'], 'dead') + self.assertGreater(bridge['final']['score'], 0) + self.assertEqual(bridge['final'], native['final']) + self.assertEqual(bridge['initial'], native['initial']) + # Death effects use native real time. Compare physical/RNG state and + # call/ledger boundaries independently from those visual timestamps. + self.assertEqual([{k: v for k, v in c.items() if k != 'pixels'} for c in bridge['calls']], + [{k: v for k, v in c.items() if k != 'pixels'} for c in native['calls']]) + self.assertEqual(bridge['transitions'][-1], {'terminated': True, 'truncated': False}) + + def test_tempest_passive_frames_use_none(self): + result = self.assert_equivalent('tempestrun', ['LEFT', 'JUMP', 'RISE']) + self.assertEqual([c['action'] for c in result['calls']], ['None', 'LEFT', 'NONE', 'NONE', 'JUMP', 'NONE', 'NONE', 'RISE', 'NONE', 'NONE']) + self.assertEqual(result['final']['player']['lane'], -1) + + def test_native_engine_faults_remain_invalid_results(self): + for mode in ('construction-fault', 'step-fault'): + with self.subTest(mode=mode): + result = self.run_episode(mode, 'race', ['RIGHT']) + self.assertEqual(result['infra_error'], 1) + self.assertIsNone(result['primary_score']) + + def test_source_and_assets_fail_closed(self): + loader = module('_tested_source_loader', ROOT / 'game_first_exam/benchmarks/vmage/common/source_loader.py') + metadata = loader.manifest() + source = Path(os.environ.get('VMAGE_ROOT', '/opt/vmage')).resolve() + loader.verify_source(source, metadata) + with tempfile.TemporaryDirectory(prefix='vmage-source-test-') as td: + scratch = Path(td) + for relative in metadata['files']: + path = scratch / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.symlink_to(source / relative) + loader.verify_source(scratch, metadata) + representatives = ['game/race_game.py', 'config/level_config/racegame/level1.json'] + representatives.append(next(p for p in metadata['files'] if p.endswith('.png'))) + for relative in representatives: + with self.subTest(source=relative): + path = scratch / relative + path.unlink() + path.write_bytes(b'corrupt-native-payload') + with self.assertRaises(ValueError): + loader.verify_source(scratch, metadata) + path.unlink() + path.symlink_to(source / relative) + for field in ('upstream_commit', 'archive_sha256', 'source_manifest_sha256'): + altered = copy.deepcopy(metadata) + altered[field] = '0' * 64 + with self.subTest(provenance=field), self.assertRaises(ValueError): + loader.verify_source(source, altered) + + def test_strict_schemas_without_native_import(self): + sys.path.insert(0, str(RUNTIME)) + register_schemas() + from config_schema import validate_instance + self.assertNotIn('pygame', sys.modules) + for game in GAMES: + instance = json.loads((task_for(game) / 'tests/instance.json').read_text()) + validate_instance(instance) + faults = [dict(instance, unknown_native_option=True), dict(instance, seed=True), + dict(instance, seed=1), dict(instance, max_steps=100), + dict(instance, observation_profile='native-rgb-v1'), dict(instance, env_id='arbitrary-module')] + schema = sys.modules['_test_vmage_' + game + '_schema'] + for field, expected in schema.FROZEN_FIELDS.items(): + changed = copy.deepcopy(instance) + if type(expected) is str: + changed[field] = expected + '-changed' + elif type(expected) in (int, float): + changed[field] = expected + 1 + elif type(expected) is dict: + changed[field][next(iter(expected))] += '-changed' + elif type(expected) is list: + changed[field][0] = changed[field][0] + '-changed' if isinstance(changed[field][0], str) else changed[field][0] + 1 + else: + changed[field] = 'unfrozen-value' + faults.append(changed) + for changed in faults: + with self.subTest(game=game, fields=[k for k in changed if changed.get(k) != instance.get(k)]): + with self.assertRaises(ValueError): + validate_instance(changed) + self.assertNotIn('pygame', sys.modules, 'configuration validation must remain stdlib-only') + + +if __name__ == '__main__': + if len(sys.argv) > 1 and sys.argv[1] == '--worker': + worker(sys.argv[2], sys.argv[3], json.loads(sys.argv[4]), sys.argv[5]) + else: + unittest.main() diff --git a/scripts/game_preflight.py b/scripts/game_preflight.py index 687683b..4332740 100644 --- a/scripts/game_preflight.py +++ b/scripts/game_preflight.py @@ -10,13 +10,14 @@ import files_image import task_conventions as tc from config_schema import PROTOCOL, positive, validate_instance, validate_suite -from game_schemas import load_schema, register_schemas, schema_paths +from game_schemas import benchmark_registration, load_schema, register_schemas sys.path.insert(0, str(ROOT / 'game_first_exam/runtime/modes')) from mode_config import validate_mode def validate_task(row, task_path=None): load_schema(row['benchmark']) + sources = benchmark_registration(row['benchmark']) task = Path(task_path) if task_path is not None else tc.task_dir(row['name']) config = tomllib.loads((task / 'task.toml').read_text()) instance = json.loads((task / 'tests/instance.json').read_text()) @@ -44,10 +45,10 @@ def validate_task(row, task_path=None): 'tests/Dockerfile': {f'/tests/{name}.py': ROOT / f'game_first_exam/runtime/{name}.py' for name in ('grade', 'config_schema', 'reducers')}, } - paths['environment/sim/Dockerfile']['/srv/adapter.py'] = ROOT / f"game_first_exam/benchmarks/{row['benchmark']}/adapter.py" - paths['tests/Dockerfile']['/tests/metric_rules.py'] = ROOT / f"game_first_exam/benchmarks/{row['benchmark']}/metric_rules.py" + paths['environment/sim/Dockerfile']['/srv/adapter.py'] = sources['adapter'] + paths['tests/Dockerfile']['/tests/metric_rules.py'] = sources['metric_rules'] for file, prefix in [('environment/sim/Dockerfile', '/srv'), ('tests/Dockerfile', '/tests')]: - paths[file][prefix + '/instance_schema.py'] = schema_paths()[row['benchmark']] + paths[file][prefix + '/instance_schema.py'] = sources['schema'] if mode != 'standard': mode_config = validate_mode(json.loads((task / 'tests/mode.json').read_text())) if mode_config['mode'] != mode: @@ -64,14 +65,20 @@ def validate_task(row, task_path=None): paths.pop('environment/sim/Dockerfile') paths['environment/Dockerfile'] = { '/app/privileged.py': modes_root / 'privileged.py', - '/srv/adapter.py': ROOT / f"game_first_exam/benchmarks/{row['benchmark']}/adapter.py", - '/srv/instance_schema.py': schema_paths()[row['benchmark']], + '/srv/adapter.py': sources['adapter'], + '/srv/instance_schema.py': sources['schema'], } - paths['tests/Dockerfile']['/srv/adapter.py'] = ROOT / f"game_first_exam/benchmarks/{row['benchmark']}/adapter.py" + paths['tests/Dockerfile']['/srv/adapter.py'] = sources['adapter'] else: paths['environment/Dockerfile']['/app/realtime_client.py'] = modes_root / 'realtime_client.py' paths['environment/sim/Dockerfile']['/srv/realtime_server.py'] = modes_root / 'realtime_server.py' paths['environment/sim/Dockerfile']['/srv/mode_config.py'] = modes_root / 'mode_config.py' + for expected in paths.values(): + if '/srv/adapter.py' in expected: + for target, source in sources['runtime_files'].items(): + if target in expected: + raise ValueError(f'{task.name}: runtime binding conflicts with public service: {target}') + expected[target] = source for file, expected in paths.items(): copied, errors = files_image.copied_from(task / file) if errors or any(copied.get(target) != source for target, source in expected.items()): diff --git a/scripts/game_schemas.py b/scripts/game_schemas.py index 75d4f4b..93ef3f0 100644 --- a/scripts/game_schemas.py +++ b/scripts/game_schemas.py @@ -3,7 +3,7 @@ import importlib.util import tomllib from functools import cache -from pathlib import Path +from pathlib import Path, PurePosixPath from config_schema import register_instance_schema @@ -11,21 +11,62 @@ REGISTRY = ROOT / 'configs/game_benchmarks.toml' -def schema_paths(): +def _trusted_source(source): + if not isinstance(source, str): + raise ValueError('invalid trusted benchmark source') + relative = PurePosixPath(source) + if relative.is_absolute() or '..' in relative.parts or str(relative) != source: + raise ValueError('source outside trusted benchmark sources') + path = (ROOT / source).resolve() + if not path.is_relative_to(ROOT / 'game_first_exam/benchmarks'): + raise ValueError('source outside trusted benchmark sources') + return path + + +def registrations(): + """Read only the host registry; instances cannot nominate runtime code or source paths.""" registered = tomllib.loads(REGISTRY.read_text()) - if set(registered) != {'benchmarks'}: + if set(registered) != {'benchmarks'} or not isinstance(registered['benchmarks'], dict): raise ValueError('invalid trusted game registry') result = {} for name, row in registered['benchmarks'].items(): - if set(row) != {'schema'} or not isinstance(row['schema'], str): + if (not isinstance(row, dict) or 'schema' not in row + or set(row) - {'schema', 'adapter', 'metric_rules', 'runtime_files'}): raise ValueError('invalid game schema registration') - path = (ROOT / row['schema']).resolve() - if not path.is_relative_to(ROOT / 'game_first_exam/benchmarks') or path.name != 'instance_schema.py': + path = _trusted_source(row['schema']) + if path.name != 'instance_schema.py': raise ValueError('schema outside trusted benchmark sources') - result[name] = path + runtime = row.get('runtime_files', {}) + if not isinstance(runtime, dict): + raise ValueError('invalid trusted runtime files') + files = {} + for target, source in runtime.items(): + destination = PurePosixPath(target) + if (not destination.is_relative_to('/srv') or destination == PurePosixPath('/srv') + or '..' in destination.parts or str(destination) != target): + raise ValueError('runtime target outside trusted service directory') + files[target] = _trusted_source(source) + sources = {'schema': path} + for kind in ('adapter', 'metric_rules'): + source = _trusted_source(row.get(kind, f'game_first_exam/benchmarks/{name}/{kind}.py')) + if source.name != kind + '.py': + raise ValueError('invalid trusted benchmark ' + kind) + sources[kind] = source + result[name] = {**sources, 'runtime_files': files} return result +def schema_paths(): + return {name: row['schema'] for name, row in registrations().items()} + + +def benchmark_registration(name): + rows = registrations() + if name not in rows: + raise ValueError('unregistered benchmark: ' + str(name)) + return rows[name] + + @cache def load_schema(name): paths = schema_paths() diff --git a/scripts/task_conventions.py b/scripts/task_conventions.py index 36b7e5c..6d75e06 100644 --- a/scripts/task_conventions.py +++ b/scripts/task_conventions.py @@ -77,6 +77,7 @@ ("crafter-", "Crafter", "crafter"), ("textworld-", "TextWorld", "textworld"), ("minigrid-", "MiniGrid", "minigrid"), + ("vmage-", "V-MAGE", "vmage"), ] 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 @@ -218,6 +219,14 @@ "`/run/rcb-limits/usage.json` to plan around the agent deadline. The client's `time_left_s` counts from the " "first `observe()` or accepted action, whichever comes first. `spec()` does not start that clock." ) +CUTOFF_NOTE_OWN[("V-MAGE", "standard")] = ( + "The wall-clock budget starts with your session and includes service startup, model thinking, waiting " + "and tool execution. The game advances only when an accepted action is executed; waiting does not " + "advance game physics or pause the wall-clock budget. At the cutoff the live episode is sealed and " + "graded at its current native score. Use `deadline_utc` and `time_left_s` in " + "`/run/rcb-limits/usage.json` for the agent deadline. The client's `time_left_s` counts from the first " + "`observe()` or accepted action; `spec()` does not start that clock." +) CUTOFF_NOTE_START = "This is wall-clock time from the start of your session;" # how an earlier note is recognised WALL_CLOCK_ENV = "RCB_WALL_CLOCK_S" # the standard modes' sim service: what its /spec budget and time_left_s report CUTOFF_CAP = 14400 # PROTOCOL §2, no benchmark excepted (ci_checks/check-cutoffs.py) diff --git a/scripts/task_resources.toml b/scripts/task_resources.toml index f5e2106..395b15e 100644 --- a/scripts/task_resources.toml +++ b/scripts/task_resources.toml @@ -21,3 +21,17 @@ 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" + +# V-MAGE native games retain independent original scores and run on CPU. +[[cap]] +match = "^vmage-(race|flappybird|pong|supermario|tempestrun)-.*-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; full-budget resource measurement pending" + +# Tempest can accumulate many image-bearing deduplicated responses during a long live episode. +[[cap]] +match = "^vmage-tempestrun-.*-standard$" +main = { cpus = 1, memory_gb = 1, pids = 256, disk_gb = 2 } +sim = { cpus = 1, memory_gb = 2, pids = 128 } +measured = "Provisional response-cache allowance; full-budget resource measurement pending"