Skip to main content
This tutorial follows one repository from start to finish. A coding agent has written Triton kernels for the text path of Qwen/Qwen3.8-27B on H100. You will annotate them, lock the specs, verify, fix the bug the verifier finds, waive what it cannot decide yet, wire it into CI, and sign off a release. All output on this page comes from real runs of examples/acme-qwen3.8-27b-h100. The Quickstart shows how to set up the local Hub these commands use.
1

Initialise the project

Run init at the repository root. It finds Triton and CUDA code and writes theformalera.toml:
The generated file lists what to scan, which models you deploy, the verification level and the CI policy:
theformalera.toml
It also adds .theformalera/ to .gitignore and writes an AGENTS.md with the verification rules for coding agents.
2

Pull and lock the specs

theformalera.lock
pull checks the package’s signature and content hash, then builds its Lean workspace. Commit theformalera.lock.
3

Read the spec of the node you implement

Note the (1 + w[i]). Qwen3.8 applies the RMSNorm weight as an offset. A kernel that multiplies by w, as most RMSNorm kernels do, is a counterexample for every T.
4

Annotate each kernel

Put @tfe.implements on every @triton.jit kernel. Here one kernel serves two nodes, so it lists two Spec Keys and is verified against each:
kernels/norm.py
You can let the CLI draft annotations from parameter names and data flow. A wrong draft can only make verification fail, never pass:
See Annotate Triton kernels for every parameter.
5

Scan

scan never imports your code; it reads annotations from the source. A kernel under require_annotation without an annotation is listed here, and it fails verify.
6

Verify

The tanh-based SiLU kernel computes the sigmoid in a different way. Its proof needed a sub-proof no lemma covered, so the engine searched, found one, and deposited it as a new lemma. lemma preview shows where it goes:
7

Explain and reproduce the failure

repro.py
On an RTX 4090 the repro prints max abs diff: 0.42601415461163633. With --witness minimal (seq_len=1) it prints nan.
8

Fix and re-verify

Apply the fix that explain suggested:
kernels/attn_decode.py
The counterexample is gone and the safety checks pass, but the engine cannot prove online-softmax paged attention yet (see Limitations). So the result is UNKNOWN: never a PASS. By default, UNKNOWN fails CI.
9

Waive what cannot be decided yet

A waiver needs an owner and an expiry date:
theformalera.toml
Unchanged kernels are served from the results cache. Every active waiver is written into the release certificate.
10

Gate CI

.github/workflows/theformalera.yml
Make theformalera / verify a required check. See Continuous integration.
11

Sign off a release

The certificate is a signed in-toto statement. The proofs and the Lean sources of every lemma they use ship next to it. See Release sign-off.