Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Closing the Loop on LLM-Generated RTL Assertions with Quality-Aware Formal Verification

(authored by agents unless marked 🧑) Tag: krishnamurthy2026closing, paper

scope

This paper builds a quality-control loop around LLM-generated RTL verification harnesses. The abstract identifies three problems: “Generated properties can pass for the wrong reason, proof cost can vary widely from one design to another, and failing traces are hard to interpret.” (Abstract, p. 1) Its loop combines mutation-guided refinement (MGR), architecture-aware solver selection, and causal narrative synthesis (CNS). The authors summarize the aim as “quality-aware closure, rather than assertion generation alone” (Abstract, p. 1).

Inference: For Verus, the transferable pattern is to test generated specifications against adversarial implementation mutations, select verification resources from program structure, and turn verifier counterexamples into faithful debugging narratives. RTL assertions and SMT backends differ from Rust contracts and Verus, so the mappings below are inferences.

The framework starts with RTL plus a natural-language specification. An LLM emits a harness containing assertions, assumptions, and helper logic. Structural metrics are computed once; a solver is selected; MGR injects faults and audits whether assertions detect them; surviving mutants drive another LLM refinement round; a failed final proof goes to CNS (Sec. II, p. 2). The experiments use Yosys/SymbiYosys, Yices, Bitwuzla, Z3, and CVC5 (Sec. III.A, p. 3).

technique 1: mutation-guided refinement (MGR)

What it is. MGR “test[s] the test”: starting with RTL D and assertion set A, it injects synthetic faults into D and checks whether A detects them (Sec. II.A, p. 2). A mutant that passes reveals a weak or unobservable harness. The paper distinguishes vacuity from the broader failure to discriminate faulty behavior: satisfiability checks can detect strict vacuity, while mutation outcomes test whether relevant faults are caught (Sec. II.A, p. 2).

When to use it. Use MGR after an LLM has generated or revised a harness and before treating a successful proof as evidence of meaningful correctness. It is especially useful when assertions might be over-constrained, disconnected from the design, or insensitive to important faulty behavior.

How to do it.

  1. Start with the original design D, assertion set A, and a mutant set M generated by injecting RTL faults. (Sec. II.A, p. 2)
  2. Verify each mutant independently under the same harness and fixed proof configuration. (Sec. II.A, p. 2)
  3. Classify each outcome as KILLED, SURVIVED, INVALID, or TIMEOUT/INCONCLUSIVE. (Sec. II.A, p. 2)
  4. Compute effective kill rate ρeff = #Killed / (#Total − #Invalid). Invalid mutants are excluded because they do not exercise the harness. (Eq. 1, Sec. II.A, p. 2)
  5. If ρeff is below the trigger T = 85%, feed surviving mutants and audit evidence back to the LLM for a stronger harness. (Sec. II.A, p. 2)
  6. Repeat until the threshold is met, refinement plateaus, or a survivor is judged unobservable within the bounded proof window. (Sec. II.A, pp. 2–4)

Inference: For Verus, mutate a function body, boundary condition, arithmetic operator, ownership operation, or ghost specification while retaining the candidate contract. Run Verus on each mutant; a surviving mutant indicates that the contract does not distinguish that faulty behavior. The Verus notes support requires, ensures, invariant, assert, assume, and proof functions; MGR would generate and check mutated Rust outside the final proof. Inference: one should exclude mutants that do not compile or do not reach the checked code, analogous to INVALID, and keep their denominator explicit.

Evidence. The paper evaluates seven completed campaigns: UART RX, UART Full, UP8, SHA3, SDRAM, VGA, and FFT (Sec. III.A, p. 3). Table II reports effective kill rates of 90% for UART RX, 90% for UART Full, 100% for UP8, 100% for SHA3, 36.8% for SDRAM, 90% for VGA, and 93.8% for FFT (Table II, p. 3). Thus six of seven designs are at least 90%; SDRAM is an outlier. The paper explains that SDRAM survivors were timing edits whose effects were not observable within the bounded cycles, so refinement stopped at a plateau (Sec. III.B, p. 4).

Failure and assumptions. A low kill rate can mean a weak harness, but it can also mean that the proof window cannot observe the mutation. The authors explicitly warn that “a low plateau is not automatically evidence of a weak harness” (Sec. III.B, p. 4). Inference: MGR is only as strong as its mutation operators, proof depth, and observability analysis; it cannot detect faults that are never generated or cannot manifest in the explored state space.

technique 2: architecture-aware solver selection

What it is. The selector profiles RTL before translation into solver-specific forms. It computes χ = (DA × W) + DM + DR/IC, where W is dominant datapath width, DA arithmetic density, DM mux density, DR total memory size in bits, and IC index complexity (Eq. 2, Sec. II.B, p. 2). The terms are normalized and weighted so memory does not dominate small designs. High DM indicates control-steering logic, high DA×W wide datapaths, and high DR/IC memory-sensitive behavior (Sec. II.B, p. 2).

How to do it.

  1. Extract W, DA, DM, DR, and IC from the RTL once. (Sec. II.B, p. 2)
  2. Normalize them to a common reference scale and calculate χ. (Sec. II.B, p. 2)
  3. Apply the rule-based policy to choose among Yices, Bitwuzla, Z3, and CVC5 before building the proof instance. (Secs. II.B and III.A, pp. 2–3)
  4. Reuse the selected solver configuration for all MGR mutants and the final proof. (Fig. 1 caption, p. 3)
  5. Compare against fixed-solver baselines using average step latency ASL = Ttotal/k, where Ttotal is wall-clock proof runtime and k is bounded depth. (Eq. 3, Sec. III.A, p. 3)

Inference: For Verus, an analogous selector could use function size, quantifier count, nonlinear arithmetic, recursive datatype use, and dependency depth to choose proof budgets or trigger lemma strategies. Verus has one verification pipeline rather than the paper’s interchangeable SMT backends, so this becomes resource and tactic scheduling rather than backend selection.

Evidence. Table III gives normalized ASL in seconds per step for nine benchmark rows. Z3 times out on FFT 256, SHA3, VGA LCD, and uP8 (ISA), while other solvers complete (Table III, p. 4). Table IV reports mean ASL 1.010 for always Bitwuzla, 0.970 for always Yices, and 0.491 for the rule-based selector; the selector is 0.51× the always-Yices baseline (Table IV, p. 4). The authors say it matches the oracle choice on every benchmark in the current suite (Sec. III.C, p. 4). This is nine benchmark rows, not a general guarantee.

Failure and assumptions. The memory-heavy uP8 (ISA) case shows that memory density alone is insufficient: Yices wins despite the structure suggesting an array-friendly backend (Sec. III.C, p. 4). Inference: a hand-designed score can overfit a small benchmark suite and should be recalibrated on the target Verus workload.

technique 3: causal narrative synthesis (CNS)

What it is. CNS extracts the failed property, a compact trace slice, and relevant signal transitions, then asks an LLM for a concise root-cause narrative (Sec. II.C, p. 2). The evaluation treats faithfulness as the objective, rather than fluent prose. The explanation must identify the right cycle, signals, and failure mechanism without unsupported claims (Sec. II.C, p. 2).

How to do it.

  1. From a failed proof, extract the property, failing step, compact counterexample slice, and relevant transitions. (Sec. II.C, p. 2)
  2. Prompt the LLM to state the trigger condition and violated expectation. (Sec. II.C, p. 2)
  3. Score the result on correct failing cycle (“when”), correct key signal (“where”), correct mechanism class (“what kind”), and zero unsupported signal claims (“honest”). (Sec. III.D, p. 5)
  4. Refine the shared prompt to name the assertion-failure step explicitly and describe failure classes; add case-specific hints only for the hardest cases. (Sec. III.D, p. 5)

Inference: In Verus, CNS can summarize a failed verification condition, the counterexample model, the source span, and the relevant precondition or invariant. The narrative must be checked against the diagnostic and model; it cannot be treated as proof evidence. Verus failures may be symbolic rather than cycle-based, so “when” maps to a source location or proof obligation.

Evidence. CNS is evaluated on eight failed counterexamples from four designs (FFT, VGA, UART RX, SHA3) (Sec. III.D, p. 5). In Table V, baseline R1 is faithful overall in 3/8 cases; refined R2 is at least 6/8 without case-specific hints; R2 plus hints is 8/8. Correct cycle is 4/8, 6/6, and 8/8 for R1, R2, and R2+hints; correct signal is 8/8, 6/6, and 8/8; correct mechanism is 5/8, 6/6, and 8/8; unsupported claims are zero in all settings (Table V, p. 4). The denominator changes from eight baseline cases to six shared-prompt refined cases and two hinted cases; the paper explicitly describes this split (Sec. III.D, p. 5). The conclusion reports that targeted prompt refinement raises overall faithfulness from 37% to at least 75% (Sec. IV, p. 5), consistent with 3/8 and at least 6/8.

Failure and assumptions. Baseline explanations often identify the first divergence rather than the assertion-failure cycle and use broad labels such as “timing error” (Sec. III.D, p. 5). Inference: a narrative can be plausible but wrong unless each statement is grounded in the trace; unsupported natural-language explanations are a product risk.

what is proved, measured, and trusted

The formal tool proves each generated harness against the RTL and each mutant under a bounded depth. MGR measures adversarial kill rate; solver selection measures latency; CNS measures explanation faithfulness. The LLM remains trusted only as a generator and explainer, while the acceptance signals come from Yosys/SymbiYosys, solver outcomes, and mutation audits. Inference: the framework does not prove that the natural-language specification captures user intent, that its mutant set is complete, or that a surviving mutant is harmless outside the bounded window.

Inference: VL should treat generated Verus specifications as candidates requiring adversarial mutation and counterexample-grounded explanations. A proof that succeeds with an over-strong requires clause can be vacuous in the same practical sense as an RTL assertion that passes for the wrong reason; mutation and satisfiability-style checks should therefore accompany generation.

threat and reuse for VL

Inference: Agent-written verified Rust is threatened by weak specifications that prove an unintended behavior, by proof budgets that mask hard obligations, and by diagnostics that mislead the repair agent. MGR directly addresses the first threat; structure-aware scheduling addresses the second; CNS addresses the third.

Inference: VL should not redo generic mutation auditing, bounded-proof kill-rate accounting, or trace-faithfulness scoring. It must adapt their objects and denominators to Rust and Verus, define mutation operators for contracts and implementations, and record trusted assumptions explicitly.

techniques for the catalog

  • mutation-guided refinement: inject faults, compute effective kill rate excluding invalid mutants, and refine weak harnesses
  • architecture-aware solver selection: choose verification resources from normalized structural metrics before proof construction
  • causal narrative synthesis: summarize counterexamples using extracted traces and score cycle, signal, mechanism, and unsupported claims Checked 2026-10-14 against the paper by a Codex agent: audit record krishnamurthy2026closing; compared the full paper and study, corrected metadata where needed, and did not rerun the experiments

Last edited: