Skip to content

Add Gymnasium 2048 adapter and validation tests - #10

Open
lyzk907-dev wants to merge 1 commit into
LAMDA-NeSy:mainfrom
lyzk907-dev:game2048
Open

lyzk907-dev wants to merge 1 commit into
LAMDA-NeSy:mainfrom
lyzk907-dev:game2048

Conversation

@lyzk907-dev

Copy link
Copy Markdown

Summary

  • add a pinned gymnasium-2048==0.1.2 adapter with source and wheel provenance
  • expose only the upstream RGB rendering of the 4x4 board and native cumulative score through PNG transport
  • preserve all four native actions, native merge rewards and native no-legal-move termination
  • add a trusted instance schema, relational metric validation, dependency lock, files-only metadata and native/contract tests

This is an adapter-only integration. It intentionally does not add frozen tasks, a suite, benchmark registration,
solutions, trajectories, or changes to shared runtime interfaces.

It also leaves .github/workflows/games.yml and game_first_exam/tests/run.sh unchanged. The maintainers can add the
shared CI/test-dispatch entries once the concurrent benchmark PRs have settled, avoiding conflicts between independent
integrations.

Isolation review

  • the public observation contains only image_png_base64
  • the upstream one-hot observation and info object are never forwarded because info["board"] contains the exact board
  • board exponents, RNG state, move legality, counters, fingerprints and metrics remain inside the trusted simulator
  • observe(), spec(), metrics() and frame() are read-only and use a cached render
  • the adapter does not access the network, read environment variables or files, invoke subprocesses, or dynamically evaluate code

Full main/simulator/verifier mount and network isolation is deferred to a future frozen-task PR.

Validation

  • adapter/service contract and public-isolation tests: 9 passed
  • native-equivalence tests against the actual upstream 0.1.2 engine: 3 passed
  • common configuration tests: 13 passed
  • layout tests: 3 passed
  • public HTTP isolation tests: 7 passed
  • files-only source hashes and reproducible OCI digest passed
  • secret scan passed
  • Python 3.12 Linux wheel dependency resolution passed
  • the PyPI wheel source matches upstream tag v0.1.2 at commit b686d2a82a347066ffa8a82f6f4f57ac44deb5dc

Local Docker was unavailable, so the exact pinned Linux/Python 3.12 image has not been built locally. The native behavior
test used the real upstream package on Windows/Python 3.13; only the target NumPy version metadata and a known Pygame
system-font lookup failure were shimmed locally. Game state, RNG, observations, actions, rewards, termination and rendered
frames were still compared step by step.

After shared test dispatch is integrated, the intended commands are:

python game_first_exam/tests/test_game2048_native.py
python game_first_exam/tests/test_game2048_contract.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant