Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Seeing it in DataLogic Studio

DataLogic Studio is a visual editor and debugger for JSONLogic, built on datalogic-rs — the engine the platform runs your adapter on. So the Studio is not an approximation of the arena: it is the same language, and it can draw your adapter as a flow diagram, run it against an observation, and step through the evaluation one node at a time.

Every example in this chapter has an Open in DataLogic Studio link. The expression and the data travel in the link itself, so it opens exactly that example, already evaluated, with no account and nothing to save. The same is true of a link you make: a link to your own adapter is your adapter, readable by anyone you send it to.

It is still not the referee. The differences are narrow and they are listed below.

Opening your own adapter

  1. Open the Studio.
  2. Tick Templating, above the diagram.
  3. Paste one adapter into Logic: the value of one input’s adapter key, not the whole manifest.
  4. Paste an observation into Data.
  5. Share copies a link to what is on the screen.

For observations to paste, What your model sees has a small one, and tinybrains adapt writes every reference observation beside the tensors it produced, as case-N/observation.json (how).

What you are looking at

  • Logic, Data, Result. Result is what the Studio computed — for an adapter, the tensor call at the top with its arguments evaluated: {"scatter": [[[12, 30], [13, 30], [43, 66]], [64, 96], "i8"]} says that the node’s scatter will receive those three points, that shape, and that dtype.
  • The diagram. Every operator is a node, drawn with what flows into it. Flow draws the data left to right; Hierarchy draws the JSON’s nesting.
  • The debugger. The step controls walk the evaluation one node at a time, and the current node shows the value it produced. It is the quickest way to watch a map body receive each element in turn, or a reduce accumulator grow.

Where the Studio and the arena differ

In the StudioIn the arena
The core operators — var, val, map, filter, reduce, if, arithmetic, comparisons, merge and the restEvaluatedEvaluated identically. It is the same engine
{"==": [0, null]}truetrue. The arena is datalogic too, so JavaScript’s coercion rules apply on both sides
An object with more than one keyWith Templating on, an object literalAn error. Every object is an operation, and an operation has one key. This is the one difference that will bite
A single-key object whose key is not an operatorWith Templating on, an object literalAn error at evaluation, Invalid operator: <key> — so a misspelt operator runs in the Studio and fails on the first observation
The tensor operatorsShown with their arguments evaluatedTensors are built, with shapes and dtypes checked against your declaration
The operation countNot shownCounted, and capped at 1,000,000 per adapter
Shapes, dtypes, saturation, a scatter point off the boardNot modelledEnforced
The Studio’s versionWhatever that site last deployedThe version the node links, recorded on your version as orion_version

The one to internalise: the Studio is more permissive about objects than the arena is. An expression that returns {"mine": …, "theirs": …} is a tidy result in the Studio and is refused outright by a node. Return an array.

A trap the Studio reproduces

{"var": "3"} on a [row, col, owner] triple is null, and null compares equal to 0. So this filter keeps every hill rather than only yours, and neither side reports a problem:

{"filter": [{"var": "hills"}, {"==": [{"var": "3"}, 0]}]}

That is the whole shape of the most expensive mistake available here, and the Studio shows it exactly as the arena will. Compare with ===, or read a field that resolves, or give var a fallback: {"var": ["3", -1]}.

When the Studio is enough, and when it is not

The Studio answers “does my JSON half pick out the right things” — the right lists, the right fields, the right coordinates, the right shape — and answers it by showing you. A scope mistake, a filter on the wrong field, or a shape assembled in the wrong order is visible in the Result pane.

It cannot answer “does my adapter build the tensor my graph was trained on”, or “does it fit the budget”, or “does the graph accept it”. tinybrains adapt writes out the tensors and what each one charged, and tinybrains check measures what admission measures.