The ledger

The claim this project makes is not that the fly trades well. It is that you can check what the fly did. That only holds if the neural state and the trade are the same transaction, so they are.

Order within a tick

A tick is 60 seconds, integrated at a fixed step of not yet measured. Nothing is submitted part-way through. The sequence is fixed and the ledger records it in this order:

  1. Read the market. Volume and momentum for the five symbols are sampled once, at the start of the tick, and held constant for its duration.
  2. Redraw the terrain. Mesa heights and hatching densities are updated, including erosion on any mesa whose volume has decayed.
  3. Render the luminance profile from the fly’s current position and heading, and drive the photoreceptors with it.
  4. Integrate. The retained graph runs for the full tick. Spike counts accumulate per population.
  5. Read out heading from the EPG population vector and turn from the PFL asymmetry. Advance the body. This produces the new position.
  6. Derive weights from the new position by the barycentric rule.
  7. Commit. Spike counts, heading, delta, position, escape flag and weights are written, and the swap that moves the book to those weights is executed — in one transaction.

Step seven is the point of the whole arrangement. The state that explains the trade and the trade itself either both land or neither does. There is no window in which the book has moved and the reason has not been published, and no opportunity to publish a reason chosen after the fact.

Schema

Every field is committed as an integer. Floating point is not used anywhere in the committed state, because two machines that disagree in the last bit of a double would produce two different ledgers from the same simulation.

committed state, per tick
FieldTypeUnitsNotes
iduint64Monotonic tick counter. Never reused, never reordered.
tsuint64msSimulation time at the end of the tick, not wall-clock time at submission.
spikesuint32[]countSpike count per retained population over the tick. Integer, so it survives replay exactly.
headingint32millidegreesEPG population vector angle at the end of the tick. Fixed point; no float is committed.
headingDeltaint32millidegreesSigned turn since the previous tick. PFL output.
positionuint32[2]1e-6 of arenaBody position on the valley floor, x then y, in normalised arena coordinates.
escapeboolDNp01 fired during this tick. If true, weights are all zero and no swap follows.
weightsuint16[5]basis pointsDerived from position. Sums to 10 000, or to 0 on escape.
graphHashbytes32Hash of the retained graph and every constant in the model. Changes if anything about the simulation changes.

Replaying a tick

Given the committed state at tick n, you should be able to run tick n+1 yourself and arrive at the same coordinates. What you need is the position, heading and membrane state carried forward from n, the market sample at n+1, and the graph identified by graphHash.

Determinism rests on four things, and all four are constraints on us:

  • Fixed step. The integrator never adapts its step size to save time, because an adaptive step makes the trajectory depend on the machine.
  • Fixed seed. Any stochastic input — background drive, sensory noise — is drawn from a counter-based generator keyed on the tick id, so it is reproducible without storing it.
  • Integer commits. Spike counts are counts. Angles and positions are fixed point. Rounding happens once, at commit, in a specified direction.
  • No wall-clock. Nothing in the simulation reads the time of day. The only clock is the tick counter.

If a replay diverges, that is a bug in this system and we want to know. A divergence is not a market condition and it has no benign explanation.

Chain

NetworkRobinhood Chain
Chain id4663
Explorerhttps://robinhoodchain.blockscout.com/tx/

Every row in the ledger on the front page links to its transaction at that base. Neuron identifiers shown alongside are the released male-cns:v1.0 identifiers, unchanged, so a spike count attributed to a population can be traced back to the specific neurons it came from.