Skip to main content

Current reference distribution

CartPole-v1

Balance an upright pole by moving its cart left or right. This is the smallest complete reference for the public Benchmark authoring surface.

01

Policy-visible contract

Policy.act() receives one ordered list containing exactly four finite floats and returns one exact integer Action.

IndexComponentMeaningBound
0cart_positionHorizontal cart position[-4.8, 4.8]
1cart_velocityHorizontal cart velocityunbounded
2pole_anglePole angle in radians≈ [-0.418, 0.418]
3pole_angular_velocityPole angular velocityunbounded
0Push left
1Push right
Strict Action handling

Invalid Actions are never clipped, repaired, converted, or replaced.

02

Episode lifecycle

  1. Derive the split-scoped Environment seed.
  2. Create a fresh Environment and Policy process.
  3. Allow state only across act() calls in this Episode.
  4. Stop on termination, 500 steps, or Policy failure.
03

Reward and score

Every valid Environment step contributes +1. The Benchmark score is the arithmetic mean of Episode contributions; a Policy failure contributes 0.

04

Install and evaluate

uv sync --project environments/gymnasium/classic_control/cartpole --extra dev
uv build environments/gymnasium/classic_control/cartpole