Scalar types
Using types as kernel parameters
Type annotations on kernel parameters declare the buffer element type:Type casting
enigma.metal_cast(value, target_type)
Standard type conversion, equivalent to C-style casting in Metal:
enigma.as_type(value, target_type)
Bitwise reinterpret (no value conversion, same bit pattern):
Integer literals
Integer literals in kernel bodies are automatically promoted tou32:
f32:
Scalar parameters
enigma.Scalar(dtype) declares a per-dispatch constant. It is lowered as a 1-element device buffer and auto-loaded at kernel entry:
Vector types
Enigma supports vector construction for geometric operations. Vector types are created from scalars:.x, .y, .z, .w, or by lane index:
