Skip to main content
A FAILED verdict always comes with concrete evidence. Use this workflow to go from the verdict to a fix.
1

Explain

Read it from the bottom up. The suspect line is the expression the failure traces back to. correct only when explains why your tests passed: they used multiples of 16.
2

Reproduce on the GPU (optional)

The script rebuilds the exact input the engine found, from a seed and a few integers (tfe.load_case). It runs your kernel on the GPU and compares the output with the spec’s float64 reference interpreter (tfe.spec_eval). --witness minimal uses the smallest witness instead (max abs diff: nan here).
3

Fix

4

Re-verify the file

The counterexample is gone. Here the verdict becomes UNKNOWN, because paged online-softmax attention is not provable yet. For a kernel the engine can prove, it becomes PASS · PROVED.

Reading each failure kind

The witness shows one output element where the kernel and the spec disagree. If correct only when reads never (fails for every tested value), the formula itself is wrong, not an edge case:
Here the weight is applied as w, but Qwen3.8’s spec says (1 + w). Run theformalera spec show <key> and compare the formula term by term.
Usual causes: a missing or wrong mask= on a load or store, or tiles that overlap. A write-write conflict is a race: which value survives depends on the GPU’s schedule.
row * (2 * I) is computed in int32 and wraps for long prefills. Cast the program id first: tl.program_id(0).to(tl.int64). For float overflow, the usual causes are exp without subtracting the max, or a half-precision intermediate.
Check assume= and domain= together. For example, T % 16 == 0 with domain={"T": (1, 8)} leaves no valid T.
Add @tfe.implements(...), or move the file outside [policy] require_annotation.

When the result is UNKNOWN

theformalera explain only covers failures. For UNKNOWN, read the detail and stuck_at fields of the JSON report:
You then have three options:
  1. Rewrite the kernel in a pattern the engine proves (see Limitations). theformalera lemma search --key <spec key> lists the patterns existing lemmas already cover.
  2. Waive it with an owner and an expiry date (see Policy and waivers).
  3. Wait: the nightly run retries UNKNOWN results when new lemmas for their node appear.

Use a counterexample in your own tests

This turns the counterexample into a regression test for the shape your differential tests never covered.