Numerical and execution contracts
These pages define behavior at the API boundary. Start with the operation guide for examples, then consult the relevant contract for edge cases. These contracts describe current behavior; dated measurements are kept in the verification archive.
| Contract | What it specifies |
|---|---|
| Floating point and masks | Rounding, NaN, signed zero, canonical masks, selection and mixed aliases |
| Reductions and scans | Fixed accumulation order, empty inputs, error budgets, ddof and combinations |
| Types and conversions | f64 precision, integer wrap/saturation, shifts, conversion pairs and atomic errors |
| Advanced mathematics | Domains, special values, libm configuration, MPFR oracle and ULP budgets |
| Pipelines | Supported nodes, serialization, strict precision, bounded caches and aliases |
| Workers | Input snapshots, task states, cancellation, byte budgets and recovery |
Rules shared by every API
- Inputs are one-dimensional, contiguous TypedArrays or matching resident handles.
- Types do not promote implicitly. Default outputs are independent copies;
outexplicitly selects an existing destination where supported. - Same-type exact output aliases are allowed where registered. Partial overlap and cross-type output overlap are rejected before writing.
- Basic arithmetic preserves each step's precision; integer arithmetic wraps unless the operation explicitly requests saturation. There is no implicit FMA or fast-math.
- NaN payloads are unspecified. Documented signed-zero and infinity behavior remains observable.
from/set/toArraycopy data; disposal invalidates owned handles.scopeis synchronous. Use a persistent arena for application lifetimes across frames, and a Worker executor for supported asynchronous calculations.simd: 'required'constrains engine initialization. Inspect each operation withgetCapabilityto distinguish explicit SIMD from scalar fallback.
Compatibility
Numeric types use independent namespaces and explicit conversions. Broadcast, output reuse and resident-buffer patterns are shared where supported. Workers provide a separate entry point for asynchronous pipeline execution.
JS, native, Wasm and Worker assets must be deployed together. ABI v6 and registry fingerprint handshakes reject incompatible assets. Serialized pipeline plans also bind to the operation fingerprint. Invalid types, lengths, overlaps, lifetimes and plans fail explicitly; complete error message text is not a stable contract.