Skip to content

tetris-bench@2

Rules and contract

The harness supplies a Tetris state and each legal placement’s one-step outcome. Typed probabilities come out. The engine chooses the highest-probability legal placement and hard-drops the piece.

Rules

The board is 10 × 20. Pieces use SRS rotation kicks, a seeded 7-bag, hold and five-piece preview. Scoring includes line clears, T-spins, combos, back-to-back clears and hard-drop distance. There is no multiplayer garbage.

The engine is deterministic for a ruleset, seed and action sequence. Blitz also depends on measured response times. Official games stop at top-out, 500 locked pieces or 10,000 ticks. A behaviour change requires a new ruleset version.

Placements are legal (x, rotation) pairs reachable from the current height. There is no per-step movement interface. The engine asks again each tick.

Two modes

IQ

Gravity pauses while the brain answers. A 10-second call timeout keeps failed adapters from hanging the runner. Three consecutive unusable decisions end the game as an adapter failure. Empty, invalid, stale and timed-out decisions count toward this limit.

Blitz

The soft deadline is the smaller of 100 ms and the time until the next gravity step. A missed deadline rolls over with no input. Gravity continues. Answers for an old state hash are discarded. This is a systems stress test. It does not affect CR or establish model intelligence.

Agent contract

The input includes the grid, active piece, hold, next five pieces, level, score, lines, pieces, combo, back-to-back status, canHold, mode, tick and state hash. Every adapter receives the same candidate after-clear grids, score deltas, line deltas and top-out flags. Duplicate physical outcomes are deduplicated. Local adapters have no private simulation context. Return JSON only.

type Answer = {
  stateHash: string;
  choice: Array<{
    x: number;
    rotation: 0 | 1 | 2 | 3;
    p: number;
  }>;
  noul?: { hold: number };
  score?: { risk: number };
  costUsd?: number;
};

Choice. A probability distribution over legal placements. Probabilities must be finite, in [0, 1], and sum to one. The highest probability wins. Ties resolve by x, then rotation.

Noul. An optional hold probability. Above 0.5, hold takes precedence over placement.

Score. An optional probability of top-out within the next ten locked pieces. Calibration uses mean squared error (Brier score). This is optional, policy-dependent forecasting, not classifier accuracy. Forecasts without a resolved outcome at the game cap are omitted.

Duplicate placements, illegal positions, malformed probabilities and empty choices are rejected, including with a hold request. Free-form chat is never an action.

CR

CR uses IQ game scores only. A higher score earns one pairwise point, and a tie earns half. Blitz results stay separate. One game per brain, seed and mode is reused against opponents because boards do not interact.

Ratings use a penalised Bradley-Terry fit on an Elo scale centred at 1500. Gaussian log-strength precision is 0.25. Each pair is weighted by 1 / (field size − 1). This fit does not depend on pairing order. CR remains relative to the field and protocol.

The official suite has 30 public seeds, seed-01 through seed-30, run serially with a fixed 500-piece cap. Quick runs use three seeds and are provisional. Public seeds support reproducibility. They are not a held-out test or evidence of general intelligence.

95% intervals use 200 paired seed bootstrap samples. A resampled seed retains every brain's game, preserving the dependence between pairwise comparisons. Three seeds cannot support a claim of significance. The intervals do not capture provider variation, prompt selection or adaptation to public seeds.

Latency percentiles include completed calls only, exclude input preparation, and exclude censored timeouts. Completion, timeout, invalid-answer and deadline-miss counts are reported separately for each mode. Mean cost is unknown when any request cost is missing. Aborted remote requests may still be billed.

Add a brain

Fork the public repository ↗ and open a PR with a thin adapter. Implement the Brain interface, register the adapter, and test its output against the shared validator. Keep credentials in environment variables.

node --test scripts/tetris-bench/*.test.ts
node scripts/tetris-bench/run.ts --official
# With server-side provider credentials configured:
node scripts/tetris-bench/run.ts --official --remote

The official runner is a CLI or server job. It writes an index and JSON recordings under public/tetris-bench. The website reads those recordings. A browser replay never changes the official rating.

Include the model identifier, adapter settings and any provider assumptions in the PR. The same harness, seeds, caps and ruleset apply to every entrant.