Certified custom-operation programs #
A program retains the Lean function supplied to the frontend and a proof that its typed expression
has the same result, including failed reads. The certificate concerns Lean semantics. Native CUDA
emission, compilation and execution have the separate trust boundary described in Runtime.
A frontend result with its original Lean function and checked semantic correspondence.
- scalar : Scalar α
- arithmetic : Arithmetic α
- correct (read : Reader α) (index : UInt64) : evaluate self.arithmetic self.expression read index = self.reference read index
The source certificate uses the arithmetic selected for device execution.
Instances For
An elementwise program whose reference calculation is the supplied scalar function.
- program : Program α
Instances For
A binary scalar function compiled with left-to-right reads of its two tensor inputs.
- program : Program α
Instances For
The scoped target before CUDA name allocation preserves the original source function.
The named statements consumed by CUDA rendering preserve the original Lean function.
Only the output index must be initialized. Other local values may be arbitrary; the allocation proof ensures that none can affect the result. Read failures are retained, and scalar arithmetic follows the supplied operation order. Rendering, NVRTC and GPU execution are separate boundaries.