Hippocampus of AI
← Architecture

Technical Writeups

Action-State Consistency with Kuration SDK

Technical Writeups 2026-10-29

Kuration SDK supports automatic per clip verdict on action-state consistency checking, paving the way towards physically grounded world models.

Tejal Bedmutha

The Implicit Physical Contract

To world models, action and video data is much more than a sequence of frames paired with inputs. It encodes an implicit physical contract: each action should change the world state in a consistent way, be it change in camera angle, position or pose, or other visual shifts. That contract is the entire signal of an action-conditioned world model, the kind used in robotics simulation, game generation, and embodied-AI training, is trying to learn. In the context of Gameplay, the actions are typically key presses or game controller actions and the world state is captured by both visual and non-visual metadata capturing camera angle, player location, player health and so on.

This graph is built using the TeaPearce dataset, in which forward motion from a W press doesn't stop at release, it peaks at or after the keypress ends, then dips and rebounds before fading into noise ~6-8 frames later, a clear action-state mismatch baked into the training data.

Models like DIAMOND, Genie, and GameNGen train exactly this way: camera frames and the actions that produced them, nothing else. If the contract is inconsistent in the training data, the model has no way to tell a genuine anomaly from the rule. In Physical AI research, this problem is called action-state consistency.

When Game Engines Lie: The Action-State Mismatch

The trouble is that you don't get this contract for free. For example, game engines are built to feel responsive and fair to a human holding a controller, not to hold still for a statistics class: “coyote time”, “input buffering”, and “favor-the-shooter” lag compensation are all deliberate departures from physically grounded input→motion mapping. A wall corner silently absorbing a strafe, or a player scoped in with nowhere left to move, or even a genuine engine glitch, look physically legitimate to a model just trying to learn "keypress A means move left".

Introducing the Action-State Consistency Operator

That's the gap, AIntropy's data curation toolkit, the Kuration SDK is addressing with an inbuilt operator that supports action-state consistency checking. The SDK consists of modular Operators, which are readily composable operations that can be chained together to form a pipeline. The action-state consistency Operator verifies the implicit contract every action-conditioned world model depends on: that taking an action produces the same characteristic screen motion every time. Internally, it measures the actual pixel displacement behind every isolated key or mouse press in a recording and flags the instances where a game's own physics: a wall collision, a scoped-in view, an engine quirk,

breaks that contract. Because it plugs into the same discoverable analyzer registry as the rest of the SDK, it composes directly with your existing curation pipeline, turning a property that used to require frame-by-frame human review into an automatic, per-clip verdict.

A real 21-frame window from the TeaPearce (CS:GO) dataset. The player holds ‘A’ key- (strafe left) while scoped in against a wooden door — the action-state-consistency operator flags this instant because the measured screen motion is far below the accepted range.

How It Works: Pixel-Flow Analysis

The pixel-shift operator isolates single, uninterrupted key or mouse presses (1–3 frames for W/S/A/D, one discrete magnitude for mouse deltas) and measures the resulting screen motion with Farneback optical flow — projected onto whichever axis that control is actually supposed to move the camera on, for example: a radial vector field for W/S (forward/backward motion should push pixels outward from or pull them toward screen center), the horizontal component for A/D and mouse-x, t . The action-state-consistency analyzer wraps that per-instance measurement in a baseline comparison and keeps a running, clip-level verdict — consistent, inconsistent, or inconclusive (no checkable instance found) — without you ever needing a second, "ground truth" dataset. A baseline can come from a dataset's own typical behavior: the 10th-to-90th-percentile range of measured shift, pooled per (control, press-length or mouse-delta) cell, across as many real episodes as you can throw at it.

The Operator adds fine-grained metadata to your dataset: a per-clip verdict, and for every inconsistent clip, the exact control, cell, frame, and measured shift that broke the range — down to the frame index, without a human reviewing a single second of footage.

Automating Your Pipeline

If you're ready to check your own action-conditioned dataset, try running this:

import kuration
import kuration.gameplay # registers pixel_shift and action_state_consistency
from kuration import CuratedDatasetAdapter, OutputSpec, SchemaSpec, input

# The 51 DIAMOND action columns: 11 keys, 2 clicks, one-hot mouse-x and mouse-y bins
action_cols = load_action_columns() # your column names, in order
schema = SchemaSpec.from_dict({
"name": "clips",
"fields": {"action": {"kind": "vector", "dims": action_cols}},
})

# The audit reads frames and actions back from disk, so write both
spec = OutputSpec.from_dict({
"shard_length": 64,
"container": "npz",
"modalities": {
"frames": {"dtype": "uint8", "shape": [H, W, 3], "source": "media:frame"},
"actions": {"dtype": "float64", "shape": [51], "source": "field:action"},
},
})

# 1. Measure pixel motion for each key press and sample diverse windows
(input("clips/*.csv", time="t", schema=schema, fields={"action": action_cols})
.join_video(lambda src: src.replace(".csv", ".mp4"), tolerance=0.020)
.window(64, stride=32)
.pixel_shift(controls=["W", "A", "S", "D"])
.bin("w_shift_mean", bins=8)
.sample("equal", n=200)
.output("clips-out/", spec=spec))

# 2. Audit the written dataset: is each clip action-state consistent?
adapter = CuratedDatasetAdapter("clips-out/")
audited = input(adapter=adapter, schema=adapter.schema, sources=adapter.sources())
checked = audited.action_state_consistency(controls=["W", "S"])
result = checked.metadata["gameplay"]["action_state_consistency"]["result"]
print(result["summary"])