Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

22.7 KB
Raw Blame
# foosball: table football after the ITSF Standard Matchplay Rules (docs/framework_zh.md §4.2, §8). Migrated from the
# legacy tree in stage 2 (scripts/olympiad/foosball, scripts/olympiad/shared/foosball/sim). Revision v2 (2026-10-11):
# the rods have the top speeds of the KiRo table soccer robot, held by the servo on the rods themselves (D10, E10); the
# scripted team's policy foos_policy.py is unchanged. The legacy recordings belong to v1 and no longer replay (README,
# golden/convert.py). A player's command takes effect 2 control steps (20 ms) after it arrives (documented in [spec]
# action; no KiRo-matched reaction delay is added for the player; declared reaction delay D = 0, [timing]). Two tasks
# with the Season-1 names ([[tasks]] id): format `match` (seat A against the scripted team, levels 1-4) and format
# `duel` (seat A blue against seat B red).

[sport]
name = "foosball"
title = "Foosball"
summary = "table football on a physical table: you drive the four motorised rods of one team (goalkeeper rod with 3 figures, 2-rod 2, 5-rod 5, 3-rod 3) by slide and angle targets that the motors follow along a speed- and acceleration-limited path, and see the table only through an overhead camera; one game to 5 goals under the ITSF rules (opening sequence, possession time limits per rod, no spinning); in the `match` format the other team is a scripted computer team, in the `duel` format another player"
protocol = "realtime"
revision = "foosball-program-v2+core-0.2"   # plugin.REVISION; foos.REVISION = foosball-program-v2 (v1: legacy)
physics = "mujoco (CPU, 1 kHz rigid bodies: a rolling, bouncing ball and 2 x 4 rods driven by force- and torque-limited motors)"
image = "ghcr.io/mll-lab-nu/efe:embodied-olympics-match-0.1.0"
status = "sport"
publish = true
category = "robotics-sports-arena"

[rulebook]
name = "ITSF (International Table Soccer Federation) Rules of Table Soccer, Standard Matchplay Rules"
version = "Version 2.0 (December 2023)"
url = "https://s3.tablesoccer.org/organization/ITSF/rules/Standard_Matchplay_Rules_2024_en.pdf"

[[deviations]]
id = "D1"
rule = "3"
text = "one game to 5 points instead of a match of several games (the points and games targets are set by the event)"
affects_result = true
[[deviations]]
id = "D2"
rule = "3, 7.1"
text = "a safety cap of 240 s of play or 40 rallies (the rulebook has no time limit); then the player with more goals wins, at equal goals the scorer of the last goal, at 0:0 the player with the ball less time in its own half, and if that is equal the player who did not have the first kick-off (the last resort; no draws)"
affects_result = true
[[deviations]]
id = "D3"
rule = "4, 5.1"
text = "the initial flip is the run-time parameter FIRST_PLAYER (who has the first kick-off); the referee places the ball at rest beside the central figure of the restart rod (its side and a few millimetres along the rod from the seed) and play starts when the reviews are in, instead of the ready protocol"
affects_result = true
[[deviations]]
id = "D4"
rule = "5.2, 5.3"
text = "no delay-of-game rule; the restart rod's possession clock already runs during the opening sequence (it starts with the possession clock figure)"
affects_result = true
[[deviations]]
id = "D5"
rule = "6, 7.1.1.1, 7.1.2, 17, 18"
text = "fouls are always given as the possession award (5-rod or goalie rod), without the non-offending team's option to continue, warnings, penalty shots or time-outs; the pause between points is the review"
affects_result = true
[[deviations]]
id = "D6"
rule = "10, 15.2-15.3"
text = "the table is fixed and rigid (no jarring or reset); the rods have mechanical stops at +-2.8 rad, so a contact spin cannot occur (the referee still checks it)"
affects_result = false
[[deviations]]
id = "D7"
rule = "7.3"
text = "a transparent cover 4 cm above the playfield keeps the ball on the table, so illegal aerials and ball off table do not occur in normal play (the ball-off-table rule is implemented)"
affects_result = false
[[deviations]]
id = "D8"
rule = "2"
text = "the figures of the two teams do not collide with each other, only with the ball"
affects_result = false
[[deviations]]
id = "D9"
rule = "7.2, 11, 12"
text = "the passing and wall rules and playing the ball dead are not judged (they need a referee's judgement of a stopped, pinned or intentional ball); the dead-ball restart for a ball at rest that no rod can reach is judged"
affects_result = true
[[deviations]]
id = "D10"
rule = "- (embodiment, not from the rulebook)"
text = "the players are motorised rods after KiRo (University of Freiburg; T. Weigel, KiRo - a table soccer robot ready for the market, ICRA 2005), the table soccer robot that publishes the speeds of all its rods, on a table of KiRo's size (1.20 x 0.68 m): a rod slides at most 2.0 m/s and turns at most 52 rad/s (KiRo: up to 2 m/s, 3000 deg/s). The servo holds the rod itself within these speeds, also when it catches up with its path after the ball held it up, a safety net holds them against outside pushes too (D11), and no command can ask for more (speed <= 2.0, omega <= 52). KiRo's 2 m/s is an average rod speed, so capping the peak speed is stricter than KiRo. KiRo publishes no accelerations or motor forces: the path's 40 m/s^2 and 4000 rad/s^2 and the motors' 60 N and 5 N m are estimates. A full-speed kick sends the ball off faster than KiRo's shots (up to 3 m/s): 4.25 m/s on average in the upper-bound shot search, at most 5.4 m/s. Both teams, the scripted team too, have the same rods. A human player is not limited this way. Revision foosball-program-v2; v1 limited only the path (2.5 m/s, 80 rad/s) and the rods reached about 2.6 m/s and over 100 rad/s"
affects_result = true
[[deviations]]
id = "D11"
rule = "- (simulation, not from the rulebook)"
text = "a temporary safety net of the simulation, not physics: a ball jammed between a foot, a side wall's rounded fillet and the cover gets contact forces of 100-230 N in the simulator, far beyond the motors (60 N, 5 N m) and unrealistic for a 24 g ball, and these pushed rods past their top speeds (with the servo alone: in 18 of 101 measured games, for a few ms, up to 58.7 rad/s and 2.11 m/s). After every 1 ms physics step a rod faster than its top speed is put back to it (and its position to where the top speed takes it); every such rod-step is counted in final.json (rod_speed_governed_steps; measured: the reference against the four levels, none in 58 of 80 games, 1-9 in the others). Open issue: fix the jammed-ball contact at its source, then remove the net"
affects_result = true

[formats.match]                        # legacy foosball-match-wallclock-program-standard
seats = ["A"]
opponent = true                        # the scripted red team of foos.py (seat B inside the world), RCB_LEVEL 1-4
levels = [1, 2, 3, 4]
[formats.duel]                         # legacy foosball-duel-wallclock-program-standard
seats = ["A", "B"]
first = ["A", "B"]                     # FIRST_PLAYER: who has the first kick-off; play both orders

[modes]
action_levels = ["low"]                # one level: the rod targets
plays = ["program"]

[timing]
start_timeout_s = 1800                 # 30 minutes (duel: after the first seat started; match: from the service start)
ready_timeout_s = 300                  # each review (legacy duel: 300 s; the legacy single had no limit)
slowdown = 20                          # RCB_SLOWDOWN default (legacy SLOWDOWN default 20; official 1-20 match, 10-20 duel)
reaction_delay_steps = 0               # declared reaction delay D (core 0.2.18), measured 2026-10-13: the reference program
                                       # through the service at x20 answers in the step it saw (1232 of 1232 acts, about
                                       # 50 ms of a 200 ms step), median latency 0 steps. foos.LATENCY_STEPS = 2 counts from
                                       # the effect step: the rods follow 2 steps (20 ms) after the state the act answers

[observation]
fields = ["rally", "t_play", "t_rally", "play_time_left_s", "awaiting_review", "game_over", "score", "fouls",
          "restart", "rods", "last_rally", "rallies"]
renderer = "mujoco"
frame_budget_ms = 250                  # one 384 x 240 overhead tile (CPU, osmesa)
columns = 1

[spec]                                 # the rules (also /spec); the limits, the camera and the geometry come from foos.py
real_time = "this sport is real time (where the generic text above says otherwise, this line holds): `game wait DT` (POST /wait {\"dt\": DT}, 0 < DT <= 1) lets the world run DT game seconds; `game ready \"WHY\" \"PLAN\"` is due only after each rally, not after each action; acts are never out of turn, one in flight per seat (it may address several rods)"
action = "game act '{\"type\": \"rods\", \"rods\": {\"midfield\": {\"slide\": 0.03, \"angle\": 1.1, \"omega\": 40}, \"goalie\": {\"slide\": -0.05}}}' (POST /act with that body; \"type\" may be left out): new targets for any of your rods goalie, defence (2-rod), midfield (5-rod) and attack (3-rod); rods you do not name keep their targets. slide (m) moves the rod along your local v (0 = centre; within +-0.11 goalie, +-0.19 defence, +-0.06 midfield, +-0.11 attack); angle (rad) turns it (0 = figures hanging straight down, + = feet swing towards the opponent's goal, up to +-2.6; 1.5 is about level, so a ball passes underneath); optional omega (rad/s, at most 52) and speed (m/s, at most 2.0) cap the rod's angular and sliding speed for this target. Each rod follows a smooth path to the target (sliding at most 2.0 m/s and 40 m/s^2, turning at most 52 rad/s and 4000 rad/s^2) with limited force (60 N) and torque (5 N m); the rod itself never moves faster than 2.0 m/s or 52 rad/s (the top speeds of the KiRo table soccer robot), not even when the ball pushes it: a rod the ball held up catches up with its path at these speeds at most; an action takes effect 2 control steps (20 ms of game time) after it arrives: it reaches the motors 2 control steps after the control step that takes it (the reply's took_effect: taken_step, effect_step = taken_step + 2), and holds until replaced; the rods cannot make a full turn (stops at +-2.8 rad). Out of range: HTTP 400"
format = "first to 5 goals wins; every goal, possession-time foul, incomplete opening sequence, illegal spin, dead ball or ball off table ends a rally: the world freezes for the reviews, every rod returns to slide 0, angle 0, and the next rally starts with the restart; the game also ends after 240 s of play (frozen time does not count) or 40 rallies"
kickoff = "a rally starts with the ball at rest beside the central figure of the restart rod. The first kick-off is match.first_kickoff's (game spec); after a goal the team that conceded kicks off. Before the ball may leave the restart rod (the 5-rod, or the goalkeeper rod and 2-rod together), the restarting team must complete the opening sequence: a move by one figure, a contact by another figure, then a contact by any figure other than that second one (restart.opening_complete in the state). If the ball leaves first, the opponent gets the ball on its 5-rod (incomplete_opening). The world is not frozen during the opening"
goal = "the ball wholly over the goal line scores 1 point for the other team, whoever touched it last"
possession = "while the ball is within reach of a rod (a figure of it can touch the ball: within 0.077 m of the rod along u), that rod's possession clock runs; it restarts when the ball leaves the rod's reach. The goalkeeper rod and 2-rod count as one (the goalie rod). Limits: goalie rod 15 s, 5-rod 10 s, 3-rod 15 s. Over the limit is a foul: after the goalie rod or the 5-rod the opponent gets the ball on its 5-rod, after the 3-rod on its goalie rod. A foul gives no point"
spinning = "a transition (the ball leaving a rod's reach) after the rod turned more than 360 degrees before or after its contact is a foul (the opponent gets the ball on its 5-rod; a goal scored that way does not count); the rods' stops make a full turn impossible"
dead_ball = "a ball at rest for 1 s that no rod can reach is put back into play: between the two 5-rods by a kick-off (by the team that conceded the last goal, else the first kick-off's team), behind a 5-rod by the goalie rod of that half"
ball_off_table = "it goes to the goalie rod of the team that did not touch it last (a transparent cover 4 cm above the playfield normally keeps the ball on the table)"
match_format = "match: you are seat A (blue) against a scripted computer team (seat B, red) of level RCB_LEVEL 1-4 (match.opponent_level in game spec): it plays the same player policy as the reference player on the true ball position a reaction delay ago and never reads your commands; level 1 reacts after 140 ms (extrapolating the ball's motion over that time), slides at 0.6 m/s and kicks at 25 rad/s, shooting from every rod; level 2 after 110 ms (half the extrapolation), 1 m/s, 35 rad/s; level 3 after 90 ms, 1.6 m/s, 45 rad/s, aims past your figures, passes, lifts its rods out of its shots and splits the goal between goalkeeper and 2-rod; level 4 the same after 80 ms (the KiRo robot's reaction time; no level reacts faster) at the top speeds (2.0 m/s, 52 rad/s). Its rods are yours (the same top speeds). Success = winning the game"
duel_format = "duel: seat A (blue, defending the goal at world x = -0.60) against seat B (red, defending x = +0.60), identical rods and motors; FIRST_PLAYER has the first kick-off"
observation = "the state: your own rods (slide, angle, their velocities and the command at the motors), the score, fouls, the time of play and of the rally, the play time left, the referee's restart (which team and rod puts the ball into play, whether its opening sequence is complete) and the rallies that ended (last_rally, rallies: how, who scored or fouled, the restart); no ball or opponent coordinates and no seed. The image: one 384 x 240 RGB tile from the fixed overhead camera straight above the table centre at 1.45 m (32 degree vertical field of view; game spec camera / cameras), turned so that your own goal is on the left and the image's right and up are your local +u and +v. The ball is orange, seat A's figures blue, seat B's red, the rods grey; figures and rods can hide the ball"
world = "metres, seconds. World frame: x along the table (seat A's goal at x = -0.60, seat B's at x = +0.60), y across, z up, playfield z = 0 with its centre at (0, 0). Your local frame (the image, your rods, game spec geometry): u towards the opponent's goal, v to the left when you look along u (seat A: u = x, v = y; seat B: u = -x, v = -y)"
table = "playfield 1.20 x 0.68 m between side walls with rounded fillets (radius 0.02 m), goal mouths 0.20 m wide; ball radius 0.0175 m, 24 g, it rolls with little resistance (about 0.1 m/s^2), bounces off the walls and is stopped by a figure it runs into; a kick sends it off at about the foot's speed, at an angle when the foot hits it off centre. Rods 0.09 m above the playfield at u = -0.525 (your goalkeeper rod), -0.375 (2-rod), -0.075 (5-rod), 0.225 (3-rod), the opponent's at the negated u; figures at slide 0 (v): goalkeeper and 3-rod -0.20, 0, 0.20; 2-rod -0.12, 0.12; 5-rod -0.24, -0.12, 0, 0.12, 0.24; a foot is a capsule along u (radius 0.012 m, half length 0.014 m) 0.075 m below the rod. Physics 1000 Hz, control 100 Hz (10 ms steps)"

[tiebreaks]
order = ["goals", "last_goal", "territory", "first_kickoff"]
text = "the first player to score 5 goals wins; at the cap (240 s of play or 40 rallies) the player with more goals wins; at equal goals the player who scored the last goal; if nobody has scored, the player with the ball less time in its own half; last resort (not from the rulebook): the player who did not have the first kick-off"
last_resort_in_prompt = true

[score]                               # the continuous score (core/score.py; grade.py also reports it as goal_share)
# Decided 2026-10-12: goals for / (goals for + goals against), 0.5 at 0:0. A side that forfeits (no-show, review
# timeout, abandoned session) gets 0: a forfeit must not earn the 0:0 value 0.5 (a player that never starts or walks
# away would otherwise score as much as one that held a level game, and better than one that played and lost 4:5).
# grade.py's goal_share also gives the forfeiting side's opponent 1 (core's field keeps that side's own share).
name = "goal_share"
text = "the share of the game's goals the side scored, goals for / (goals for + goals against), 0.5 when nobody scored"
from = "share"
forfeit = 0.0
range = [0, 1]

[[exploits]]
id = "E1"
text = "holding the ball still on a rod is a possession-time foul, never a point: the opponent gets the ball"
test = "test_exploit_holding_the_ball_is_a_foul_not_a_point"
[[exploits]]
id = "E2"
text = "rocking the ball across the band two rods reach does not restart their possession clocks"
test = "test_exploit_rocking_across_a_rod_border_does_not_reset_the_clock"
[[exploits]]
id = "E3"
text = "a ball parked in the own corner behind the goalkeeper stays within reach: its clock runs out"
test = "test_exploit_parking_the_ball_in_a_corner_is_a_foul"
[[exploits]]
id = "E4"
text = "every rally ends: with nobody playing, the ball is reachable and a clock runs out (or it is dead and restarted)"
test = "test_exploit_ball_cannot_get_stuck"
[[exploits]]
id = "E5"
text = "doing nothing loses to the scripted team (format match), and a team that only blocks loses to one that plays"
test = "test_exploit_passive_play_loses"
[[exploits]]
id = "E6"
text = "an out-of-range or malformed command is refused (HTTP 400) and changes nothing; a command while the world is frozen does nothing"
test = "test_exploit_bad_and_frozen_actions_are_refused"
[[exploits]]
id = "E7"
text = "the observation and /spec hold no ball or opponent coordinate and no seed"
test = "test_exploit_world_state_hidden"
[[exploits]]
id = "E8"
text = "a seat that does not review in time loses the duel (ready_timeout)"
test = "test_exploit_review_stalling_forfeits"
[[exploits]]
id = "E9"
text = "no draws: a finished game always has a winner through the tiebreak chain; spinning a rod gains nothing"
test = "test_exploit_no_draw_and_no_spinning"
[[exploits]]
id = "E10"
text = "no command makes a rod move faster than the top speeds (2.0 m/s, 52 rad/s; D10), measured on the joints every physics step: full-travel and full-range moves from rest and reversed at full speed, a path faster than the top speed, a rod held still while its path runs on and then released (it catches up at the top speed at most, not with a burst), and open play of both teams"
test = "test_exploit_rod_speed_limits_hold"

[players]
reference = "reference"
reference_class = "builtin_players:Reference"
check = ["random"]

[reference]                            # tools/check stage 5: the opponent calibration and the camera-only evidence
match = "refcheck:reference_match"     # truth: the shared policy on the true ball (30 ms ago, every 50 ms); camera:
                                       # the [players] reference (the gate evidence: 100 matches per level, 100 / 87 /
                                       # 21 / 10 won, docs/screening/foosball.md section 6)
seeds = 20                             # seeds 1-20 per official level, first kick-off alternating (odd A, even B)
camera_seeds = 5                       # seeds 1-5 at level 1

[fairness]
# The reference in both seats (style team, the same deterministic program): the seats are point-symmetric through the
# table centre; the seed places the ball at every restart. Realtime: a wide interval only warns. Official evidence
# (revision v2 with the fixed Tracker, 2026-10-12, a CPU cluster; accepted by Chi Gui as the fairness evidence): seeds 1-200 x
# first kick-off A/B, N = 400: first kick-off 208/400, +2.0 pp [-2.9, +6.9]; seat A 182/400, -4.5 pp [-9.4, +0.4]: no
# significant bias found (neither interval lies outside +-5 pp; neither proves the bias is within +-5 pp). Measured
# with the 20 ms command latency of the contract. A duel takes about 240-300 CPU s in process, so the 400
# matches (about 34 CPU hours) do not fit tools/check's stage 4 (stage_timeout_s): they ran as sharded jobs
# (docs/screening/foosball.md section 6); `tools/check foosball --quick` plays 20 per order (a WARN).
policy = "reference"
matches_per_order = 200                # N = 400, the official evidence above
max_advantage_pp = 5
mirror = "statistical"                 # MuJoCo's contact order is not exactly mirror-symmetric

[official]                             # the legacy official configurations (grade.py: official_config); all four levels
                                       # pass the screening gates (docs/screening/foosball.md section 6)
seeds = [1, 2, 3, 101, 111, 121, 202, 212, 222, 303, 313, 323, 404, 414, 424]   # duel 1-3; match L1 101.., L2 202.., ...
levels = [1, 2, 3, 4]
first_any = true

[official.hidden_seeds]                 # registered hidden seed set (tools/seeds.py; public commitments: seed_commitments.json)
sha256 = "f597d655405c697becbf50bbadbaadde54c08bbe8dc295ef7fb59906967b55c1"
counts = { "duel" = 20, "match/L1" = 20, "match/L2" = 20, "match/L3" = 20, "match/L4" = 20 }

[golden]
episodes = "golden"                    # converted legacy records + the golden-data store via golden/convert.py

[[tasks]]
id = "foosball-match-wallclock-program-standard"   # the Season-1 task name
format = "match"
action_level = "low"
[[tasks]]
id = "foosball-duel-wallclock-program-standard"    # the Season-1 task name
format = "duel"
action_level = "low"

[broadcast]                            # spectators: foos.scene_xml's camera "broadcast" (pos 0 -1.25 1.15, xyaxes 1 0 0 0 .68 .73)
camera = { name = "broadcast", pos = [0.0, -1.25, 1.15], lookat = [0.0, -0.0154, 0.0], up = [0.0, 0.6816, 0.7317], fovy_deg = 45, width = 640, height = 360 }

[capabilities]                         # docs/capabilities_zh.md: 2 primary, 1 secondary, 0 none
a1 = 2                                 # the ball and the opposing figures only from the overhead image (calibration)
a2 = 2                                 # rolling, bounces, kicks off the feet, the motors' limited paths
a3 = 2                                 # timing a kick with four rods under a 20 ms command latency
a4 = 1                                 # real time matters (more command latency loses: reference wins at L2 49/60, 15/40, 6/40 at 20, 60, 100 ms), but compensating it earns nothing measurable (paired, 40-60 seeds per latency; screening 2026-10-12); live play adds the program's own compute latency, not covered
b1 = 1                                 # opening sequence, possession time limits, restarts
b2 = 0                                 # not declared for now: the reference cannot aim precisely enough to exploit an opponent's gap; retest when an angle-precise reference exists (screening 2026-10-12)
b3 = 0
physics = ["collision", "friction_rolling"]

[check]                               # tools/check time limits (x20 matches are long)
stage_timeout_s = 10800               # in-image stages (fairness: a duel takes ~110 s in process)
live_player_timeout_s = 6000          # offline live run: an x20 match against the scripted team takes ~4200 s