---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://perfloop.ai/.well-known/search?q={query}"
  method: "GET"
---

situation

# Find and fix bugs in Rust, with a failing test as proof

Perfloop finds Rust code that gives the wrong result, such as destructors that run in the wrong order or a switch that falls into the wrong arm, and code that never finishes, such as a request that hangs. It brings back a fix only with a check that fails on the original code and passes with the fix.

## The workflow

1. Connect your repos in Setup. A model build reads them, and hypotheses worth testing appear as Cases.
2. Open a Case and select **Work this case**. Your coding agent can also submit a branch for review through the MCP server.
3. Perfloop states what the code must do, writes the fix and a check of that statement, such as a test, and runs the repo's builds and tests for the code it touches.
4. An independent verifier checks the proof. The Case page shows the verdict and the evidence.

[Bugs](https://perfloop.ai/docs/work/bugs) explains what Perfloop looks for. A passing check covers the behavior it states, not the whole program. Blocked goroutines and tasks, and slow waits, have their own page, [Concurrency bugs in Go and Rust](https://perfloop.ai/go-rust-concurrency-bugs), and [Find performance problems, bugs and security flaws](https://perfloop.ai/find-bugs-and-performance-problems) covers all three kinds of work.

## Public Cases

Each Case below passed that check.

- [cpp2rust](https://app.perfloop.ai/t/oss/case_pgkf7zsf0d), which translates C++ to Rust: the Rust it generated for `delete[]` ran element destructors from first to last instead of in the reverse order C++ requires. Merged upstream.
- [cpp2rust](https://app.perfloop.ai/t/oss/case_zn6xpkfecf): when a switch's default arm was not last, the translator moved it to the end, so the generated Rust fell through into the wrong arms. Merged upstream.
- [Openraft](https://app.perfloop.ai/t/oss/case_0hjtvnp33b): after a leader change or restart, a follower that skipped a snapshot whose logs it had already committed waited for a log-flush signal that never came, so the request hung. The maintainers merged their own version of the fix.

## What it cannot do

Perfloop opens pull requests, or an issue when a result suits one better. It cannot approve, merge, or deploy. A proven result opens nothing until a member selects **Allow & open PR** or **Allow & open issue** in Inbox, unless an Admin set that repo's **Pull requests** control to **Open**. When your repo's rules hold a result, the hold shows on its Case page instead. A hypothesis the evidence disproves stays on its Case as refuted. Start with the [Quickstart](https://perfloop.ai/docs/work/quickstart).
