Vortex has a layered execution model: rather than a flat registry of compute functions keyed by operation and dtype, it uses a child-driven dispatch system built around theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vortex-data/vortex/llms.txt
Use this file to discover all available pages before exploring further.
VTable. When Vortex is asked to execute an array, the encoding gets the first opportunity to handle the operation natively. If it declines, the scheduler canonicalizes the array and retries. This means encoding-specific kernels live inside the encoding’s vtable, not in a separate compute function registry.
The execution model
Array execution in Vortex proceeds in three layers:- Reduce (
VTable::reduce,VTable::reduce_parent) — Pure structural transformations that require no I/O or buffer reads. These run eagerly and synchronously to simplify the array tree before any execution begins. - Parent kernel (
VTable::execute_parent,ExecuteParentKernel) — A child encoding intercepts an operation being performed by its parent. For example, aRunEndArraychild of aSliceArraycan binary-search its run-end positions rather than decoding everything. - Execute (
VTable::execute) — The encoding’s own canonicalization logic. It may request that a child slot be canonicalized first (by returningExecutionResult::execute_slot), or produce a result directly (by returningExecutionResult::done).
Implementing execute
The execute method on VTable is where your encoding decodes its data into a canonical form. It must be iterative, not recursive — instead of recursively canonicalizing children itself, it requests that the scheduler do so by returning ExecutionResult::execute_slot:
Implementing encoding-specific parent kernels
Parent kernels let a child encoding intercept operations performed by a parent array type. This is useful for operations like slicing or filtering that can be handled more efficiently without full decoding. To add a parent kernel for your encodingMyEncoding:
Implement ExecuteParentKernel
ExecuteParentKernel must be implemented on a zero-sized type. The #[derive(Debug)] is required.Implementing reduce rules
Reduce rules are structural-only transformations that fire before any execution. Unlike parent kernels, they cannot read buffers. They are useful for algebraic simplifications — for example, collapsing aSliceArray wrapping a RunEndArray that contains a single run into a ConstantArray.
Override VTable::reduce_parent to provide reduce rules:
encodings/runend/src/rules.rs for examples of reduce rules implemented for RunEndArray.
Fallback to canonical
If your encoding does not implement a parent kernel or reduce rule for a given operation, the scheduler will canonicalize your array (by callingexecute) and retry the operation on the result. This means you only need to implement kernels for operations where the encoding can genuinely do better than decoding first.
The OperationsVTable sub-trait
The OperationsVTable associated type on VTable provides legacy scalar access via scalar_at. If your encoding does not support direct scalar access, set it to NotSupported:
OperationsVTable<MyEncoding> for your vtable struct:
Testing compute implementations
UseVortexResult<()> return types and assert_arrays_eq! for array comparisons. For operations that depend on session execution, create a VortexSession with the required encodings registered:
rstest case parameterization when testing multiple input shapes or dtypes against the same operation.
Further reading
vortex-array/src/array/vtable/mod.rs—VTabletrait withexecute,execute_parent,reduce,reduce_parentvortex-array/src/kernel.rs—ExecuteParentKernel,ParentKernelSetvortex-array/src/array/vtable/operations.rs—OperationsVTablesub-traitencodings/runend/src/kernel.rs—RunEndparent kernels (slice, filter, take, compare)encodings/runend/src/rules.rs—RunEndreduce rules- GitHub Discussions