File size: 5,239 Bytes
7285553
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
language:
- en
- ru
license: apache-2.0
task_categories:
- text-generation
tags:
- physics
- simulation
- 2d-physics
- rigid-body
- pymunk
- synthetic
- scene-generation
size_categories:
- 1M<n<10M
---

# Physics Generalization Dataset

**1,000,020 diverse 2D rigid body physics simulation scenes** for training and evaluating LLMs on physics prediction tasks.

## Overview

This dataset contains procedurally generated physics simulations across **30 distinct scenario types** organized in 6 categories. Unlike typical physics datasets that only feature random objects falling in a box, this dataset covers a wide range of physical phenomena: collisions, stacking, ramps, pendulums, constraints, and mini-game-inspired physics.

Each scene is a 200-frame simulation at 1/60s timestep using the Pymunk (Chipmunk2D) physics engine, exported in JSONL format with rich metadata.

## Dataset Structure

### Splits

| Split | Scenes | Scenario Types | Purpose |
|-------|--------|----------------|---------|
| **train** | 900,000 | 24 (seen only) | Training |
| **val** | 100,020 | 30 (seen + unseen) | Evaluation |

### Unseen Scenarios (held out from training)

6 scenario types appear **only in val**, enabling out-of-distribution generalization evaluation:

| Difficulty | Scenario | Description |
|-----------|----------|-------------|
| Simple | `pong` | Ball bouncing between two paddles (zero gravity) |
| Simple | `bowling` | Heavy ball rolling toward arranged pins |
| Simple | `ramp_roll` | Objects rolling down an inclined plane |
| Complex | `angry_birds` | Projectile launched at multi-layer block structure |
| Complex | `hourglass` | Objects falling through narrow gap between chambers |
| Complex | `newtons_cradle` | Balls suspended by pin joints, momentum transfer |

### Seen Scenarios (in both train and val)

24 scenario types with 37,500 samples each in train:

**Collision & Ballistics:** `billiards`, `breakout`, `explosion`, `head_on`, `projectile`

**Stacking & Structural:** `bridge`, `dominos`, `jenga`, `pyramid`, `tower`

**Ramps & Terrain:** `funnel`, `marble_run`, `plinko`, `ski_jump` (+ unseen `ramp_roll`)

**Pendulums & Constraints:** `chain`, `pendulum`, `seesaw`, `wrecking_ball` (+ unseen `newtons_cradle`)

**Mini-game Physics:** `basketball`, `pinball` (+ unseen `angry_birds`, `bowling`, `pong`)

**Complex & Chaotic:** `avalanche`, `conveyor`, `orbit`, `wind` (+ unseen `hourglass`)

## Data Format

Each scene is a JSONL file (1 header line + 200 frame lines).

### Header (line 1)
```json
{
  "type": "scene_header",
  "seed": 1315353,
  "scenario_type": "explosion",
  "scenario_category": "collision",
  "difficulty": 4,
  "description": "Explosion: 25 objects flying outward from center.",
  "object_count": 25,
  "gravity": {"x": 0.0, "y": -981.0},
  "timestep": 0.016666666666666666,
  "static_geometry": [...],
  "constraints": [...],
  "objects": [
    {
      "id": 0, "type": "circle",
      "position": {"x": 401.23, "y": 302.45},
      "material": {"mass": 2.5, "friction": 0.6, "elasticity": 0.7},
      "radius": 15.3
    }
  ]
}
```

### Frame (lines 2-201)
```json
{
  "frame": 1,
  "description": "Frame 1: All objects are in motion.",
  "objects": [
    {
      "id": 0, "type": "circle",
      "position": {"x": 415.67, "y": 318.90},
      "velocity": {"x": 280.5, "y": 320.1},
      "angle": 0.052,
      "angular_velocity": 0.003,
      "material": {"mass": 2.5, "friction": 0.6, "elasticity": 0.7}
    }
  ]
}
```

## Key Features

- **30 scenario types** with qualitatively different physics (not just parameter variation)
- **Difficulty scaling** (1-5) per scenario: controls object count, velocity, structural complexity
- **Deterministic** generation via seed-based RNG
- **Constraints/Joints**: PinJoint, PivotJoint for pendulums, seesaws, chains, Newton's cradle
- **Custom static geometry**: ramps, funnels, peg grids, bumpers, hourglass chambers, basketball hoops
- **Rich text descriptions** for each scene (useful as LLM context)
- **Zero gravity** scenarios: billiards, pong, orbit
- **Initial velocities**: projectiles, explosions, head-on collisions (not just "objects at rest")
- **Clean train/unseen split** for generalization evaluation

## Physics Engine

- **Pymunk** (Python wrapper for Chipmunk2D)
- Scene: 800×600 pixels
- Fixed timestep: 1/60s
- Elasticity always < 1.0 (energy conservation, no Pymunk instability)
- Threading disabled (determinism)

## Generation

Generated using 22 CPU cores in ~29 minutes at ~578 scenes/sec.

```bash
python scripts/generate_scenarios_dataset.py --split all --workers 22
```

## File Organization

```
data_scenarios/
├── manifest.json          # Split config, seen/unseen lists
├── train/
│   ├── avalanche/         # 37,500 scenes
│   ├── basketball/
│   ├── ...                # 24 scenario type directories
│   └── wrecking_ball/
└── val/
    ├── angry_birds/       # 3,334 scenes (UNSEEN)
    ├── avalanche/
    ├── bowling/           # 3,334 scenes (UNSEEN)
    ├── ...                # 30 scenario type directories
    └── wind/
```

## Citation

Part of a research project on training LLMs to predict 2D rigid body physics.