Coverage levels
L1 and L2 are static and run on every PR. L3 needs one short run on the target hardware, once per release.
Check node coverage
layers[3..15].mlp.act alone does not cover mlp.act.
Record the launch sequence (L3)
trace runs your program in-process with Triton’s JIT launcher instrumented. For every launch it records the kernel, the grid, the constexprs, and the shape, stride, dtype and storage of every tensor argument. Host control flow differs between prefill, decode and mixed batches, so scenarios.yaml lists the scenarios to cover:
scenarios.yaml
args and env. Launches of CUDA/CUTLASS kernels from a PyTorch extension are recorded when the extension calls theformalera.trace.record_launch(...) (the C++ macro THEFORMALERA_TRACE_LAUNCH).
For host-side control flow, L3 is sampling of the listed scenarios, not proof. The certificate says so:
"host_control_flow": "scenario-based sampling (L3); kernels: proof".Sign off
signoffrefuses to run after a partialverify(verify kernels/x.py, or--changed-only).- Private lemmas from your org library are needed for the customer’s re-check, so they ship with the proofs.
signofflists them and asks first; pass--yesin CI. - The signing key is
--key, else$THEFORMALERA_SIGNING_KEY, else.theformalera/signing-key.pem, which is generated if it is missing. Keep the release key in a secret store. - Next to the certificate,
proofs/holds every proof file andproofs/lemmas/the Lean sources of the lemma closure.
Gate the deployment
cert verify exits 0 only when:
- the DSSE signature verifies with
--pubkey(or$THEFORMALERA_SIGNER_PUBKEY); - the coverage level is at least
--require(defaultL3); - with
--commit, the certificate’s subject is that git commit; - with
--proofs, every proof file and the lemma closure match their digests in the certificate, and they all re-check with Lean, lemmas first.
Delivering to a customer
When you deliver a disposable inference system, ship the certificate,proofs/ and proofs/lemmas/ with it. Your customer can re-check everything with the standard Lean 4 toolchain, without trusting you or us. See Re-check proofs.