Skip to main content
The CI gate ensures every kernel that gets merged is correct. Sign-off answers a bigger question: is this whole inference system correct for this model? The answer is a coverage level, written into a signed certificate that your deployment pipeline checks.

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

A node is covered only when it is covered in every layer that has it. 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
Each scenario runs the command with its extra 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

  • signoff refuses to run after a partial verify (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. signoff lists them and asks first; pass --yes in 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 and proofs/lemmas/ the Lean sources of the lemma closure.
See Certificate format for the full statement.

Gate the deployment

and, for a level the release does not reach:
cert verify exits 0 only when:
  1. the DSSE signature verifies with --pubkey (or $THEFORMALERA_SIGNER_PUBKEY);
  2. the coverage level is at least --require (default L3);
  3. with --commit, the certificate’s subject is that git commit;
  4. 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.