Anticipation Pipeline Diagram
```mermaid flowchart TB subgraph Input [Input: MotionWindow] MW[MotionWindow<br/>50 frames @ 50Hz] SF[SkeletonFrames<br/>27 bones × 50 frames] LF[LatentFrames<br/>Optional embeddings] Coverage[Coverage Check<br/>≥ 0.9 required] end
Full Public Reader
Anticipation Pipeline Diagram
Version: 2.0.0
Last Updated: 2025-01-01
Parent: [06-ANTICIPATION.md](../06-ANTICIPATION.md)
---
Complete Anticipation Pipeline
flowchart TB
subgraph Input [Input: MotionWindow]
MW[MotionWindow<br/>50 frames @ 50Hz]
SF[SkeletonFrames<br/>27 bones × 50 frames]
LF[LatentFrames<br/>Optional embeddings]
Coverage[Coverage Check<br/>≥ 0.9 required]
end
subgraph Validate [Validation Layer]
NaN[NaN/Inf Check<br/>All values finite]
Time[Time Bounds<br/>t_end > t_start]
Bones[Bone Count<br/>= 27 (MOCOPI_BONE_COUNT)]
end
subgraph Features [Feature Extraction]
subgraph Kinematic [Kinematic Features]
Pos[Position Deltas<br/>Δp per frame]
Vel[Velocity<br/>dp/dt]
Acc[Acceleration<br/>dv/dt]
Jerk[Jerk<br/>da/dt]
end
subgraph Latent [Latent Features]
LatZ[Latent Z<br/>From LatentFrames]
LatVel[Latent Velocity<br/>dz/dt]
end
subgraph Fusion [Feature Fusion]
Embed[Regime Embedding<br/>64-256 dims]
Constraint[Constraint Vector<br/>~8 dims]
Deriv[Derivative Summary<br/>~8 dims]
end
end
subgraph Scalars [Scalar Computation]
subgraph Primary [Primary Scalars]
C[Commitment<br/>∈ [0, 1]]
U[Uncertainty<br/>∈ [0, 1]]
TP[Transition Pressure<br/>∈ [-∞, +∞]]
end
subgraph Secondary [Secondary Scalars]
RM[Recovery Margin<br/>∈ [0, 1]]
PS[Phase Stiffness<br/>∈ [0, 1]]
N[Novelty<br/>∈ [0, 1]]
S[Stability<br/>∈ [0, 1]]
end
end
subgraph Neighbors [Neighbor-Based (Optional)]
HNSW[HNSW Query<br/>k nearest]
Disp[Continuation Dispersion<br/>σ of next states]
Blend[70/30 Blend<br/>neighbor + heuristic]
end
subgraph Output [Output: AnticipationPacket]
Packet[AnticipationPacket<br/>schema_version: 0.1.0]
Debug[DebugTrace<br/>Optional]
end
%% Flow
MW --> SF & LF --> Coverage --> Validate
NaN & Time & Bones --> Features
Pos --> Vel --> Acc --> Jerk
LatZ --> LatVel
Jerk --> Embed
Vel & Acc --> Constraint
Jerk --> Deriv
LatVel --> Embed
Embed --> C & U
Constraint --> C
C & U --> TP
Constraint --> RM
Jerk --> PS
Embed --> N
LatVel --> S
Embed --> HNSW --> Disp --> Blend --> U
C & U & TP & RM & PS & N & S --> Packet
Embed & Constraint & Deriv --> Packet
Packet --> Debug---
Scalar Computation Details
Commitment
Formula:
commitment = 1.0 - uncertainty * (1.0 - constraint_saturation)Where `constraint_saturation` = how close to physical limits (joint angles, balance).
Interpretation: How irreversible the motion has become.
| Value | Meaning | System Response |
|---|---|---|
| 0.0-0.3 | Low | Observe, wait |
| 0.3-0.6 | Medium | Prepare response |
| 0.6-0.8 | High | Begin execution |
| 0.8-1.0 | Very High | Full commit |
Uncertainty
Without neighbors (heuristic):
uncertainty = regime_embedding.variance() * (1.0 - directional_persistence)With neighbors (MotionPhraseIndex):
dispersion = continuation_dispersion(neighbors)
neighbor_uncertainty = dispersion_to_uncertainty(dispersion)
uncertainty = 0.7 * neighbor_uncertainty + 0.3 * heuristic_uncertaintyInterpretation: How many plausible futures remain.
Transition Pressure
Formula:
dC = (commitment - prev_commitment) / dt
dU = (uncertainty - prev_uncertainty) / dt
transition_pressure = alpha * dC + (1 - alpha) * (-dU)Where `alpha = 0.3` (configurable).
Interpretation: Rate at which futures are collapsing.
| Value | Meaning |
|---|---|
| > 0.5 | Strong convergence |
| 0.0-0.5 | Gentle convergence |
| -0.5-0.0 | Gentle divergence |
| < -0.5 | Strong divergence |
---
Configuration
pub struct AnticipationConfig {
/// Minimum coverage to process [0, 1]
pub min_coverage: f32, // 0.9
/// Regime embedding dimension
pub regime_embedding_dim: usize, // 64
/// Constraint vector dimension
pub constraint_vector_dim: usize, // 8
/// Derivative summary dimension
pub derivative_summary_dim: usize, // 8
/// Transition pressure smoothing (α)
pub transition_pressure_alpha: f32, // 0.3
/// Emit debug traces
pub emit_debug: bool, // false
}---
Invariants Enforced
| ID | Invariant | Check Location |
|---|---|---|
| INV-001 | Deterministic | No random seeds |
| INV-003 | Coverage ≥ 0.9 | Entry validation |
| INV-004 | Scalars in bounds | Packet creation |
| INV-005 | Bone count = 27 | Frame validation |
| INV-007 | Schema version | Deserialization |
---
Performance
| Metric | Target | Achieved |
|---|---|---|
| Latency | < 2ms | ~1.5ms |
| Memory | < 1MB | ~500KB |
| Allocations | 0 hot-path | Pre-allocated |
---
Navigation
- Overview: [system-overview.md](system-overview.md)
- Data Flow: [data-flow.md](data-flow.md)
- Gesture Pipeline: [gesture-pipeline.md](gesture-pipeline.md)
- Anticipation Docs: [06-ANTICIPATION.md](../06-ANTICIPATION.md)
Promotion Decision
Promote into a technical note or architecture paper with implementation anchors.
Source Anchor
Comp-Core/docs/architecture/diagrams/anticipation-pipeline.md
Detected Structure
Evaluation · Architecture