latent_sokoban.agent¶
latent_sokoban.agent
¶
Agent interface for the evaluation harness.
An agent sees ONLY what the competition rules allow: the current board image, the goal board image, and its own action history. The harness never passes symbolic state.
Entrants implement Agent in their own repos and point evaluate.py at it with --agent path.to.module:ClassName. The class is constructed with no arguments (load your checkpoint in init or reset()).
Dynamics-call budget¶
Planning is budgeted in counted learned-dynamics calls, not wall-clock rollouts. One unit = one predicted transition of one candidate state, so a batched forward pass over B candidates rolled H steps costs B * H units. Your planner MUST tick the meter the harness attaches to self.call_meter every time your dynamics model runs:
class MyAgent(Agent):
def act(self, obs, goal, action_history):
...
z_next = self.dynamics(z, a) # z has batch size B
self.call_meter.tick(z.shape[0]) # count it
...
The harness checks the meter after every act(): exceeding the per-action cap fails the episode (strict mode, the default). Correct metering is verified by source review at submission. An unmetered or under-metered dynamics call is a rules violation. Encoder and goal-scoring passes are free; only latent transition predictions count.
CallMeter
¶
Agent
¶
Base class. Subclass and override act().
Source code in latent_sokoban/agent.py
RandomAgent
¶
Bases: Agent
Uniform-random policy. The floor of the leaderboard.
Makes zero dynamics calls, so it never violates the call budget.