Skip to content
PHYRE is a benchmark for physical reasoning.
Python C++ JavaScript CMake Thrift CSS Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Initial commit Aug 15, 2019
examples Open the colab link in a new window Aug 21, 2019
imgs Initial commit Aug 15, 2019
src yapf src/python (#6) Aug 29, 2019
third-party Initial commit Aug 15, 2019
.gitmodules Initial commit Aug 15, 2019
CMakeLists.txt Initial commit Aug 15, 2019 yapf src/python (#6) Aug 29, 2019
Dockerfile Initial commit Aug 15, 2019 Updates to python package (#3) Aug 19, 2019
LICENSE Initial commit Aug 15, 2019
Makefile Initial commit Aug 15, 2019
env.yml Initial commit Aug 15, 2019
requirements.agents.txt Initial commit Aug 15, 2019

GitHub license CircleCI

PHYRE is a benchmark for physical reasoning.

It provides a set of physics puzzles in a simulated 2D world. Each puzzle has a goal state (e.g., make the green ball touch the blue wall) and an initial state in which the goal is not satisfied (see the figure below). A puzzle can be solved by placing one or more new bodies in the environment such that when the physical simulation is run the goal is satisfied. An agent playing this game must solve previously unseen puzzles in as few attempts as possible.


You can explore the tasks and try to solve them using the demo and jump straight into jupyter notebook.

Getting started


The simplest way to install PHYRE is via pip. As PHYRE requires Python version 3.6, we recommend installing PHYRE inside a virtual environment, e.g. using Conda.

We provide PHYRE as a pip package for both Linux and Mac OS.

conda create -n phyre python=3.6 && conda activate phyre
pip install phyre

To check that the installation was successful, run python -m phyre.server and open http://localhost:30303. That should start a local demo server.

For instructions on building PHYRE from source and installing in a Docker container, see INSTALLATION.


We provide jupyter notebooks that show how to use PHYRE API (open in Colab) to run simulations and evaluate a random agent and how to use simulation cache (open in Colab) to train agents faster.

Training an agent

We provide a set of baseline agents that are described in the paper. In order to run them, you need to install additional python dependencies with pip install -r requirements.agents.txt.

All the agents are located in agents/ folder. The entry point is that will train an agent on specified eval setup with a specified fold. E.g., the following command will train a memoization agent:

python agents/ \
    --output-dir=results/ball_cross_template/0 \
    --eval-setup-name=ball_cross_template \
    --fold-id=0 \
    --mem-rerank-size 100 \

File contains groups of experiments, e.g, sweeping over number of update for DQN-O or training agents on all seeds and eval setups. And starts experiments to train all baseline algorithms in the paper.


PHYRE is released under the Apache license. See LICENSE for additional details.


If you use PHYRE in your experiments, please cite it:

    title={PHYRE: A New Benchmark for Physical Reasoning},
    author={Anton Bakhtin and Laurens van der Maaten and Justin Johnson and Laura Gustafson and Ross Girshick},
You can’t perform that action at this time.