---
title: "Catch Go bugs that fuzzing misses with Gemini and a constraint solver"
description: "The author built a pipeline that compiles Go functions to RISC-V assembly, feeds the source and disassembly to Gemini 4 Argon, and has the model write Z3 constraint-solver scripts targeting surviving bounds-check traps. Z3 returns a concrete crashing input when satisfiable, and go test replays that input against the real function. The workflow caught all three planted bugs in test parsers and three latent bugs in the skill-lint CLI. Fuzzing missed two of the planted crashes because spare slice capacity or multi-step precondition checks hid the crash. The approach trades away a full correctness proof for practical bug-finding value, with the LLM translation dominating the runtime at about a minute per function while Z3 finishes in milliseconds."
---

# Catch Go bugs that fuzzing misses with Gemini and a constraint solver

[Google](https://yomu.fyi/company/google) · Karl Weinmeister · Nov 12, 2026

**Type:** Tutorial

## Summary

The author built a pipeline that compiles Go functions to RISC-V assembly, feeds the source and disassembly to Gemini 4 Argon, and has the model write Z3 constraint-solver scripts targeting surviving bounds-check traps. Z3 returns a concrete crashing input when satisfiable, and go test replays that input against the real function. The workflow caught all three planted bugs in test parsers and three latent bugs in the skill-lint CLI. Fuzzing missed two of the planted crashes because spare slice capacity or multi-step precondition checks hid the crash. The approach trades away a full correctness proof for practical bug-finding value, with the LLM translation dominating the runtime at about a minute per function while Z3 finishes in milliseconds.

## Context

The author maintains 175 agent skill files and wrote a Go CLI called skill-lint that checks SKILL.md files and applies LLM-generated line edits. Even with unit and fuzz tests, slice or index mistakes in Markdown parsers or the edit applier can cause runtime panics. The post explores using Gemini and the Z3 constraint solver to find bounds-check bugs that fuzzing misses.

## Approach / What changed

Compile Go functions to RISC-V assembly, pass the source and disassembly to Gemini 4 Argon, which writes Z3 constraint-solver scripts modeling the path to each surviving bounds-check trap; Z3 returns a concrete crashing input when satisfiable, and go test replays that input against the real function.

## Takeaways

- Go’s SSA prove pass eliminates most bounds checks, leaving only traps the compiler could not rule out; targeting those survivors with a solver is more efficient than checking every index operation.
- A sat answer from Z3 provides concrete bytes that go test runs against the real function, giving a real crash reproducer even if the LLM’s model is unsound; unsat only means ‘maybe correct.’
- Fuzzing pure helpers with slice capacity clipped to length catches bounds bugs in seconds, but a solver is worth the extra minute on traps that survive both the compiler’s range prover and a quick fuzz run.

## FAQ

### How does Go's compiler expose bounds checks to the solver?

Go compiles every slice or index operation it cannot prove safe into an explicit branch to runtime.panicBounds. The SSA prove pass eliminates most checks, leaving only the traps the compiler could not rule out. The solver targets those surviving traps.

### Why is a sat answer from Z3 considered a real bug?

A sat answer from Z3 comes with concrete bytes aimed at the trap, and go test runs them against the real function. If go test panics, you have a concrete bug reproducer regardless of whether the LLM's model was sound. An unsat answer only means 'maybe correct.'

### How did the author test whether fuzzing missed the bugs?

The author ran unseeded go test -fuzz on Go 1.27.3 against each planted bug: one 3-second run and three 60-second runs, each with a fresh fuzz cache. Fuzzing missed two of the planted crashes because spare slice capacity or multi-step precondition checks hid the crash.

**Tags:** [Fuzzing](https://yomu.fyi/topic/fuzzing), [Gemini](https://yomu.fyi/topic/gemini), [Go](https://yomu.fyi/topic/go), [Z3](https://yomu.fyi/topic/z3)

- Source: [Google](https://developers.googleblog.com/catch-go-bugs-that-fuzzing-misses-with-gemini-and-a-constraint-solver)
- Source URL: https://developers.googleblog.com/catch-go-bugs-that-fuzzing-misses-with-gemini-and-a-constraint-solver
- Ingested by Yomu: 2026-11-12T21:00:25.612Z

[Read original post](https://developers.googleblog.com/catch-go-bugs-that-fuzzing-misses-with-gemini-and-a-constraint-solver)
