Skip to content

Task ports and simulation timing

The active Python interface couples a reservoir to a declared task through input and effector arrays. This closes the observation/action loop without a generic body component system. A port’s width and timing are part of the task contract.

Inspect the declared interface

from brainlesslab import TaskSpec
from brainlesslab.tasks import definition
for kind in ("tracking", "pong", "cartpole_plank_easy", "delayed_cue"):
info = definition(TaskSpec(kind))
print(kind, info.n_inputs, info.n_effectors, info.neural_frames)

Expect input widths 62, 46, 8 and 3 respectively under default options. Each task has two effectors. CartPole executes 24 neural frames per world tick; the other three use one. Changing Tracking’s sensor offsets changes its input width.

Validate an assembled composition before execution:

Terminal window
uv run brainlesslab check python/plans/delayed-cue.toml

The resolved widths must match model construction. Input weights connect receptor channels to nodes; output masks select the emitted activity contributing to each effector. Readouts are fixed construction values, rather than fitted task classifiers.

Follow one world tick

The world supplies observations for the current tick. The task encodes them into receptor values. For each neural frame, the runner applies declared input gain or interventions, advances the reservoir, and accumulates effectors. The task then applies one world action and updates its state.

CartPole’s encoder distributes four state variables across sign-specific spike channels over 24 frames. It sums effector votes across those frames and applies one force. An equality in the total votes chooses left. Advancing physics once per neural frame would implement a different task.

Binary probes accumulate effectors only inside their response windows. Their go channel marks that window. Pre-response output does not count toward the decision, and equal response evidence chooses left.

A numerical failure disables subsequent work for that trajectory. An inactive batch slot does not advance neural or world state. These execution guards must not turn an unfinished episode into a completed score.

Keep observation and diagnostic truth separate

Reference policies receive only their declared observations. Offline labels, cue identities, hidden mappings and response schedules are retained for scoring and analysis; they are not online inputs. Visible reversal feedback reports a chosen action and its correctness, which differs from revealing the hidden mapping.

Physical snapshots and replay frames expose diagnostic world state after execution. The website displays generated development recordings; it does not execute another implementation of these equations.

Generic Embodiment, geometry/physiology composition and ecological populations belong to the earlier implementation described in version history. They are not active Python extension interfaces.

Continue with task pages, implementation interfaces and limits.