Skip to main content

Crate shape_runtime

Crate shape_runtime 

Source
Expand description

Runtime module for Shape execution

This module contains the pattern matching engine, query executor, and evaluation logic for the Shape language.

Shape is a general-purpose scientific computing language for high-speed time-series analysis. The runtime is domain-agnostic - all domain-specific logic (finance, IoT, sensors, etc.) belongs in stdlib modules.

Re-exports§

pub use alerts::Alert;
pub use alerts::AlertRouter;
pub use alerts::AlertSeverity;
pub use alerts::AlertSink;
pub use context::DataLoadMode;
pub use context::ExecutionContext as Context;
pub use data::DataFrame;
pub use data::OwnedDataRow as RowValue;
pub use event_queue::EventQueue;
pub use event_queue::MemoryEventQueue;
pub use event_queue::QueuedEvent;
pub use event_queue::SharedEventQueue;
pub use event_queue::SuspensionState;
pub use event_queue::WaitCondition;
pub use event_queue::create_event_queue;
pub use extensions::ExtensionCapability;
pub use extensions::ExtensionDataSource;
pub use extensions::ExtensionLoader;
pub use extensions::ExtensionOutputSink;
pub use extensions::LoadedExtension;
pub use extensions::ParsedOutputField;
pub use extensions::ParsedOutputSchema;
pub use extensions::ParsedQueryParam;
pub use extensions::ParsedQuerySchema;
pub use extensions_config::ExtensionEntry as GlobalExtensionEntry;
pub use extensions_config::ExtensionsConfig as GlobalExtensionsConfig;
pub use extensions_config::load_extensions_config;
pub use extensions_config::load_extensions_config_from;
pub use hashing::HashDigest;
pub use hashing::combine_hashes;
pub use hashing::hash_bytes;
pub use hashing::hash_file;
pub use hashing::hash_string;
pub use intrinsics::IntrinsicFn;
pub use intrinsics::IntrinsicsRegistry;
pub use join_executor::JoinExecutor;
pub use leakage::LeakageDetector;
pub use leakage::LeakageReport;
pub use leakage::LeakageSeverity;
pub use leakage::LeakageType;
pub use leakage::LeakageWarning;
pub use module_bindings::ModuleBindingRegistry;
pub use module_exports::FrameInfo;
pub use module_exports::ModuleContext;
pub use module_exports::ModuleExportRegistry;
pub use module_exports::ModuleExports;
pub use module_exports::ModuleFn;
pub use module_exports::VmStateAccessor;
pub use multiple_testing::MultipleTestingGuard;
pub use multiple_testing::MultipleTestingStats;
pub use multiple_testing::WarningLevel;
pub use progress::LoadPhase;
pub use progress::ProgressEvent;
pub use progress::ProgressGranularity;
pub use progress::ProgressHandle;
pub use progress::ProgressRegistry;
pub use query_result::AlertResult;
pub use query_result::QueryResult;
pub use query_result::QueryType;
pub use stream_executor::StreamEvent;
pub use stream_executor::StreamExecutor;
pub use stream_executor::StreamState;
pub use sync_bridge::SyncDataProvider;
pub use sync_bridge::block_on_shared;
pub use sync_bridge::get_runtime_handle;
pub use sync_bridge::initialize_shared_runtime;
pub use type_schema::FieldDef;
pub use type_schema::FieldType;
pub use type_schema::SchemaId;
pub use type_schema::TypeSchema;
pub use type_schema::TypeSchemaBuilder;
pub use type_schema::TypeSchemaRegistry;
pub use window_executor::WindowExecutor;
pub use wire_conversion::nb_extract_typed_value;
pub use wire_conversion::nb_to_envelope;
pub use wire_conversion::nb_to_wire;
pub use wire_conversion::nb_typed_value_to_envelope;
pub use wire_conversion::wire_to_nb;

Modules§

alerts
Alert Pipeline System
annotation_context
Annotation context and decorator registry
arrow_c
Arrow C Data Interface import helpers.
ast_extensions
Extensions to the AST for flexible query execution
binary_reader
Binary reader for converting binary columnar data to DataTable
blob_prefetch
Speculative prefetch for content-addressed function blobs.
blob_store
Blob store abstraction for content-addressed function blobs.
blob_wire_format
Cross-language wire format for FunctionBlob serialization.
builtin_metadata
Builtin function metadata for LSP introspection
chart_detect
Chart auto-detection from Arrow IPC table data.
closure
Closure support for Shape functions
code_search
Structural code search over content-addressed function blobs.
columnar_aggregations
SIMD-optimized aggregations for columnar object series
const_eval
Const evaluation for annotation metadata() handlers
content_builders
Content namespace builder functions.
content_dispatch
Content trait dispatch — render any ValueWord value as a ContentNode.
content_methods
Content method dispatch for ContentNode instance methods.
content_renderer
ContentRenderer trait for rendering ContentNode to various output formats.
context
Execution context for Shape runtime
crypto
Cryptographic utilities for module signing and trust verification.
data
Generic data types for Shape
dependency_resolver
Dependency resolution from shape.toml
distributed_gc
Distributed garbage collection for content-addressed function blobs.
doc_extract
engine
Shape Engine - Unified execution interface
error
Unified error handling for Shape
event_queue
Platform-agnostic event queue for async operations
execution_proof
Proof of execution for content-addressed functions.
extension_context
Context-aware extension discovery and module-artifact registration.
extensions
Extension system surface for Shape runtime.
extensions_config
Global extension configuration loading from TOML.
frontmatter
Front-matter parser for Shape scripts
fuzzy
Fuzzy matching algorithms for pattern recognition
fuzzy_property
Property-specific fuzzy matching for Shape
hashing
SHA256 hashing utilities for reproducibility artifacts
intrinsics
High-performance intrinsic functions for Shape
join_executor
JOIN execution engine
leakage
Lookahead bias and data leakage detection
lookahead_guard
Data access validation for time-series processing
metadata
Language metadata API for LSP and tooling
module_bindings
Module Binding Registry - Single source of truth for module binding values
module_exports
Runtime module export bindings for Shape extensions.
module_loader
Module loading and management for Shape
module_manifest
Module manifest for content-addressed module distribution.
multi_table
Multi-series data alignment and analysis module
multiple_testing
Multiple testing corrections and warnings
native_resolution
Shared native dependency resolution for CLI, compiler, and runtime.
output_adapter
Output adapter trait for handling print() results
package_bundle
Package bundle format for distributable .shapec files
package_lock
Unified shape.lock model for deterministic dependency resolution and compile-time artifact caching.
pattern_library
Pattern library stub for semantic analysis
pattern_state_machine
Generic pattern state machine for sequence detection
plugins
Plugin System for Shape
progress
Progress reporting system for data loading operations
project
Project root detection and shape.toml configuration
provider_registry
Provider registry for managing named data providers
query_builder
Query plan and SQL generation for data source pushdown.
query_executor
High-level query execution API for Shape
query_result
Enhanced query result types that support both analysis and simulations
renderers
Content renderers for various output targets.
schema_cache
Data-source schema cache backed by unified shape.lock artifacts.
schema_inference
Schema inference for data files.
simd_comparisons
SIMD-accelerated comparison operations for series
simd_forward_fill
SIMD-optimized forward-fill operations for table alignment
simd_i64
SIMD-style i64 operations for integer-typed arrays.
simd_rolling
SIMD-accelerated rolling window operations
simd_statistics
SIMD-accelerated statistical operations
simulation
Generic Simulation Engine
snapshot
Snapshotting and resumability support
state_diff
Content-addressed state diffing for distributed Shape.
statistics
Advanced statistics module for Shape pattern analysis
stdlib
Standard library modules for the Shape runtime.
stdlib_io
Native io module for file system and network operations.
stdlib_metadata
Stdlib metadata extractor for LSP introspection
stdlib_time
Native time module for precision timing.
stream_executor
Stream executor for real-time data processing
sync_bridge
Async/Sync bridge for Shape runtime
time_window
Time window support for Shape
timeframe_utils
Utilities for timeframe operations and timestamp generation
type_mapping
Type mapping system for validating DataFrame structure
type_methods
Type method registry for storing user-defined methods on types
type_schema
Type Schema Registry for JIT Type Specialization
type_system
Shape Type System
visitor
AST Visitor trait and walk functions for Shape.
window_executor
Window function execution engine
window_manager
Generic window manager for time-series aggregations
wire_conversion
Conversion between runtime values and wire format.

Structs§

AlignedVec
A vector with SIMD-aligned memory allocation
Runtime
The main runtime engine for Shape
SourceLocation
Source location information for error reporting
Value
An 8-byte value word for the VM stack (NaN-boxed encoding).

Enums§

ShapeError
The main error type for Shape operations

Type Aliases§

Result
Result type alias for Shape operations