Look at the cube through the overhead camera, then through the camera on the wrist. The first view tells me where the box is on the table. The second tells me what is close to the gripper. If I give both pictures to a robot and say “Pick up the cube and place it in the box,” what should come out of the model? In this experiment I can actually look at the answer. It is a table of 50 proposed future actions. Each row has six numbers.

What can I give the model, and what can I get back?
Pause the cube-pickup episode at frame zero. On the left of the circuit are three kinds of evidence: the pictures tell us where things are, the instruction identifies the task, and six numbers describe the arm’s current configuration. On the right is a proposal for what the arm could do next. Each of the 50 rows holds six robot-profile coordinates. A mug label, a box around the cube, or a sentence describing the scene would be a different output contract.
Start at Camera encoder and open Group by 4 × 4. Select graph_slots to see which buffer the grouping kernel reads. Return to the parent, open Action expert, and compare Even layer with Odd layer. Each inspector links the diagram to an actual call exported from the pinned CKE builder.
| Boundary | This replay accepts or returns | What that lets me test |
|---|---|---|
| Observation | Two RGB views from one instant, one instruction, six state coordinates | The host prepares the camera pixels, tokens and normalized state. An extra input fixes the initial noise for a repeatable comparison. |
| Generated inference | Prepared arrays in a CKE arena → one 50 × 32 normalized proposal | Both vision passes, the joined observation, prefix memory, and ten refinements run inside the generated entry. |
| Robot profile | SO100 action statistics → 50 × 6 scaled values | Check all 300 outputs. Sending them to an arm adds a calibrated adapter, control timing and a new observation after movement. |
The released configuration names three possible camera inputs and resizes images with padding to 512 × 512. The generated circuit we ran is wired for two views. To test a third view I would extend the builder and obtain a matching reference capture before making a compatibility claim. Inspect the released input and output features.
Get the first piece running on Linux
Choose your starting point. The small test needs a compiler and the Python packages below. The released ingress test adds the roughly 865 MiB checkpoint and checks the action-and-time projection. The full camera replay also needs the recorded packet and the matching SO100 statistics. Use the same shell for the three command blocks so the paths and revision stay set.
For a first run I use a small deterministic test. It builds a real graph, compiles its C providers, calls the generated function and compares its output with PyTorch. Its small random weights keep the setup cheap. Use Linux, Git, a C compiler available as cc, and Python 3.11 or newer with venv. Python runs the test and prepares arrays. PyTorch supplies the independent computation and checkpoint loader. CKE executes the graph under test.
git clone --filter=blob:none https://github.com/C-Kernel-Engine/C-Kernel-Engine.git
cd C-Kernel-Engine
git checkout --detach afadd2c5e75cced16a95be5cc2499b7b57685538
python3 -m venv .venv
source .venv/bin/activate
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install numpy pytest safetensors jsonschema
python -m pytest -qs \
'tests/test_v8_smolvla_action_expert.py::test_generated_smolvla_action_expert[synthetic]' \
tests/test_v8_smolvla_action_expert.py::test_pack_action_unnormalizerLook for 2 passed. The small expert here has five action rows and three integration steps. To try the released weights with entirely public inputs, run the action-and-time projection below. It takes an actual 50 × 32 tensor with seeded test values and checks five time coordinates against the reference. In our released-weight ingress rerun, the maximum error across the five time coordinates was 0.00000206. This gives me a first checkpoint before adding cameras.
repo=https://huggingface.co/lerobot/smolvla_base/resolve
rev=5e8d12a6e2975b0e5e5fce7c8caf47c371d257b6
mkdir -p model
curl -fL "$repo/$rev/model.safetensors" -o model/model.safetensors
export CK_SMOLVLA_BASE_WEIGHTS="$PWD/model/model.safetensors"
python -m pytest -qs tests/test_v8_smolvla_action_ingress.py::test_released_smolvla_action_ingressWhere one patch goes
SmolVLA is a 450-million-parameter vision-language-action policy. In this SO100 replay the host decodes both views, resizes and pads them, tokenizes the instruction and standardizes the six state values. CKE begins at those prepared tensors. The recorded state is padded to 32 channels, and a mask identifies the instruction tokens that carry content. A reproducibility harness also supplies the same starting noise to both runtimes. If I changed that noise on one side, I would be comparing two different proposals. Base model and LeRobot examples.
| Stage | Shape in this replay | What changes |
|---|---|---|
| Patch one camera | 512 × 512 × 3 → 1,024 × 768 | Each nonoverlapping 16 × 16 patch holds 768 colour values. A learned affine projection gives it a feature row, and an embedding records its position on the 32 × 32 grid. |
| 12 vision layers per camera | 1,024 × 768 → 1,024 × 768 | Each layer lets patches exchange information by attention, then applies a feed-forward network. The two views use the same vision weights. |
| Visual connector | 64 × 12,288 → 64 × 960 per camera | Group each 4 × 4 neighbourhood of feature rows. Sixteen 768-wide vectors form one long row, then a learned projection compresses it. |
| Join the observation | (64 + 64 + 48 + 1) × 960 | Append two camera streams, the token embeddings and one projected state row. Of the 177 positions, 141 are visible in this capture. |
| Observation memory | 16 pairs of key and value arrays | The language backbone builds a cache at each depth. The expert can read it throughout all ten refinements. |
| Trajectory → SO100 profile | 50 × 32 → 50 × 6 | Select and unnormalize six channels in each future row. The profile specifies their order and scaling. |
Inside a vision layer, queries, keys and values are learned matrix projections. For one attention head, the row of softmax(QKᵀ / √64) tells one patch how to mix value rows across this camera. There are 12 such heads. The output projection is added to the incoming row through a residual connection. Layer normalization, a 768 → 3,072 → 768 MLP, GELU and a second residual complete the block. This is where a patch on the gripper can acquire information about a neighbouring object. The 4 × 4 connector only comes after all twelve layers. Another way vision rows enter a transformer.
Look closely at the count of 141. In this packet, slots 0–127 are camera rows and 128–139 are visible language rows. Positions 140–175 are padding. The state is still visible at slot 176. The generated attention kernel accepts disjoint ranges, so the state can stay in its original position. See how the replay constructs the mask.
Why refine fifty actions ten times?
Those two counts answer different questions. Fifty is the prediction horizon in action rows. Ten is how many times the solver revises the entire proposal before returning it. Row 12 is a future command. Solver iteration 2 is the second revision of all fifty commands. Neither index specifies motor speed.
During flow-matching training, a demonstration supplies an action chunk A and a sampled noise chunk supplies ε. With time running from clean at zero to noise at one, a straight interpolation is x(t) = (1 − t)A + tε. Its derivative is ε − A. The expert learns a velocity field conditioned on the observation, the noisy chunk and the time. At inference we have the observation and noise. We integrate that learned field back toward zero. The CKE replay exercises this inference loop with fixed weights. SmolVLA paper.
For the first update the solver supplies t = 1. An input projection maps each 32-value row to 720 features. Sines and cosines encode time. The circuit joins action and time features, projects them and applies SiLU. Sixteen expert layers then refine those hidden rows. Odd-numbered layers, counting from zero, use cross-attention to the observation. Even-numbered layers can also attend to the visible part of the proposed action sequence up through the current row. The masks carry this distinction into the attention kernel. The expert's residual paths use RMS normalization, gated feed-forward products and dense projections.
What can future action row twelve see?
Counting rows from zero, row 12 in layer zero can read all 141 visible prefix slots and action rows 0 through 12. That makes 154 accessible keys out of 227 allocated slots. In layer one the same query has only the 141 visible observation keys. The 50 queries are still evaluated together. This alternating mask gives one layer a way to coordinate the proposal so far and the next a way to consult the scene directly.
In the generated calls, both cases use attention_ranges_checked_f32. Follow the key and ranges inputs: layer zero reads concatenated keys and self_ranges; layer one reads prefix_1.projected_key and cross_ranges. There are 15 query heads and five key/value heads, each 64 features wide. Groups of three query heads share one set of keys and values. Attention kernel contract.
The output projection gives a velocity estimate v for each element. The C kernel computes x_next = x + (−0.1) × v. For a worked scalar example, if one entry is 0.8 and its estimated velocity is 0.3, that entry becomes 0.77. Every row gets the same step size and its own velocity. Repeat at times 0.9 down to 0.1. The weights stay fixed across these calls. The proposed trajectory changes.
How CKE stitches the calculation into C
Our C-Kernel-Engine describes this calculation with named input buffers, output buffers, dimensions, weight references and kernel names. For example, the input to the last operator is literally step_9.next_action. Its output buffer is action_output. You can inspect the declaration on your machine before compiling anything.
from version.v8.scripts.build_smolvla_visual_policy_v8 import build_circuit
graph, config, weights = build_circuit(action_channels=6)
ops = graph["block_types"]["block"]["body"]["ops"]
print(len(ops), len({op["kernel"] for op in ops}))
print(ops[-1]["graph_slots"])
print(graph["activation_buffers"]["action_output"])I get 2,975 operation calls using 17 distinct kernel names at this revision. The builder namespaces the reused action-and-time and output stages by iteration, connects the previous output to the next input and binds repeated weight names to the same parameters. The compiler resolves the providers, plans offsets for intermediate buffers and emits the native entry. The last prefix layer only needs to produce the K/V consumed by the expert. There is no next prefix layer waiting for its residual output. Vision and output wiring · Prefix cache, attention masks and expert loop.
One kernel name appears in two places I would have drawn differently by hand. camera_0.patches uses spatial_window_layout_f32_checked to gather raw pixels into patches. Later camera_0.tiles uses that same provider to group spatial neighbours after the vision layers. The first rearranges RGB values; the second rearranges learned features. Select each call in the camera diagram to compare their extents, then open its C source. Spatial layout implementation.
Read one row as a roboticist
For channel j, the last operation computes a[j] = σ[j] × x[j] + μ[j] using the released SO100 statistics. CKE packs the six scales along the diagonal of a 6 × 32 matrix and the means into a bias vector. The other columns get zero weight. One checked linear kernel therefore selects the six useful coordinates and restores each coordinate’s scale. Reading a neighbouring profile's means would change the command even with a numerically perfect transformer.

The first reference row rounds to [−11.12, 79.70, 158.25, 82.56, −37.39, 0.15]. By row 49 it is [12.21, 115.36, 127.28, 79.62, −8.59, 10.45]. Those are values in the released action profile. Index, calibration and units belong to the robot adapter. A robot controller also needs a clock at which to consume the rows, plus a decision about when a fresh observation supersedes the remaining commands.
Replay the full recorded example and interpret the error
For this step you also need the prepared observation packet publisher-vision-action-fp32.npz. The pinned CKE tree supplies the harness and verifies the packet hash. The model download supplies the weights and statistics. On a clean public checkout without the packet, the released projection test above still works. Retaining the packet makes the two views, visibility mask, initial noise and independent expected answer identical for both implementations.
curl -fL https://www.antsand.com/uploads/shivasnotes-replays/c1669f1294229cd3/publisher-vision-action-fp32.npz -o publisher-vision-action-fp32.npz
stats=policy_postprocessor_step_0_unnormalizer_processor.safetensors
curl -fL "$repo/$rev/$stats" -o "model/$stats"
export CK_SMOLVLA_ACTION_STATS="$PWD/model/$stats"
export CK_SMOLVLA_VISUAL_CAPTURE="$PWD/publisher-vision-action-fp32.npz"
CK_NUM_THREADS=4 OMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 \
python -m pytest -qs 'tests/test_v8_smolvla_action_expert.py::test_generated_smolvla_action_expert[visual]'When checking a new implementation, I first compare the joined observation, then visible K/V at each prefix depth, then the normalized action table, and finally the scaled robot output. If only that last comparison fails, the SO100 means, scales and channel order are the first things I would inspect. Exact assertions and tolerances.
| Run | What we checked on the pinned revision |
|---|---|
| Small synthetic + affine packing | Two tests passed. The synthetic expert agreed within 3.58 × 10⁻⁷ maximum absolute error; it also rejected a bad attention range and recovered the original output after restoration. |
| Released ingress | Five time coordinates from 1.0 down to 0.0. Maximum absolute discrepancy was 2.06 × 10⁻⁶. |
| Full prepared camera replay | All 1,600 normalized entries and all 300 scaled outputs passed. The test also compared the prefix embedding and the visible elements of all sixteen K/V pairs. |
My test says “skipped.” How can I tell which input is missing?
Run the same pytest command with -rs to print the reason. The visual fixture needs CK_SMOLVLA_BASE_WEIGHTS and CK_SMOLVLA_VISUAL_CAPTURE. Set CK_SMOLVLA_ACTION_STATS as shown above to include the six-channel SO100 readout. Look for both visual in the printed result and a separate denormalized_max_abs line. The latter confirms that scaling was actually tested.
On an AMD Ryzen 9 9950X3D, with four CKE threads, the portable FP32 generated entry took 51.30 seconds for this one observation. That timer brackets the native call after setup. The test process reported 67.86 seconds including setup and checks. The maximum absolute difference was 0.0000011921 across 1,600 normalized entries and 0.0000610352 across 300 unnormalized entries. The test also checked the vision prefix and each layer’s visible cache entries. Since we replayed saved reference output, this run gives no paired PyTorch latency.
I repeated the complete visual test with four pinned CPU cores on the same Ryzen. The native call took 41.35 seconds after setup, and reproduced the same two maximum errors. The spread between the runs matters if you are considering using the policy on a control clock. These are individual offline replay timings. Live control latency also includes capture, preprocessing, communication and actuation.
Print the reference rows used to draw the six traces
Run this in the same checkout after downloading the packet and statistics. It reconstructs the expected 50 × 6 table that the native output is compared against. The visual pytest command above runs the native model.
from pathlib import Path
import numpy as np
from safetensors.numpy import load_file
stats = load_file("model/policy_postprocessor_step_0_unnormalizer_processor.safetensors")
with np.load(Path("publisher-vision-action-fp32.npz"), allow_pickle=False) as packet:
normalized = packet["expected"][:, :6]
actions = normalized * stats["so100.buffer.action.std"] + stats["so100.buffer.action.mean"]
print(packet["task"].item(), actions.shape)
print("First row:", actions[0].round(2))
print("Last row: ", actions[-1].round(2))Does the arm actually put the cube in the box? The SmolVLA authors reported 78.3% SO100 task success in a community-data pretraining comparison, up from 51.7% without that pretraining in their setup. That percentage counts task outcomes. Our error measures how far one implementation's numbers drift from another’s on the same frame. A closed-loop CKE success rate would need repeated episodes, resets, execution at a specified cadence and a stated success criterion. An arm missing the first grasp could change every subsequent camera observation. Publisher’s experiments and protocol.
Two robotics tests with different starting lines
In SmolVLA we can hand the generated circuit two prepared pixel arrays and follow them into six scaled SO100 coordinates per row. In the REKI LIBERO experiment we load the publisher’s saved vision-language features, then trace register memory and the generated action expert into seven normalized coordinates per row. A raw timing comparison would charge SmolVLA for image encoding that sits outside the REKI timer. Comparing the input and output contracts first makes the engineering differences visible. Open the companion REKI circuit.
The pull requests behind SmolVLA
6 merged PRsOne way to read this history is to watch what the caller had to supply. At first the tests provided intermediate tensors. By the last merge I could start from two prepared camera views, token IDs and robot state, and compare all 300 scaled action values with a reference.
Build the action expertFollow the noise and time inputs into the first complete denoising loop.3 PRs
- PR #1368Embed the noisy action and the solver time02699ce1
The input is 50 rows of 32 noisy action values and one timestep. Projections, sinusoidal features and an MLP turn them into 50 rows of width 720. The test compared five timesteps with PyTorch using released weights. - PR #1382Read the observation cache and update an actionce9eb2b4
Two generated stages checked how prepared queries attend to cached keys and values, and how predicted velocity changes an action in one Euler step. The test still supplied the expert features. - PR #1409Run all 16 expert layers for ten updates38159210
Connected alternating self-attention and cross-attention to the update loop. On a recorded SO100 observation, CKE started from saved prefix keys and values and reproduced the final 50 × 32 normalized tensor within 5.52 × 10⁻⁷ maximum absolute error.
Connect the cameras and recover SO100 coordinatesEach merge moves the replay closer to what a robotics developer can supply or read.3 PRs
- PR #1411Build the observation cache inside the graph6e365400
Starting one stage earlier, CKE took prepared multimodal embeddings and built the keys and values for all 16 layers. The replay checked the visible cache entries layer by layer as well as the final actions. - PR #1412Start with two camera views, text IDs and arm state3e9f61af
Connected both SigLIP camera streams, language lookup and the state projection to the cache and action expert. The recorded test compared all 1,600 normalized outputs. The host still prepared the camera tensors, masks and initial noise. - PR #1417Convert the output into the six SO100 coordinates0a3524ba
An optional final projection applies the released SO100 means and standard deviations. It keeps the normalized tensor available and returns 50 × 6 scaled values, checked against the same transformation in PyTorch.
Merge dates are in UTC. All entries are included in the CKE revision used for this article’s replay.
Related reading
- For the robotics math behind observing a moving system, read our state-estimation walkthrough. For why computing an observation once can matter, see prefill, decode and the matrix kernels behind them.
Lab hardware used in this article
- Ryzen · AMD Ryzen 9 9950X3D workstation
- Zen 5 · 16 cores, 32 threads · 128 MiB L3 · AVX-512 with BF16 and VNNI. Linux reports 150.7 GiB usable RAM. 4 TB NVMe and 12 TB HDD on an ASUS TUF X870E-PLUS WIFI7 board. Ubuntu 26.04 LTS. Lab inventory, 3 December 2026. Earlier runs used different memory configurations.
Comments
Join the conversation. Replies can go three levels deep.